diff options
author | Jesse Buhagiar <jooster669@gmail.com> | 2022-03-09 22:27:02 +1100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-04-09 11:40:33 +0200 |
commit | b928fdc3ee40e0394e7fd1cfadcf1fdf13c301ae (patch) | |
tree | 80cec036ff9f3ead5f0d5a1828fee661b2bcc396 | |
parent | c9f44c746a13389ed57881ffcbc22e03b98017eb (diff) | |
download | serenity-b928fdc3ee40e0394e7fd1cfadcf1fdf13c301ae.zip |
LibGL: Add stub `glClipPlane`
-rw-r--r-- | Userland/Libraries/LibGL/GL/gl.h | 9 | ||||
-rw-r--r-- | Userland/Libraries/LibGL/GLContext.cpp | 10 | ||||
-rw-r--r-- | Userland/Libraries/LibGL/GLContext.h | 4 | ||||
-rw-r--r-- | Userland/Libraries/LibGL/GLUtils.cpp | 5 |
4 files changed, 27 insertions, 1 deletions
diff --git a/Userland/Libraries/LibGL/GL/gl.h b/Userland/Libraries/LibGL/GL/gl.h index 0b9ecc1f2c..4956561d1c 100644 --- a/Userland/Libraries/LibGL/GL/gl.h +++ b/Userland/Libraries/LibGL/GL/gl.h @@ -477,6 +477,14 @@ extern "C" { #define GL_ADD 0x0104 +// User clipping planes +#define GL_CLIP_PLANE0 0x3000 +#define GL_CLIP_PLANE1 0x3001 +#define GL_CLIP_PLANE2 0x3002 +#define GL_CLIP_PLANE3 0x3003 +#define GL_CLIP_PLANE4 0x3004 +#define GL_CLIP_PLANE5 0x3005 + GLAPI void glBegin(GLenum mode); GLAPI void glClear(GLbitfield mask); GLAPI void glClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); @@ -670,6 +678,7 @@ GLAPI void glRectf(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2); GLAPI void glRecti(GLint x1, GLint y1, GLint x2, GLint y2); GLAPI void glGetTexLevelParameteriv(GLenum target, GLint level, GLenum pname, GLint* params); GLAPI void glPointSize(GLfloat size); +GLAPI void glClipPlane(GLenum plane, GLdouble const* equation); #ifdef __cplusplus } diff --git a/Userland/Libraries/LibGL/GLContext.cpp b/Userland/Libraries/LibGL/GLContext.cpp index c34b167ac5..1d48651fbc 100644 --- a/Userland/Libraries/LibGL/GLContext.cpp +++ b/Userland/Libraries/LibGL/GLContext.cpp @@ -1936,6 +1936,16 @@ void GLContext::gl_depth_mask(GLboolean flag) m_rasterizer->set_options(options); } +void GLContext::gl_clip_plane(GLenum plane, [[maybe_unused]] GLdouble const* equation) +{ + APPEND_TO_CALL_LIST_AND_RETURN_IF_NEEDED(gl_clip_plane, plane, equation); + + RETURN_WITH_ERROR_IF(m_in_draw_state, GL_INVALID_OPERATION); + RETURN_WITH_ERROR_IF((plane < GL_CLIP_PLANE0) || (plane > GL_CLIP_PLANE5), GL_INVALID_ENUM); + + dbgln_if(GL_DEBUG, "GLContext FIXME: implement gl_clip_plane() (equation = [{} {} {} {}])", equation[0], equation[1], equation[2], equation[3]); +} + void GLContext::gl_enable_client_state(GLenum cap) { RETURN_WITH_ERROR_IF(m_in_draw_state, GL_INVALID_OPERATION); diff --git a/Userland/Libraries/LibGL/GLContext.h b/Userland/Libraries/LibGL/GLContext.h index 20ebfb9de4..964040b5ee 100644 --- a/Userland/Libraries/LibGL/GLContext.h +++ b/Userland/Libraries/LibGL/GLContext.h @@ -156,6 +156,7 @@ public: void gl_color_material(GLenum face, GLenum mode); void gl_get_light(GLenum light, GLenum pname, void* params, GLenum type); void gl_get_material(GLenum face, GLenum pname, void* params, GLenum type); + void gl_clip_plane(GLenum plane, GLdouble const* equation); void present(); private: @@ -396,7 +397,8 @@ private: decltype(&GLContext::gl_materialfv), decltype(&GLContext::gl_materialiv), decltype(&GLContext::gl_color_material), - decltype(&GLContext::gl_get_light)>; + decltype(&GLContext::gl_get_light), + decltype(&GLContext::gl_clip_plane)>; using ExtraSavedArguments = Variant< FloatMatrix4x4>; diff --git a/Userland/Libraries/LibGL/GLUtils.cpp b/Userland/Libraries/LibGL/GLUtils.cpp index c5cf954be1..ba76700151 100644 --- a/Userland/Libraries/LibGL/GLUtils.cpp +++ b/Userland/Libraries/LibGL/GLUtils.cpp @@ -189,3 +189,8 @@ void glPopAttrib() { g_gl_context->gl_pop_attrib(); } + +void glClipPlane(GLenum plane, GLdouble const* equation) +{ + g_gl_context->gl_clip_plane(plane, equation); +} |