summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJelle Raaijmakers <jelle@gmta.nl>2023-01-04 01:18:19 +0100
committerTim Flynn <trflynn89@pm.me>2023-01-03 19:49:31 -0500
commitd57e9b53a03bf944b6ffdec5fc3bae4695dc5876 (patch)
treeedf8bbc1c20fbac81d7980feb7384b5d1f2968c2
parent215d68baf6661693a8d3e67976afbdf0b6bdfdbf (diff)
downloadserenity-d57e9b53a03bf944b6ffdec5fc3bae4695dc5876.zip
LibGL: Implement `GL_BLEND_DST` and `GL_BLEND_SRC`
These context parameters are used to retrieve the active blend functions.
-rw-r--r--Userland/Libraries/LibGL/ContextParameter.cpp2
-rw-r--r--Userland/Libraries/LibGL/GL/gl.h2
2 files changed, 4 insertions, 0 deletions
diff --git a/Userland/Libraries/LibGL/ContextParameter.cpp b/Userland/Libraries/LibGL/ContextParameter.cpp
index 7e901b7202..40d40ac6fe 100644
--- a/Userland/Libraries/LibGL/ContextParameter.cpp
+++ b/Userland/Libraries/LibGL/ContextParameter.cpp
@@ -22,8 +22,10 @@ Optional<ContextParameter> GLContext::get_context_parameter(GLenum name)
return ContextParameter { .type = GL_BOOL, .is_capability = true, .value = { .boolean_value = m_alpha_test_enabled } };
case GL_BLEND:
return ContextParameter { .type = GL_BOOL, .is_capability = true, .value = { .boolean_value = m_blend_enabled } };
+ case GL_BLEND_DST:
case GL_BLEND_DST_ALPHA:
return ContextParameter { .type = GL_INT, .value = { .integer_value = static_cast<GLint>(m_blend_destination_factor) } };
+ case GL_BLEND_SRC:
case GL_BLEND_SRC_ALPHA:
return ContextParameter { .type = GL_INT, .value = { .integer_value = static_cast<GLint>(m_blend_source_factor) } };
case GL_BLUE_BITS:
diff --git a/Userland/Libraries/LibGL/GL/gl.h b/Userland/Libraries/LibGL/GL/gl.h
index 6c816da59f..85e7b3a394 100644
--- a/Userland/Libraries/LibGL/GL/gl.h
+++ b/Userland/Libraries/LibGL/GL/gl.h
@@ -108,6 +108,8 @@ extern "C" {
#define GL_MATRIX_MODE 0x0BA0
#define GL_NORMALIZE 0x0BA1
#define GL_VIEWPORT 0x0BA2
+#define GL_BLEND_DST 0x0BE0
+#define GL_BLEND_SRC 0x0BE1
#define GL_COLOR_CLEAR_VALUE 0x0C22
#define GL_DOUBLEBUFFER 0x0C32
#define GL_TEXTURE_GEN_S 0x0C60