gate with OPENGL_11 prototype and definition for rlSetPointSize and rlGetPointSize
This commit is contained in:
parent
87f758f9b4
commit
fac83ef010
16
src/rlgl.h
16
src/rlgl.h
|
|
@ -686,6 +686,10 @@ RLAPI void rlDisableScissorTest(void); // Disable scissor test
|
|||
RLAPI void rlScissor(int x, int y, int width, int height); // Scissor test
|
||||
RLAPI void rlEnablePointMode(void); // Enable point mode
|
||||
RLAPI void rlDisablePointMode(void); // Disable point mode
|
||||
#if defined(GRAPHICS_API_OPENGL_11)
|
||||
RLAPI void rlSetPointSize(float size); // Set the point drawing size
|
||||
RLAPI float rlGetPointSize(void); // Get the point drawing size
|
||||
#endif
|
||||
RLAPI void rlEnableWireMode(void); // Enable wire mode
|
||||
RLAPI void rlDisableWireMode(void); // Disable wire mode
|
||||
RLAPI void rlSetLineWidth(float width); // Set the line drawing width
|
||||
|
|
@ -2016,6 +2020,18 @@ float rlGetLineWidth(void)
|
|||
return width;
|
||||
}
|
||||
|
||||
#if defined(GRAPHICS_API_OPENGL_11)
|
||||
// Set the point drawing size
|
||||
void rlSetPointSize(float size) { glPointSize(size); }
|
||||
|
||||
// Get the point drawing size
|
||||
float rlGetPointSize(void)
|
||||
{
|
||||
float size = 0;
|
||||
glGetFloatv(GL_POINT_SIZE, &size);
|
||||
return size;
|
||||
}
|
||||
#endif
|
||||
// Enable line aliasing
|
||||
void rlEnableSmoothLines(void)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1436,7 +1436,7 @@ void DrawMesh(Mesh mesh, Material material, Matrix transform)
|
|||
if (mesh.animNormals) rlEnableStatePointer(GL_NORMAL_ARRAY, mesh.animNormals);
|
||||
else rlEnableStatePointer(GL_NORMAL_ARRAY, mesh.normals);
|
||||
|
||||
rlEnableStatePointer(GL_COLOR_ARRAY, mesh.colors);
|
||||
if (mesh.colors) rlEnableStatePointer(GL_COLOR_ARRAY, mesh.colors);
|
||||
|
||||
rlPushMatrix();
|
||||
rlMultMatrixf(MatrixToFloat(transform));
|
||||
|
|
@ -1452,7 +1452,7 @@ void DrawMesh(Mesh mesh, Material material, Matrix transform)
|
|||
rlDisableStatePointer(GL_VERTEX_ARRAY);
|
||||
rlDisableStatePointer(GL_TEXTURE_COORD_ARRAY);
|
||||
rlDisableStatePointer(GL_NORMAL_ARRAY);
|
||||
rlDisableStatePointer(GL_COLOR_ARRAY);
|
||||
if (mesh.colors) rlDisableStatePointer(GL_COLOR_ARRAY);
|
||||
|
||||
rlDisableTexture();
|
||||
#endif
|
||||
|
|
@ -4420,7 +4420,11 @@ static Model LoadOBJ(const char *fileName)
|
|||
model.meshes[i].vertices = (float *)MemAlloc(sizeof(float)*vertexCount*3);
|
||||
model.meshes[i].normals = (float *)MemAlloc(sizeof(float)*vertexCount*3);
|
||||
model.meshes[i].texcoords = (float *)MemAlloc(sizeof(float)*vertexCount*2);
|
||||
model.meshes[i].colors = (unsigned char *)MemAlloc(sizeof(unsigned char)*vertexCount*4);
|
||||
#if defined(GRAPHICS_API_OPENGL_11)
|
||||
model.meshes[i].colors = NULL;
|
||||
#else
|
||||
model.meshes[i].colors = (unsigned char *)MemAlloc(sizeof(unsigned char)*vertexCount*4);
|
||||
#endif
|
||||
}
|
||||
|
||||
MemFree(localMeshVertexCounts);
|
||||
|
|
@ -4487,9 +4491,9 @@ static Model LoadOBJ(const char *fileName)
|
|||
}
|
||||
|
||||
model.meshes[meshIndex].texcoords[localMeshVertexCount*2 + 1] = 1.0f - model.meshes[meshIndex].texcoords[localMeshVertexCount*2 + 1];
|
||||
|
||||
for (int i = 0; i < 4; i++) model.meshes[meshIndex].colors[localMeshVertexCount*4 + i] = 255;
|
||||
|
||||
#if !defined(GRAPHICS_API_OPENGL_11)
|
||||
for (int i = 0; i < 4; i++) model.meshes[meshIndex].colors[localMeshVertexCount*4 + i] = 255;
|
||||
#endif
|
||||
faceVertIndex++;
|
||||
localMeshVertexCount++;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user