ladybird/Userland/Libraries/LibGL/GLUtils.cpp

152 lines
2.8 KiB
C++
Raw Normal View History

/*
* Copyright (c) 2021, Jesse Buhagiar <jooster669@gmail.com>
* Copyright (c) 2021, Stephan Unverwerth <s.unverwerth@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include "GL/gl.h"
#include "GLContext.h"
extern GL::GLContext* g_gl_context;
void glEnable(GLenum cap)
{
g_gl_context->gl_enable(cap);
}
void glDisable(GLenum cap)
{
g_gl_context->gl_disable(cap);
}
void glFrontFace(GLenum mode)
{
g_gl_context->gl_front_face(mode);
}
void glCullFace(GLenum mode)
{
g_gl_context->gl_cull_face(mode);
}
void glClear(GLbitfield mask)
{
g_gl_context->gl_clear(mask);
}
void glClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
{
g_gl_context->gl_clear_color(red, green, blue, alpha);
}
void glClearDepth(GLdouble depth)
{
g_gl_context->gl_clear_depth(depth);
}
2021-08-13 15:03:39 +03:00
void glColorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha)
{
g_gl_context->gl_color_mask(red, green, blue, alpha);
}
GLubyte* glGetString(GLenum name)
{
return g_gl_context->gl_get_string(name);
}
void glViewport(GLint x, GLint y, GLsizei width, GLsizei height)
{
g_gl_context->gl_viewport(x, y, width, height);
}
GLenum glGetError()
{
return g_gl_context->gl_get_error();
}
void glFlush()
{
2021-05-21 00:20:23 +03:00
g_gl_context->gl_flush();
}
void glFinish()
{
2021-05-21 00:20:23 +03:00
g_gl_context->gl_finish();
}
void glHint(GLenum target, GLenum mode)
{
g_gl_context->gl_hint(target, mode);
}
2021-05-24 16:24:49 +03:00
void glReadBuffer(GLenum mode)
{
g_gl_context->gl_read_buffer(mode);
}
2021-08-31 21:23:29 +03:00
void glDrawBuffer(GLenum buffer)
{
g_gl_context->gl_draw_buffer(buffer);
}
void glReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid* pixels)
{
g_gl_context->gl_read_pixels(x, y, width, height, format, type, pixels);
}
void glGetFloatv(GLenum pname, GLfloat* params)
{
g_gl_context->gl_get_floatv(pname, params);
}
2021-08-13 02:06:26 +03:00
2021-08-17 11:38:34 +03:00
void glGetBooleanv(GLenum pname, GLboolean* data)
{
g_gl_context->gl_get_booleanv(pname, data);
}
2021-08-17 11:58:21 +03:00
void glGetIntegerv(GLenum pname, GLint* data)
{
g_gl_context->gl_get_integerv(pname, data);
}
2021-08-13 02:06:26 +03:00
void glDepthMask(GLboolean flag)
{
g_gl_context->gl_depth_mask(flag);
}
void glEnableClientState(GLenum cap)
{
g_gl_context->gl_enable_client_state(cap);
}
void glDisableClientState(GLenum cap)
{
g_gl_context->gl_disable_client_state(cap);
}
2021-08-16 18:52:12 +03:00
void glDepthRange(GLdouble min, GLdouble max)
{
g_gl_context->gl_depth_range(min, max);
}
2021-08-16 18:59:45 +03:00
void glDepthFunc(GLenum func)
{
g_gl_context->gl_depth_func(func);
}
void glPolygonMode(GLenum face, GLenum mode)
{
g_gl_context->gl_polygon_mode(face, mode);
}
2021-08-31 21:50:01 +03:00
void glPolygonOffset(GLfloat factor, GLfloat units)
{
g_gl_context->gl_polygon_offset(factor, units);
}
void glPixelStorei(GLenum pname, GLint param)
{
g_gl_context->gl_pixel_store(pname, param);
}