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:
parent
403c560a7a
commit
a074b7e871
3 changed files with 30 additions and 19 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue