summaryrefslogtreecommitdiffstats
path: root/src/jake2/render/opengl/JoglGL2.java
blob: d0785851ed397020dca5ef2625e9db89d8a5604a (plain)
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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
package jake2.render.opengl;


import java.nio.*;

import javax.media.opengl.GL;
import javax.media.opengl.GL2;

public class JoglGL2 implements QGL {
    
    private GL2 gl;
    
    JoglGL2() {
        // singleton
    }
    
    void setGL(GL2 gl) {
        this.gl = gl;
    }
    
    public void glAlphaFunc(int func, float ref) {
        gl.glAlphaFunc(func, ref);
    }

    public void glBegin(int mode) {
        gl.glBegin(mode);
    }

    public void glBindTexture(int target, int texture) {
        gl.glBindTexture(target, texture);
    }

    public void glBlendFunc(int sfactor, int dfactor) {
        gl.glBlendFunc(sfactor, dfactor);
    }

    public void glClear(int mask) {
        gl.glClear(mask);
    }

    public void glClearColor(float red, float green, float blue, float alpha) {
        gl.glClearColor(red, green, blue, alpha);
    }

    public void glColor3f(float red, float green, float blue) {
        gl.glColor3f(red, green, blue);
    }

    public void glColor3ub(byte red, byte green, byte blue) {
        gl.glColor3ub(red, green, blue);
    }

    public void glColor4f(float red, float green, float blue, float alpha) {
        gl.glColor4f(red, green, blue, alpha);
    }

    public void glColor4ub(byte red, byte green, byte blue, byte alpha) {
        gl.glColor4ub(red, green, blue, alpha);
    }

    public void glColorPointer(int size, boolean unsigned, int stride,
            ByteBuffer pointer) {
        gl.glColorPointer(size, GL_UNSIGNED_BYTE, stride, pointer);
    }
    
    public void glColorPointer(int size, int stride, FloatBuffer pointer) {
        gl.glColorPointer(size, GL_FLOAT, stride, pointer);
    }

    public void glCullFace(int mode) {
        gl.glCullFace(mode);
    }

    public void glDeleteTextures(IntBuffer textures) {
        gl.glDeleteTextures(textures.limit(), textures);
    }

    public void glDepthFunc(int func) {
        gl.glDepthFunc(func);
    }

    public void glDepthMask(boolean flag) {
        gl.glDepthMask(flag);
    }

    public void glDepthRange(double zNear, double zFar) {
        gl.glDepthRange(zNear, zFar);
    }

    public void glDisable(int cap) {
        gl.glDisable(cap);
    }

    public void glDisableClientState(int cap) {
        gl.glDisableClientState(cap);
    }

    public void glDrawArrays(int mode, int first, int count) {
        gl.glDrawArrays(mode, first, count);
    }

    public void glDrawBuffer(int mode) {
        gl.glDrawBuffer(mode);
    }

    public void glDrawElements(int mode, ShortBuffer indices) {
        gl.glDrawElements(mode, indices.remaining(), GL.GL_UNSIGNED_SHORT, indices);
    }

    public void glEnable(int cap) {
        gl.glEnable(cap);
    }

    public void glEnableClientState(int cap) {
        gl.glEnableClientState(cap);
    }

    public void glEnd() {
        gl.glEnd();
    }

    public void glFinish() {
        gl.glFinish();
    }

    public void glFlush() {
        gl.glFlush();
    }

    public void glFrustum(double left, double right, double bottom,
            double top, double zNear, double zFar) {
        gl.glFrustum(left, right, bottom, top, zNear, zFar);
    }

    public int glGetError() {
        return gl.glGetError();
    }

    public void glGetFloat(int pname, FloatBuffer params) {
        gl.glGetFloatv(pname, params);
    }

    public String glGetString(int name) {
        return gl.glGetString(name);
    }
    
    public void glHint(int target, int mode) {
	gl.glHint(target, mode);
    }

    public void glInterleavedArrays(int format, int stride,
            FloatBuffer pointer) {
        gl.glInterleavedArrays(format, stride, pointer);
    }

    public void glLoadIdentity() {
        gl.glLoadIdentity();
    }

    public void glLoadMatrix(FloatBuffer m) {
        gl.glLoadMatrixf(m);
    }

    public void glMatrixMode(int mode) {
        gl.glMatrixMode(mode);
    }

    public void glOrtho(double left, double right, double bottom,
            double top, double zNear, double zFar) {
        gl.glOrtho(left, right, bottom, top, zNear, zFar);
    }

    public void glPixelStorei(int pname, int param) {
        gl.glPixelStorei(pname, param);
    }

    public void glPointSize(float size) {
        gl.glPointSize(size);
    }

    public void glPolygonMode(int face, int mode) {
        gl.glPolygonMode(face, mode);
    }

    public void glPopMatrix() {
        gl.glPopMatrix();
    }

    public void glPushMatrix() {
        gl.glPushMatrix();
    }

    public void glReadPixels(int x, int y, int width, int height,
            int format, int type, ByteBuffer pixels) {
        gl.glReadPixels(x, y, width, height, format, type, pixels);
    }

    public void glRotatef(float angle, float x, float y, float z) {
        gl.glRotatef(angle, x, y, z);
    }

    public void glScalef(float x, float y, float z) {
        gl.glScalef(x, y, z);
    }

    public void glScissor(int x, int y, int width, int height) {
        gl.glScissor(x, y, width, height);
    }

    public void glShadeModel(int mode) {
        gl.glShadeModel(mode);
    }

    public void glTexCoord2f(float s, float t) {
        gl.glTexCoord2f(s, t);
    }

    public void glTexCoordPointer(int size, int stride, FloatBuffer pointer) {
        gl.glTexCoordPointer(size, GL_FLOAT, stride, pointer);
    }

    public void glTexEnvi(int target, int pname, int param) {
        gl.glTexEnvi(target, pname, param);
    }

    public void glTexImage2D(int target, int level, int internalformat,
            int width, int height, int border, int format, int type,
            ByteBuffer pixels) {
        gl.glTexImage2D(target, level, internalformat, width, height, border,
                format, type, pixels);
    }

    public void glTexImage2D(int target, int level, int internalformat,
            int width, int height, int border, int format, int type,
            IntBuffer pixels) {
        gl.glTexImage2D(target, level, internalformat, width, height, border,
                format, type, pixels);
    }

    public void glTexParameterf(int target, int pname, float param) {
        gl.glTexParameterf(target, pname, param);
    }

    public void glTexParameteri(int target, int pname, int param) {
        gl.glTexParameteri(target, pname, param);
    }

    public void glTexSubImage2D(int target, int level, int xoffset,
            int yoffset, int width, int height, int format, int type,
            IntBuffer pixels) {
        gl.glTexSubImage2D(target, level, xoffset, yoffset, width, height,
                format, type, pixels);
    }

    public void glTranslatef(float x, float y, float z) {
        gl.glTranslatef(x, y, z);
    }

    public void glVertex2f(float x, float y) {
        gl.glVertex2f(x, y);
    }

    public void glVertex3f(float x, float y, float z) {
        gl.glVertex3f(x, y, z);
    }

    public void glVertexPointer(int size, int stride, FloatBuffer pointer) {
        gl.glVertexPointer(size, GL_FLOAT, stride, pointer);
    }

    public void glViewport(int x, int y, int width, int height) {
        gl.glViewport(x, y, width, height);
    }

    public void glColorTable(int target, int internalFormat, int width,
            int format, int type, ByteBuffer data) {
        gl.glColorTable(target, internalFormat, width, format, type, data);
    }

    public void glActiveTextureARB(int texture) {
        gl.glActiveTexture(texture);
    }

    public void glClientActiveTextureARB(int texture) {
        gl.glClientActiveTexture(texture);
    }

    public void glPointParameterEXT(int pname, FloatBuffer pfParams) {
        gl.glPointParameterfv(pname, pfParams);
    }

    public void glPointParameterfEXT(int pname, float param) {
        gl.glPointParameterf(pname, param);
    }
    public void glLockArraysEXT(int first, int count) {
        gl.glLockArraysEXT(first, count);
    }

    public void glArrayElement(int index) {
        gl.glArrayElement(index);
    }

    public void glUnlockArraysEXT() {
        gl.glUnlockArraysEXT();
    }
    
    public void glMultiTexCoord2f(int target, float s, float t) {
        gl.glMultiTexCoord2f(target, s, t);
    }
    
    /*
     * util extensions
     */
    public void setSwapInterval(int interval) {
	gl.setSwapInterval(interval);
    }

}