mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-30 03:20:28 +00:00
LibGL: Implement glTexCoordPointer
This commit is contained in:
parent
f52f40925c
commit
f776402632
Notes:
sideshowbarker
2024-07-18 06:57:49 +09:00
Author: https://github.com/sunverwerth Commit: https://github.com/SerenityOS/serenity/commit/f7764026323 Pull-request: https://github.com/SerenityOS/serenity/pull/9382 Reviewed-by: https://github.com/alimpfard
5 changed files with 25 additions and 0 deletions
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue