[rlgl] Allow tint colors in GL_LINE (wires) and GL_POINT (points) draw modes on OpenGL 1.1 clean (#5207)

* gate with OPENGL_11 prototype and definition for rlSetPointSize and rlGetPointSize

* gate with OPENGL_11 prototype and definition for rlSetPointSize and rlGetPointSize

* more coverage for fixing expected texcoords, normals, and colors

* fix guard styling

* fix guard issue, and remove fallback unneccessary else clause (default shader ill work)

* opengl3.3 and es2 need the color array allocated in order to allow for updates later (unlike opengl11)
This commit is contained in:
iann
2025-09-29 02:34:38 +09:00
committed by GitHub
parent 4cd131cf29
commit f36c8ddc56
2 changed files with 58 additions and 15 deletions

View File

@@ -644,10 +644,8 @@ RLAPI void rlEnableVertexBufferElement(unsigned int id); // Enable vertex buffer
RLAPI void rlDisableVertexBufferElement(void); // Disable vertex buffer element (VBO element)
RLAPI void rlEnableVertexAttribute(unsigned int index); // Enable vertex attribute index
RLAPI void rlDisableVertexAttribute(unsigned int index); // Disable vertex attribute index
#if defined(GRAPHICS_API_OPENGL_11)
RLAPI void rlEnableStatePointer(int vertexAttribType, void *buffer); // Enable attribute state pointer
RLAPI void rlDisableStatePointer(int vertexAttribType); // Disable attribute state pointer
#endif
// Textures state
RLAPI void rlActiveTextureSlot(int slot); // Select and active a texture slot
@@ -686,6 +684,8 @@ 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
RLAPI void rlSetPointSize(float size); // Set the point drawing size
RLAPI float rlGetPointSize(void); // Get the point drawing size
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 +2016,25 @@ float rlGetLineWidth(void)
return width;
}
// Set the point drawing size
void rlSetPointSize(float size)
{
#if defined(GRAPHICS_API_OPENGL_11)
glPointSize(size);
#endif
}
// Get the point drawing size
float rlGetPointSize(void)
{
float size = 1;
#if defined(GRAPHICS_API_OPENGL_11)
glGetFloatv(GL_POINT_SIZE, &size);
#endif
return size;
}
// Enable line aliasing
void rlEnableSmoothLines(void)
{
@@ -4003,10 +4022,10 @@ void rlDrawVertexArrayElementsInstanced(int offset, int count, const void *buffe
#endif
}
#if defined(GRAPHICS_API_OPENGL_11)
// Enable vertex state pointer
void rlEnableStatePointer(int vertexAttribType, void *buffer)
{
#if defined(GRAPHICS_API_OPENGL_11)
if (buffer != NULL) glEnableClientState(vertexAttribType);
switch (vertexAttribType)
{
@@ -4017,14 +4036,16 @@ void rlEnableStatePointer(int vertexAttribType, void *buffer)
//case GL_INDEX_ARRAY: if (buffer != NULL) glIndexPointer(GL_SHORT, 0, buffer); break; // Indexed colors
default: break;
}
#endif
}
// Disable vertex state pointer
void rlDisableStatePointer(int vertexAttribType)
{
#if defined(GRAPHICS_API_OPENGL_11)
glDisableClientState(vertexAttribType);
}
#endif
}
// Load vertex array object (VAO)
unsigned int rlLoadVertexArray(void)