OSDN Git Service

02bc1c7c1dfa51c4d94c61189037ff45c7a92033
[mikumikustudio/libgdx-mikumikustudio.git] / backends / gdx-backend-jglfw / src / com / badlogic / gdx / backends / jglfw / JglfwGL10.java
1
2 package com.badlogic.gdx.backends.jglfw;
3
4 import static com.badlogic.gdx.backends.jglfw.JglfwUtil.*;
5 import static com.badlogic.jglfw.utils.Memory.*;
6
7 import com.badlogic.gdx.graphics.GL10;
8 import com.badlogic.jglfw.gl.GL;
9
10 import java.nio.Buffer;
11 import java.nio.FloatBuffer;
12 import java.nio.IntBuffer;
13
14 public class JglfwGL10 implements GL10 {
15         public void glActiveTexture (int texture) {
16                 GL.glActiveTexture(texture);
17         }
18
19         public void glBindTexture (int target, int texture) {
20                 GL.glBindTexture(target, texture);
21         }
22
23         public void glBlendFunc (int sfactor, int dfactor) {
24                 GL.glBlendFunc(sfactor, dfactor);
25         }
26
27         public void glClear (int mask) {
28                 GL.glClear(mask);
29         }
30
31         public void glClearColor (float red, float green, float blue, float alpha) {
32                 GL.glClearColor(red, green, blue, alpha);
33         }
34
35         public void glClearDepthf (float depth) {
36                 GL.glClearDepthf(depth);
37         }
38
39         public void glClearStencil (int s) {
40                 GL.glClearStencil(s);
41         }
42
43         public void glColorMask (boolean red, boolean green, boolean blue, boolean alpha) {
44                 GL.glColorMask(red, green, blue, alpha);
45         }
46
47         public void glCompressedTexImage2D (int target, int level, int internalformat, int width, int height, int border,
48                 int imageSize, Buffer data) {
49                 GL.glCompressedTexImage2D(target, level, internalformat, width, height, border, imageSize, data, getPosition(data));
50         }
51
52         public void glCompressedTexSubImage2D (int target, int level, int xoffset, int yoffset, int width, int height, int format,
53                 int imageSize, Buffer data) {
54                 GL.glCompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, imageSize, data, getPosition(data));
55         }
56
57         public void glCopyTexImage2D (int target, int level, int internalformat, int x, int y, int width, int height, int border) {
58                 GL.glCopyTexImage2D(target, level, internalformat, x, y, width, height, border);
59         }
60
61         public void glCopyTexSubImage2D (int target, int level, int xoffset, int yoffset, int x, int y, int width, int height) {
62                 GL.glCopyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height);
63         }
64
65         public void glCullFace (int mode) {
66                 GL.glCullFace(mode);
67         }
68
69         public void glDeleteTextures (int n, IntBuffer textures) {
70                 GL.glDeleteTextures(n, textures, getPosition(textures));
71         }
72
73         public void glDepthFunc (int func) {
74                 GL.glDepthFunc(func);
75         }
76
77         public void glDepthMask (boolean flag) {
78                 GL.glDepthMask(flag);
79         }
80
81         public void glDepthRangef (float zNear, float zFar) {
82                 GL.glDepthRangef(zNear, zFar);
83         }
84
85         public void glDisable (int cap) {
86                 GL.glDisable(cap);
87         }
88
89         public void glDrawArrays (int mode, int first, int count) {
90                 GL.glDrawArrays(mode, first, count);
91         }
92
93         public void glDrawElements (int mode, int count, int type, Buffer indices) {
94                 GL.glDrawElements(mode, count, type, indices, getPosition(indices));
95         }
96
97         public void glEnable (int cap) {
98                 GL.glEnable(cap);
99         }
100
101         public void glFinish () {
102                 GL.glFinish();
103         }
104
105         public void glFlush () {
106                 GL.glFlush();
107         }
108
109         public void glFrontFace (int mode) {
110                 GL.glFrontFace(mode);
111         }
112
113         public void glGenTextures (int n, IntBuffer textures) {
114                 GL.glGenTextures(n, textures, getPosition(textures));
115         }
116
117         public int glGetError () {
118                 return GL.glGetError();
119         }
120
121         public void glGetIntegerv (int pname, IntBuffer params) {
122                 GL.glGetIntegerv(pname, params, getPosition(params));
123         }
124
125         public String glGetString (int name) {
126                 return GL.glGetString(name);
127         }
128
129         public void glHint (int target, int mode) {
130                 GL.glHint(target, mode);
131         }
132
133         public void glLineWidth (float width) {
134                 GL.glLineWidth(width);
135         }
136
137         public void glPixelStorei (int pname, int param) {
138                 GL.glPixelStorei(pname, param);
139         }
140
141         public void glPolygonOffset (float factor, float units) {
142                 GL.glPolygonOffset(factor, units);
143         }
144
145         public void glReadPixels (int x, int y, int width, int height, int format, int type, Buffer pixels) {
146                 GL.glReadPixels(x, y, width, height, format, type, pixels, getPosition(pixels));
147         }
148
149         public void glScissor (int x, int y, int width, int height) {
150                 GL.glScissor(x, y, width, height);
151         }
152
153         public void glStencilFunc (int func, int ref, int mask) {
154                 GL.glStencilFunc(func, ref, mask);
155         }
156
157         public void glStencilMask (int mask) {
158                 GL.glStencilMask(mask);
159         }
160
161         public void glStencilOp (int fail, int zfail, int zpass) {
162                 GL.glStencilOp(fail, zfail, zpass);
163         }
164
165         public void glTexImage2D (int target, int level, int internalFormat, int width, int height, int border, int format, int type,
166                 Buffer pixels) {
167                 GL.glTexImage2D(target, level, internalFormat, width, height, border, format, type, pixels, getPosition(pixels));
168         }
169
170         public void glTexParameterf (int target, int pname, float param) {
171                 GL.glTexParameterf(target, pname, param);
172         }
173
174         public void glTexSubImage2D (int target, int level, int xoffset, int yoffset, int width, int height, int format, int type,
175                 Buffer pixels) {
176                 GL.glTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels, getPosition(pixels));
177         }
178
179         public void glViewport (int x, int y, int width, int height) {
180                 GL.glViewport(x, y, width, height);
181         }
182
183         public void glAlphaFunc (int func, float ref) {
184                 GL.glAlphaFunc(func, ref);
185         }
186
187         public void glClientActiveTexture (int texture) {
188                 GL.glClientActiveTexture(texture);
189         }
190
191         public void glColor4f (float red, float green, float blue, float alpha) {
192                 GL.glColor4f(red, green, blue, alpha);
193         }
194
195         public void glColorPointer (int size, int type, int stride, Buffer pointer) {
196                 GL.glColorPointer(size, type, stride, pointer, getPosition(pointer));
197         }
198
199         public void glDeleteTextures (int n, int[] textures, int offset) {
200                 GL.glDeleteTextures(n, toBuffer(textures, offset), 0);
201         }
202
203         public void glDisableClientState (int array) {
204                 GL.glDisableClientState(array);
205         }
206
207         public void glEnableClientState (int array) {
208                 GL.glEnableClientState(array);
209         }
210
211         public void glFogf (int pname, float param) {
212                 GL.glFogf(pname, param);
213         }
214
215         public void glFogfv (int pname, float[] params, int offset) {
216                 GL.glFogfv(pname, toBuffer(params, offset), 0);
217         }
218
219         public void glFogfv (int pname, FloatBuffer params) {
220                 GL.glFogfv(pname, params, getPosition(params));
221         }
222
223         public void glFrustumf (float left, float right, float bottom, float top, float zNear, float zFar) {
224                 GL.glFrustum(left, right, bottom, top, zNear, zFar);
225         }
226
227         public void glGenTextures (int n, int[] textures, int offset) {
228                 IntBuffer buffer = toBuffer(textures, offset);
229                 GL.glGenTextures(n, buffer, 0);
230                 toArray(buffer, textures, offset);
231         }
232
233         public void glGetIntegerv (int pname, int[] params, int offset) {
234                 IntBuffer buffer = toBuffer(params, offset);
235                 GL.glGetIntegerv(pname, buffer, 0);
236                 toArray(buffer, params, offset);
237         }
238
239         public void glLightModelf (int pname, float param) {
240                 GL.glLightModelf(pname, param);
241         }
242
243         public void glLightModelfv (int pname, float[] params, int offset) {
244                 GL.glLightModelfv(pname, toBuffer(params, offset), 0);
245         }
246
247         public void glLightModelfv (int pname, FloatBuffer params) {
248                 GL.glLightModelfv(pname, params, getPosition(params));
249         }
250
251         public void glLightf (int light, int pname, float param) {
252                 GL.glLightf(light, pname, param);
253         }
254
255         public void glLightfv (int light, int pname, float[] params, int offset) {
256                 GL.glLightfv(light, pname, toBuffer(params, offset), 0);
257         }
258
259         public void glLightfv (int light, int pname, FloatBuffer params) {
260                 GL.glLightfv(light, pname, params, getPosition(params));
261         }
262
263         public void glLoadIdentity () {
264                 GL.glLoadIdentity();
265         }
266
267         public void glLoadMatrixf (float[] m, int offset) {
268                 GL.glLoadMatrixf(toBuffer(m, offset), 0);
269         }
270
271         public void glLoadMatrixf (FloatBuffer m) {
272                 GL.glLoadMatrixf(m, getPosition(m));
273         }
274
275         public void glLogicOp (int opcode) {
276                 GL.glLogicOp(opcode);
277         }
278
279         public void glMaterialf (int face, int pname, float param) {
280                 GL.glMaterialf(face, pname, param);
281         }
282
283         public void glMaterialfv (int face, int pname, float[] params, int offset) {
284                 GL.glMaterialfv(face, pname, toBuffer(params, offset), 0);
285         }
286
287         public void glMaterialfv (int face, int pname, FloatBuffer params) {
288                 GL.glMaterialfv(face, pname, params, getPosition(params));
289         }
290
291         public void glMatrixMode (int mode) {
292                 GL.glMatrixMode(mode);
293         }
294
295         public void glMultMatrixf (float[] m, int offset) {
296                 GL.glMultMatrixf(toBuffer(m, offset), 0);
297         }
298
299         public void glMultMatrixf (FloatBuffer m) {
300                 GL.glMultMatrixf(m, getPosition(m));
301         }
302
303         public void glMultiTexCoord4f (int target, float s, float t, float r, float q) {
304                 GL.glMultiTexCoord4f(target, s, t, r, q);
305         }
306
307         public void glNormal3f (float nx, float ny, float nz) {
308                 GL.glNormal3f(nx, ny, nz);
309         }
310
311         public void glNormalPointer (int type, int stride, Buffer pointer) {
312                 GL.glNormalPointer(type, stride, pointer, getPosition(pointer));
313         }
314
315         public void glOrthof (float left, float right, float bottom, float top, float zNear, float zFar) {
316                 GL.glOrtho(left, right, bottom, top, zNear, zFar);
317         }
318
319         public void glPointSize (float size) {
320                 GL.glPointSize(size);
321         }
322
323         public void glPopMatrix () {
324                 GL.glPopMatrix();
325         }
326
327         public void glPushMatrix () {
328                 GL.glPushMatrix();
329         }
330
331         public void glRotatef (float angle, float x, float y, float z) {
332                 GL.glRotatef(angle, x, y, z);
333         }
334
335         public void glSampleCoverage (float value, boolean invert) {
336                 GL.glSampleCoverage(value, invert);
337         }
338
339         public void glScalef (float x, float y, float z) {
340                 GL.glScalef(x, y, z);
341         }
342
343         public void glShadeModel (int mode) {
344                 GL.glShadeModel(mode);
345         }
346
347         public void glTexCoordPointer (int size, int type, int stride, Buffer pointer) {
348                 GL.glTexCoordPointer(size, type, stride, pointer, getPosition(pointer));
349         }
350
351         public void glTexEnvf (int target, int pname, float param) {
352                 GL.glTexEnvf(target, pname, param);
353         }
354
355         public void glTexEnvfv (int target, int pname, float[] params, int offset) {
356                 GL.glTexEnvfv(target, pname, toBuffer(params, offset), 0);
357         }
358
359         public void glTexEnvfv (int target, int pname, FloatBuffer params) {
360                 GL.glTexEnvfv(target, pname, params, getPosition(params));
361         }
362
363         public void glTranslatef (float x, float y, float z) {
364                 GL.glTranslatef(x, y, z);
365         }
366
367         public void glVertexPointer (int size, int type, int stride, Buffer buffer) {
368                 GL.glVertexPointer(size, type, stride, buffer, getPosition(buffer));
369         }
370
371         public void glPolygonMode (int face, int mode) {
372                 GL.glPolygonMode(face, mode);
373         }
374 }