mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 16:27:35 +00:00
LibGL: Implement glRectf
and glRecti
This commit is contained in:
parent
4a36d6b439
commit
d83702cb92
5 changed files with 30 additions and 1 deletions
|
@ -578,6 +578,8 @@ GLAPI void glPushAttrib(GLbitfield mask);
|
|||
GLAPI void glPopAttrib();
|
||||
GLAPI void glBitmap(GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, GLubyte const* bitmap);
|
||||
GLAPI void glCopyTexImage2D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
|
||||
GLAPI void glRectf(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2);
|
||||
GLAPI void glRecti(GLint x1, GLint y1, GLint x2, GLint y2);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -116,6 +116,7 @@ public:
|
|||
virtual void gl_light_model(GLenum pname, GLfloat x, GLfloat y, GLfloat z, GLfloat w) = 0;
|
||||
virtual void gl_bitmap(GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, GLubyte const* bitmap) = 0;
|
||||
virtual void gl_copy_tex_image_2d(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border) = 0;
|
||||
virtual void gl_rect(GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2) = 0;
|
||||
|
||||
virtual void present() = 0;
|
||||
};
|
||||
|
|
|
@ -164,3 +164,13 @@ void glNormal3fv(GLfloat const* v)
|
|||
{
|
||||
g_gl_context->gl_normal(v[0], v[1], v[2]);
|
||||
}
|
||||
|
||||
void glRectf(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2)
|
||||
{
|
||||
g_gl_context->gl_rect(x1, y1, x2, y2);
|
||||
}
|
||||
|
||||
void glRecti(GLint x1, GLint y1, GLint x2, GLint y2)
|
||||
{
|
||||
g_gl_context->gl_rect(x1, y1, x2, y2);
|
||||
}
|
||||
|
|
|
@ -2658,6 +2658,19 @@ void SoftwareGLContext::gl_copy_tex_image_2d(GLenum target, GLint level, GLenum
|
|||
target, level, internalformat, x, y, width, height, border);
|
||||
}
|
||||
|
||||
void SoftwareGLContext::gl_rect(GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2)
|
||||
{
|
||||
APPEND_TO_CALL_LIST_AND_RETURN_IF_NEEDED(gl_rect, x1, y1, x2, y2);
|
||||
RETURN_WITH_ERROR_IF(m_in_draw_state, GL_INVALID_OPERATION);
|
||||
|
||||
gl_begin(GL_POLYGON);
|
||||
gl_vertex(x1, y1, 0.0, 0.0);
|
||||
gl_vertex(x2, y1, 0.0, 0.0);
|
||||
gl_vertex(x2, y2, 0.0, 0.0);
|
||||
gl_vertex(x1, y2, 0.0, 0.0);
|
||||
gl_end();
|
||||
}
|
||||
|
||||
void SoftwareGLContext::present()
|
||||
{
|
||||
m_rasterizer.blit_to(*m_frontbuffer);
|
||||
|
|
|
@ -129,6 +129,8 @@ public:
|
|||
virtual void gl_light_model(GLenum pname, GLfloat x, GLfloat y, GLfloat z, GLfloat w) override;
|
||||
virtual void gl_bitmap(GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, GLubyte const* bitmap) override;
|
||||
virtual void gl_copy_tex_image_2d(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border) override;
|
||||
virtual void gl_rect(GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2) override;
|
||||
|
||||
virtual void present() override;
|
||||
|
||||
private:
|
||||
|
@ -312,7 +314,8 @@ private:
|
|||
decltype(&SoftwareGLContext::gl_pop_attrib),
|
||||
decltype(&SoftwareGLContext::gl_light_model),
|
||||
decltype(&SoftwareGLContext::gl_bitmap),
|
||||
decltype(&SoftwareGLContext::gl_copy_tex_image_2d)>;
|
||||
decltype(&SoftwareGLContext::gl_copy_tex_image_2d),
|
||||
decltype(&SoftwareGLContext::gl_rect)>;
|
||||
|
||||
using ExtraSavedArguments = Variant<
|
||||
FloatMatrix4x4>;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue