LibGL: Implement glTexCoordPointer

This commit is contained in:
Stephan Unverwerth 2021-08-13 13:54:51 +02:00 committed by Andreas Kling
parent f52f40925c
commit f776402632
Notes: sideshowbarker 2024-07-18 06:57:49 +09:00
5 changed files with 25 additions and 0 deletions

View file

@ -359,6 +359,7 @@ GLAPI void glEnableClientState(GLenum cap);
GLAPI void glDisableClientState(GLenum cap);
GLAPI void glVertexPointer(GLint size, GLenum type, GLsizei stride, const void* pointer);
GLAPI void glColorPointer(GLint size, GLenum type, GLsizei stride, const void* pointer);
GLAPI void glTexCoordPointer(GLint size, GLenum type, GLsizei stride, const void* pointer);
#ifdef __cplusplus
}

View file

@ -68,6 +68,7 @@ public:
virtual void gl_disable_client_state(GLenum cap) = 0;
virtual void gl_vertex_pointer(GLint size, GLenum type, GLsizei stride, const void* pointer) = 0;
virtual void gl_color_pointer(GLint size, GLenum type, GLsizei stride, const void* pointer) = 0;
virtual void gl_tex_coord_pointer(GLint size, GLenum type, GLsizei stride, const void* pointer) = 0;
virtual void present() = 0;
};

View file

@ -18,3 +18,8 @@ void glColorPointer(GLint size, GLenum type, GLsizei stride, const void* pointer
{
g_gl_context->gl_color_pointer(size, type, stride, pointer);
}
void glTexCoordPointer(GLint size, GLenum type, GLsizei stride, const void* pointer)
{
g_gl_context->gl_tex_coord_pointer(size, type, stride, pointer);
}

View file

@ -1485,6 +1485,22 @@ void SoftwareGLContext::gl_color_pointer(GLint size, GLenum type, GLsizei stride
m_client_color_pointer.pointer = pointer;
}
void SoftwareGLContext::gl_tex_coord_pointer(GLint size, GLenum type, GLsizei stride, const void* pointer)
{
RETURN_WITH_ERROR_IF(m_in_draw_state, GL_INVALID_OPERATION);
RETURN_WITH_ERROR_IF(!(size == 1 || size == 2 || size == 3 || size == 4), GL_INVALID_VALUE);
RETURN_WITH_ERROR_IF(!(type == GL_SHORT || type == GL_INT || type == GL_FLOAT || type == GL_DOUBLE), GL_INVALID_ENUM);
RETURN_WITH_ERROR_IF(stride < 0, GL_INVALID_VALUE);
m_client_tex_coord_pointer.size = size;
m_client_tex_coord_pointer.type = type;
m_client_tex_coord_pointer.stride = stride;
m_client_tex_coord_pointer.pointer = pointer;
}
void SoftwareGLContext::present()
{
m_rasterizer.blit_to(*m_frontbuffer);

View file

@ -78,6 +78,7 @@ public:
virtual void gl_disable_client_state(GLenum cap) override;
virtual void gl_vertex_pointer(GLint size, GLenum type, GLsizei stride, const void* pointer) override;
virtual void gl_color_pointer(GLint size, GLenum type, GLsizei stride, const void* pointer) override;
virtual void gl_tex_coord_pointer(GLint size, GLenum type, GLsizei stride, const void* pointer) override;
virtual void present() override;
@ -235,6 +236,7 @@ private:
VertexAttribPointer m_client_vertex_pointer;
VertexAttribPointer m_client_color_pointer;
VertexAttribPointer m_client_tex_coord_pointer;
};
}