ruby-opengl 0.33.0 → 0.40.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (103) hide show
  1. data/Rakefile +42 -15
  2. data/doc/build_install.txt +70 -25
  3. data/doc/history.txt +4 -0
  4. data/doc/requirements_and_design.txt +2 -3
  5. data/doc/roadmap.txt +15 -2
  6. data/doc/screenshots.txt +23 -0
  7. data/doc/supplies/page_template.html +2 -1
  8. data/doc/thanks.txt +3 -0
  9. data/doc/tutorial.txt +5 -3
  10. data/examples/README +57 -7
  11. data/examples/legacy/COPYRIGHT +8 -0
  12. data/examples/{aaindex.rb → legacy/aaindex.rb} +6 -5
  13. data/examples/legacy/aapoly.rb +153 -0
  14. data/examples/legacy/aargb.rb +139 -0
  15. data/examples/legacy/accanti.rb +159 -0
  16. data/examples/legacy/accpersp.rb +216 -0
  17. data/examples/legacy/alpha.rb +133 -0
  18. data/examples/legacy/alpha3D.rb +165 -0
  19. data/examples/legacy/bezcurve.rb +107 -0
  20. data/examples/legacy/bezmesh.rb +131 -0
  21. data/examples/legacy/checker.rb +121 -0
  22. data/examples/legacy/clip.rb +104 -0
  23. data/examples/legacy/colormat.rb +145 -0
  24. data/examples/legacy/cube.rb +73 -0
  25. data/examples/legacy/depthcue.rb +101 -0
  26. data/examples/legacy/dof.rb +212 -0
  27. data/examples/legacy/double.rb +104 -0
  28. data/examples/legacy/drawf.rb +98 -0
  29. data/examples/legacy/feedback.rb +152 -0
  30. data/examples/legacy/fog.rb +172 -0
  31. data/examples/legacy/font-glut.rb +41 -0
  32. data/examples/legacy/font.rb +158 -0
  33. data/examples/legacy/hello.rb +75 -0
  34. data/examples/legacy/image.rb +145 -0
  35. data/examples/legacy/jitter.rb +209 -0
  36. data/examples/legacy/lines.rb +135 -0
  37. data/examples/legacy/list.rb +120 -0
  38. data/examples/legacy/material.rb +290 -0
  39. data/examples/legacy/mipmap.rb +159 -0
  40. data/examples/legacy/model.rb +119 -0
  41. data/examples/legacy/movelight.rb +140 -0
  42. data/examples/legacy/pickdepth.rb +180 -0
  43. data/examples/legacy/planet.rb +112 -0
  44. data/examples/legacy/quadric.rb +180 -0
  45. data/examples/legacy/readpixel.rb +59 -0
  46. data/examples/legacy/robot.rb +120 -0
  47. data/examples/legacy/select.rb +207 -0
  48. data/examples/{smooth_prev.rb → legacy/smooth.rb} +3 -2
  49. data/examples/legacy/stencil.rb +154 -0
  50. data/examples/legacy/stroke.rb +170 -0
  51. data/examples/legacy/surface.rb +170 -0
  52. data/examples/legacy/teaambient.rb +132 -0
  53. data/examples/legacy/teapots.rb +188 -0
  54. data/examples/legacy/tess.rb +222 -0
  55. data/examples/legacy/texbind.rb +157 -0
  56. data/examples/legacy/texgen.rb +171 -0
  57. data/examples/legacy/texturesurf.rb +128 -0
  58. data/examples/legacy/varray.rb +167 -0
  59. data/examples/legacy/wrap.rb +158 -0
  60. data/examples/nehe_lesson02.rb +117 -0
  61. data/examples/nehe_lesson03.rb +122 -0
  62. data/examples/nehe_lesson04.rb +133 -0
  63. data/examples/nehe_lesson05.rb +186 -0
  64. data/examples/plane.rb +1 -1
  65. data/examples/smooth.rb +4 -2
  66. data/examples/test.rb +3 -2
  67. data/ext/common/{rbogl.c → common.h} +99 -32
  68. data/ext/common/gl-enums.h +39 -1
  69. data/ext/gl/gl-1.0-1.1.c +350 -305
  70. data/ext/gl/gl-1.2.c +933 -38
  71. data/ext/gl/gl-1.3.c +725 -0
  72. data/ext/gl/gl-1.4.c +647 -0
  73. data/ext/gl/gl-1.5.c +362 -0
  74. data/ext/gl/gl-2.0.c +1632 -0
  75. data/ext/gl/gl-2.1.c +154 -0
  76. data/ext/gl/gl-enums.c +1 -2
  77. data/ext/gl/gl.c +58 -2
  78. data/ext/gl/mkrf_conf.rb +4 -1
  79. data/ext/glu/glu.c +5 -4
  80. data/ext/glu/mkrf_conf.rb +4 -1
  81. data/ext/glut/glut.c +7 -1
  82. data/ext/glut/mkrf_conf.rb +5 -0
  83. data/lib/gl_prev.rb +4 -3
  84. data/lib/glu_prev.rb +4 -3
  85. data/lib/glut_prev.rb +3 -3
  86. data/{examples/all_tests.rb → lib/opengl.rb} +9 -12
  87. data/test/README +5 -18
  88. data/test/tc_common.rb +79 -0
  89. data/test/tc_func_10_11.rb +1255 -0
  90. data/test/tc_func_12.rb +186 -0
  91. data/test/tc_func_13.rb +203 -0
  92. data/test/tc_func_14.rb +197 -0
  93. data/test/tc_func_15.rb +82 -0
  94. data/test/tc_func_20.rb +320 -0
  95. data/test/tc_func_21.rb +67 -0
  96. data/test/tc_include_gl.rb +1 -1
  97. data/test/{tc_opengl_namespace.rb → tc_misc.rb} +20 -20
  98. data/test/tc_require_gl.rb +1 -1
  99. metadata +99 -27
  100. data/ext/common/Rakefile +0 -39
  101. data/ext/common/rbogl.h +0 -52
  102. data/test/runtests.sh +0 -7
  103. data/test/tc_gl_vertex.rb +0 -180
data/ext/gl/gl-1.3.c ADDED
@@ -0,0 +1,725 @@
1
+ /*
2
+ * Copyright (C) 2007 Jan Dvorak <jan.dvorak@kraxnet.cz>
3
+ *
4
+ * This program is distributed under the terms of the MIT license.
5
+ * See the included MIT-LICENSE file for the terms of this license.
6
+ *
7
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
8
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
9
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
10
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
11
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
12
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
13
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
14
+ */
15
+
16
+ #ifdef __APPLE__
17
+ #include <OpenGL/gl.h>
18
+ #elif defined WIN32
19
+ #include <windows.h>
20
+ #include <GL/gl.h>
21
+ #else
22
+ #include <GL/gl.h>
23
+ #endif
24
+ #include "../common/common.h"
25
+
26
+ /* OpenGL 1.3 functions */
27
+
28
+ static void (APIENTRY * fptr_glActiveTexture)(GLenum);
29
+ static VALUE
30
+ gl_ActiveTexture(obj,arg1)
31
+ VALUE obj,arg1;
32
+ {
33
+ GLenum texture;
34
+ LOAD_GL_FUNC(glActiveTexture)
35
+ texture = (GLenum)NUM2INT(arg1);
36
+ fptr_glActiveTexture(texture);
37
+ return Qnil;
38
+ }
39
+
40
+ static void (APIENTRY * fptr_glClientActiveTexture)(GLenum);
41
+ static VALUE
42
+ gl_ClientActiveTexture(obj,arg1)
43
+ VALUE obj,arg1;
44
+ {
45
+ GLenum texture;
46
+ LOAD_GL_FUNC(glClientActiveTexture)
47
+ texture = (GLenum)NUM2INT(arg1);
48
+ fptr_glClientActiveTexture(texture);
49
+ return Qnil;
50
+ }
51
+
52
+ static void (APIENTRY * fptr_glMultiTexCoord1d)(GLenum,GLdouble);
53
+ static VALUE
54
+ gl_MultiTexCoord1d(obj,arg1,arg2)
55
+ VALUE obj,arg1,arg2;
56
+ {
57
+ GLenum target;
58
+ GLdouble s;
59
+ LOAD_GL_FUNC(glMultiTexCoord1d)
60
+ target = (GLenum)NUM2INT(arg1);
61
+ s = (GLdouble)NUM2DBL(arg2);
62
+ fptr_glMultiTexCoord1d(target,s);
63
+ return Qnil;
64
+ }
65
+
66
+ static void (APIENTRY * fptr_glMultiTexCoord1f)(GLenum,GLfloat);
67
+ static VALUE
68
+ gl_MultiTexCoord1f(obj,arg1,arg2)
69
+ VALUE obj,arg1,arg2;
70
+ {
71
+ GLenum target;
72
+ GLfloat s;
73
+ LOAD_GL_FUNC(glMultiTexCoord1f)
74
+ target = (GLenum)NUM2INT(arg1);
75
+ s = (GLfloat)NUM2DBL(arg2);
76
+ fptr_glMultiTexCoord1f(target,s);
77
+ return Qnil;
78
+ }
79
+
80
+ static void (APIENTRY * fptr_glMultiTexCoord1i)(GLenum,GLint);
81
+ static VALUE
82
+ gl_MultiTexCoord1i(obj,arg1,arg2)
83
+ VALUE obj,arg1,arg2;
84
+ {
85
+ GLenum target;
86
+ GLint s;
87
+ LOAD_GL_FUNC(glMultiTexCoord1i)
88
+ target = (GLenum)NUM2INT(arg1);
89
+ s = (GLint)NUM2INT(arg2);
90
+ fptr_glMultiTexCoord1i(target,s);
91
+ return Qnil;
92
+ }
93
+
94
+ static void (APIENTRY * fptr_glMultiTexCoord1s)(GLenum,GLshort);
95
+ static VALUE
96
+ gl_MultiTexCoord1s(obj,arg1,arg2)
97
+ VALUE obj,arg1,arg2;
98
+ {
99
+ GLenum target;
100
+ GLshort s;
101
+ LOAD_GL_FUNC(glMultiTexCoord1s)
102
+ target = (GLenum)NUM2INT(arg1);
103
+ s = (GLshort)NUM2INT(arg2);
104
+ fptr_glMultiTexCoord1s(target,s);
105
+ return Qnil;
106
+ }
107
+
108
+ static void (APIENTRY * fptr_glMultiTexCoord2d)(GLenum,GLdouble,GLdouble);
109
+ static VALUE
110
+ gl_MultiTexCoord2d(obj,arg1,arg2,arg3)
111
+ VALUE obj,arg1,arg2,arg3;
112
+ {
113
+ GLenum target;
114
+ GLdouble s;
115
+ GLdouble t;
116
+ LOAD_GL_FUNC(glMultiTexCoord2d)
117
+ target = (GLenum)NUM2INT(arg1);
118
+ s = (GLdouble)NUM2DBL(arg2);
119
+ t = (GLdouble)NUM2DBL(arg3);
120
+ fptr_glMultiTexCoord2d(target,s,t);
121
+ return Qnil;
122
+ }
123
+
124
+ static void (APIENTRY * fptr_glMultiTexCoord2f)(GLenum,GLfloat,GLfloat);
125
+ static VALUE
126
+ gl_MultiTexCoord2f(obj,arg1,arg2,arg3)
127
+ VALUE obj,arg1,arg2,arg3;
128
+ {
129
+ GLenum target;
130
+ GLfloat s;
131
+ GLfloat t;
132
+ LOAD_GL_FUNC(glMultiTexCoord2f)
133
+ target = (GLenum)NUM2INT(arg1);
134
+ s = (GLfloat)NUM2DBL(arg2);
135
+ t = (GLfloat)NUM2DBL(arg3);
136
+ fptr_glMultiTexCoord2f(target,s,t);
137
+ return Qnil;
138
+ }
139
+
140
+ static void (APIENTRY * fptr_glMultiTexCoord2i)(GLenum,GLint,GLint);
141
+ static VALUE
142
+ gl_MultiTexCoord2i(obj,arg1,arg2,arg3)
143
+ VALUE obj,arg1,arg2,arg3;
144
+ {
145
+ GLenum target;
146
+ GLint s;
147
+ GLint t;
148
+ LOAD_GL_FUNC(glMultiTexCoord2i)
149
+ target = (GLenum)NUM2INT(arg1);
150
+ s = (GLint)NUM2INT(arg2);
151
+ t = (GLint)NUM2INT(arg3);
152
+ fptr_glMultiTexCoord2i(target,s,t);
153
+ return Qnil;
154
+ }
155
+
156
+ static void (APIENTRY * fptr_glMultiTexCoord2s)(GLenum,GLshort,GLshort);
157
+ static VALUE
158
+ gl_MultiTexCoord2s(obj,arg1,arg2,arg3)
159
+ VALUE obj,arg1,arg2,arg3;
160
+ {
161
+ GLenum target;
162
+ GLshort s;
163
+ GLshort t;
164
+ LOAD_GL_FUNC(glMultiTexCoord2s)
165
+ target = (GLenum)NUM2INT(arg1);
166
+ s = (GLshort)NUM2INT(arg2);
167
+ t = (GLshort)NUM2INT(arg3);
168
+ fptr_glMultiTexCoord2s(target,s,t);
169
+ return Qnil;
170
+ }
171
+
172
+ static void (APIENTRY * fptr_glMultiTexCoord3d)(GLenum,GLdouble,GLdouble,GLdouble);
173
+ static VALUE
174
+ gl_MultiTexCoord3d(obj,arg1,arg2,arg3,arg4)
175
+ VALUE obj,arg1,arg2,arg3,arg4;
176
+ {
177
+ GLenum target;
178
+ GLdouble s;
179
+ GLdouble t;
180
+ GLdouble r;
181
+ LOAD_GL_FUNC(glMultiTexCoord3d)
182
+ target = (GLenum)NUM2INT(arg1);
183
+ s = (GLdouble)NUM2DBL(arg2);
184
+ t = (GLdouble)NUM2DBL(arg3);
185
+ r = (GLdouble)NUM2DBL(arg4);
186
+ fptr_glMultiTexCoord3d(target,s,t,r);
187
+ return Qnil;
188
+ }
189
+
190
+ static void (APIENTRY * fptr_glMultiTexCoord3f)(GLenum,GLfloat,GLfloat,GLfloat);
191
+ static VALUE
192
+ gl_MultiTexCoord3f(obj,arg1,arg2,arg3,arg4)
193
+ VALUE obj,arg1,arg2,arg3,arg4;
194
+ {
195
+ GLenum target;
196
+ GLfloat s;
197
+ GLfloat t;
198
+ GLfloat r;
199
+ LOAD_GL_FUNC(glMultiTexCoord3f)
200
+ target = (GLenum)NUM2INT(arg1);
201
+ s = (GLfloat)NUM2DBL(arg2);
202
+ t = (GLfloat)NUM2DBL(arg3);
203
+ r = (GLfloat)NUM2DBL(arg4);
204
+ fptr_glMultiTexCoord3f(target,s,t,r);
205
+ return Qnil;
206
+ }
207
+
208
+ static void (APIENTRY * fptr_glMultiTexCoord3i)(GLenum,GLint,GLint,GLint);
209
+ static VALUE
210
+ gl_MultiTexCoord3i(obj,arg1,arg2,arg3,arg4)
211
+ VALUE obj,arg1,arg2,arg3,arg4;
212
+ {
213
+ GLenum target;
214
+ GLint s;
215
+ GLint t;
216
+ GLint r;
217
+ LOAD_GL_FUNC(glMultiTexCoord3i)
218
+ target = (GLenum)NUM2INT(arg1);
219
+ s = (GLint)NUM2INT(arg2);
220
+ t = (GLint)NUM2INT(arg3);
221
+ r = (GLint)NUM2INT(arg4);
222
+ fptr_glMultiTexCoord3i(target,s,t,r);
223
+ return Qnil;
224
+ }
225
+
226
+ static void (APIENTRY * fptr_glMultiTexCoord3s)(GLenum,GLshort,GLshort,GLshort);
227
+ static VALUE
228
+ gl_MultiTexCoord3s(obj,arg1,arg2,arg3,arg4)
229
+ VALUE obj,arg1,arg2,arg3,arg4;
230
+ {
231
+ GLenum target;
232
+ GLshort s;
233
+ GLshort t;
234
+ GLshort r;
235
+ LOAD_GL_FUNC(glMultiTexCoord3s)
236
+ target = (GLenum)NUM2INT(arg1);
237
+ s = (GLshort)NUM2INT(arg2);
238
+ t = (GLshort)NUM2INT(arg3);
239
+ r = (GLshort)NUM2INT(arg4);
240
+ fptr_glMultiTexCoord3s(target,s,t,r);
241
+ return Qnil;
242
+ }
243
+
244
+ static void (APIENTRY * fptr_glMultiTexCoord4d)(GLenum,GLdouble,GLdouble,GLdouble,GLdouble);
245
+ static VALUE
246
+ gl_MultiTexCoord4d(obj,arg1,arg2,arg3,arg4,arg5)
247
+ VALUE obj,arg1,arg2,arg3,arg4,arg5;
248
+ {
249
+ GLenum target;
250
+ GLdouble s;
251
+ GLdouble t;
252
+ GLdouble r;
253
+ GLdouble q;
254
+ LOAD_GL_FUNC(glMultiTexCoord4d)
255
+ target = (GLenum)NUM2INT(arg1);
256
+ s = (GLdouble)NUM2DBL(arg2);
257
+ t = (GLdouble)NUM2DBL(arg3);
258
+ r = (GLdouble)NUM2DBL(arg4);
259
+ q = (GLdouble)NUM2DBL(arg5);
260
+ fptr_glMultiTexCoord4d(target,s,t,r,q);
261
+ return Qnil;
262
+ }
263
+
264
+ static void (APIENTRY * fptr_glMultiTexCoord4f)(GLenum,GLfloat,GLfloat,GLfloat,GLfloat);
265
+ static VALUE
266
+ gl_MultiTexCoord4f(obj,arg1,arg2,arg3,arg4,arg5)
267
+ VALUE obj,arg1,arg2,arg3,arg4,arg5;
268
+ {
269
+ GLenum target;
270
+ GLfloat s;
271
+ GLfloat t;
272
+ GLfloat r;
273
+ GLfloat q;
274
+ LOAD_GL_FUNC(glMultiTexCoord4f)
275
+ target = (GLenum)NUM2INT(arg1);
276
+ s = (GLfloat)NUM2DBL(arg2);
277
+ t = (GLfloat)NUM2DBL(arg3);
278
+ r = (GLfloat)NUM2DBL(arg4);
279
+ q = (GLfloat)NUM2DBL(arg5);
280
+ fptr_glMultiTexCoord4f(target,s,t,r,q);
281
+ return Qnil;
282
+ }
283
+
284
+ static void (APIENTRY * fptr_glMultiTexCoord4i)(GLenum,GLint,GLint,GLint,GLint);
285
+ static VALUE
286
+ gl_MultiTexCoord4i(obj,arg1,arg2,arg3,arg4,arg5)
287
+ VALUE obj,arg1,arg2,arg3,arg4,arg5;
288
+ {
289
+ GLenum target;
290
+ GLint s;
291
+ GLint t;
292
+ GLint r;
293
+ GLint q;
294
+ LOAD_GL_FUNC(glMultiTexCoord4i)
295
+ target = (GLenum)NUM2INT(arg1);
296
+ s = (GLint)NUM2INT(arg2);
297
+ t = (GLint)NUM2INT(arg3);
298
+ r = (GLint)NUM2INT(arg4);
299
+ q = (GLint)NUM2INT(arg5);
300
+ fptr_glMultiTexCoord4i(target,s,t,r,q);
301
+ return Qnil;
302
+ }
303
+
304
+ static void (APIENTRY * fptr_glMultiTexCoord4s)(GLenum,GLshort,GLshort,GLshort,GLshort);
305
+ static VALUE
306
+ gl_MultiTexCoord4s(obj,arg1,arg2,arg3,arg4,arg5)
307
+ VALUE obj,arg1,arg2,arg3,arg4,arg5;
308
+ {
309
+ GLenum target;
310
+ GLshort s;
311
+ GLshort t;
312
+ GLshort r;
313
+ GLshort q;
314
+ LOAD_GL_FUNC(glMultiTexCoord4s)
315
+ target = (GLenum)NUM2INT(arg1);
316
+ s = (GLshort)NUM2INT(arg2);
317
+ t = (GLshort)NUM2INT(arg3);
318
+ r = (GLshort)NUM2INT(arg4);
319
+ q = (GLshort)NUM2INT(arg5);
320
+ fptr_glMultiTexCoord4s(target,s,t,r,q);
321
+ return Qnil;
322
+ }
323
+
324
+ #define GLMULTITEXCOORD_VFUNC(_type_) \
325
+ static VALUE \
326
+ gl_MultiTexCoord##_type_##v(argc,argv,obj) \
327
+ int argc; \
328
+ VALUE *argv; \
329
+ VALUE obj; \
330
+ { \
331
+ int num; \
332
+ VALUE args[5]; \
333
+ RArray *ary; \
334
+ switch (num = rb_scan_args(argc, argv, "23", &args[0], &args[1], &args[2], &args[3],&args[4])) { \
335
+ case 2: \
336
+ if (TYPE(args[1]) == T_ARRAY) { \
337
+ ary = RARRAY(args[1]); \
338
+ switch (ary->len) { \
339
+ case 1: \
340
+ gl_MultiTexCoord1##_type_(obj,args[0],ary->ptr[0]); \
341
+ break; \
342
+ case 2: \
343
+ gl_MultiTexCoord2##_type_(obj,args[0],ary->ptr[0],ary->ptr[1]); \
344
+ break; \
345
+ case 3: \
346
+ gl_MultiTexCoord3##_type_(obj,args[0],ary->ptr[0],ary->ptr[1],ary->ptr[2]); \
347
+ break; \
348
+ case 4: \
349
+ gl_MultiTexCoord4##_type_(obj,args[0],ary->ptr[0],ary->ptr[1],ary->ptr[2],ary->ptr[3]); \
350
+ break; \
351
+ default: \
352
+ rb_raise(rb_eArgError, "array length:%d", num); \
353
+ } \
354
+ } \
355
+ else { \
356
+ gl_MultiTexCoord1##_type_(obj,args[0], args[1]); \
357
+ break; \
358
+ } \
359
+ break; \
360
+ case 3: \
361
+ gl_MultiTexCoord2##_type_(obj,args[0], args[1], args[2]); \
362
+ break; \
363
+ case 4: \
364
+ gl_MultiTexCoord3##_type_(obj,args[0], args[1], args[2], args[3]); \
365
+ break; \
366
+ case 5: \
367
+ gl_MultiTexCoord4##_type_(obj,args[0], args[1], args[2], args[3], args[4]); \
368
+ break; \
369
+ default: \
370
+ rb_raise(rb_eArgError, "too many arguments"); \
371
+ break; \
372
+ } \
373
+ return Qnil; \
374
+ }
375
+
376
+ GLMULTITEXCOORD_VFUNC(d)
377
+ GLMULTITEXCOORD_VFUNC(f)
378
+ GLMULTITEXCOORD_VFUNC(i)
379
+ GLMULTITEXCOORD_VFUNC(s)
380
+ #undef GLTEXCOORD_VFUNC
381
+
382
+
383
+ static void (APIENTRY * fptr_glLoadTransposeMatrixf)(const GLfloat[]);
384
+ static VALUE
385
+ gl_LoadTransposeMatrixf(obj,arg1)
386
+ VALUE obj,arg1;
387
+ {
388
+ GLfloat m[4*4];
389
+ LOAD_GL_FUNC(glLoadTransposeMatrixf)
390
+ ary2cmat4x4flt(arg1, m);
391
+ fptr_glLoadTransposeMatrixf(m);
392
+ return Qnil;
393
+ }
394
+
395
+ static void (APIENTRY * fptr_glLoadTransposeMatrixd)(const GLdouble[]);
396
+ static VALUE
397
+ gl_LoadTransposeMatrixd(obj,arg1)
398
+ VALUE obj,arg1;
399
+ {
400
+ GLdouble m[4*4];
401
+ LOAD_GL_FUNC(glLoadTransposeMatrixd)
402
+ ary2cmat4x4dbl(arg1, m);
403
+ fptr_glLoadTransposeMatrixd(m);
404
+ return Qnil;
405
+ }
406
+
407
+ static void (APIENTRY * fptr_glMultTransposeMatrixf)(const GLfloat[]);
408
+ static VALUE
409
+ gl_MultTransposeMatrixf(obj,arg1)
410
+ VALUE obj,arg1;
411
+ {
412
+ GLfloat m[4*4];
413
+ LOAD_GL_FUNC(glMultTransposeMatrixf)
414
+ ary2cmat4x4flt(arg1, m);
415
+ fptr_glMultTransposeMatrixf(m);
416
+ return Qnil;
417
+ }
418
+
419
+ static void (APIENTRY * fptr_glMultTransposeMatrixd)(const GLdouble[]);
420
+ static VALUE
421
+ gl_MultTransposeMatrixd(obj,arg1)
422
+ VALUE obj,arg1;
423
+ {
424
+ GLdouble m[4*4];
425
+ LOAD_GL_FUNC(glMultTransposeMatrixd)
426
+ ary2cmat4x4dbl(arg1, m);
427
+ fptr_glMultTransposeMatrixd(m);
428
+ return Qnil;
429
+ }
430
+
431
+ static void (APIENTRY * fptr_glSampleCoverage)(GLclampf,GLboolean);
432
+ static VALUE
433
+ gl_SampleCoverage(obj,arg1,arg2)
434
+ VALUE obj,arg1,arg2;
435
+ {
436
+ GLclampf value;
437
+ GLboolean invert;
438
+ LOAD_GL_FUNC(glSampleCoverage)
439
+ value = (GLclampf)NUM2DBL(arg1);
440
+ invert = (GLboolean)NUM2INT(arg2);
441
+ fptr_glSampleCoverage(value,invert);
442
+ return Qnil;
443
+ }
444
+
445
+ static void (APIENTRY * fptr_glCompressedTexImage3D)(GLenum,GLint,GLenum,GLsizei,GLsizei,GLsizei,GLint,GLsizei,GLvoid*);
446
+ static VALUE
447
+ gl_CompressedTexImage3D(obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9)
448
+ VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9;
449
+ {
450
+ GLenum target;
451
+ GLint level;
452
+ GLenum internalformat;
453
+ GLsizei width;
454
+ GLsizei height;
455
+ GLsizei depth;
456
+ GLint border;
457
+ GLsizei imagesize;
458
+ GLvoid *pixels;
459
+ LOAD_GL_FUNC(glCompressedTexImage3D)
460
+ target = (GLenum)NUM2INT(arg1);
461
+ level = (GLint)NUM2INT(arg2);
462
+ internalformat = (GLenum)NUM2INT(arg3);
463
+ width = (GLsizei)NUM2UINT(arg4);
464
+ height = (GLsizei)NUM2UINT(arg5);
465
+ depth = (GLsizei)NUM2UINT(arg6);
466
+ border = (GLint)NUM2INT(arg7);
467
+ imagesize = (GLsizei)NUM2UINT(arg8);
468
+ if (TYPE(arg9) == T_STRING) {
469
+ if (RSTRING(arg9)->len < imagesize)
470
+ rb_raise(rb_eArgError, "string length:%d",RSTRING(arg9)->len);
471
+ pixels = RSTRING(arg9)->ptr;
472
+ } else if (NIL_P(arg9)) {
473
+ pixels = NULL;
474
+ } else {
475
+ Check_Type(arg9,T_STRING); /* force exception */
476
+ return Qnil;
477
+ }
478
+ fptr_glCompressedTexImage3D(target,level,internalformat,width,height,depth,border,imagesize,pixels);
479
+ return Qnil;
480
+ }
481
+
482
+ static void (APIENTRY * fptr_glCompressedTexImage2D)(GLenum,GLint,GLenum,GLsizei,GLsizei,GLint,GLsizei,GLvoid*);
483
+ static VALUE
484
+ gl_CompressedTexImage2D(obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8)
485
+ VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8;
486
+ {
487
+ GLenum target;
488
+ GLint level;
489
+ GLenum internalformat;
490
+ GLsizei width;
491
+ GLsizei height;
492
+ GLint border;
493
+ GLsizei imagesize;
494
+ GLvoid *pixels;
495
+ LOAD_GL_FUNC(glCompressedTexImage2D)
496
+ target = (GLenum)NUM2INT(arg1);
497
+ level = (GLint)NUM2INT(arg2);
498
+ internalformat = (GLenum)NUM2INT(arg3);
499
+ width = (GLsizei)NUM2UINT(arg4);
500
+ height = (GLsizei)NUM2UINT(arg5);
501
+ border = (GLint)NUM2INT(arg6);
502
+ imagesize = (GLsizei)NUM2UINT(arg7);
503
+ if (TYPE(arg8) == T_STRING) {
504
+ if (RSTRING(arg8)->len < imagesize)
505
+ rb_raise(rb_eArgError, "string length:%d",RSTRING(arg8)->len);
506
+ pixels = RSTRING(arg8)->ptr;
507
+ } else if (NIL_P(arg8)) {
508
+ pixels = NULL;
509
+ } else {
510
+ Check_Type(arg8,T_STRING); /* force exception */
511
+ return Qnil;
512
+ }
513
+ fptr_glCompressedTexImage2D(target,level,internalformat,width,height,border,imagesize,pixels);
514
+ return Qnil;
515
+ }
516
+
517
+ static void (APIENTRY * fptr_glCompressedTexImage1D)(GLenum,GLint,GLenum,GLsizei,GLint,GLsizei,GLvoid*);
518
+ static VALUE
519
+ gl_CompressedTexImage1D(obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7)
520
+ VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7;
521
+ {
522
+ GLenum target;
523
+ GLint level;
524
+ GLenum internalformat;
525
+ GLsizei width;
526
+ GLint border;
527
+ GLsizei imagesize;
528
+ GLvoid *pixels;
529
+ LOAD_GL_FUNC(glCompressedTexImage1D)
530
+ target = (GLenum)NUM2INT(arg1);
531
+ level = (GLint)NUM2INT(arg2);
532
+ internalformat = (GLenum)NUM2INT(arg3);
533
+ width = (GLsizei)NUM2UINT(arg4);
534
+ border = (GLint)NUM2INT(arg5);
535
+ imagesize = (GLsizei)NUM2UINT(arg6);
536
+ if (TYPE(arg7) == T_STRING) {
537
+ if (RSTRING(arg7)->len < imagesize)
538
+ rb_raise(rb_eArgError, "string length:%d",RSTRING(arg7)->len);
539
+ pixels = RSTRING(arg7)->ptr;
540
+ } else if (NIL_P(arg7)) {
541
+ pixels = NULL;
542
+ } else {
543
+ Check_Type(arg7,T_STRING); /* force exception */
544
+ return Qnil;
545
+ }
546
+ fptr_glCompressedTexImage1D(target,level,internalformat,width,border,imagesize,pixels);
547
+ return Qnil;
548
+ }
549
+
550
+ static void (APIENTRY * fptr_glCompressedTexSubImage3D)(GLenum,GLint,GLint,GLint,GLint,GLsizei,GLsizei,GLsizei,GLenum,GLsizei,GLvoid*);
551
+ static VALUE
552
+ gl_CompressedTexSubImage3D(obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11)
553
+ VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11;
554
+ {
555
+ GLenum target;
556
+ GLint level;
557
+ GLint xoffset;
558
+ GLint yoffset;
559
+ GLint zoffset;
560
+ GLsizei width;
561
+ GLsizei height;
562
+ GLsizei depth;
563
+ GLenum format;
564
+ GLsizei imagesize;
565
+ GLvoid *pixels;
566
+ LOAD_GL_FUNC(glCompressedTexSubImage3D)
567
+ target = (GLenum)NUM2INT(arg1);
568
+ level = (GLint)NUM2INT(arg2);
569
+ xoffset = (GLint)NUM2INT(arg3);
570
+ yoffset = (GLint)NUM2INT(arg4);
571
+ zoffset = (GLint)NUM2INT(arg5);
572
+ width = (GLsizei)NUM2UINT(arg6);
573
+ height = (GLsizei)NUM2UINT(arg7);
574
+ depth = (GLsizei)NUM2UINT(arg8);
575
+ format = (GLenum)NUM2INT(arg9);
576
+ imagesize = (GLsizei)NUM2UINT(arg10);
577
+ if (TYPE(arg11) == T_STRING) {
578
+ if (RSTRING(arg11)->len < imagesize)
579
+ rb_raise(rb_eArgError, "string length:%d",RSTRING(arg11)->len);
580
+ pixels = RSTRING(arg11)->ptr;
581
+ } else {
582
+ Check_Type(arg11,T_STRING); /* force exception */
583
+ return Qnil;
584
+ }
585
+ fptr_glCompressedTexSubImage3D(target,level,xoffset,yoffset,zoffset,width,height,depth,format,imagesize,pixels);
586
+ return Qnil;
587
+ }
588
+
589
+ static void (APIENTRY * fptr_glCompressedTexSubImage2D)(GLenum,GLint,GLint,GLint,GLsizei,GLsizei,GLenum,GLsizei,GLvoid*);
590
+ static VALUE
591
+ gl_CompressedTexSubImage2D(obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9)
592
+ VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9;
593
+ {
594
+ GLenum target;
595
+ GLint level;
596
+ GLint xoffset;
597
+ GLint yoffset;
598
+ GLsizei width;
599
+ GLsizei height;
600
+ GLenum format;
601
+ GLsizei imagesize;
602
+ GLvoid *pixels;
603
+ LOAD_GL_FUNC(glCompressedTexSubImage2D)
604
+ target = (GLenum)NUM2INT(arg1);
605
+ level = (GLint)NUM2INT(arg2);
606
+ xoffset = (GLint)NUM2INT(arg3);
607
+ yoffset = (GLint)NUM2INT(arg4);
608
+ width = (GLsizei)NUM2UINT(arg5);
609
+ height = (GLsizei)NUM2UINT(arg6);
610
+ format = (GLenum)NUM2INT(arg7);
611
+ imagesize = (GLsizei)NUM2UINT(arg8);
612
+ if (TYPE(arg9) == T_STRING) {
613
+ if (RSTRING(arg9)->len < imagesize)
614
+ rb_raise(rb_eArgError, "string length:%d",RSTRING(arg9)->len);
615
+ pixels = RSTRING(arg9)->ptr;
616
+ } else {
617
+ Check_Type(arg9,T_STRING); /* force exception */
618
+ return Qnil;
619
+ }
620
+ fptr_glCompressedTexSubImage2D(target,level,xoffset,yoffset,width,height,format,imagesize,pixels);
621
+ return Qnil;
622
+ }
623
+
624
+ static void (APIENTRY * fptr_glCompressedTexSubImage1D)(GLenum,GLint,GLint,GLsizei,GLenum,GLsizei,GLvoid*);
625
+ static VALUE
626
+ gl_CompressedTexSubImage1D(obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7)
627
+ VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7;
628
+ {
629
+ GLenum target;
630
+ GLint level;
631
+ GLint xoffset;
632
+ GLsizei width;
633
+ GLenum format;
634
+ GLsizei imagesize;
635
+ GLvoid *pixels;
636
+ LOAD_GL_FUNC(glCompressedTexSubImage1D)
637
+ target = (GLenum)NUM2INT(arg1);
638
+ level = (GLint)NUM2INT(arg2);
639
+ xoffset = (GLint)NUM2INT(arg3);
640
+ width = (GLsizei)NUM2UINT(arg4);
641
+ format = (GLenum)NUM2INT(arg5);
642
+ imagesize = (GLsizei)NUM2UINT(arg6);
643
+ if (TYPE(arg7) == T_STRING) {
644
+ if (RSTRING(arg7)->len < imagesize)
645
+ rb_raise(rb_eArgError, "string length:%d",RSTRING(arg7)->len);
646
+ pixels = RSTRING(arg7)->ptr;
647
+ } else {
648
+ Check_Type(arg7,T_STRING); /* force exception */
649
+ return Qnil;
650
+ }
651
+ fptr_glCompressedTexSubImage1D(target,level,xoffset,width,format,imagesize,pixels);
652
+ return Qnil;
653
+ }
654
+
655
+ static void (APIENTRY * fptr_glGetCompressedTexImage)(GLenum,GLint,GLvoid*);
656
+ static VALUE
657
+ gl_GetCompressedTexImage(obj,arg1,arg2)
658
+ VALUE obj,arg1,arg2;
659
+ {
660
+ GLenum target;
661
+ GLint lod;
662
+ GLsizei size = 0;
663
+ VALUE data;
664
+ LOAD_GL_FUNC(glGetCompressedTexImage)
665
+ target = (GLenum)NUM2INT(arg1);
666
+ lod = (GLenum)NUM2INT(arg2);
667
+ glGetTexLevelParameteriv(target,lod,GL_TEXTURE_COMPRESSED_IMAGE_SIZE,&size); /* 1.0 function */
668
+ data = allocate_buffer_with_string(size);
669
+ fptr_glGetCompressedTexImage(target,lod,(GLvoid*)RSTRING(data)->ptr);
670
+ return data;
671
+ }
672
+
673
+ void gl_init_functions_1_3(VALUE module)
674
+ {
675
+ rb_define_module_function(module, "glActiveTexture", gl_ActiveTexture, 1);
676
+ rb_define_module_function(module, "glClientActiveTexture", gl_ClientActiveTexture, 1);
677
+ rb_define_module_function(module, "glMultiTexCoord1d", gl_MultiTexCoord1d, 2);
678
+ rb_define_module_function(module, "glMultiTexCoord1f", gl_MultiTexCoord1f, 2);
679
+ rb_define_module_function(module, "glMultiTexCoord1i", gl_MultiTexCoord1i, 2);
680
+ rb_define_module_function(module, "glMultiTexCoord1s", gl_MultiTexCoord1s, 2);
681
+ rb_define_module_function(module, "glMultiTexCoord2d", gl_MultiTexCoord2d, 3);
682
+ rb_define_module_function(module, "glMultiTexCoord2f", gl_MultiTexCoord2f, 3);
683
+ rb_define_module_function(module, "glMultiTexCoord2i", gl_MultiTexCoord2i, 3);
684
+ rb_define_module_function(module, "glMultiTexCoord2s", gl_MultiTexCoord2s, 3);
685
+ rb_define_module_function(module, "glMultiTexCoord3d", gl_MultiTexCoord3d, 4);
686
+ rb_define_module_function(module, "glMultiTexCoord3f", gl_MultiTexCoord3f, 4);
687
+ rb_define_module_function(module, "glMultiTexCoord3i", gl_MultiTexCoord3i, 4);
688
+ rb_define_module_function(module, "glMultiTexCoord3s", gl_MultiTexCoord3s, 4);
689
+ rb_define_module_function(module, "glMultiTexCoord4d", gl_MultiTexCoord4d, 5);
690
+ rb_define_module_function(module, "glMultiTexCoord4f", gl_MultiTexCoord4f, 5);
691
+ rb_define_module_function(module, "glMultiTexCoord4i", gl_MultiTexCoord4i, 5);
692
+ rb_define_module_function(module, "glMultiTexCoord4s", gl_MultiTexCoord4s, 5);
693
+ rb_define_module_function(module, "glLoadTransposeMatrixf", gl_LoadTransposeMatrixf, 1);
694
+ rb_define_module_function(module, "glLoadTransposeMatrixd", gl_LoadTransposeMatrixd, 1);
695
+ rb_define_module_function(module, "glMultTransposeMatrixf", gl_MultTransposeMatrixf, 1);
696
+ rb_define_module_function(module, "glMultTransposeMatrixd", gl_MultTransposeMatrixd, 1);
697
+ rb_define_module_function(module, "glSampleCoverage", gl_SampleCoverage, 2);
698
+ rb_define_module_function(module, "glCompressedTexImage3D", gl_CompressedTexImage3D, 9);
699
+ rb_define_module_function(module, "glCompressedTexImage2D", gl_CompressedTexImage2D, 8);
700
+ rb_define_module_function(module, "glCompressedTexImage1D", gl_CompressedTexImage1D, 7);
701
+ rb_define_module_function(module, "glCompressedTexSubImage3D", gl_CompressedTexSubImage3D, 11);
702
+ rb_define_module_function(module, "glCompressedTexSubImage2D", gl_CompressedTexSubImage2D, 9);
703
+ rb_define_module_function(module, "glCompressedTexSubImage1D", gl_CompressedTexSubImage1D, 7);
704
+ rb_define_module_function(module, "glGetCompressedTexImage", gl_GetCompressedTexImage, 2);
705
+
706
+ /* Additional functions */
707
+
708
+ rb_define_module_function(module, "glMultiTexCoord", gl_MultiTexCoorddv, -1);
709
+ rb_define_module_function(module, "glMultiTexCoord1dv", gl_MultiTexCoorddv, -1);
710
+ rb_define_module_function(module, "glMultiTexCoord1fv", gl_MultiTexCoordfv, -1);
711
+ rb_define_module_function(module, "glMultiTexCoord1iv", gl_MultiTexCoordiv, -1);
712
+ rb_define_module_function(module, "glMultiTexCoord1sv", gl_MultiTexCoordsv, -1);
713
+ rb_define_module_function(module, "glMultiTexCoord2dv", gl_MultiTexCoorddv, -1);
714
+ rb_define_module_function(module, "glMultiTexCoord2fv", gl_MultiTexCoordfv, -1);
715
+ rb_define_module_function(module, "glMultiTexCoord2iv", gl_MultiTexCoordiv, -1);
716
+ rb_define_module_function(module, "glMultiTexCoord2sv", gl_MultiTexCoordsv, -1);
717
+ rb_define_module_function(module, "glMultiTexCoord3dv", gl_MultiTexCoorddv, -1);
718
+ rb_define_module_function(module, "glMultiTexCoord3fv", gl_MultiTexCoordfv, -1);
719
+ rb_define_module_function(module, "glMultiTexCoord3iv", gl_MultiTexCoordiv, -1);
720
+ rb_define_module_function(module, "glMultiTexCoord3sv", gl_MultiTexCoordsv, -1);
721
+ rb_define_module_function(module, "glMultiTexCoord4dv", gl_MultiTexCoorddv, -1);
722
+ rb_define_module_function(module, "glMultiTexCoord4fv", gl_MultiTexCoordfv, -1);
723
+ rb_define_module_function(module, "glMultiTexCoord4iv", gl_MultiTexCoordiv, -1);
724
+ rb_define_module_function(module, "glMultiTexCoord4sv", gl_MultiTexCoordsv, -1);
725
+ }