diff options
-rw-r--r-- | Userland/Libraries/LibGL/GL/gl.h | 2 | ||||
-rw-r--r-- | Userland/Libraries/LibGL/GLContext.h | 2 | ||||
-rw-r--r-- | Userland/Libraries/LibGL/GLUtils.cpp | 10 | ||||
-rw-r--r-- | Userland/Libraries/LibGL/SoftwareGLContext.cpp | 20 | ||||
-rw-r--r-- | Userland/Libraries/LibGL/SoftwareGLContext.h | 2 |
5 files changed, 36 insertions, 0 deletions
diff --git a/Userland/Libraries/LibGL/GL/gl.h b/Userland/Libraries/LibGL/GL/gl.h index 1896caaa35..806e23fb3a 100644 --- a/Userland/Libraries/LibGL/GL/gl.h +++ b/Userland/Libraries/LibGL/GL/gl.h @@ -124,6 +124,8 @@ void glCallList(GLuint list); void glDeleteLists(GLuint list, GLsizei range); void glEndList(void); void glNewList(GLuint list, GLenum mode); +void glFlush(); +void glFinish(); #ifdef __cplusplus } diff --git a/Userland/Libraries/LibGL/GLContext.h b/Userland/Libraries/LibGL/GLContext.h index 3c2b830ad8..dffa8073ed 100644 --- a/Userland/Libraries/LibGL/GLContext.h +++ b/Userland/Libraries/LibGL/GLContext.h @@ -47,6 +47,8 @@ public: virtual void gl_delete_lists(GLuint list, GLsizei range) = 0; virtual void gl_end_list(void) = 0; virtual void gl_new_list(GLuint list, GLenum mode) = 0; + virtual void gl_flush() = 0; + virtual void gl_finish() = 0; virtual void present() = 0; }; diff --git a/Userland/Libraries/LibGL/GLUtils.cpp b/Userland/Libraries/LibGL/GLUtils.cpp index 0bfe7041d6..d3f37c1ce7 100644 --- a/Userland/Libraries/LibGL/GLUtils.cpp +++ b/Userland/Libraries/LibGL/GLUtils.cpp @@ -59,3 +59,13 @@ GLenum glGetError() { return g_gl_context->gl_get_error(); } + +void glFlush() +{ + return g_gl_context->gl_flush(); +} + +void glFinish() +{ + return g_gl_context->gl_finish(); +} diff --git a/Userland/Libraries/LibGL/SoftwareGLContext.cpp b/Userland/Libraries/LibGL/SoftwareGLContext.cpp index e952dab48e..1d531dbd53 100644 --- a/Userland/Libraries/LibGL/SoftwareGLContext.cpp +++ b/Userland/Libraries/LibGL/SoftwareGLContext.cpp @@ -839,6 +839,26 @@ void SoftwareGLContext::gl_new_list(GLuint list, GLenum mode) m_current_listing_index = CurrentListing { {}, static_cast<size_t>(list - 1), mode }; } +void SoftwareGLContext::gl_flush() +{ + if (m_in_draw_state) { + m_error = GL_INVALID_OPERATION; + return; + } + + // No-op since SoftwareGLContext is completely synchronous at the moment +} + +void SoftwareGLContext::gl_finish() +{ + if (m_in_draw_state) { + m_error = GL_INVALID_OPERATION; + return; + } + + // No-op since SoftwareGLContext is completely synchronous at the moment +} + void SoftwareGLContext::present() { m_rasterizer.blit_to(*m_frontbuffer); diff --git a/Userland/Libraries/LibGL/SoftwareGLContext.h b/Userland/Libraries/LibGL/SoftwareGLContext.h index 04982769f2..a1d84e00c6 100644 --- a/Userland/Libraries/LibGL/SoftwareGLContext.h +++ b/Userland/Libraries/LibGL/SoftwareGLContext.h @@ -53,6 +53,8 @@ public: virtual void gl_delete_lists(GLuint list, GLsizei range) override; virtual void gl_end_list(void) override; virtual void gl_new_list(GLuint list, GLenum mode) override; + virtual void gl_flush() override; + virtual void gl_finish() override; virtual void present() override; |