gate with OPENGL_11 prototype and definition for rlSetPointSize and rlGetPointSize

This commit is contained in:
iann 2025-09-24 11:35:07 +09:00
parent 87f758f9b4
commit fac83ef010
2 changed files with 26 additions and 6 deletions

View File

@ -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 rlScissor(int x, int y, int width, int height); // Scissor test
RLAPI void rlEnablePointMode(void); // Enable point mode RLAPI void rlEnablePointMode(void); // Enable point mode
RLAPI void rlDisablePointMode(void); // Disable 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 rlEnableWireMode(void); // Enable wire mode
RLAPI void rlDisableWireMode(void); // Disable wire mode RLAPI void rlDisableWireMode(void); // Disable wire mode
RLAPI void rlSetLineWidth(float width); // Set the line drawing width RLAPI void rlSetLineWidth(float width); // Set the line drawing width
@ -2016,6 +2020,18 @@ float rlGetLineWidth(void)
return width; 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 // Enable line aliasing
void rlEnableSmoothLines(void) void rlEnableSmoothLines(void)
{ {

View File

@ -1436,7 +1436,7 @@ void DrawMesh(Mesh mesh, Material material, Matrix transform)
if (mesh.animNormals) rlEnableStatePointer(GL_NORMAL_ARRAY, mesh.animNormals); if (mesh.animNormals) rlEnableStatePointer(GL_NORMAL_ARRAY, mesh.animNormals);
else rlEnableStatePointer(GL_NORMAL_ARRAY, mesh.normals); else rlEnableStatePointer(GL_NORMAL_ARRAY, mesh.normals);
rlEnableStatePointer(GL_COLOR_ARRAY, mesh.colors); if (mesh.colors) rlEnableStatePointer(GL_COLOR_ARRAY, mesh.colors);
rlPushMatrix(); rlPushMatrix();
rlMultMatrixf(MatrixToFloat(transform)); rlMultMatrixf(MatrixToFloat(transform));
@ -1452,7 +1452,7 @@ void DrawMesh(Mesh mesh, Material material, Matrix transform)
rlDisableStatePointer(GL_VERTEX_ARRAY); rlDisableStatePointer(GL_VERTEX_ARRAY);
rlDisableStatePointer(GL_TEXTURE_COORD_ARRAY); rlDisableStatePointer(GL_TEXTURE_COORD_ARRAY);
rlDisableStatePointer(GL_NORMAL_ARRAY); rlDisableStatePointer(GL_NORMAL_ARRAY);
rlDisableStatePointer(GL_COLOR_ARRAY); if (mesh.colors) rlDisableStatePointer(GL_COLOR_ARRAY);
rlDisableTexture(); rlDisableTexture();
#endif #endif
@ -4420,7 +4420,11 @@ static Model LoadOBJ(const char *fileName)
model.meshes[i].vertices = (float *)MemAlloc(sizeof(float)*vertexCount*3); model.meshes[i].vertices = (float *)MemAlloc(sizeof(float)*vertexCount*3);
model.meshes[i].normals = (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].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); 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]; model.meshes[meshIndex].texcoords[localMeshVertexCount*2 + 1] = 1.0f - model.meshes[meshIndex].texcoords[localMeshVertexCount*2 + 1];
#if !defined(GRAPHICS_API_OPENGL_11)
for (int i = 0; i < 4; i++) model.meshes[meshIndex].colors[localMeshVertexCount*4 + i] = 255; for (int i = 0; i < 4; i++) model.meshes[meshIndex].colors[localMeshVertexCount*4 + i] = 255;
#endif
faceVertIndex++; faceVertIndex++;
localMeshVertexCount++; localMeshVertexCount++;
} }