2021-05-16 15:05:13 +03:00
|
|
|
/*
|
2021-05-29 13:38:28 +03:00
|
|
|
* Copyright (c) 2021, Stephan Unverwerth <s.unverwerth@serenityos.org>
|
2021-12-01 18:10:17 +03:00
|
|
|
* Copyright (c) 2021, Jelle Raaijmakers <jelle@gmta.nl>
|
2022-01-07 17:41:46 +03:00
|
|
|
* Copyright (c) 2022, Jesse Buhagiar <jooster669@gmail.com>
|
2021-05-16 15:05:13 +03:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "GL/gl.h"
|
|
|
|
#include "GLContext.h"
|
2021-12-01 15:34:45 +03:00
|
|
|
#include <AK/Debug.h>
|
2021-05-16 15:05:13 +03:00
|
|
|
|
|
|
|
extern GL::GLContext* g_gl_context;
|
|
|
|
|
2022-01-10 01:01:19 +03:00
|
|
|
void glColorMaterial(GLenum face, GLenum mode)
|
|
|
|
{
|
2022-01-13 05:03:35 +03:00
|
|
|
g_gl_context->gl_color_material(face, mode);
|
2022-01-10 01:01:19 +03:00
|
|
|
}
|
|
|
|
|
2021-12-01 15:34:45 +03:00
|
|
|
void glLightf(GLenum light, GLenum pname, GLfloat param)
|
|
|
|
{
|
2022-01-07 17:41:46 +03:00
|
|
|
g_gl_context->gl_lightf(light, pname, param);
|
2021-12-01 15:34:45 +03:00
|
|
|
}
|
|
|
|
|
2022-01-07 17:41:46 +03:00
|
|
|
void glLightfv(GLenum light, GLenum pname, GLfloat const* param)
|
2021-12-01 15:34:45 +03:00
|
|
|
{
|
2022-01-07 17:41:46 +03:00
|
|
|
g_gl_context->gl_lightfv(light, pname, param);
|
2021-12-01 15:34:45 +03:00
|
|
|
}
|
|
|
|
|
2021-12-01 19:09:22 +03:00
|
|
|
void glLightModelf(GLenum pname, GLfloat param)
|
|
|
|
{
|
|
|
|
g_gl_context->gl_light_model(pname, param, 0.0f, 0.0f, 0.0f);
|
|
|
|
}
|
|
|
|
|
|
|
|
void glLightModelfv(GLenum pname, GLfloat const* params)
|
|
|
|
{
|
|
|
|
switch (pname) {
|
|
|
|
case GL_LIGHT_MODEL_AMBIENT:
|
|
|
|
g_gl_context->gl_light_model(pname, params[0], 0.0f, 0.0f, 0.0f);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
g_gl_context->gl_light_model(pname, params[0], params[1], params[2], params[3]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-01-10 04:29:37 +03:00
|
|
|
void glLightModeli(GLenum pname, GLint param)
|
|
|
|
{
|
|
|
|
g_gl_context->gl_light_model(pname, param, 0.0f, 0.0f, 0.0f);
|
|
|
|
}
|
|
|
|
|
2021-12-01 18:10:17 +03:00
|
|
|
void glMaterialf(GLenum face, GLenum pname, GLfloat param)
|
|
|
|
{
|
2022-01-08 09:46:58 +03:00
|
|
|
g_gl_context->gl_materialf(face, pname, param);
|
2021-12-01 18:10:17 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
void glMaterialfv(GLenum face, GLenum pname, GLfloat const* params)
|
|
|
|
{
|
2022-01-08 09:46:58 +03:00
|
|
|
g_gl_context->gl_materialfv(face, pname, params);
|
2021-12-01 18:10:17 +03:00
|
|
|
}
|
|
|
|
|
2021-05-16 15:05:13 +03:00
|
|
|
void glShadeModel(GLenum mode)
|
|
|
|
{
|
|
|
|
g_gl_context->gl_shade_model(mode);
|
|
|
|
}
|