summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibGL/ContextParameter.cpp
diff options
context:
space:
mode:
authorJelle Raaijmakers <jelle@gmta.nl>2022-09-04 16:46:23 +0200
committerLinus Groh <mail@linusgroh.de>2022-09-11 22:37:07 +0100
commit07e94b3ec16ace890e8ef394f982512d5f4d9c1f (patch)
tree0243f3ff2164a1063a48410cd453f97acf8d5e91 /Userland/Libraries/LibGL/ContextParameter.cpp
parent759ef82e75dd5d41b539bf63854d070ae272bb5a (diff)
downloadserenity-07e94b3ec16ace890e8ef394f982512d5f4d9c1f.zip
LibGL: Implement `GL_CURRENT_COLOR` context parameter
Diffstat (limited to 'Userland/Libraries/LibGL/ContextParameter.cpp')
-rw-r--r--Userland/Libraries/LibGL/ContextParameter.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/Userland/Libraries/LibGL/ContextParameter.cpp b/Userland/Libraries/LibGL/ContextParameter.cpp
index 0598e1d2cf..b08687d611 100644
--- a/Userland/Libraries/LibGL/ContextParameter.cpp
+++ b/Userland/Libraries/LibGL/ContextParameter.cpp
@@ -32,6 +32,18 @@ Optional<ContextParameter> GLContext::get_context_parameter(GLenum name)
return ContextParameter { .type = GL_INT, .value = { .integer_value = static_cast<GLint>(m_color_material_face) } };
case GL_COLOR_MATERIAL_MODE:
return ContextParameter { .type = GL_INT, .value = { .integer_value = static_cast<GLint>(m_color_material_mode) } };
+ case GL_CURRENT_COLOR:
+ return ContextParameter {
+ .type = GL_DOUBLE,
+ .count = 4,
+ .value = {
+ .double_list = {
+ static_cast<double>(m_current_vertex_color.x()),
+ static_cast<double>(m_current_vertex_color.y()),
+ static_cast<double>(m_current_vertex_color.z()),
+ static_cast<double>(m_current_vertex_color.w()),
+ } }
+ };
case GL_CULL_FACE:
return ContextParameter { .type = GL_BOOL, .is_capability = true, .value = { .boolean_value = m_cull_faces } };
case GL_DEPTH_BITS: