ManaPlus
naclglfunctions.h
Go to the documentation of this file.
1 /*
2  * The ManaPlus Client
3  * Copyright (C) 2014-2019 The ManaPlus Developers
4  * Copyright (C) 2019-2021 Andrei Karas
5  *
6  * This file is part of The ManaPlus Client.
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program. If not, see <http://www.gnu.org/licenses/>.
20  */
21 
22 #ifndef RENDER_OPENGL_NACLGLFUNCTIONS_H
23 #define RENDER_OPENGL_NACLGLFUNCTIONS_H
24 
25 #if defined(__native_client__) && defined(USE_OPENGL)
26 
27 #include <ppapi/c/ppb_opengles2.h>
28 
29 extern const struct PPB_OpenGLES2* gles2Interface;
30 extern PP_Resource gles2Context;
31 
32 #define mglDrawArrays(...) \
33  gles2Interface->DrawArrays(gles2Context, __VA_ARGS__)
34 #define mglEnableVertexAttribArray(...) \
35  gles2Interface->EnableVertexAttribArray(gles2Context, __VA_ARGS__)
36 #define mglVertexAttribPointer(...) \
37  gles2Interface->VertexAttribPointer(gles2Context, __VA_ARGS__)
38 #define mglUseProgram(...) \
39  gles2Interface->UseProgram(gles2Context, __VA_ARGS__)
40 #define mglViewport(...) \
41  gles2Interface->Viewport(gles2Context, __VA_ARGS__)
42 #define mglGenBuffers(...) \
43  gles2Interface->GenBuffers(gles2Context, __VA_ARGS__)
44 #define mglBindBuffer(...) \
45  gles2Interface->BindBuffer(gles2Context, __VA_ARGS__)
46 #define mglBufferData(...) \
47  gles2Interface->BufferData(gles2Context, __VA_ARGS__)
48 #define mglDeleteBuffers(...) \
49  gles2Interface->DeleteBuffers(gles2Context, __VA_ARGS__)
50 #define mglGetUniformLocation(...) \
51  gles2Interface->GetUniformLocation(gles2Context, __VA_ARGS__)
52 #define mglCreateShader(...) \
53  gles2Interface->CreateShader(gles2Context, __VA_ARGS__)
54 #define mglShaderSource(...) \
55  gles2Interface->ShaderSource(gles2Context, __VA_ARGS__)
56 #define mglCompileShader(...) \
57  gles2Interface->CompileShader(gles2Context, __VA_ARGS__)
58 #define mglGetShaderiv(...) \
59  gles2Interface->GetShaderiv(gles2Context, __VA_ARGS__)
60 #define mglAttachShader(...) \
61  gles2Interface->AttachShader(gles2Context, __VA_ARGS__)
62 #define mglBindAttribLocation(...) \
63  gles2Interface->BindAttribLocation(gles2Context, __VA_ARGS__)
64 #define mglLinkProgram(...) \
65  gles2Interface->LinkProgram(gles2Context, __VA_ARGS__)
66 #define mglGetProgramiv(...) \
67  gles2Interface->GetProgramiv(gles2Context, __VA_ARGS__)
68 #define mglClearColor(...) \
69  gles2Interface->ClearColor(gles2Context, __VA_ARGS__)
70 #define mglUniform1f(...) \
71  gles2Interface->Uniform1f(gles2Context, __VA_ARGS__)
72 #define mglUniform2f(...) \
73  gles2Interface->Uniform2f(gles2Context, __VA_ARGS__)
74 #define mglUniform3f(...) \
75  gles2Interface->Uniform3f(gles2Context, __VA_ARGS__)
76 #define mglUniform4f(...) \
77  gles2Interface->Uniform4f(gles2Context, __VA_ARGS__)
78 #define mglUniform1i(...) \
79  gles2Interface->Uniform1i(gles2Context, __VA_ARGS__)
80 #define mglUniform2i(...) \
81  gles2Interface->Uniform2i(gles2Context, __VA_ARGS__)
82 #define mglUniform3i(...) \
83  gles2Interface->Uniform3i(gles2Context, __VA_ARGS__)
84 #define mglUniform4i(...) \
85  gles2Interface->Uniform4i(gles2Context, __VA_ARGS__)
86 #define mglUniform1fv(...) \
87  gles2Interface->Uniform1fv(gles2Context, __VA_ARGS__)
88 #define mglUniform2fv(...) \
89  gles2Interface->Uniform2fv(gles2Context, __VA_ARGS__)
90 #define mglUniform3fv(...) \
91  gles2Interface->Uniform3fv(gles2Context, __VA_ARGS__)
92 #define mglUniform4fv(...) \
93  gles2Interface->Uniform4fv(gles2Context, __VA_ARGS__)
94 #define mglUniform1iv(...) \
95  gles2Interface->Uniform1iv(gles2Context, __VA_ARGS__)
96 #define mglUniform2iv(...) \
97  gles2Interface->Uniform2iv(gles2Context, __VA_ARGS__)
98 #define mglUniform3iv(...) \
99  gles2Interface->Uniform3iv(gles2Context, __VA_ARGS__)
100 #define mglUniform4iv(...) \
101  gles2Interface->Uniform4iv(gles2Context, __VA_ARGS__)
102 #define mglActiveTexture(...) \
103  gles2Interface->ActiveTexture(gles2Context, __VA_ARGS__)
104 #define mglBindTexture(...) \
105  gles2Interface->BindTexture(gles2Context, __VA_ARGS__)
106 #define mglEnable(...) \
107  gles2Interface->Enable(gles2Context, __VA_ARGS__)
108 #define mglClear(...) \
109  gles2Interface->Clear(gles2Context, __VA_ARGS__)
110 #define mglValidateProgram(...) \
111  gles2Interface->ValidateProgram(gles2Context, __VA_ARGS__)
112 #define mglDeleteProgram(...) \
113  gles2Interface->DeleteProgram(gles2Context, __VA_ARGS__)
114 #define mglCreateProgram() \
115  gles2Interface->CreateProgram(gles2Context)
116 #define mglGetProgramInfoLog(...) \
117  gles2Interface->GetProgramInfoLog(gles2Context, __VA_ARGS__)
118 #define mglDisable(...) \
119  gles2Interface->Disable(gles2Context, __VA_ARGS__)
120 #define mglHint(...) \
121  gles2Interface->Hint(gles2Context, __VA_ARGS__)
122 #define mglScissor(...) \
123  gles2Interface->Scissor(gles2Context, __VA_ARGS__)
124 #define mglEnable(...) \
125  gles2Interface->Enable(gles2Context, __VA_ARGS__)
126 #define mglGetIntegerv(...) \
127  gles2Interface->GetIntegerv(gles2Context, __VA_ARGS__)
128 #define mglGetString(...) \
129  gles2Interface->GetString(gles2Context, __VA_ARGS__)
130 #define mglBindFramebuffer(...) \
131  gles2Interface->BindFramebuffer(gles2Context, __VA_ARGS__)
132 #define mglBindRenderbuffer(...) \
133  gles2Interface->BindRenderbuffer(gles2Context, __VA_ARGS__)
134 #define mglBlendColor(...) \
135  gles2Interface->BlendColor(gles2Context, __VA_ARGS__)
136 #define mglBlendEquation(...) \
137  gles2Interface->BlendEquation(gles2Context, __VA_ARGS__)
138 #define mglBlendEquationSeparate(...) \
139  gles2Interface->BlendEquationSeparate(gles2Context, __VA_ARGS__)
140 #define mglBlendFunc(...) \
141  gles2Interface->BlendFunc(gles2Context, __VA_ARGS__)
142 #define mglBlendFuncSeparate(...) \
143  gles2Interface->BlendFuncSeparate(gles2Context, __VA_ARGS__)
144 #define mglBufferSubData(...) \
145  gles2Interface->BufferSubData(gles2Context, __VA_ARGS__)
146 #define mglCheckFramebufferStatus(...) \
147  gles2Interface->CheckFramebufferStatus(gles2Context, __VA_ARGS__)
148 #define mglClearDepthf(...) \
149  gles2Interface->ClearDepthf(gles2Context, __VA_ARGS__)
150 #define mglClearStencil(...) \
151  gles2Interface->ClearStencil(gles2Context, __VA_ARGS__)
152 #define mglColorMask(...) \
153  gles2Interface->ColorMask(gles2Context, __VA_ARGS__)
154 #define mglCompressedTexImage2D(...) \
155  gles2Interface->CompressedTexImage2D(gles2Context, __VA_ARGS__)
156 #define mglCompressedTexSubImage2D(...) \
157  gles2Interface->CompressedTexSubImage2D(gles2Context, __VA_ARGS__)
158 #define mglCopyTexImage2D(...) \
159  gles2Interface->CopyTexImage2D(gles2Context, __VA_ARGS__)
160 #define mglCopyTexSubImage2D(...) \
161  gles2Interface->CopyTexSubImage2D(gles2Context, __VA_ARGS__)
162 #define mglCullFace(...) \
163  gles2Interface->CullFace(gles2Context, __VA_ARGS__)
164 #define mglDeleteFramebuffers(...) \
165  gles2Interface->DeleteFramebuffers(gles2Context, __VA_ARGS__)
166 #define mglDeleteRenderbuffers(...) \
167  gles2Interface->DeleteRenderbuffers(gles2Context, __VA_ARGS__)
168 #define mglDeleteShader(...) \
169  gles2Interface->DeleteShader(gles2Context, __VA_ARGS__)
170 #define mglDeleteTextures(...) \
171  gles2Interface->DeleteTextures(gles2Context, __VA_ARGS__)
172 #define mglDepthFunc(...) \
173  gles2Interface->DepthFunc(gles2Context, __VA_ARGS__)
174 #define mglDepthMask(...) \
175  gles2Interface->DepthMask(gles2Context, __VA_ARGS__)
176 #define mglDepthRangef(...) \
177  gles2Interface->DepthRangef(gles2Context, __VA_ARGS__)
178 #define mglDetachShader(...) \
179  gles2Interface->DetachShader(gles2Context, __VA_ARGS__)
180 #define mglDisableVertexAttribArray(...) \
181  gles2Interface->DisableVertexAttribArray(gles2Context, __VA_ARGS__)
182 #define mglDrawElements(...) \
183  gles2Interface->DrawElements(gles2Context, __VA_ARGS__)
184 #define mglFinish(...) \
185  gles2Interface->Finish(gles2Context, __VA_ARGS__)
186 #define mglFlush(...) \
187  gles2Interface->Flush(gles2Context, __VA_ARGS__)
188 #define mglFramebufferRenderbuffer(...) \
189  gles2Interface->FramebufferRenderbuffer(gles2Context, __VA_ARGS__)
190 #define mglFramebufferTexture2D(...) \
191  gles2Interface->FramebufferTexture2D(gles2Context, __VA_ARGS__)
192 #define mglFrontFace(...) \
193  gles2Interface->FrontFace(gles2Context, __VA_ARGS__)
194 #define mglGenerateMipmap(...) \
195  gles2Interface->GenerateMipmap(gles2Context, __VA_ARGS__)
196 #define mglGenFramebuffers(...) \
197  gles2Interface->GenFramebuffers(gles2Context, __VA_ARGS__)
198 #define mglGenRenderbuffers(...) \
199  gles2Interface->GenRenderbuffers(gles2Context, __VA_ARGS__)
200 #define mglGenTextures(...) \
201  gles2Interface->GenTextures(gles2Context, __VA_ARGS__)
202 #define mglGetActiveAttrib(...) \
203  gles2Interface->GetActiveAttrib(gles2Context, __VA_ARGS__)
204 #define mglGetActiveUniform(...) \
205  gles2Interface->GetActiveUniform(gles2Context, __VA_ARGS__)
206 #define mglGetAttachedShaders(...) \
207  gles2Interface->GetAttachedShaders(gles2Context, __VA_ARGS__)
208 #define mglGetAttribLocation(...) \
209  gles2Interface->GetAttribLocation(gles2Context, __VA_ARGS__)
210 #define mglGetBooleanv(...) \
211  gles2Interface->GetBooleanv(gles2Context, __VA_ARGS__)
212 #define mglGetBufferParameteriv(...) \
213  gles2Interface->GetBufferParameteriv(gles2Context, __VA_ARGS__)
214 #define mglGetError(...) \
215  gles2Interface->GetError(gles2Context, __VA_ARGS__)
216 #define mglGetFloatv(...) \
217  gles2Interface->GetFloatv(gles2Context, __VA_ARGS__)
218 #define mglGetFramebufferAttachmentParameteriv(...) \
219  gles2Interface->GetFramebufferAttachmentParameteriv(gles2Context, \
220  __VA_ARGS__)
221 #define mglGetIntegerv(...) \
222  gles2Interface->GetIntegerv(gles2Context, __VA_ARGS__)
223 #define mglGetRenderbufferParameteriv(...) \
224  gles2Interface->GetRenderbufferParameteriv(gles2Context, __VA_ARGS__)
225 #define mglGetShaderInfoLog(...) \
226  gles2Interface->GetShaderInfoLog(gles2Context, __VA_ARGS__)
227 #define mglGetShaderPrecisionFormat(...) \
228  gles2Interface->GetShaderPrecisionFormat(gles2Context, __VA_ARGS__)
229 #define mglGetShaderSource(...) \
230  gles2Interface->GetShaderSource(gles2Context, __VA_ARGS__)
231 #define mglGetTexParameterfv(...) \
232  gles2Interface->GetTexParameterfv(gles2Context, __VA_ARGS__)
233 #define mglGetTexParameteriv(...) \
234  gles2Interface->GetTexParameteriv(gles2Context, __VA_ARGS__)
235 #define mglGetUniformfv(...) \
236  gles2Interface->GetUniformfv(gles2Context, __VA_ARGS__)
237 #define mglGetUniformiv(...) \
238  gles2Interface->GetUniformiv(gles2Context, __VA_ARGS__)
239 #define mglGetVertexAttribfv(...) \
240  gles2Interface->GetVertexAttribfv(gles2Context, __VA_ARGS__)
241 #define mglGetVertexAttribiv(...) \
242  gles2Interface->GetVertexAttribiv(gles2Context, __VA_ARGS__)
243 #define mglGetVertexAttribPointerv(...) \
244  gles2Interface->GetVertexAttribPointerv(gles2Context, __VA_ARGS__)
245 #define mglIsBuffer(...) \
246  gles2Interface->IsBuffer(gles2Context, __VA_ARGS__)
247 #define mglIsEnabled(...) \
248  gles2Interface->IsEnabled(gles2Context, __VA_ARGS__)
249 #define mglIsFramebuffer(...) \
250  gles2Interface->IsFramebuffer(gles2Context, __VA_ARGS__)
251 #define mglIsProgram(...) \
252  gles2Interface->IsProgram(gles2Context, __VA_ARGS__)
253 #define mglIsRenderbuffer(...) \
254  gles2Interface->IsRenderbuffer(gles2Context, __VA_ARGS__)
255 #define mglIsShader(...) \
256  gles2Interface->IsShader(gles2Context, __VA_ARGS__)
257 #define mglIsTexture(...) \
258  gles2Interface->IsTexture(gles2Context, __VA_ARGS__)
259 #define mglLineWidth(...) \
260  gles2Interface->LineWidth(gles2Context, __VA_ARGS__)
261 #define mglPixelStorei(...) \
262  gles2Interface->PixelStorei(gles2Context, __VA_ARGS__)
263 #define mglPolygonOffset(...) \
264  gles2Interface->PolygonOffset(gles2Context, __VA_ARGS__)
265 #define mglReadPixels(...) \
266  gles2Interface->ReadPixels(gles2Context, __VA_ARGS__)
267 #define mglReleaseShaderCompiler(...) \
268  gles2Interface->ReleaseShaderCompiler(gles2Context, __VA_ARGS__)
269 #define mglRenderbufferStorage(...) \
270  gles2Interface->RenderbufferStorage(gles2Context, __VA_ARGS__)
271 #define mglSampleCoverage(...) \
272  gles2Interface->SampleCoverage(gles2Context, __VA_ARGS__)
273 #define mglShaderBinary(...) \
274  gles2Interface->ShaderBinary(gles2Context, __VA_ARGS__)
275 #define mglStencilFunc(...) \
276  gles2Interface->StencilFunc(gles2Context, __VA_ARGS__)
277 #define mglStencilFuncSeparate(...) \
278  gles2Interface->StencilFuncSeparate(gles2Context, __VA_ARGS__)
279 #define mglStencilMask(...) \
280  gles2Interface->StencilMask(gles2Context, __VA_ARGS__)
281 #define mglStencilMaskSeparate(...) \
282  gles2Interface->StencilMaskSeparate(gles2Context, __VA_ARGS__)
283 #define mglStencilOp(...) \
284  gles2Interface->StencilOp(gles2Context, __VA_ARGS__)
285 #define mglStencilOpSeparate(...) \
286  gles2Interface->StencilOpSeparate(gles2Context, __VA_ARGS__)
287 #define mglTexImage2D(...) \
288  gles2Interface->TexImage2D(gles2Context, __VA_ARGS__)
289 #define mglTexParameterf(...) \
290  gles2Interface->TexParameterf(gles2Context, __VA_ARGS__)
291 #define mglTexParameterfv(...) \
292  gles2Interface->TexParameterfv(gles2Context, __VA_ARGS__)
293 #define mglTexParameteri(...) \
294  gles2Interface->TexParameteri(gles2Context, __VA_ARGS__)
295 #define mglTexParameteriv(...) \
296  gles2Interface->TexParameteriv(gles2Context, __VA_ARGS__)
297 #define mglTexSubImage2D(...) \
298  gles2Interface->TexSubImage2D(gles2Context, __VA_ARGS__)
299 #define mglUniformMatrix2fv(...) \
300  gles2Interface->UniformMatrix2fv(gles2Context, __VA_ARGS__)
301 #define mglUniformMatrix3fv(...) \
302  gles2Interface->UniformMatrix3fv(gles2Context, __VA_ARGS__)
303 #define mglUniformMatrix4fv(...) \
304  gles2Interface->UniformMatrix4fv(gles2Context, __VA_ARGS__)
305 #define mglVertexAttrib1f(...) \
306  gles2Interface->VertexAttrib1f(gles2Context, __VA_ARGS__)
307 #define mglVertexAttrib2f(...) \
308  gles2Interface->VertexAttrib2f(gles2Context, __VA_ARGS__)
309 #define mglVertexAttrib3f(...) \
310  gles2Interface->VertexAttrib3f(gles2Context, __VA_ARGS__)
311 #define mglVertexAttrib4f(...) \
312  gles2Interface->VertexAttrib4f(gles2Context, __VA_ARGS__)
313 #define mglVertexAttrib1fv(...) \
314  gles2Interface->VertexAttrib1fv(gles2Context, __VA_ARGS__)
315 #define mglVertexAttrib2fv(...) \
316  gles2Interface->VertexAttrib2fv(gles2Context, __VA_ARGS__)
317 #define mglVertexAttrib3fv(...) \
318  gles2Interface->VertexAttrib3fv(gles2Context, __VA_ARGS__)
319 #define mglVertexAttrib4fv(...) \
320  gles2Interface->VertexAttrib4fv(gles2Context, __VA_ARGS__)
321 
322 #endif // defined(__native_client__) && defined(USE_OPENGL)
323 #endif // RENDER_OPENGL_NACLGLFUNCTIONS_H