forked from SerenityOS/serenity
-
Notifications
You must be signed in to change notification settings - Fork 0
/
GLUtils.cpp
136 lines (109 loc) · 2.48 KB
/
GLUtils.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
/*
* Copyright (c) 2021, Jesse Buhagiar <[email protected]>
* Copyright (c) 2021, Stephan Unverwerth <[email protected]>
*
* 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);
}
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()
{
g_gl_context->gl_flush();
}
void glFinish()
{
g_gl_context->gl_finish();
}
void glHint(GLenum target, GLenum mode)
{
g_gl_context->gl_hint(target, mode);
}
void glReadBuffer(GLenum mode)
{
g_gl_context->gl_read_buffer(mode);
}
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);
}
void glGetBooleanv(GLenum pname, GLboolean* data)
{
g_gl_context->gl_get_booleanv(pname, data);
}
void glGetIntegerv(GLenum pname, GLint* data)
{
g_gl_context->gl_get_integerv(pname, data);
}
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);
}
void glDepthRange(GLdouble min, GLdouble max)
{
g_gl_context->gl_depth_range(min, max);
}
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);
}