1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 11:27:35 +00:00

LibGL: Support glLightModel inside lists

We now dereference the pointer given to us before adding the arguments
to an active list. This also factors out the switching logic from the
API wrappers, which helps us with a future commit where we autogenerate
all API wrapper functions.
This commit is contained in:
Jelle Raaijmakers 2022-12-09 16:25:15 +01:00 committed by Andreas Kling
parent 403c560a7a
commit a074b7e871
3 changed files with 30 additions and 19 deletions

View file

@ -568,36 +568,22 @@ void glLightiv(GLenum light, GLenum pname, GLint const* params)
void glLightModelf(GLenum pname, GLfloat param)
{
g_gl_context->gl_light_model(pname, param, 0.0f, 0.0f, 0.0f);
g_gl_context->gl_light_model(pname, param, 0.f, 0.f, 0.f);
}
void glLightModelfv(GLenum pname, GLfloat const* params)
{
switch (pname) {
case GL_LIGHT_MODEL_AMBIENT:
g_gl_context->gl_light_model(pname, params[0], params[1], params[2], params[3]);
break;
default:
g_gl_context->gl_light_model(pname, params[0], 0.0f, 0.0f, 0.0f);
break;
}
g_gl_context->gl_light_modelv(pname, params, GL_FLOAT);
}
void glLightModeliv(GLenum pname, GLint const* params)
{
switch (pname) {
case GL_LIGHT_MODEL_AMBIENT:
g_gl_context->gl_light_model(pname, params[0], params[1], params[2], params[3]);
break;
default:
g_gl_context->gl_light_model(pname, params[0], 0.0f, 0.0f, 0.0f);
break;
}
g_gl_context->gl_light_modelv(pname, params, GL_INT);
}
void glLightModeli(GLenum pname, GLint param)
{
g_gl_context->gl_light_model(pname, param, 0.0f, 0.0f, 0.0f);
g_gl_context->gl_light_model(pname, static_cast<float>(param), 0.f, 0.f, 0.f);
}
void glLineWidth(GLfloat width)