opengl 0.7.0.pre1-x86-mingw32 → 0.7.0.pre2-x86-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- data/.autotest +29 -0
- data/.gitignore +5 -8
- data/History.rdoc +33 -0
- data/Manifest.txt +72 -57
- data/README.rdoc +72 -25
- data/Rakefile +60 -72
- data/Rakefile.cross +5 -2
- data/{doc → docs}/build_install.txt +0 -0
- data/{doc → docs}/extensions.txt.in +0 -0
- data/{doc → docs}/history.txt +0 -0
- data/{doc → docs}/requirements_and_design.txt +0 -0
- data/{doc → docs}/roadmap.txt +0 -0
- data/{doc → docs}/scientific_use.txt +0 -0
- data/{doc → docs}/supplies/page_template.html +0 -0
- data/{doc → docs}/thanks.txt +0 -0
- data/{doc → docs}/tutorial.txt +0 -0
- data/examples/NeHe/NeHe.png +0 -0
- data/examples/NeHe/crate.png +0 -0
- data/examples/NeHe/glass.png +0 -0
- data/examples/NeHe/nehe_lesson02.rb +82 -83
- data/examples/NeHe/nehe_lesson03.rb +88 -88
- data/examples/NeHe/nehe_lesson04.rb +93 -96
- data/examples/NeHe/nehe_lesson05.rb +137 -144
- data/examples/NeHe/nehe_lesson06.rb +183 -0
- data/examples/NeHe/nehe_lesson07.rb +237 -0
- data/examples/NeHe/nehe_lesson08.rb +252 -0
- data/examples/NeHe/nehe_lesson09.rb +199 -0
- data/examples/NeHe/nehe_lesson11.rb +173 -0
- data/examples/NeHe/nehe_lesson12.rb +200 -0
- data/examples/NeHe/nehe_lesson16.rb +208 -0
- data/examples/NeHe/nehe_lesson19.rb +206 -0
- data/examples/NeHe/particle.png +0 -0
- data/examples/NeHe/star.png +0 -0
- data/examples/NeHe/tim.png +0 -0
- data/examples/RedBook/light.rb +154 -0
- data/examples/misc/OGLBench.rb +2 -2
- data/examples/misc/trislam.rb +2 -2
- data/ext/{common → opengl}/common.h +2 -11
- data/ext/{common → opengl}/conv.h +43 -31
- data/ext/{glut → opengl}/extconf.rb +14 -7
- data/ext/{common → opengl}/funcdef.h +155 -125
- data/ext/{gl → opengl}/gl-1.0-1.1.c +426 -162
- data/ext/{gl → opengl}/gl-1.2.c +70 -66
- data/ext/{gl → opengl}/gl-1.3.c +19 -19
- data/ext/{gl → opengl}/gl-1.4.c +23 -23
- data/ext/{gl → opengl}/gl-1.5.c +46 -47
- data/ext/{gl → opengl}/gl-2.0.c +66 -60
- data/ext/{gl → opengl}/gl-2.1.c +4 -4
- data/ext/{gl → opengl}/gl-enums.c +2 -1
- data/ext/{common → opengl}/gl-enums.h +0 -0
- data/ext/{gl → opengl}/gl-error.c +12 -4
- data/ext/{common → opengl}/gl-error.h +7 -2
- data/ext/{gl → opengl}/gl-ext-3dfx.c +1 -1
- data/ext/{gl → opengl}/gl-ext-arb.c +75 -70
- data/ext/{gl → opengl}/gl-ext-ati.c +3 -3
- data/ext/{gl → opengl}/gl-ext-ext.c +54 -54
- data/ext/{gl → opengl}/gl-ext-gremedy.c +3 -3
- data/ext/{gl → opengl}/gl-ext-nv.c +49 -48
- data/ext/{common → opengl}/gl-types.h +0 -0
- data/ext/{gl → opengl}/gl.c +8 -10
- data/ext/{glu → opengl}/glu-enums.c +1 -1
- data/ext/{common → opengl}/glu-enums.h +0 -0
- data/ext/{glu → opengl}/glu.c +7 -3
- data/ext/{glut → opengl}/glut.c +98 -48
- data/ext/opengl/opengl.c +11 -0
- data/lib/gl.rb +1 -0
- data/lib/glu.rb +1 -0
- data/lib/glut.rb +1 -0
- data/lib/opengl.rb +13 -14
- data/lib/opengl/opengl.so +0 -0
- data/lib/opengl/test_case.rb +87 -0
- data/test/{tc_misc.rb → test_gl.rb} +2 -14
- data/test/test_gl_10_11.rb +1363 -0
- data/test/test_gl_12.rb +182 -0
- data/test/{tc_func_13.rb → test_gl_13.rb} +14 -14
- data/test/test_gl_14.rb +221 -0
- data/test/test_gl_15.rb +260 -0
- data/test/test_gl_20.rb +430 -0
- data/test/test_gl_21.rb +553 -0
- data/test/test_gl_ext_arb.rb +526 -0
- data/test/{tc_ext_ati.rb → test_gl_ext_ati.rb} +11 -14
- data/test/test_gl_ext_ext.rb +608 -0
- data/test/{tc_ext_gremedy.rb → test_gl_ext_gremedy.rb} +6 -6
- data/test/test_gl_ext_nv.rb +352 -0
- data/test/test_glu.rb +309 -0
- metadata +159 -102
- data/History.txt +0 -36
- data/ext/gl/extconf.rb +0 -43
- data/ext/glu/extconf.rb +0 -51
- data/test/README +0 -10
- data/test/tc_common.rb +0 -98
- data/test/tc_ext_arb.rb +0 -467
- data/test/tc_ext_ext.rb +0 -551
- data/test/tc_ext_nv.rb +0 -357
- data/test/tc_func_10_11.rb +0 -1281
- data/test/tc_func_12.rb +0 -186
- data/test/tc_func_14.rb +0 -197
- data/test/tc_func_15.rb +0 -270
- data/test/tc_func_20.rb +0 -346
- data/test/tc_func_21.rb +0 -541
- data/test/tc_glu.rb +0 -310
- data/test/tc_include_gl.rb +0 -35
- data/test/tc_require_gl.rb +0 -34
@@ -15,7 +15,7 @@
|
|
15
15
|
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
16
16
|
*/
|
17
17
|
|
18
|
-
#include "
|
18
|
+
#include "common.h"
|
19
19
|
|
20
20
|
#ifndef MAX
|
21
21
|
#define MAX(a, b) (((a) > (b)) ? (a) : (b))
|
@@ -63,14 +63,9 @@ GL_FUNC_STATIC_2(DeleteLists,GLvoid, GLuint,GLuint)
|
|
63
63
|
GL_FUNC_STATIC_1(DepthFunc,GLvoid, GLenum)
|
64
64
|
GL_FUNC_STATIC_1(DepthMask,GLvoid, GLboolean)
|
65
65
|
GL_FUNC_STATIC_2(DepthRange,GLvoid, GLclampd,GLclampd)
|
66
|
-
GL_FUNC_STATIC_1(Disable,GLvoid, GLenum)
|
67
|
-
GL_FUNC_STATIC_1(DisableClientState,GLvoid, GLenum)
|
68
66
|
GL_FUNC_STATIC_3(DrawArrays,GLvoid, GLenum,GLint,GLsizei)
|
69
67
|
GL_FUNC_STATIC_1(DrawBuffer,GLvoid, GLenum)
|
70
68
|
GL_FUNC_STATIC_1(EdgeFlag,GLvoid, GLboolean)
|
71
|
-
GL_FUNC_STATIC_1(Enable,GLvoid, GLenum)
|
72
|
-
GL_FUNC_STATIC_1(EnableClientState,GLvoid, GLenum)
|
73
|
-
GL_FUNC_STATIC_0(EndList,GLvoid)
|
74
69
|
GL_FUNC_STATIC_1(EvalCoord1d,GLvoid, GLdouble)
|
75
70
|
GL_FUNC_STATIC_1(EvalCoord1f,GLvoid, GLfloat)
|
76
71
|
GL_FUNC_STATIC_2(EvalCoord2d,GLvoid, GLdouble,GLdouble)
|
@@ -115,7 +110,6 @@ GL_FUNC_STATIC_6(MapGrid2f,GLvoid, GLint,GLfloat,GLfloat,GLint,GLfloat,GLfloat)
|
|
115
110
|
GL_FUNC_STATIC_3(Materialf,GLvoid, GLenum,GLenum,GLfloat)
|
116
111
|
GL_FUNC_STATIC_3(Materiali,GLvoid, GLenum,GLenum,GLint)
|
117
112
|
GL_FUNC_STATIC_1(MatrixMode,GLvoid, GLenum)
|
118
|
-
GL_FUNC_STATIC_2(NewList,GLvoid, GLuint,GLenum)
|
119
113
|
GL_FUNC_STATIC_3(Normal3b,GLvoid, GLbyte,GLbyte,GLbyte)
|
120
114
|
GL_FUNC_STATIC_3(Normal3d,GLvoid, GLdouble,GLdouble,GLdouble)
|
121
115
|
GL_FUNC_STATIC_3(Normal3f,GLvoid, GLfloat,GLfloat,GLfloat)
|
@@ -133,11 +127,9 @@ GL_FUNC_STATIC_2(PolygonMode,GLvoid, GLenum,GLenum)
|
|
133
127
|
GL_FUNC_STATIC_2(PolygonOffset,GLvoid, GLfloat,GLfloat)
|
134
128
|
GL_FUNC_STATIC_0(PopAttrib,GLvoid)
|
135
129
|
GL_FUNC_STATIC_0(PopClientAttrib,GLvoid)
|
136
|
-
GL_FUNC_STATIC_0(PopMatrix,GLvoid)
|
137
130
|
GL_FUNC_STATIC_0(PopName,GLvoid)
|
138
131
|
GL_FUNC_STATIC_1(PushAttrib,GLvoid, GLbitfield)
|
139
132
|
GL_FUNC_STATIC_1(PushClientAttrib,GLvoid, GLbitfield)
|
140
|
-
GL_FUNC_STATIC_0(PushMatrix,GLvoid)
|
141
133
|
GL_FUNC_STATIC_1(PushName,GLvoid, GLuint)
|
142
134
|
GL_FUNC_STATIC_2(RasterPos2d,GLvoid, GLdouble,GLdouble)
|
143
135
|
GL_FUNC_STATIC_2(RasterPos2f,GLvoid, GLfloat,GLfloat)
|
@@ -208,21 +200,300 @@ GL_FUNC_STATIC_4(Viewport,GLvoid, GLuint,GLuint,GLuint,GLuint)
|
|
208
200
|
VALUE inside_begin_end = Qfalse;
|
209
201
|
|
210
202
|
static VALUE
|
211
|
-
|
212
|
-
VALUE obj,arg1;
|
203
|
+
gl_Enable1(VALUE caps)
|
213
204
|
{
|
214
|
-
|
215
|
-
|
216
|
-
|
205
|
+
long i;
|
206
|
+
|
207
|
+
for (i = 0; i < RARRAY_LEN(caps); i++) {
|
208
|
+
glEnable(CONV_GLenum(rb_ary_entry(caps, i)));
|
209
|
+
|
210
|
+
CHECK_GLERROR_FROM("glEnable");
|
211
|
+
}
|
212
|
+
|
213
|
+
return Qnil;
|
217
214
|
}
|
218
215
|
|
219
216
|
static VALUE
|
220
|
-
|
221
|
-
|
217
|
+
gl_Enable0(VALUE caps)
|
218
|
+
{
|
219
|
+
gl_Enable1(caps);
|
220
|
+
|
221
|
+
if (rb_block_given_p())
|
222
|
+
rb_yield(Qundef);
|
223
|
+
|
224
|
+
return Qnil;
|
225
|
+
}
|
226
|
+
|
227
|
+
static VALUE
|
228
|
+
gl_Disable1(VALUE caps)
|
229
|
+
{
|
230
|
+
long i;
|
231
|
+
for (i = 0; i < RARRAY_LEN(caps); i++) {
|
232
|
+
glDisable(CONV_GLenum(rb_ary_entry(caps, i)));
|
233
|
+
|
234
|
+
CHECK_GLERROR_FROM("glDisable");
|
235
|
+
}
|
236
|
+
|
237
|
+
return Qnil;
|
238
|
+
}
|
239
|
+
|
240
|
+
static VALUE
|
241
|
+
gl_Disable0(VALUE caps)
|
242
|
+
{
|
243
|
+
gl_Disable1(caps);
|
244
|
+
|
245
|
+
if (rb_block_given_p())
|
246
|
+
rb_yield(Qundef);
|
247
|
+
|
248
|
+
return Qnil;
|
249
|
+
}
|
250
|
+
|
251
|
+
static VALUE
|
252
|
+
gl_Enable(int argc, VALUE *argv, VALUE self)
|
253
|
+
{
|
254
|
+
int i;
|
255
|
+
VALUE caps, rev;
|
256
|
+
|
257
|
+
rb_scan_args(argc, argv, "1*", NULL, NULL);
|
258
|
+
|
259
|
+
caps = rb_ary_new2(argc);
|
260
|
+
|
261
|
+
for (i = 0; i < argc; i++)
|
262
|
+
rb_ary_push(caps, argv[i]);
|
263
|
+
|
264
|
+
rev = rb_ary_reverse(caps);
|
265
|
+
|
266
|
+
if (rb_block_given_p())
|
267
|
+
return rb_ensure(gl_Enable0, caps, gl_Disable1, rev);
|
268
|
+
else
|
269
|
+
gl_Enable0(caps);
|
270
|
+
|
271
|
+
return Qnil;
|
272
|
+
}
|
273
|
+
|
274
|
+
static VALUE
|
275
|
+
gl_Disable(int argc, VALUE *argv, VALUE self)
|
276
|
+
{
|
277
|
+
int i;
|
278
|
+
VALUE caps, rev;
|
279
|
+
|
280
|
+
rb_scan_args(argc, argv, "1*", NULL, NULL);
|
281
|
+
|
282
|
+
caps = rb_ary_new2(argc);
|
283
|
+
|
284
|
+
for (i = 0; i < argc; i++)
|
285
|
+
rb_ary_push(caps, argv[i]);
|
286
|
+
|
287
|
+
rev = rb_ary_reverse(caps);
|
288
|
+
|
289
|
+
if (rb_block_given_p())
|
290
|
+
return rb_ensure(gl_Disable0, caps, gl_Enable1, rev);
|
291
|
+
else
|
292
|
+
gl_Disable0(caps);
|
293
|
+
|
294
|
+
return Qnil;
|
295
|
+
}
|
296
|
+
|
297
|
+
static VALUE
|
298
|
+
gl_EnableClientState1(VALUE ary)
|
299
|
+
{
|
300
|
+
long i;
|
301
|
+
for (i = 0; i < RARRAY_LEN(ary); i++) {
|
302
|
+
glEnableClientState(CONV_GLenum(rb_ary_entry(ary, i)));
|
303
|
+
|
304
|
+
CHECK_GLERROR_FROM("glEnableClientState");
|
305
|
+
}
|
306
|
+
|
307
|
+
return Qnil;
|
308
|
+
}
|
309
|
+
|
310
|
+
static VALUE
|
311
|
+
gl_EnableClientState0(VALUE ary)
|
312
|
+
{
|
313
|
+
gl_EnableClientState1(ary);
|
314
|
+
|
315
|
+
if (rb_block_given_p())
|
316
|
+
rb_yield(Qundef);
|
317
|
+
|
318
|
+
return Qnil;
|
319
|
+
}
|
320
|
+
|
321
|
+
static VALUE
|
322
|
+
gl_DisableClientState1(VALUE ary)
|
323
|
+
{
|
324
|
+
long i;
|
325
|
+
for (i = 0; i < RARRAY_LEN(ary); i++) {
|
326
|
+
glDisableClientState(CONV_GLenum(rb_ary_entry(ary, i)));
|
327
|
+
|
328
|
+
CHECK_GLERROR_FROM("glDisableClientState");
|
329
|
+
}
|
330
|
+
|
331
|
+
return Qnil;
|
332
|
+
}
|
333
|
+
|
334
|
+
static VALUE
|
335
|
+
gl_DisableClientState0(VALUE ary)
|
336
|
+
{
|
337
|
+
gl_DisableClientState1(ary);
|
338
|
+
|
339
|
+
if (rb_block_given_p())
|
340
|
+
rb_yield(Qundef);
|
341
|
+
|
342
|
+
return Qnil;
|
343
|
+
}
|
344
|
+
|
345
|
+
static VALUE
|
346
|
+
gl_EnableClientState(int argc, VALUE *argv, VALUE self)
|
347
|
+
{
|
348
|
+
int i;
|
349
|
+
VALUE ary, rev;
|
350
|
+
|
351
|
+
rb_scan_args(argc, argv, "1*", NULL, NULL);
|
352
|
+
|
353
|
+
ary = rb_ary_new2(argc);
|
354
|
+
|
355
|
+
for (i = 0; i < argc; i++)
|
356
|
+
rb_ary_push(ary, argv[i]);
|
357
|
+
|
358
|
+
rev = rb_ary_reverse(ary);
|
359
|
+
|
360
|
+
if (rb_block_given_p())
|
361
|
+
return rb_ensure(gl_EnableClientState0, ary, gl_DisableClientState1, rev);
|
362
|
+
else
|
363
|
+
gl_EnableClientState0(ary);
|
364
|
+
|
365
|
+
return Qnil;
|
366
|
+
}
|
367
|
+
|
368
|
+
static VALUE
|
369
|
+
gl_DisableClientState(int argc, VALUE *argv, VALUE self)
|
370
|
+
{
|
371
|
+
int i;
|
372
|
+
VALUE ary, rev;
|
373
|
+
|
374
|
+
rb_scan_args(argc, argv, "1*", NULL, NULL);
|
375
|
+
|
376
|
+
ary = rb_ary_new2(argc);
|
377
|
+
|
378
|
+
for (i = 0; i < argc; i++)
|
379
|
+
rb_ary_push(ary, argv[i]);
|
380
|
+
|
381
|
+
rev = rb_ary_reverse(ary);
|
382
|
+
|
383
|
+
if (rb_block_given_p())
|
384
|
+
return rb_ensure(gl_DisableClientState0, ary, gl_EnableClientState1, rev);
|
385
|
+
else
|
386
|
+
gl_DisableClientState0(ary);
|
387
|
+
|
388
|
+
return Qnil;
|
389
|
+
}
|
390
|
+
|
391
|
+
static VALUE
|
392
|
+
gl_Begin0(GLenum mode)
|
393
|
+
{
|
394
|
+
glBegin(mode);
|
395
|
+
|
396
|
+
if (rb_block_given_p())
|
397
|
+
rb_yield(Qundef);
|
398
|
+
|
399
|
+
return Qnil;
|
400
|
+
}
|
401
|
+
|
402
|
+
static VALUE
|
403
|
+
gl_End(VALUE self)
|
222
404
|
{
|
223
405
|
inside_begin_end = Qfalse;
|
406
|
+
|
224
407
|
glEnd();
|
225
|
-
|
408
|
+
|
409
|
+
CHECK_GLERROR_FROM("glEnd");
|
410
|
+
|
411
|
+
return Qnil;
|
412
|
+
}
|
413
|
+
|
414
|
+
static VALUE
|
415
|
+
gl_Begin(VALUE self, VALUE mode)
|
416
|
+
{
|
417
|
+
GLenum begin_mode = CONV_GLenum(mode);
|
418
|
+
inside_begin_end = Qtrue;
|
419
|
+
|
420
|
+
if (rb_block_given_p())
|
421
|
+
return rb_ensure(gl_Begin0, (VALUE)begin_mode, gl_End, self);
|
422
|
+
else
|
423
|
+
gl_Begin0(begin_mode);
|
424
|
+
|
425
|
+
return Qnil;
|
426
|
+
}
|
427
|
+
|
428
|
+
static VALUE
|
429
|
+
gl_PopMatrix(VALUE self)
|
430
|
+
{
|
431
|
+
glPopMatrix();
|
432
|
+
|
433
|
+
CHECK_GLERROR_FROM("glPopMatrix");
|
434
|
+
|
435
|
+
return Qnil;
|
436
|
+
}
|
437
|
+
|
438
|
+
static VALUE
|
439
|
+
gl_PushMatrix0(void)
|
440
|
+
{
|
441
|
+
glPushMatrix();
|
442
|
+
|
443
|
+
if (rb_block_given_p())
|
444
|
+
rb_yield(Qnil);
|
445
|
+
|
446
|
+
return Qnil;
|
447
|
+
}
|
448
|
+
|
449
|
+
static VALUE
|
450
|
+
gl_PushMatrix(VALUE self)
|
451
|
+
{
|
452
|
+
if (rb_block_given_p())
|
453
|
+
return rb_ensure(gl_PushMatrix0, (VALUE)NULL, gl_PopMatrix, self);
|
454
|
+
else
|
455
|
+
glPushMatrix();
|
456
|
+
|
457
|
+
return Qnil;
|
458
|
+
}
|
459
|
+
|
460
|
+
static VALUE
|
461
|
+
gl_NewList0(VALUE args)
|
462
|
+
{
|
463
|
+
GLuint list;
|
464
|
+
GLenum mode;
|
465
|
+
|
466
|
+
list = (GLuint)NUM2UINT(rb_ary_entry(args, 0));
|
467
|
+
mode = RUBY2GLENUM(rb_ary_entry(args, 1));
|
468
|
+
|
469
|
+
glNewList(list, mode);
|
470
|
+
|
471
|
+
if (rb_block_given_p())
|
472
|
+
rb_yield(Qundef);
|
473
|
+
|
474
|
+
return Qnil;
|
475
|
+
}
|
476
|
+
|
477
|
+
static VALUE
|
478
|
+
gl_EndList(VALUE self)
|
479
|
+
{
|
480
|
+
glEndList();
|
481
|
+
|
482
|
+
return Qnil;
|
483
|
+
}
|
484
|
+
|
485
|
+
static VALUE
|
486
|
+
gl_NewList(VALUE self, VALUE list, VALUE mode)
|
487
|
+
{
|
488
|
+
VALUE args = rb_ary_new2(2);
|
489
|
+
rb_ary_push(args, list);
|
490
|
+
rb_ary_push(args, mode);
|
491
|
+
|
492
|
+
if (rb_block_given_p())
|
493
|
+
return rb_ensure(gl_NewList0, args, gl_EndList, self);
|
494
|
+
else
|
495
|
+
gl_NewList0(args);
|
496
|
+
|
226
497
|
return Qnil;
|
227
498
|
}
|
228
499
|
|
@@ -237,7 +508,7 @@ VALUE obj,arg1,arg2;
|
|
237
508
|
lists = pack_array_or_pass_string(type,arg2);
|
238
509
|
n = (GLsizei)RSTRING_LENINT(lists) / gltype_glformat_unit_size(type,1);
|
239
510
|
glCallLists(n, type, RSTRING_PTR(lists));
|
240
|
-
|
511
|
+
CHECK_GLERROR_FROM("glCallLists");
|
241
512
|
return Qnil;
|
242
513
|
}
|
243
514
|
|
@@ -268,7 +539,7 @@ VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7;
|
|
268
539
|
|
269
540
|
glBitmap(width, height, xorig, yorig, xmove, ymove, (const GLubyte *)RSTRING_PTR(data));
|
270
541
|
}
|
271
|
-
|
542
|
+
CHECK_GLERROR_FROM("glBitmap");
|
272
543
|
return Qnil;
|
273
544
|
}
|
274
545
|
|
@@ -280,7 +551,7 @@ VALUE obj,arg1;
|
|
280
551
|
Check_Type(arg1,T_ARRAY);
|
281
552
|
ary2cboolean(arg1,flag,1);
|
282
553
|
glEdgeFlagv(flag);
|
283
|
-
|
554
|
+
CHECK_GLERROR_FROM("glEdgeFlagv");
|
284
555
|
return Qnil;
|
285
556
|
}
|
286
557
|
|
@@ -292,7 +563,7 @@ VALUE obj,arg1;
|
|
292
563
|
Check_Type(arg1,T_ARRAY);
|
293
564
|
ary2cdbl(arg1,c,1);
|
294
565
|
glIndexdv(c);
|
295
|
-
|
566
|
+
CHECK_GLERROR_FROM("glIndexdv");
|
296
567
|
return Qnil;
|
297
568
|
}
|
298
569
|
|
@@ -304,7 +575,7 @@ VALUE obj,arg1;
|
|
304
575
|
Check_Type(arg1,T_ARRAY);
|
305
576
|
ary2cflt(arg1,c,1);
|
306
577
|
glIndexfv(c);
|
307
|
-
|
578
|
+
CHECK_GLERROR_FROM("glIndexfv");
|
308
579
|
return Qnil;
|
309
580
|
}
|
310
581
|
|
@@ -316,7 +587,7 @@ VALUE obj,arg1;
|
|
316
587
|
Check_Type(arg1,T_ARRAY);
|
317
588
|
ary2cint(arg1,c,1);
|
318
589
|
glIndexiv(c);
|
319
|
-
|
590
|
+
CHECK_GLERROR_FROM("glIndexiv");
|
320
591
|
return Qnil;
|
321
592
|
}
|
322
593
|
|
@@ -328,7 +599,7 @@ VALUE obj,arg1;
|
|
328
599
|
Check_Type(arg1,T_ARRAY);
|
329
600
|
ary2cshort(arg1,c,1);
|
330
601
|
glIndexsv(c);
|
331
|
-
|
602
|
+
CHECK_GLERROR_FROM("glIndexsv");
|
332
603
|
return Qnil;
|
333
604
|
}
|
334
605
|
|
@@ -342,7 +613,7 @@ VALUE obj,arg1,arg2;
|
|
342
613
|
Check_Type(arg2,T_ARRAY);
|
343
614
|
ary2cdbl(arg2, equation, 4);
|
344
615
|
glClipPlane(plane,equation);
|
345
|
-
|
616
|
+
CHECK_GLERROR_FROM("glClipPlane");
|
346
617
|
return Qnil;
|
347
618
|
}
|
348
619
|
|
@@ -356,7 +627,7 @@ VALUE obj,arg1,arg2;
|
|
356
627
|
Check_Type(arg2,T_ARRAY);
|
357
628
|
ary2cflt(arg2,params,4);
|
358
629
|
glFogfv(pname,params);
|
359
|
-
|
630
|
+
CHECK_GLERROR_FROM("glFogfv");
|
360
631
|
return Qnil;
|
361
632
|
}
|
362
633
|
|
@@ -370,7 +641,7 @@ VALUE obj,arg1,arg2;
|
|
370
641
|
Check_Type(arg2,T_ARRAY);
|
371
642
|
ary2cint(arg2,params,4);
|
372
643
|
glFogiv(pname,params);
|
373
|
-
|
644
|
+
CHECK_GLERROR_FROM("glFogiv");
|
374
645
|
return Qnil;
|
375
646
|
}
|
376
647
|
|
@@ -386,7 +657,7 @@ VALUE obj,arg1,arg2,arg3;
|
|
386
657
|
Check_Type(arg3,T_ARRAY);
|
387
658
|
ary2cflt(arg3,params,4);
|
388
659
|
glLightfv(light,pname,params);
|
389
|
-
|
660
|
+
CHECK_GLERROR_FROM("glLightfv");
|
390
661
|
return Qnil;
|
391
662
|
}
|
392
663
|
|
@@ -402,7 +673,7 @@ VALUE obj,arg1,arg2,arg3;
|
|
402
673
|
Check_Type(arg3,T_ARRAY);
|
403
674
|
ary2cint(arg3,params,4);
|
404
675
|
glLightiv(light,pname,params);
|
405
|
-
|
676
|
+
CHECK_GLERROR_FROM("glLightiv");
|
406
677
|
return Qnil;
|
407
678
|
}
|
408
679
|
|
@@ -416,7 +687,7 @@ VALUE obj,arg1,arg2;
|
|
416
687
|
Check_Type(arg2,T_ARRAY);
|
417
688
|
ary2cflt(arg2,params,4);
|
418
689
|
glLightModelfv(pname,params);
|
419
|
-
|
690
|
+
CHECK_GLERROR_FROM("glLightModelfv");
|
420
691
|
return Qnil;
|
421
692
|
}
|
422
693
|
|
@@ -430,7 +701,7 @@ VALUE obj,arg1,arg2;
|
|
430
701
|
Check_Type(arg2,T_ARRAY);
|
431
702
|
ary2cint(arg2,params,4);
|
432
703
|
glLightModeliv(pname,params);
|
433
|
-
|
704
|
+
CHECK_GLERROR_FROM("glLightModeliv");
|
434
705
|
return Qnil;
|
435
706
|
}
|
436
707
|
|
@@ -447,7 +718,7 @@ VALUE obj,arg1,arg2,arg3;
|
|
447
718
|
Check_Type(arg3,T_ARRAY);
|
448
719
|
ary2cflt(arg3,params,4);
|
449
720
|
glMaterialfv(face,pname,params);
|
450
|
-
|
721
|
+
CHECK_GLERROR_FROM("glMaterialfv");
|
451
722
|
return Qnil;
|
452
723
|
}
|
453
724
|
|
@@ -463,7 +734,7 @@ VALUE obj,arg1,arg2,arg3;
|
|
463
734
|
Check_Type(arg3,T_ARRAY);
|
464
735
|
ary2cint(arg3,params,4);
|
465
736
|
glMaterialiv(face,pname,params);
|
466
|
-
|
737
|
+
CHECK_GLERROR_FROM("glMaterialiv");
|
467
738
|
return Qnil;
|
468
739
|
}
|
469
740
|
|
@@ -481,7 +752,7 @@ VALUE obj,arg1;
|
|
481
752
|
|
482
753
|
glPolygonStipple((GLubyte *)RSTRING_PTR(data));
|
483
754
|
}
|
484
|
-
|
755
|
+
CHECK_GLERROR_FROM("glPolygonStipple");
|
485
756
|
return Qnil;
|
486
757
|
}
|
487
758
|
|
@@ -498,7 +769,7 @@ VALUE obj,arg1,arg2,arg3;
|
|
498
769
|
Check_Type(arg3,T_ARRAY);
|
499
770
|
ary2cflt(arg3,params,4);
|
500
771
|
glTexParameterfv(target,pname,params);
|
501
|
-
|
772
|
+
CHECK_GLERROR_FROM("glTexParameterfv");
|
502
773
|
return Qnil;
|
503
774
|
}
|
504
775
|
|
@@ -514,7 +785,7 @@ VALUE obj,arg1,arg2,arg3;
|
|
514
785
|
Check_Type(arg3,T_ARRAY);
|
515
786
|
ary2cint(arg3,params,4);
|
516
787
|
glTexParameteriv(target,pname,params);
|
517
|
-
|
788
|
+
CHECK_GLERROR_FROM("glTexParameteriv");
|
518
789
|
return Qnil;
|
519
790
|
}
|
520
791
|
|
@@ -540,7 +811,7 @@ VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8;
|
|
540
811
|
|
541
812
|
if (CheckBufferBinding(GL_PIXEL_UNPACK_BUFFER_BINDING)) {
|
542
813
|
glTexImage1D(target,level,components,width,border,format,type,(GLvoid *)NUM2LONG(arg8));
|
543
|
-
|
814
|
+
CHECK_GLERROR_FROM("glTexImage1D");
|
544
815
|
return Qnil;
|
545
816
|
}
|
546
817
|
|
@@ -553,7 +824,7 @@ VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8;
|
|
553
824
|
pixels = RSTRING_PTR(data);
|
554
825
|
}
|
555
826
|
glTexImage1D(target,level,components,width,border,format,type,pixels);
|
556
|
-
|
827
|
+
CHECK_GLERROR_FROM("glTexImage1D");
|
557
828
|
return Qnil;
|
558
829
|
}
|
559
830
|
|
@@ -581,7 +852,7 @@ VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9;
|
|
581
852
|
|
582
853
|
if (CheckBufferBinding(GL_PIXEL_UNPACK_BUFFER_BINDING)) {
|
583
854
|
glTexImage2D(target,level,components,width,height,border,format,type,(GLvoid *)NUM2LONG(arg9));
|
584
|
-
|
855
|
+
CHECK_GLERROR_FROM("glTexImage2D");
|
585
856
|
return Qnil;
|
586
857
|
}
|
587
858
|
|
@@ -594,7 +865,7 @@ VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9;
|
|
594
865
|
pixels = RSTRING_PTR(data);
|
595
866
|
}
|
596
867
|
glTexImage2D(target,level,components,width,height,border,format,type,pixels);
|
597
|
-
|
868
|
+
CHECK_GLERROR_FROM("glTexImage2D");
|
598
869
|
return Qnil;
|
599
870
|
}
|
600
871
|
|
@@ -610,7 +881,7 @@ VALUE obj,arg1,arg2,arg3;
|
|
610
881
|
Check_Type(arg3,T_ARRAY);
|
611
882
|
ary2cflt(arg3,params,4);
|
612
883
|
glTexEnvfv(target,pname,params);
|
613
|
-
|
884
|
+
CHECK_GLERROR_FROM("glTexEnvfv");
|
614
885
|
return Qnil;
|
615
886
|
}
|
616
887
|
|
@@ -626,7 +897,7 @@ VALUE obj,arg1,arg2,arg3;
|
|
626
897
|
Check_Type(arg3,T_ARRAY);
|
627
898
|
ary2cint(arg3,params,4);
|
628
899
|
glTexEnviv(target,pname,params);
|
629
|
-
|
900
|
+
CHECK_GLERROR_FROM("glTexEnviv");
|
630
901
|
return Qnil;
|
631
902
|
}
|
632
903
|
|
@@ -643,7 +914,7 @@ VALUE obj,arg1,arg2,arg3;
|
|
643
914
|
Check_Type(arg3,T_ARRAY);
|
644
915
|
ary2cdbl(arg3,params,4);
|
645
916
|
glTexGendv(coord,pname,params);
|
646
|
-
|
917
|
+
CHECK_GLERROR_FROM("glTexGendv");
|
647
918
|
return Qnil;
|
648
919
|
}
|
649
920
|
|
@@ -660,7 +931,7 @@ VALUE obj,arg1,arg2,arg3;
|
|
660
931
|
Check_Type(arg3,T_ARRAY);
|
661
932
|
ary2cflt(arg3,params,4);
|
662
933
|
glTexGenfv(coord,pname,params);
|
663
|
-
|
934
|
+
CHECK_GLERROR_FROM("glTexGenfv");
|
664
935
|
return Qnil;
|
665
936
|
}
|
666
937
|
|
@@ -677,7 +948,7 @@ VALUE obj,arg1,arg2,arg3;
|
|
677
948
|
Check_Type(arg3,T_ARRAY);
|
678
949
|
ary2cint(arg3,params,4);
|
679
950
|
glTexGeniv(coord,pname,params);
|
680
|
-
|
951
|
+
CHECK_GLERROR_FROM("glTexGeniv");
|
681
952
|
return Qnil;
|
682
953
|
}
|
683
954
|
static VALUE g_current_feed_buffer;
|
@@ -692,7 +963,7 @@ VALUE obj,arg1,arg2;
|
|
692
963
|
g_current_feed_buffer = allocate_buffer_with_string(sizeof(GLfloat)*size);
|
693
964
|
rb_str_freeze(g_current_feed_buffer);
|
694
965
|
glFeedbackBuffer(size, type, (GLfloat*)RSTRING_PTR(g_current_feed_buffer));
|
695
|
-
|
966
|
+
CHECK_GLERROR_FROM("glFeedbackBuffer");
|
696
967
|
return g_current_feed_buffer;
|
697
968
|
}
|
698
969
|
|
@@ -706,7 +977,7 @@ VALUE obj,arg1;
|
|
706
977
|
g_current_sel_buffer = allocate_buffer_with_string(sizeof(GLuint)*size);
|
707
978
|
rb_str_freeze(g_current_sel_buffer);
|
708
979
|
glSelectBuffer(size, (GLuint*)RSTRING_PTR(g_current_sel_buffer));
|
709
|
-
|
980
|
+
CHECK_GLERROR_FROM("glSelectBuffer");
|
710
981
|
return g_current_sel_buffer;
|
711
982
|
}
|
712
983
|
|
@@ -734,7 +1005,7 @@ VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6;
|
|
734
1005
|
ary2cdbl(work_ary, points, order*stride);
|
735
1006
|
glMap1d(target, u1, u2, stride, order, points);
|
736
1007
|
xfree(points);
|
737
|
-
|
1008
|
+
CHECK_GLERROR_FROM("glMap1d");
|
738
1009
|
return Qnil;
|
739
1010
|
}
|
740
1011
|
|
@@ -761,7 +1032,7 @@ VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6;
|
|
761
1032
|
ary2cflt(work_ary, points, order*stride);
|
762
1033
|
glMap1f(target, u1, u2, stride, order, points);
|
763
1034
|
xfree(points);
|
764
|
-
|
1035
|
+
CHECK_GLERROR_FROM("glMap1f");
|
765
1036
|
return Qnil;
|
766
1037
|
}
|
767
1038
|
|
@@ -796,7 +1067,7 @@ VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10;
|
|
796
1067
|
ary2cdbl(work_ary, points, MAX(ustride*uorder, vstride*vorder));
|
797
1068
|
glMap2d(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points);
|
798
1069
|
xfree(points);
|
799
|
-
|
1070
|
+
CHECK_GLERROR_FROM("glMap2d");
|
800
1071
|
return Qnil;
|
801
1072
|
}
|
802
1073
|
|
@@ -831,7 +1102,7 @@ VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10;
|
|
831
1102
|
ary2cflt(work_ary, points, MAX(ustride*uorder, vstride*vorder));
|
832
1103
|
glMap2f(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points);
|
833
1104
|
xfree(points);
|
834
|
-
|
1105
|
+
CHECK_GLERROR_FROM("glMap2f");
|
835
1106
|
return Qnil;
|
836
1107
|
}
|
837
1108
|
|
@@ -843,7 +1114,7 @@ VALUE obj,arg1;
|
|
843
1114
|
Check_Type(arg1,T_ARRAY);
|
844
1115
|
ary2cdbl(arg1,params,1);
|
845
1116
|
glEvalCoord1dv(params);
|
846
|
-
|
1117
|
+
CHECK_GLERROR_FROM("glEvalCoord1dv");
|
847
1118
|
return Qnil;
|
848
1119
|
}
|
849
1120
|
|
@@ -855,7 +1126,7 @@ VALUE obj,arg1;
|
|
855
1126
|
Check_Type(arg1,T_ARRAY);
|
856
1127
|
ary2cflt(arg1,params,1);
|
857
1128
|
glEvalCoord1fv(params);
|
858
|
-
|
1129
|
+
CHECK_GLERROR_FROM("glEvalCoord1fv");
|
859
1130
|
return Qnil;
|
860
1131
|
}
|
861
1132
|
|
@@ -867,7 +1138,7 @@ VALUE obj,arg1;
|
|
867
1138
|
Check_Type(arg1,T_ARRAY);
|
868
1139
|
ary2cdbl(arg1,params,2);
|
869
1140
|
glEvalCoord2dv(params);
|
870
|
-
|
1141
|
+
CHECK_GLERROR_FROM("glEvalCoord2fv");
|
871
1142
|
return Qnil;
|
872
1143
|
}
|
873
1144
|
|
@@ -879,7 +1150,7 @@ VALUE obj,arg1;
|
|
879
1150
|
Check_Type(arg1,T_ARRAY);
|
880
1151
|
ary2cflt(arg1,params,2);
|
881
1152
|
glEvalCoord2fv(params);
|
882
|
-
|
1153
|
+
CHECK_GLERROR_FROM("glEvalCoord2fv");
|
883
1154
|
return Qnil;
|
884
1155
|
}
|
885
1156
|
|
@@ -916,7 +1187,7 @@ VALUE obj; \
|
|
916
1187
|
glPixelMap##_type_##v(map,size,(GLvoid *)NUM2LONG(args[2])); \
|
917
1188
|
break; \
|
918
1189
|
} \
|
919
|
-
|
1190
|
+
CHECK_GLERROR_FROM("glPixelMap" #_type_ "v"); \
|
920
1191
|
return Qnil; \
|
921
1192
|
}
|
922
1193
|
|
@@ -958,7 +1229,7 @@ VALUE obj;
|
|
958
1229
|
FORCE_PIXEL_STORE_MODE
|
959
1230
|
glReadPixels(x,y,width,height,format,type,(GLvoid*)RSTRING_PTR(pixels));
|
960
1231
|
RESTORE_PIXEL_STORE_MODE
|
961
|
-
|
1232
|
+
CHECK_GLERROR_FROM("glReadPixels");
|
962
1233
|
return pixels;
|
963
1234
|
break;
|
964
1235
|
case 7:
|
@@ -967,7 +1238,7 @@ VALUE obj;
|
|
967
1238
|
FORCE_PIXEL_STORE_MODE
|
968
1239
|
glReadPixels(x,y,width,height,format,type,(GLvoid*)NUM2LONG(args[6]));
|
969
1240
|
RESTORE_PIXEL_STORE_MODE
|
970
|
-
|
1241
|
+
CHECK_GLERROR_FROM("glReadPixels");
|
971
1242
|
return Qnil;
|
972
1243
|
break;
|
973
1244
|
}
|
@@ -995,7 +1266,7 @@ VALUE obj,arg1,arg2,arg3,arg4,arg5;
|
|
995
1266
|
pixels = RSTRING_PTR(data);
|
996
1267
|
glDrawPixels(width,height,format,type,pixels);
|
997
1268
|
}
|
998
|
-
|
1269
|
+
CHECK_GLERROR_FROM("glDrawPixels");
|
999
1270
|
return Qnil;
|
1000
1271
|
}
|
1001
1272
|
|
@@ -1012,7 +1283,7 @@ VALUE obj,arg1;
|
|
1012
1283
|
retary = rb_ary_new2(4);
|
1013
1284
|
for(i=0;i<4;i++)
|
1014
1285
|
rb_ary_push(retary, rb_float_new(equation[i]));
|
1015
|
-
|
1286
|
+
CHECK_GLERROR_FROM("glGetClipPlane");
|
1016
1287
|
return retary;
|
1017
1288
|
}
|
1018
1289
|
|
@@ -1135,28 +1406,28 @@ VALUE obj,arg1; \
|
|
1135
1406
|
for (j = 0; j < 4; j++) \
|
1136
1407
|
rb_ary_push(ary2, _conv_(items[i*4+j])); \
|
1137
1408
|
} \
|
1138
|
-
|
1409
|
+
CHECK_GLERROR_FROM("glGet" #_name_ "v"); \
|
1139
1410
|
return ary; \
|
1140
1411
|
case GL_POLYGON_STIPPLE: \
|
1141
1412
|
glGet##_name_##v(pname, items); \
|
1142
|
-
|
1413
|
+
CHECK_GLERROR_FROM("glGet" #_name_ "v"); \
|
1143
1414
|
return rb_str_new((const char*)items, 32); \
|
1144
1415
|
case GL_COMPRESSED_TEXTURE_FORMATS: \
|
1145
1416
|
glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &nitems); \
|
1146
|
-
|
1417
|
+
CHECK_GLERROR_FROM("glGetIntegerv"); \
|
1147
1418
|
if (nitems<=0||nitems>64) \
|
1148
1419
|
return INT2NUM(0); \
|
1149
1420
|
break; \
|
1150
1421
|
default: /* size=1 */ \
|
1151
1422
|
glGet##_name_##v(pname, items); \
|
1152
|
-
|
1423
|
+
CHECK_GLERROR_FROM("glGet" #_name_ "v"); \
|
1153
1424
|
return _conv_(items[0]); \
|
1154
1425
|
} \
|
1155
1426
|
glGet##_name_##v(pname, items); \
|
1156
1427
|
ary = rb_ary_new2(nitems); \
|
1157
1428
|
for (i = 0; i < nitems; i++) \
|
1158
1429
|
rb_ary_push(ary, _conv_(items[i])); \
|
1159
|
-
|
1430
|
+
CHECK_GLERROR_FROM("glGet" #_name_ "v"); \
|
1160
1431
|
return ary; \
|
1161
1432
|
}
|
1162
1433
|
|
@@ -1200,7 +1471,7 @@ VALUE obj,arg1,arg2;
|
|
1200
1471
|
break; /* not reached */
|
1201
1472
|
}
|
1202
1473
|
glGetLightfv(light,pname,params);
|
1203
|
-
RET_ARRAY_OR_SINGLE(size,rb_float_new,params)
|
1474
|
+
RET_ARRAY_OR_SINGLE("glGetLightfv", size, rb_float_new, params);
|
1204
1475
|
}
|
1205
1476
|
|
1206
1477
|
static VALUE
|
@@ -1235,7 +1506,7 @@ VALUE obj,arg1,arg2;
|
|
1235
1506
|
break; /* not reached */
|
1236
1507
|
}
|
1237
1508
|
glGetLightiv(light,pname,params);
|
1238
|
-
RET_ARRAY_OR_SINGLE(size,INT2NUM,params)
|
1509
|
+
RET_ARRAY_OR_SINGLE("glGetLightiv", size, INT2NUM, params);
|
1239
1510
|
}
|
1240
1511
|
|
1241
1512
|
#define GETMAP_FUNC(_name_,_type_) \
|
@@ -1280,7 +1551,7 @@ VALUE obj,arg1,arg2; \
|
|
1280
1551
|
case GL_DOMAIN: size = dims*2; break; \
|
1281
1552
|
case GL_COEFF: \
|
1282
1553
|
glGetMapiv(target,GL_ORDER,order); \
|
1283
|
-
|
1554
|
+
CHECK_GLERROR_FROM("glGetMapiv"); \
|
1284
1555
|
if (dims==1) \
|
1285
1556
|
size = order[0] * pointsize; \
|
1286
1557
|
else \
|
@@ -1293,7 +1564,7 @@ VALUE obj,arg1,arg2; \
|
|
1293
1564
|
points = ALLOC_N(_type_,size); \
|
1294
1565
|
gl##_name_(target,query,points); \
|
1295
1566
|
\
|
1296
|
-
RET_ARRAY_OR_SINGLE_FREE(size,RETCONV_##_type_,points) \
|
1567
|
+
RET_ARRAY_OR_SINGLE_FREE("gl" #_name_, size, RETCONV_##_type_, points); \
|
1297
1568
|
}
|
1298
1569
|
|
1299
1570
|
GETMAP_FUNC(GetMapdv,GLdouble)
|
@@ -1329,7 +1600,7 @@ VALUE obj,arg1,arg2;
|
|
1329
1600
|
break; /* not reached */
|
1330
1601
|
}
|
1331
1602
|
glGetMaterialfv(face,pname,params);
|
1332
|
-
RET_ARRAY_OR_SINGLE(size,rb_float_new,params)
|
1603
|
+
RET_ARRAY_OR_SINGLE("glGetMaterialfv", size, rb_float_new, params);
|
1333
1604
|
}
|
1334
1605
|
|
1335
1606
|
static VALUE
|
@@ -1360,7 +1631,7 @@ VALUE obj,arg1,arg2;
|
|
1360
1631
|
break; /* not reached */
|
1361
1632
|
}
|
1362
1633
|
glGetMaterialiv(face,pname,params);
|
1363
|
-
RET_ARRAY_OR_SINGLE(size,INT2NUM,params)
|
1634
|
+
RET_ARRAY_OR_SINGLE("glGetMaterialiv", size, INT2NUM, params);
|
1364
1635
|
}
|
1365
1636
|
|
1366
1637
|
#define GLGETPIXELMAP_FUNC(_type_,_vartype_,_convert_) \
|
@@ -1379,7 +1650,8 @@ VALUE obj; \
|
|
1379
1650
|
default: \
|
1380
1651
|
case 1: \
|
1381
1652
|
if (CheckBufferBinding(GL_PIXEL_PACK_BUFFER_BINDING)) \
|
1382
|
-
rb_raise(rb_eArgError,
|
1653
|
+
rb_raise(rb_eArgError, \
|
1654
|
+
"Pixel pack buffer bound, but offset argument missing"); \
|
1383
1655
|
\
|
1384
1656
|
map = (GLenum)NUM2INT(args[0]); \
|
1385
1657
|
switch(map) { \
|
@@ -1398,10 +1670,11 @@ VALUE obj; \
|
|
1398
1670
|
break; \
|
1399
1671
|
} \
|
1400
1672
|
glGetIntegerv(map_size,&size); \
|
1401
|
-
|
1673
|
+
CHECK_GLERROR_FROM("glGetIntegerv"); \
|
1402
1674
|
values = ALLOC_N(_vartype_,size); \
|
1403
1675
|
glGetPixelMap##_type_##v(map,values); \
|
1404
|
-
|
1676
|
+
RET_ARRAY_OR_SINGLE_FREE("glGetPixelMap" #_type_ "v", size, _convert_, \
|
1677
|
+
values); \
|
1405
1678
|
break; \
|
1406
1679
|
case 2: \
|
1407
1680
|
if (!CheckBufferBinding(GL_PIXEL_PACK_BUFFER_BINDING)) \
|
@@ -1409,7 +1682,7 @@ VALUE obj; \
|
|
1409
1682
|
\
|
1410
1683
|
map = (GLenum)NUM2INT(args[0]); \
|
1411
1684
|
glGetPixelMap##_type_##v(map,(GLvoid*)NUM2LONG(args[1])); \
|
1412
|
-
|
1685
|
+
CHECK_GLERROR_FROM("glGetPixelMap" #_type_ "v"); \
|
1413
1686
|
return Qnil; \
|
1414
1687
|
} \
|
1415
1688
|
}
|
@@ -1436,13 +1709,13 @@ VALUE obj;
|
|
1436
1709
|
FORCE_PIXEL_STORE_MODE
|
1437
1710
|
glGetPolygonStipple(mask);
|
1438
1711
|
RESTORE_PIXEL_STORE_MODE
|
1439
|
-
|
1712
|
+
CHECK_GLERROR_FROM("glGetPolygonStipple");
|
1440
1713
|
return rb_str_new((const char*)mask, 128);
|
1441
1714
|
case 1:
|
1442
1715
|
if (!CheckBufferBinding(GL_PIXEL_PACK_BUFFER_BINDING))
|
1443
1716
|
rb_raise(rb_eArgError, "Pixel pack buffer not bound");
|
1444
1717
|
glGetPolygonStipple((GLvoid *)NUM2LONG(args[0]));
|
1445
|
-
|
1718
|
+
CHECK_GLERROR_FROM("glGetPolygonStipple");
|
1446
1719
|
return Qnil;
|
1447
1720
|
}
|
1448
1721
|
}
|
@@ -1455,7 +1728,7 @@ VALUE obj,arg1;
|
|
1455
1728
|
const GLubyte *ret;
|
1456
1729
|
name = (GLenum)NUM2INT(arg1);
|
1457
1730
|
ret = glGetString(name);
|
1458
|
-
|
1731
|
+
CHECK_GLERROR_FROM("glGetString");
|
1459
1732
|
return rb_str_new2((const char*)ret);
|
1460
1733
|
}
|
1461
1734
|
|
@@ -1485,7 +1758,7 @@ VALUE obj,arg1,arg2; \
|
|
1485
1758
|
break; \
|
1486
1759
|
} \
|
1487
1760
|
gl##_name_(target,pname,params); \
|
1488
|
-
RET_ARRAY_OR_SINGLE(size,RETCONV_##_type_,params) \
|
1761
|
+
RET_ARRAY_OR_SINGLE("gl" #_name_, size, RETCONV_##_type_, params); \
|
1489
1762
|
}
|
1490
1763
|
|
1491
1764
|
GETTEXENVFUNC(GetTexEnvfv,GLfloat)
|
@@ -1513,7 +1786,7 @@ VALUE obj,arg1,arg2; \
|
|
1513
1786
|
break; \
|
1514
1787
|
} \
|
1515
1788
|
gl##_name_(coord,pname,params); \
|
1516
|
-
RET_ARRAY_OR_SINGLE(size,RETCONV_##_type_,params) \
|
1789
|
+
RET_ARRAY_OR_SINGLE("gl" #_name_, size, RETCONV_##_type_, params); \
|
1517
1790
|
}
|
1518
1791
|
|
1519
1792
|
GETTEXGENFUNC(GetTexGendv,GLdouble)
|
@@ -1581,13 +1854,13 @@ VALUE obj;
|
|
1581
1854
|
default:
|
1582
1855
|
rb_raise(rb_eArgError, "Target type not supported");
|
1583
1856
|
}
|
1584
|
-
|
1857
|
+
CHECK_GLERROR_FROM("glGetTexLevelParameteriv");
|
1585
1858
|
pixels = allocate_buffer_with_string(GetDataSize(type,format,size));
|
1586
1859
|
|
1587
1860
|
FORCE_PIXEL_STORE_MODE
|
1588
1861
|
glGetTexImage(tex,lod,format,type,(GLvoid*)RSTRING_PTR(pixels));
|
1589
1862
|
RESTORE_PIXEL_STORE_MODE
|
1590
|
-
|
1863
|
+
CHECK_GLERROR_FROM("glGetTexImage");
|
1591
1864
|
return pixels;
|
1592
1865
|
break;
|
1593
1866
|
case 5:
|
@@ -1597,7 +1870,7 @@ VALUE obj;
|
|
1597
1870
|
FORCE_PIXEL_STORE_MODE
|
1598
1871
|
glGetTexImage(tex,lod,format,type,(GLvoid*)NUM2LONG(args[4]));
|
1599
1872
|
RESTORE_PIXEL_STORE_MODE
|
1600
|
-
|
1873
|
+
CHECK_GLERROR_FROM("glGetTexImage");
|
1601
1874
|
return Qnil;
|
1602
1875
|
}
|
1603
1876
|
}
|
@@ -1624,7 +1897,7 @@ VALUE obj,arg1,arg2;
|
|
1624
1897
|
break;
|
1625
1898
|
}
|
1626
1899
|
glGetTexParameterfv(target,pname,params);
|
1627
|
-
RET_ARRAY_OR_SINGLE(size,RETCONV_GLfloat,params)
|
1900
|
+
RET_ARRAY_OR_SINGLE("glGetTexParameterfv", size, RETCONV_GLfloat, params);
|
1628
1901
|
}
|
1629
1902
|
|
1630
1903
|
static VALUE
|
@@ -1649,7 +1922,8 @@ VALUE obj,arg1,arg2;
|
|
1649
1922
|
break;
|
1650
1923
|
}
|
1651
1924
|
glGetTexParameteriv(target,pname,params);
|
1652
|
-
|
1925
|
+
RET_ARRAY_OR_SINGLE_BOOL("glGetTexParameteriv", size, cond_GLBOOL2RUBY,
|
1926
|
+
pname, params);
|
1653
1927
|
}
|
1654
1928
|
|
1655
1929
|
static VALUE
|
@@ -1664,7 +1938,7 @@ VALUE obj,arg1,arg2,arg3;
|
|
1664
1938
|
level = (GLint)NUM2INT(arg2);
|
1665
1939
|
pname = (GLenum)NUM2INT(arg3);
|
1666
1940
|
glGetTexLevelParameterfv(target,level,pname,¶ms);
|
1667
|
-
|
1941
|
+
CHECK_GLERROR_FROM("glGetTexLevelParameterfv");
|
1668
1942
|
return RETCONV_GLfloat(params);
|
1669
1943
|
}
|
1670
1944
|
|
@@ -1680,7 +1954,7 @@ VALUE obj,arg1,arg2,arg3;
|
|
1680
1954
|
level = (GLint)NUM2INT(arg2);
|
1681
1955
|
pname = (GLenum)NUM2INT(arg3);
|
1682
1956
|
glGetTexLevelParameteriv(target,level,pname,¶ms);
|
1683
|
-
|
1957
|
+
CHECK_GLERROR_FROM("glGetTexLevelParameteriv");
|
1684
1958
|
return cond_GLBOOL2RUBY(pname,params);
|
1685
1959
|
}
|
1686
1960
|
|
@@ -1692,7 +1966,7 @@ VALUE obj,arg1;
|
|
1692
1966
|
GLfloat m[4*4];
|
1693
1967
|
ary2cmatfloat(arg1, m, 4, 4);
|
1694
1968
|
glLoadMatrixf(m);
|
1695
|
-
|
1969
|
+
CHECK_GLERROR_FROM("glLoadMatrixf");
|
1696
1970
|
return Qnil;
|
1697
1971
|
}
|
1698
1972
|
|
@@ -1703,7 +1977,7 @@ VALUE obj,arg1;
|
|
1703
1977
|
GLdouble m[4*4];
|
1704
1978
|
ary2cmatdouble(arg1, m, 4, 4);
|
1705
1979
|
glLoadMatrixd(m);
|
1706
|
-
|
1980
|
+
CHECK_GLERROR_FROM("glLoadMatrixd");
|
1707
1981
|
return Qnil;
|
1708
1982
|
}
|
1709
1983
|
|
@@ -1714,7 +1988,7 @@ VALUE obj,arg1;
|
|
1714
1988
|
GLfloat m[4*4];
|
1715
1989
|
ary2cmatfloat(arg1, m, 4, 4);
|
1716
1990
|
glMultMatrixf(m);
|
1717
|
-
|
1991
|
+
CHECK_GLERROR_FROM("glMultMatrixf");
|
1718
1992
|
return Qnil;
|
1719
1993
|
}
|
1720
1994
|
|
@@ -1725,7 +1999,7 @@ VALUE obj,arg1;
|
|
1725
1999
|
GLdouble m[4*4];
|
1726
2000
|
ary2cmatdouble(arg1, m, 4, 4);
|
1727
2001
|
glMultMatrixd(m);
|
1728
|
-
|
2002
|
+
CHECK_GLERROR_FROM("glMultMatrixd");
|
1729
2003
|
return Qnil;
|
1730
2004
|
}
|
1731
2005
|
|
@@ -1759,7 +2033,7 @@ VALUE obj, arg1, arg2, arg3, arg4; \
|
|
1759
2033
|
g_##_func_##_ptr = data; \
|
1760
2034
|
gl##_func_##Pointer(size, type, stride, (const GLvoid*)RSTRING_PTR(data)); \
|
1761
2035
|
} \
|
1762
|
-
|
2036
|
+
CHECK_GLERROR_FROM("gl" #_func_ "Pointer"); \
|
1763
2037
|
return Qnil; \
|
1764
2038
|
}
|
1765
2039
|
|
@@ -1786,7 +2060,7 @@ VALUE obj,arg1,arg2,arg3,arg4;
|
|
1786
2060
|
data = pack_array_or_pass_string(type,arg4);
|
1787
2061
|
glDrawElements(mode, count, type, (const GLvoid*)RSTRING_PTR(data));
|
1788
2062
|
}
|
1789
|
-
|
2063
|
+
CHECK_GLERROR_FROM("glDrawElements");
|
1790
2064
|
return Qnil;
|
1791
2065
|
}
|
1792
2066
|
|
@@ -1806,7 +2080,7 @@ VALUE obj,arg1,arg2;
|
|
1806
2080
|
g_EdgeFlag_ptr = data;
|
1807
2081
|
glEdgeFlagPointer(stride, (const GLvoid*)RSTRING_PTR(data));
|
1808
2082
|
}
|
1809
|
-
|
2083
|
+
CHECK_GLERROR_FROM("glEdgeFlagPointer");
|
1810
2084
|
return Qnil;
|
1811
2085
|
}
|
1812
2086
|
|
@@ -1861,7 +2135,7 @@ VALUE obj,arg1,arg2,arg3;
|
|
1861
2135
|
g_Index_ptr = data;
|
1862
2136
|
glIndexPointer(type, stride, (const GLvoid*)RSTRING_PTR(data));
|
1863
2137
|
}
|
1864
|
-
|
2138
|
+
CHECK_GLERROR_FROM("glIndexPointer");
|
1865
2139
|
return Qnil;
|
1866
2140
|
}
|
1867
2141
|
|
@@ -1878,7 +2152,7 @@ VALUE obj,arg1,arg2,arg3;
|
|
1878
2152
|
data = pack_array_or_pass_string(GL_FLOAT,arg3);
|
1879
2153
|
rb_str_freeze(data);
|
1880
2154
|
glInterleavedArrays(format, stride, (const GLvoid*)RSTRING_PTR(data));
|
1881
|
-
|
2155
|
+
CHECK_GLERROR_FROM("glInterleavedArrays");
|
1882
2156
|
return Qnil;
|
1883
2157
|
}
|
1884
2158
|
|
@@ -1900,7 +2174,7 @@ VALUE obj,arg1,arg2,arg3;
|
|
1900
2174
|
g_Normal_ptr = data;
|
1901
2175
|
glNormalPointer(type, stride, (const GLvoid*)RSTRING_PTR(data));
|
1902
2176
|
}
|
1903
|
-
|
2177
|
+
CHECK_GLERROR_FROM("glNormalPointer");
|
1904
2178
|
return Qnil;
|
1905
2179
|
}
|
1906
2180
|
|
@@ -1925,7 +2199,7 @@ VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7;
|
|
1925
2199
|
|
1926
2200
|
if (CheckBufferBinding(GL_PIXEL_UNPACK_BUFFER_BINDING)) {
|
1927
2201
|
glTexSubImage1D(target,level,xoffset,width,format,type,(GLvoid *)NUM2LONG(arg7));
|
1928
|
-
|
2202
|
+
CHECK_GLERROR_FROM("glTexSubImage1D");
|
1929
2203
|
return Qnil;
|
1930
2204
|
}
|
1931
2205
|
|
@@ -1933,7 +2207,7 @@ VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7;
|
|
1933
2207
|
CheckDataSize(type,format,width,data);
|
1934
2208
|
|
1935
2209
|
glTexSubImage1D(target,level,xoffset,width,format,type,RSTRING_PTR(data));
|
1936
|
-
|
2210
|
+
CHECK_GLERROR_FROM("glTexSubImage1D");
|
1937
2211
|
return Qnil;
|
1938
2212
|
}
|
1939
2213
|
|
@@ -1961,7 +2235,7 @@ VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9;
|
|
1961
2235
|
|
1962
2236
|
if (CheckBufferBinding(GL_PIXEL_UNPACK_BUFFER_BINDING)) {
|
1963
2237
|
glTexSubImage2D(target,level,xoffset,yoffset,width,height,format,type,(GLvoid *)NUM2LONG(arg9));
|
1964
|
-
|
2238
|
+
CHECK_GLERROR_FROM("glTexSubImage2D");
|
1965
2239
|
return Qnil;
|
1966
2240
|
}
|
1967
2241
|
|
@@ -1969,7 +2243,7 @@ VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9;
|
|
1969
2243
|
CheckDataSize(type,format,width*height,data);
|
1970
2244
|
|
1971
2245
|
glTexSubImage2D(target,level,xoffset,yoffset,width,height,format,type,RSTRING_PTR(data));
|
1972
|
-
|
2246
|
+
CHECK_GLERROR_FROM("glTexSubImage2D");
|
1973
2247
|
return Qnil;
|
1974
2248
|
}
|
1975
2249
|
|
@@ -2000,7 +2274,7 @@ VALUE obj,arg1;
|
|
2000
2274
|
}
|
2001
2275
|
xfree(textures);
|
2002
2276
|
xfree(residences);
|
2003
|
-
|
2277
|
+
CHECK_GLERROR_FROM("glAreTexturesResident");
|
2004
2278
|
return retary;
|
2005
2279
|
}
|
2006
2280
|
|
@@ -2025,7 +2299,7 @@ VALUE obj,arg1,arg2;
|
|
2025
2299
|
glPrioritizeTextures(size,textures,priorities);
|
2026
2300
|
xfree(textures);
|
2027
2301
|
xfree(priorities);
|
2028
|
-
|
2302
|
+
CHECK_GLERROR_FROM("glPrioritizeTextures");
|
2029
2303
|
return Qnil;
|
2030
2304
|
}
|
2031
2305
|
|
@@ -2037,7 +2311,7 @@ VALUE obj,arg1;
|
|
2037
2311
|
Check_Type(arg1,T_ARRAY);
|
2038
2312
|
ary2cubyte(arg1,c,1);
|
2039
2313
|
glIndexubv(c);
|
2040
|
-
|
2314
|
+
CHECK_GLERROR_FROM("glIndexubv");
|
2041
2315
|
return Qnil;
|
2042
2316
|
}
|
2043
2317
|
|
@@ -2052,11 +2326,11 @@ VALUE *argv; \
|
|
2052
2326
|
VALUE obj; \
|
2053
2327
|
{ \
|
2054
2328
|
int num; \
|
2055
|
-
VALUE
|
2329
|
+
VALUE args[4]; \
|
2330
|
+
VALUE ary; \
|
2056
2331
|
switch (num = rb_scan_args(argc, argv, "13", &args[0], &args[1], &args[2], &args[3])) { \
|
2057
2332
|
case 1: \
|
2058
|
-
|
2059
|
-
ary = args[0]; \
|
2333
|
+
ary = rb_convert_type(args[0], T_ARRAY, "Array", "to_a"); \
|
2060
2334
|
switch (RARRAY_LEN(ary)) { \
|
2061
2335
|
case 3: \
|
2062
2336
|
gl_Color3##_type_(obj,RARRAY_PTR(ary)[0],RARRAY_PTR(ary)[1],RARRAY_PTR(ary)[2]); \
|
@@ -2067,9 +2341,6 @@ VALUE obj; \
|
|
2067
2341
|
default: \
|
2068
2342
|
rb_raise(rb_eArgError, "array length:%li", RARRAY_LEN(ary)); \
|
2069
2343
|
} \
|
2070
|
-
} \
|
2071
|
-
else \
|
2072
|
-
Check_Type(args[0],T_ARRAY); /* force exception */ \
|
2073
2344
|
break; \
|
2074
2345
|
case 3: \
|
2075
2346
|
gl_Color3##_type_(obj,args[0], args[1], args[2]); \
|
@@ -2101,21 +2372,18 @@ VALUE *argv; \
|
|
2101
2372
|
VALUE obj; \
|
2102
2373
|
{ \
|
2103
2374
|
int num; \
|
2104
|
-
VALUE
|
2375
|
+
VALUE args[3]; \
|
2376
|
+
VALUE ary; \
|
2105
2377
|
switch (num = rb_scan_args(argc, argv, "12", &args[0], &args[1], &args[2])) { \
|
2106
2378
|
case 1: \
|
2107
|
-
|
2108
|
-
ary = args[0]; \
|
2379
|
+
ary = rb_convert_type(args[0], T_ARRAY, "Array", "to_a"); \
|
2109
2380
|
switch (RARRAY_LEN(ary)) { \
|
2110
2381
|
case 3: \
|
2111
2382
|
gl_Normal3##_type_(obj,RARRAY_PTR(ary)[0], RARRAY_PTR(ary)[1],RARRAY_PTR(ary)[2]); \
|
2112
2383
|
break; \
|
2113
2384
|
default: \
|
2114
|
-
rb_raise(rb_eArgError, "array length
|
2385
|
+
rb_raise(rb_eArgError, "array length: %li", RARRAY_LEN(ary)); \
|
2115
2386
|
} \
|
2116
|
-
} \
|
2117
|
-
else \
|
2118
|
-
Check_Type(args[0],T_ARRAY); /* force exception */ \
|
2119
2387
|
break; \
|
2120
2388
|
case 3: \
|
2121
2389
|
gl_Normal3##_type_(obj,args[0], args[1], args[2]); \
|
@@ -2141,11 +2409,11 @@ VALUE *argv; \
|
|
2141
2409
|
VALUE obj; \
|
2142
2410
|
{ \
|
2143
2411
|
int num; \
|
2144
|
-
VALUE
|
2412
|
+
VALUE args[4]; \
|
2413
|
+
VALUE ary; \
|
2145
2414
|
switch (num = rb_scan_args(argc, argv, "13", &args[0], &args[1], &args[2], &args[3])) { \
|
2146
2415
|
case 1: \
|
2147
|
-
|
2148
|
-
ary = args[0]; \
|
2416
|
+
ary = rb_convert_type(args[0], T_ARRAY, "Array", "to_a"); \
|
2149
2417
|
switch (RARRAY_LEN(ary)) { \
|
2150
2418
|
case 2: \
|
2151
2419
|
gl_RasterPos2##_type_(obj,RARRAY_PTR(ary)[0],RARRAY_PTR(ary)[1]); \
|
@@ -2159,9 +2427,6 @@ VALUE obj; \
|
|
2159
2427
|
default: \
|
2160
2428
|
rb_raise(rb_eArgError, "array length:%d", num); \
|
2161
2429
|
} \
|
2162
|
-
} \
|
2163
|
-
else \
|
2164
|
-
Check_Type(args[0],T_ARRAY); /* force exception */ \
|
2165
2430
|
break; \
|
2166
2431
|
case 2: \
|
2167
2432
|
gl_RasterPos2##_type_(obj,args[0], args[1]); \
|
@@ -2192,28 +2457,29 @@ VALUE *argv; \
|
|
2192
2457
|
VALUE obj; \
|
2193
2458
|
{ \
|
2194
2459
|
int num; \
|
2195
|
-
VALUE
|
2460
|
+
VALUE args[4]; \
|
2461
|
+
VALUE ary1, ary2; \
|
2196
2462
|
switch (num = rb_scan_args(argc, argv, "22", &args[0], &args[1], &args[2], &args[3])) { \
|
2197
2463
|
case 2: \
|
2198
|
-
|
2199
|
-
|
2200
|
-
|
2201
|
-
|
2202
|
-
|
2203
|
-
|
2204
|
-
|
2205
|
-
|
2206
|
-
|
2207
|
-
|
2208
|
-
|
2209
|
-
|
2210
|
-
|
2464
|
+
ary1 = rb_convert_type(args[0], T_ARRAY, "Array", "to_a"); \
|
2465
|
+
ary2 = rb_convert_type(args[1], T_ARRAY, "Array", "to_a"); \
|
2466
|
+
if (RARRAY_LEN(ary1) != 2) \
|
2467
|
+
rb_raise(rb_eArgError, "first array must be of length 2 (was %li)", \
|
2468
|
+
RARRAY_LEN(ary1)); \
|
2469
|
+
\
|
2470
|
+
if (RARRAY_LEN(ary2) != 2) \
|
2471
|
+
rb_raise(rb_eArgError, "second array must be of length 2 (was %li)", \
|
2472
|
+
RARRAY_LEN(ary2)); \
|
2473
|
+
\
|
2474
|
+
gl_Rect##_type_(obj, \
|
2475
|
+
RARRAY_PTR(ary1)[0], RARRAY_PTR(ary1)[1], \
|
2476
|
+
RARRAY_PTR(ary2)[0], RARRAY_PTR(ary2)[1]); \
|
2211
2477
|
break; \
|
2212
2478
|
case 4: \
|
2213
2479
|
gl_Rect##_type_(obj,args[0], args[1], args[2], args[3]); \
|
2214
2480
|
break; \
|
2215
2481
|
default: \
|
2216
|
-
rb_raise(rb_eArgError, "arg length
|
2482
|
+
rb_raise(rb_eArgError, "arg length: %d", num); \
|
2217
2483
|
} \
|
2218
2484
|
return Qnil; \
|
2219
2485
|
}
|
@@ -2232,11 +2498,11 @@ VALUE *argv; \
|
|
2232
2498
|
VALUE obj; \
|
2233
2499
|
{ \
|
2234
2500
|
int num; \
|
2235
|
-
VALUE
|
2501
|
+
VALUE args[4]; \
|
2502
|
+
VALUE ary; \
|
2236
2503
|
switch (num = rb_scan_args(argc, argv, "13", &args[0], &args[1], &args[2], &args[3])) { \
|
2237
2504
|
case 1: \
|
2238
|
-
|
2239
|
-
ary = args[0]; \
|
2505
|
+
ary = rb_convert_type(args[0], T_ARRAY, "Array", "to_a"); \
|
2240
2506
|
switch (RARRAY_LEN(ary)) { \
|
2241
2507
|
case 1: \
|
2242
2508
|
gl_TexCoord1##_type_(obj,RARRAY_PTR(ary)[0]); \
|
@@ -2251,11 +2517,8 @@ VALUE obj; \
|
|
2251
2517
|
gl_TexCoord4##_type_(obj,RARRAY_PTR(ary)[0],RARRAY_PTR(ary)[1],RARRAY_PTR(ary)[2],RARRAY_PTR(ary)[3]); \
|
2252
2518
|
break; \
|
2253
2519
|
default: \
|
2254
|
-
|
2520
|
+
rb_raise(rb_eArgError, "array length: %d", num); \
|
2255
2521
|
} \
|
2256
|
-
} \
|
2257
|
-
else \
|
2258
|
-
gl_TexCoord1##_type_(obj,args[0]); \
|
2259
2522
|
break; \
|
2260
2523
|
case 2: \
|
2261
2524
|
gl_TexCoord2##_type_(obj,args[0], args[1]); \
|
@@ -2286,11 +2549,11 @@ int argc; \
|
|
2286
2549
|
VALUE *argv; \
|
2287
2550
|
VALUE obj; \
|
2288
2551
|
{ \
|
2289
|
-
VALUE
|
2552
|
+
VALUE args[4]; \
|
2553
|
+
VALUE ary; \
|
2290
2554
|
switch (rb_scan_args(argc, argv, "13", &args[0], &args[1], &args[2], &args[3])) { \
|
2291
2555
|
case 1: \
|
2292
|
-
|
2293
|
-
ary = args[0]; \
|
2556
|
+
ary = rb_convert_type(args[0], T_ARRAY, "Array", "to_a"); \
|
2294
2557
|
switch (RARRAY_LEN(ary)) { \
|
2295
2558
|
case 2: \
|
2296
2559
|
gl_Vertex2##_type_(obj,RARRAY_PTR(ary)[0],RARRAY_PTR(ary)[1]); \
|
@@ -2302,11 +2565,8 @@ VALUE obj; \
|
|
2302
2565
|
gl_Vertex4##_type_(obj,RARRAY_PTR(ary)[0],RARRAY_PTR(ary)[1],RARRAY_PTR(ary)[2],RARRAY_PTR(ary)[3]); \
|
2303
2566
|
break; \
|
2304
2567
|
default: \
|
2305
|
-
rb_raise(rb_eRuntimeError, "glVertex vertex num error
|
2568
|
+
rb_raise(rb_eRuntimeError, "glVertex vertex num error!: %ld", RARRAY_LEN(ary)); \
|
2306
2569
|
} \
|
2307
|
-
} \
|
2308
|
-
else \
|
2309
|
-
Check_Type(args[0],T_ARRAY); /* force exception */ \
|
2310
2570
|
break; \
|
2311
2571
|
case 2: \
|
2312
2572
|
gl_Vertex2##_type_(obj,args[0], args[1]); \
|
@@ -2345,13 +2605,17 @@ VALUE obj,arg1,arg2;
|
|
2345
2605
|
}
|
2346
2606
|
|
2347
2607
|
static VALUE
|
2348
|
-
gl_Material(
|
2349
|
-
VALUE obj,arg1,arg2,arg3;
|
2608
|
+
gl_Material(VALUE self, VALUE face, VALUE pname, VALUE param)
|
2350
2609
|
{
|
2351
|
-
|
2352
|
-
|
2353
|
-
|
2354
|
-
|
2610
|
+
VALUE ary;
|
2611
|
+
|
2612
|
+
if (RB_TYPE_P(param, T_ARRAY)) {
|
2613
|
+
gl_Materialfv(self, face, pname, param);
|
2614
|
+
} else if (ary = rb_convert_type(param, T_ARRAY, "Array", "to_a")) {
|
2615
|
+
gl_Materialfv(self, face, pname, ary);
|
2616
|
+
} else {
|
2617
|
+
gl_Materialf(self, face, pname, param);
|
2618
|
+
}
|
2355
2619
|
|
2356
2620
|
return Qnil;
|
2357
2621
|
}
|
@@ -2572,8 +2836,8 @@ void gl_init_functions_1_0__1_1(VALUE module)
|
|
2572
2836
|
rb_define_module_function(module, "glDepthMask", gl_DepthMask, 1);
|
2573
2837
|
rb_define_module_function(module, "glIndexMask", gl_IndexMask, 1);
|
2574
2838
|
rb_define_module_function(module, "glAccum", gl_Accum, 2);
|
2575
|
-
rb_define_module_function(module, "glDisable", gl_Disable, 1);
|
2576
|
-
rb_define_module_function(module, "glEnable", gl_Enable, 1);
|
2839
|
+
rb_define_module_function(module, "glDisable", gl_Disable, -1);
|
2840
|
+
rb_define_module_function(module, "glEnable", gl_Enable, -1);
|
2577
2841
|
rb_define_module_function(module, "glFinish", gl_Finish, 0);
|
2578
2842
|
rb_define_module_function(module, "glFlush", gl_Flush, 0);
|
2579
2843
|
rb_define_module_function(module, "glPopAttrib", gl_PopAttrib, 0);
|
@@ -2668,11 +2932,11 @@ void gl_init_functions_1_0__1_1(VALUE module)
|
|
2668
2932
|
/* OpenGL 1.1 functions */
|
2669
2933
|
rb_define_module_function(module, "glArrayElement", gl_ArrayElement, 1);
|
2670
2934
|
rb_define_module_function(module, "glColorPointer", gl_ColorPointer, 4);
|
2671
|
-
rb_define_module_function(module, "glDisableClientState", gl_DisableClientState, 1);
|
2935
|
+
rb_define_module_function(module, "glDisableClientState", gl_DisableClientState, -1);
|
2672
2936
|
rb_define_module_function(module, "glDrawArrays", gl_DrawArrays, 3);
|
2673
2937
|
rb_define_module_function(module, "glDrawElements", gl_DrawElements, 4);
|
2674
2938
|
rb_define_module_function(module, "glEdgeFlagPointer", gl_EdgeFlagPointer, 2);
|
2675
|
-
rb_define_module_function(module, "glEnableClientState", gl_EnableClientState, 1);
|
2939
|
+
rb_define_module_function(module, "glEnableClientState", gl_EnableClientState, -1);
|
2676
2940
|
rb_define_module_function(module, "glGetPointerv", gl_GetPointerv, 1);
|
2677
2941
|
rb_define_module_function(module, "glIndexPointer", gl_IndexPointer, 3);
|
2678
2942
|
rb_define_module_function(module, "glInterleavedArrays", gl_InterleavedArrays, 3);
|