1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 01:17:34 +00:00

LibGL: Add stubs for glPushAttrib and glPopAttrib

This commit is contained in:
Jelle Raaijmakers 2021-12-01 16:59:30 +01:00 committed by Andreas Kling
parent fbed7a5ba8
commit 0453cad46c
5 changed files with 37 additions and 1 deletions

View file

@ -468,6 +468,8 @@ GLAPI void glRasterPos2i(GLint x, GLint y);
GLAPI void glMaterialf(GLenum face, GLenum pname, GLfloat param);
GLAPI void glMaterialfv(GLenum face, GLenum pname, GLfloat const* params);
GLAPI void glLineWidth(GLfloat width);
GLAPI void glPushAttrib(GLbitfield mask);
GLAPI void glPopAttrib();
#ifdef __cplusplus
}

View file

@ -99,6 +99,8 @@ public:
virtual void gl_raster_pos(GLfloat x, GLfloat y, GLfloat z, GLfloat w) = 0;
virtual void gl_materialv(GLenum face, GLenum pname, GLfloat const* params) = 0;
virtual void gl_line_width(GLfloat width) = 0;
virtual void gl_push_attrib(GLbitfield mask) = 0;
virtual void gl_pop_attrib() = 0;
virtual void present() = 0;
};

View file

@ -164,3 +164,13 @@ void glScissor(GLint x, GLint y, GLsizei width, GLsizei height)
{
g_gl_context->gl_scissor(x, y, width, height);
}
void glPushAttrib(GLbitfield mask)
{
g_gl_context->gl_push_attrib(mask);
}
void glPopAttrib()
{
g_gl_context->gl_pop_attrib();
}

View file

@ -2327,6 +2327,24 @@ void SoftwareGLContext::gl_line_width(GLfloat width)
m_line_width = width;
}
void SoftwareGLContext::gl_push_attrib(GLbitfield mask)
{
APPEND_TO_CALL_LIST_AND_RETURN_IF_NEEDED(gl_push_attrib, mask);
RETURN_WITH_ERROR_IF(m_in_draw_state, GL_INVALID_OPERATION);
// FIXME: implement
dbgln_if(GL_DEBUG, "SoftwareGLContext FIXME: implement gl_push_attrib({})", mask);
}
void SoftwareGLContext::gl_pop_attrib()
{
APPEND_TO_CALL_LIST_AND_RETURN_IF_NEEDED(gl_pop_attrib);
RETURN_WITH_ERROR_IF(m_in_draw_state, GL_INVALID_OPERATION);
// FIXME: implement
dbgln_if(GL_DEBUG, "SoftwareGLContext FIXME: implement gl_pop_attrib()");
}
void SoftwareGLContext::present()
{
m_rasterizer.blit_to(*m_frontbuffer);

View file

@ -110,6 +110,8 @@ public:
virtual void gl_raster_pos(GLfloat x, GLfloat y, GLfloat z, GLfloat w) override;
virtual void gl_materialv(GLenum face, GLenum pname, GLfloat const* params) override;
virtual void gl_line_width(GLfloat width) override;
virtual void gl_push_attrib(GLbitfield mask) override;
virtual void gl_pop_attrib() override;
virtual void present() override;
private:
@ -280,7 +282,9 @@ private:
decltype(&SoftwareGLContext::gl_normal),
decltype(&SoftwareGLContext::gl_raster_pos),
decltype(&SoftwareGLContext::gl_materialv),
decltype(&SoftwareGLContext::gl_line_width)>;
decltype(&SoftwareGLContext::gl_line_width),
decltype(&SoftwareGLContext::gl_push_attrib),
decltype(&SoftwareGLContext::gl_pop_attrib)>;
using ExtraSavedArguments = Variant<
FloatMatrix4x4>;