1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-13 19:17:36 +00:00

LibGL: Invoke own methods when drawing arrays or elements

Instead of calling the public API, call our own internal API.
This commit is contained in:
Jelle Raaijmakers 2021-12-01 23:24:31 +01:00 committed by Andreas Kling
parent b79642ef74
commit 46c564dd1a

View file

@ -1934,12 +1934,12 @@ void SoftwareGLContext::gl_draw_arrays(GLenum mode, GLint first, GLsizei count)
return; return;
auto last = first + count; auto last = first + count;
glBegin(mode); gl_begin(mode);
for (int i = first; i < last; i++) { for (int i = first; i < last; i++) {
if (m_client_side_texture_coord_array_enabled) { if (m_client_side_texture_coord_array_enabled) {
float tex_coords[4] { 0, 0, 0, 0 }; float tex_coords[4] { 0, 0, 0, 0 };
read_from_vertex_attribute_pointer(m_client_tex_coord_pointer, i, tex_coords, false); read_from_vertex_attribute_pointer(m_client_tex_coord_pointer, i, tex_coords, false);
glTexCoord4fv(tex_coords); gl_tex_coord(tex_coords[0], tex_coords[1], tex_coords[2], tex_coords[3]);
} }
if (m_client_side_color_array_enabled) { if (m_client_side_color_array_enabled) {
@ -1952,7 +1952,7 @@ void SoftwareGLContext::gl_draw_arrays(GLenum mode, GLint first, GLsizei count)
read_from_vertex_attribute_pointer(m_client_vertex_pointer, i, vertex, false); read_from_vertex_attribute_pointer(m_client_vertex_pointer, i, vertex, false);
glVertex4fv(vertex); glVertex4fv(vertex);
} }
glEnd(); gl_end();
} }
void SoftwareGLContext::gl_draw_elements(GLenum mode, GLsizei count, GLenum type, const void* indices) void SoftwareGLContext::gl_draw_elements(GLenum mode, GLsizei count, GLenum type, const void* indices)
@ -1979,7 +1979,7 @@ void SoftwareGLContext::gl_draw_elements(GLenum mode, GLsizei count, GLenum type
if (!m_client_side_vertex_array_enabled) if (!m_client_side_vertex_array_enabled)
return; return;
glBegin(mode); gl_begin(mode);
for (int index = 0; index < count; index++) { for (int index = 0; index < count; index++) {
int i = 0; int i = 0;
switch (type) { switch (type) {
@ -1997,7 +1997,7 @@ void SoftwareGLContext::gl_draw_elements(GLenum mode, GLsizei count, GLenum type
if (m_client_side_texture_coord_array_enabled) { if (m_client_side_texture_coord_array_enabled) {
float tex_coords[4] { 0, 0, 0, 0 }; float tex_coords[4] { 0, 0, 0, 0 };
read_from_vertex_attribute_pointer(m_client_tex_coord_pointer, i, tex_coords, false); read_from_vertex_attribute_pointer(m_client_tex_coord_pointer, i, tex_coords, false);
glTexCoord4fv(tex_coords); gl_tex_coord(tex_coords[0], tex_coords[1], tex_coords[2], tex_coords[3]);
} }
if (m_client_side_color_array_enabled) { if (m_client_side_color_array_enabled) {
@ -2010,7 +2010,7 @@ void SoftwareGLContext::gl_draw_elements(GLenum mode, GLsizei count, GLenum type
read_from_vertex_attribute_pointer(m_client_vertex_pointer, i, vertex, false); read_from_vertex_attribute_pointer(m_client_vertex_pointer, i, vertex, false);
glVertex4fv(vertex); glVertex4fv(vertex);
} }
glEnd(); gl_end();
} }
void SoftwareGLContext::gl_draw_pixels(GLsizei width, GLsizei height, GLenum format, GLenum type, const void* data) void SoftwareGLContext::gl_draw_pixels(GLsizei width, GLsizei height, GLenum format, GLenum type, const void* data)