opengl 0.8.0-x86-mingw32 → 0.9.0-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (149) hide show
  1. checksums.yaml +7 -0
  2. checksums.yaml.gz.sig +1 -0
  3. data.tar.gz.sig +2 -0
  4. data/.gitignore +2 -1
  5. data/.travis.yml +19 -0
  6. data/History.rdoc +26 -0
  7. data/Manifest.txt +3 -23
  8. data/README.rdoc +43 -37
  9. data/Rakefile +6 -62
  10. data/examples/NeHe/nehe_lesson02.rb +3 -2
  11. data/examples/NeHe/nehe_lesson03.rb +3 -2
  12. data/examples/NeHe/nehe_lesson04.rb +3 -1
  13. data/examples/NeHe/nehe_lesson05.rb +4 -1
  14. data/examples/NeHe/nehe_lesson06.rb +9 -6
  15. data/examples/NeHe/nehe_lesson07.rb +9 -6
  16. data/examples/NeHe/nehe_lesson08.rb +9 -6
  17. data/examples/NeHe/nehe_lesson09.rb +10 -6
  18. data/examples/NeHe/nehe_lesson11.rb +9 -6
  19. data/examples/NeHe/nehe_lesson12.rb +9 -6
  20. data/examples/NeHe/nehe_lesson16.rb +50 -47
  21. data/examples/NeHe/nehe_lesson19.rb +10 -7
  22. data/examples/NeHe/nehe_lesson36.rb +234 -229
  23. data/examples/OrangeBook/brick.rb +227 -225
  24. data/examples/OrangeBook/particle.rb +233 -231
  25. data/examples/RedBook/aapoly.rb +71 -70
  26. data/examples/RedBook/aargb.rb +54 -52
  27. data/examples/RedBook/accanti.rb +96 -94
  28. data/examples/RedBook/accpersp.rb +106 -104
  29. data/examples/RedBook/alpha.rb +54 -52
  30. data/examples/RedBook/alpha3D.rb +90 -88
  31. data/examples/RedBook/bezcurve.rb +48 -46
  32. data/examples/RedBook/bezmesh.rb +71 -69
  33. data/examples/RedBook/checker.rb +57 -55
  34. data/examples/RedBook/clip.rb +41 -39
  35. data/examples/RedBook/colormat.rb +72 -70
  36. data/examples/RedBook/cube.rb +39 -37
  37. data/examples/RedBook/depthcue.rb +37 -35
  38. data/examples/RedBook/dof.rb +110 -109
  39. data/examples/RedBook/double.rb +40 -38
  40. data/examples/RedBook/drawf.rb +30 -28
  41. data/examples/RedBook/feedback.rb +79 -77
  42. data/examples/RedBook/fog.rb +90 -89
  43. data/examples/RedBook/font.rb +78 -76
  44. data/examples/RedBook/hello.rb +29 -27
  45. data/examples/RedBook/image.rb +57 -55
  46. data/examples/RedBook/jitter.rb +131 -131
  47. data/examples/RedBook/light.rb +2 -1
  48. data/examples/RedBook/lines.rb +70 -68
  49. data/examples/RedBook/list.rb +48 -46
  50. data/examples/RedBook/material.rb +200 -199
  51. data/examples/RedBook/mipmap.rb +84 -82
  52. data/examples/RedBook/model.rb +55 -53
  53. data/examples/RedBook/movelight.rb +52 -50
  54. data/examples/RedBook/pickdepth.rb +103 -101
  55. data/examples/RedBook/planet.rb +46 -44
  56. data/examples/RedBook/quadric.rb +97 -95
  57. data/examples/RedBook/robot.rb +55 -53
  58. data/examples/RedBook/select.rb +118 -116
  59. data/examples/RedBook/smooth.rb +35 -33
  60. data/examples/RedBook/stencil.rb +96 -94
  61. data/examples/RedBook/stroke.rb +75 -73
  62. data/examples/RedBook/surface.rb +93 -91
  63. data/examples/RedBook/teaambient.rb +71 -69
  64. data/examples/RedBook/teapots.rb +105 -103
  65. data/examples/RedBook/tess.rb +96 -94
  66. data/examples/RedBook/texbind.rb +79 -77
  67. data/examples/RedBook/texgen.rb +88 -86
  68. data/examples/RedBook/texturesurf.rb +57 -55
  69. data/examples/RedBook/varray.rb +85 -83
  70. data/examples/RedBook/wrap.rb +76 -74
  71. data/examples/misc/OGLBench.rb +114 -113
  72. data/examples/misc/anisotropic.rb +154 -152
  73. data/examples/misc/fbo_test.rb +37 -36
  74. data/examples/misc/font-glut.rb +47 -46
  75. data/examples/misc/glfwtest.rb +16 -16
  76. data/examples/misc/plane.rb +13 -13
  77. data/examples/misc/readpixel.rb +66 -65
  78. data/examples/misc/sdltest.rb +21 -19
  79. data/examples/misc/trislam.rb +548 -547
  80. data/ext/opengl/common.h +16 -38
  81. data/ext/opengl/conv.h +39 -41
  82. data/ext/opengl/extconf.rb +4 -31
  83. data/ext/opengl/funcdef.h +126 -124
  84. data/ext/opengl/gl-1.0-1.1.c +1917 -1917
  85. data/ext/opengl/gl-1.2.c +4 -667
  86. data/ext/opengl/gl-1.3.c +9 -9
  87. data/ext/opengl/gl-1.4.c +8 -8
  88. data/ext/opengl/gl-1.5.c +1 -1
  89. data/ext/opengl/gl-2.0.c +392 -388
  90. data/ext/opengl/gl-3.0.c +493 -0
  91. data/ext/opengl/gl-enums.c +1523 -5
  92. data/ext/opengl/gl-enums.h +4679 -122
  93. data/ext/opengl/gl-error.c +7 -7
  94. data/ext/opengl/gl-error.h +4 -4
  95. data/ext/opengl/gl-ext-arb.c +468 -464
  96. data/ext/opengl/gl-ext-ext.c +18 -18
  97. data/ext/opengl/gl-ext-nv.c +15 -15
  98. data/ext/opengl/gl.c +2 -0
  99. data/ext/opengl/gl_buffer.c +92 -92
  100. data/ext/opengl/opengl.c +1 -7
  101. data/lib/opengl.rb +23 -59
  102. data/lib/opengl/1.9/opengl.so +0 -0
  103. data/lib/opengl/2.0/opengl.so +0 -0
  104. data/lib/opengl/2.1/opengl.so +0 -0
  105. data/lib/opengl/test_case.rb +1 -2
  106. data/test/dummy.xorg.conf +140 -0
  107. data/test/test_gl.rb +18 -22
  108. data/test/test_gl_10_11.rb +220 -220
  109. data/test/test_gl_12.rb +11 -122
  110. data/test/test_gl_13.rb +202 -210
  111. data/test/test_gl_14.rb +16 -19
  112. data/test/test_gl_15.rb +2 -4
  113. data/test/test_gl_20.rb +45 -58
  114. data/test/test_gl_21.rb +46 -163
  115. data/test/test_gl_ext_arb.rb +54 -72
  116. data/test/test_gl_ext_ati.rb +0 -2
  117. data/test/test_gl_ext_ext.rb +66 -66
  118. data/test/test_gl_ext_gremedy.rb +8 -15
  119. data/test/test_gl_ext_nv.rb +109 -112
  120. data/test/test_opengl_buffer.rb +8 -25
  121. data/utils/README +0 -5
  122. data/utils/enumgen.rb +72 -76
  123. data/utils/extlistgen.rb +55 -55
  124. metadata +90 -67
  125. metadata.gz.sig +0 -0
  126. data/Rakefile.cross +0 -107
  127. data/docs/build_install.txt +0 -119
  128. data/docs/extensions.txt.in +0 -348
  129. data/docs/history.txt +0 -66
  130. data/docs/requirements_and_design.txt +0 -117
  131. data/docs/roadmap.txt +0 -28
  132. data/docs/scientific_use.txt +0 -35
  133. data/docs/supplies/page_template.html +0 -71
  134. data/docs/thanks.txt +0 -29
  135. data/docs/tutorial.txt +0 -469
  136. data/ext/opengl/glu-enums.c +0 -164
  137. data/ext/opengl/glu-enums.h +0 -463
  138. data/ext/opengl/glu.c +0 -1534
  139. data/ext/opengl/glut.c +0 -1145
  140. data/ext/opengl/glut_callbacks.c +0 -845
  141. data/lib/glu.rb +0 -1
  142. data/lib/glut.rb +0 -1
  143. data/lib/opengl/opengl.so +0 -0
  144. data/test/test_glu.rb +0 -309
  145. data/utils/mkdn2html.rb +0 -59
  146. data/utils/post-mkdn2html.rb +0 -91
  147. data/website/images/ogl.jpg +0 -0
  148. data/website/images/tab_bottom.gif +0 -0
  149. data/website/style.css +0 -198
@@ -1,19 +1,19 @@
1
1
  /*
2
- * Copyright (C) 1999 - 2005 Yoshi <yoshi@giganet.net>
3
- * Copyright (C) 2006 John M. Gabriele <jmg3000@gmail.com>
4
- * Copyright (C) 2007 Jan Dvorak <jan.dvorak@kraxnet.cz>
5
- *
6
- * This program is distributed under the terms of the MIT license.
7
- * See the included MIT-LICENSE file for the terms of this license.
8
- *
9
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
10
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
11
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
12
- * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
13
- * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
14
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
15
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
16
- */
2
+ * Copyright (C) 1999 - 2005 Yoshi <yoshi@giganet.net>
3
+ * Copyright (C) 2006 John M. Gabriele <jmg3000@gmail.com>
4
+ * Copyright (C) 2007 Jan Dvorak <jan.dvorak@kraxnet.cz>
5
+ *
6
+ * This program is distributed under the terms of the MIT license.
7
+ * See the included MIT-LICENSE file for the terms of this license.
8
+ *
9
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
10
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
11
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
12
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
13
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
14
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
15
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
16
+ */
17
17
 
18
18
  #include "common.h"
19
19
 
@@ -268,7 +268,7 @@ gl_Enable(int argc, VALUE *argv, VALUE self)
268
268
  else
269
269
  gl_Enable0(caps);
270
270
 
271
- return Qnil;
271
+ return Qnil;
272
272
  }
273
273
 
274
274
  static VALUE
@@ -291,7 +291,7 @@ gl_Disable(int argc, VALUE *argv, VALUE self)
291
291
  else
292
292
  gl_Disable0(caps);
293
293
 
294
- return Qnil;
294
+ return Qnil;
295
295
  }
296
296
 
297
297
  static VALUE
@@ -362,7 +362,7 @@ gl_EnableClientState(int argc, VALUE *argv, VALUE self)
362
362
  else
363
363
  gl_EnableClientState0(ary);
364
364
 
365
- return Qnil;
365
+ return Qnil;
366
366
  }
367
367
 
368
368
  static VALUE
@@ -385,13 +385,13 @@ gl_DisableClientState(int argc, VALUE *argv, VALUE self)
385
385
  else
386
386
  gl_DisableClientState0(ary);
387
387
 
388
- return Qnil;
388
+ return Qnil;
389
389
  }
390
390
 
391
391
  static VALUE
392
392
  gl_Begin0(GLenum mode)
393
393
  {
394
- glBegin(mode);
394
+ glBegin(mode);
395
395
 
396
396
  if (rb_block_given_p())
397
397
  rb_yield(Qundef);
@@ -402,27 +402,27 @@ gl_Begin0(GLenum mode)
402
402
  static VALUE
403
403
  gl_End(VALUE self)
404
404
  {
405
- inside_begin_end = Qfalse;
405
+ inside_begin_end = Qfalse;
406
406
 
407
- glEnd();
407
+ glEnd();
408
408
 
409
- CHECK_GLERROR_FROM("glEnd");
409
+ CHECK_GLERROR_FROM("glEnd");
410
410
 
411
- return Qnil;
411
+ return Qnil;
412
412
  }
413
413
 
414
414
  static VALUE
415
415
  gl_Begin(VALUE self, VALUE mode)
416
416
  {
417
417
  GLenum begin_mode = CONV_GLenum(mode);
418
- inside_begin_end = Qtrue;
418
+ inside_begin_end = Qtrue;
419
419
 
420
420
  if (rb_block_given_p())
421
421
  return rb_ensure(gl_Begin0, (VALUE)begin_mode, gl_End, self);
422
422
  else
423
- gl_Begin0(begin_mode);
423
+ gl_Begin0(begin_mode);
424
424
 
425
- return Qnil;
425
+ return Qnil;
426
426
  }
427
427
 
428
428
  static VALUE
@@ -492,217 +492,217 @@ gl_NewList(VALUE self, VALUE list, VALUE mode)
492
492
  if (rb_block_given_p())
493
493
  return rb_ensure(gl_NewList0, args, gl_EndList, self);
494
494
  else
495
- gl_NewList0(args);
495
+ gl_NewList0(args);
496
496
 
497
- return Qnil;
497
+ return Qnil;
498
498
  }
499
499
 
500
500
  static VALUE
501
501
  gl_CallLists(obj,arg1,arg2)
502
502
  VALUE obj,arg1,arg2;
503
503
  {
504
- GLsizei n;
505
- GLenum type;
506
- VALUE lists;
507
- type = CONV_GLenum(arg1);
508
- lists = pack_array_or_pass_string(type,arg2);
509
- n = (GLsizei)RSTRING_LENINT(lists) / gltype_glformat_unit_size(type,1);
510
- glCallLists(n, type, RSTRING_PTR(lists));
511
- CHECK_GLERROR_FROM("glCallLists");
512
- return Qnil;
504
+ GLsizei n;
505
+ GLenum type;
506
+ VALUE lists;
507
+ type = CONV_GLenum(arg1);
508
+ lists = pack_array_or_pass_string(type,arg2);
509
+ n = (GLsizei)RSTRING_LENINT(lists) / gltype_glformat_unit_size(type,1);
510
+ glCallLists(n, type, RSTRING_PTR(lists));
511
+ CHECK_GLERROR_FROM("glCallLists");
512
+ return Qnil;
513
513
  }
514
514
 
515
515
  static VALUE
516
516
  gl_Bitmap(obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7)
517
517
  VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7;
518
518
  {
519
- GLsizei width;
520
- GLsizei height;
521
- GLfloat xorig;
522
- GLfloat yorig;
523
- GLfloat xmove;
524
- GLfloat ymove;
525
- width = (GLsizei)NUM2UINT(arg1);
526
- height = (GLsizei)NUM2UINT(arg2);
527
- xorig = (GLfloat)NUM2DBL(arg3);
528
- yorig = (GLfloat)NUM2DBL(arg4);
529
- xmove = (GLfloat)NUM2DBL(arg5);
530
- ymove = (GLfloat)NUM2DBL(arg6);
531
- if (CheckBufferBinding(GL_PIXEL_UNPACK_BUFFER_BINDING)) {
532
- glBitmap(width, height, xorig, yorig, xmove, ymove, (GLubyte *)NUM2LONG(arg7));
533
- } else {
534
- VALUE data;
535
- data = pack_array_or_pass_string(GL_UNSIGNED_BYTE,arg7);
536
-
537
- if ((RSTRING_LEN(data)*8) < (width * height))
538
- rb_raise(rb_eArgError, "string length:%li", RSTRING_LEN(data));
539
-
540
- glBitmap(width, height, xorig, yorig, xmove, ymove, (const GLubyte *)RSTRING_PTR(data));
541
- }
542
- CHECK_GLERROR_FROM("glBitmap");
543
- return Qnil;
519
+ GLsizei width;
520
+ GLsizei height;
521
+ GLfloat xorig;
522
+ GLfloat yorig;
523
+ GLfloat xmove;
524
+ GLfloat ymove;
525
+ width = (GLsizei)NUM2UINT(arg1);
526
+ height = (GLsizei)NUM2UINT(arg2);
527
+ xorig = (GLfloat)NUM2DBL(arg3);
528
+ yorig = (GLfloat)NUM2DBL(arg4);
529
+ xmove = (GLfloat)NUM2DBL(arg5);
530
+ ymove = (GLfloat)NUM2DBL(arg6);
531
+ if (CheckBufferBinding(GL_PIXEL_UNPACK_BUFFER_BINDING)) {
532
+ glBitmap(width, height, xorig, yorig, xmove, ymove, (GLubyte *)NUM2SIZET(arg7));
533
+ } else {
534
+ VALUE data;
535
+ data = pack_array_or_pass_string(GL_UNSIGNED_BYTE,arg7);
536
+
537
+ if ((RSTRING_LEN(data)*8) < (width * height))
538
+ rb_raise(rb_eArgError, "string length:%li", RSTRING_LEN(data));
539
+
540
+ glBitmap(width, height, xorig, yorig, xmove, ymove, (const GLubyte *)RSTRING_PTR(data));
541
+ }
542
+ CHECK_GLERROR_FROM("glBitmap");
543
+ return Qnil;
544
544
  }
545
545
 
546
546
  static VALUE
547
547
  gl_EdgeFlagv(obj,arg1)
548
548
  VALUE obj,arg1;
549
549
  {
550
- GLboolean flag[1] = { GL_FALSE };
551
- Check_Type(arg1,T_ARRAY);
552
- ary2cboolean(arg1,flag,1);
553
- glEdgeFlagv(flag);
554
- CHECK_GLERROR_FROM("glEdgeFlagv");
555
- return Qnil;
550
+ GLboolean flag[1] = { GL_FALSE };
551
+ Check_Type(arg1,T_ARRAY);
552
+ ary2cboolean(arg1,flag,1);
553
+ glEdgeFlagv(flag);
554
+ CHECK_GLERROR_FROM("glEdgeFlagv");
555
+ return Qnil;
556
556
  }
557
557
 
558
558
  static VALUE
559
559
  gl_Indexdv(obj,arg1)
560
560
  VALUE obj,arg1;
561
561
  {
562
- GLdouble c[1] = {0.0};
563
- Check_Type(arg1,T_ARRAY);
564
- ary2cdbl(arg1,c,1);
565
- glIndexdv(c);
566
- CHECK_GLERROR_FROM("glIndexdv");
567
- return Qnil;
562
+ GLdouble c[1] = {0.0};
563
+ Check_Type(arg1,T_ARRAY);
564
+ ary2cdbl(arg1,c,1);
565
+ glIndexdv(c);
566
+ CHECK_GLERROR_FROM("glIndexdv");
567
+ return Qnil;
568
568
  }
569
569
 
570
570
  static VALUE
571
571
  gl_Indexfv(obj,arg1)
572
572
  VALUE obj,arg1;
573
573
  {
574
- GLfloat c[1] = { (GLfloat)0.0 };
575
- Check_Type(arg1,T_ARRAY);
576
- ary2cflt(arg1,c,1);
577
- glIndexfv(c);
578
- CHECK_GLERROR_FROM("glIndexfv");
579
- return Qnil;
574
+ GLfloat c[1] = { (GLfloat)0.0 };
575
+ Check_Type(arg1,T_ARRAY);
576
+ ary2cflt(arg1,c,1);
577
+ glIndexfv(c);
578
+ CHECK_GLERROR_FROM("glIndexfv");
579
+ return Qnil;
580
580
  }
581
581
 
582
582
  static VALUE
583
583
  gl_Indexiv(obj,arg1)
584
584
  VALUE obj,arg1;
585
585
  {
586
- GLint c[1] = {0};
587
- Check_Type(arg1,T_ARRAY);
588
- ary2cint(arg1,c,1);
589
- glIndexiv(c);
590
- CHECK_GLERROR_FROM("glIndexiv");
591
- return Qnil;
586
+ GLint c[1] = {0};
587
+ Check_Type(arg1,T_ARRAY);
588
+ ary2cint(arg1,c,1);
589
+ glIndexiv(c);
590
+ CHECK_GLERROR_FROM("glIndexiv");
591
+ return Qnil;
592
592
  }
593
593
 
594
594
  static VALUE
595
595
  gl_Indexsv(obj,arg1)
596
596
  VALUE obj,arg1;
597
597
  {
598
- GLshort c[1] = {0};
599
- Check_Type(arg1,T_ARRAY);
600
- ary2cshort(arg1,c,1);
601
- glIndexsv(c);
602
- CHECK_GLERROR_FROM("glIndexsv");
603
- return Qnil;
598
+ GLshort c[1] = {0};
599
+ Check_Type(arg1,T_ARRAY);
600
+ ary2cshort(arg1,c,1);
601
+ glIndexsv(c);
602
+ CHECK_GLERROR_FROM("glIndexsv");
603
+ return Qnil;
604
604
  }
605
605
 
606
606
  static VALUE
607
607
  gl_ClipPlane(obj,arg1,arg2)
608
608
  VALUE obj,arg1,arg2;
609
609
  {
610
- GLenum plane;
611
- GLdouble equation[4];
612
- plane = (GLenum)NUM2INT(arg1);
613
- Check_Type(arg2,T_ARRAY);
614
- ary2cdbl(arg2, equation, 4);
615
- glClipPlane(plane,equation);
616
- CHECK_GLERROR_FROM("glClipPlane");
617
- return Qnil;
610
+ GLenum plane;
611
+ GLdouble equation[4];
612
+ plane = (GLenum)NUM2INT(arg1);
613
+ Check_Type(arg2,T_ARRAY);
614
+ ary2cdbl(arg2, equation, 4);
615
+ glClipPlane(plane,equation);
616
+ CHECK_GLERROR_FROM("glClipPlane");
617
+ return Qnil;
618
618
  }
619
619
 
620
620
  static VALUE
621
621
  gl_Fogfv(obj,arg1,arg2)
622
622
  VALUE obj,arg1,arg2;
623
623
  {
624
- GLenum pname;
625
- GLfloat params[4] = {(GLfloat)0.0, (GLfloat)0.0, (GLfloat)0.0, (GLfloat)0.0};
626
- pname = (GLenum)NUM2INT(arg1);
627
- Check_Type(arg2,T_ARRAY);
628
- ary2cflt(arg2,params,4);
629
- glFogfv(pname,params);
630
- CHECK_GLERROR_FROM("glFogfv");
631
- return Qnil;
624
+ GLenum pname;
625
+ GLfloat params[4] = {(GLfloat)0.0, (GLfloat)0.0, (GLfloat)0.0, (GLfloat)0.0};
626
+ pname = (GLenum)NUM2INT(arg1);
627
+ Check_Type(arg2,T_ARRAY);
628
+ ary2cflt(arg2,params,4);
629
+ glFogfv(pname,params);
630
+ CHECK_GLERROR_FROM("glFogfv");
631
+ return Qnil;
632
632
  }
633
633
 
634
634
  static VALUE
635
635
  gl_Fogiv(obj,arg1,arg2)
636
636
  VALUE obj,arg1,arg2;
637
637
  {
638
- GLenum pname;
639
- GLint params[4] = {0,0,0,0};
640
- pname = (GLenum)NUM2INT(arg1);
641
- Check_Type(arg2,T_ARRAY);
642
- ary2cint(arg2,params,4);
643
- glFogiv(pname,params);
644
- CHECK_GLERROR_FROM("glFogiv");
645
- return Qnil;
638
+ GLenum pname;
639
+ GLint params[4] = {0,0,0,0};
640
+ pname = (GLenum)NUM2INT(arg1);
641
+ Check_Type(arg2,T_ARRAY);
642
+ ary2cint(arg2,params,4);
643
+ glFogiv(pname,params);
644
+ CHECK_GLERROR_FROM("glFogiv");
645
+ return Qnil;
646
646
  }
647
647
 
648
648
  static VALUE
649
649
  gl_Lightfv(obj,arg1,arg2,arg3)
650
650
  VALUE obj,arg1,arg2,arg3;
651
651
  {
652
- GLenum light;
653
- GLenum pname;
654
- GLfloat params[4] = {(GLfloat)0.0, (GLfloat)0.0, (GLfloat)0.0, (GLfloat)0.0};
655
- light = (GLenum)NUM2INT(arg1);
656
- pname = (GLenum)NUM2INT(arg2);
657
- Check_Type(arg3,T_ARRAY);
658
- ary2cflt(arg3,params,4);
659
- glLightfv(light,pname,params);
660
- CHECK_GLERROR_FROM("glLightfv");
661
- return Qnil;
652
+ GLenum light;
653
+ GLenum pname;
654
+ GLfloat params[4] = {(GLfloat)0.0, (GLfloat)0.0, (GLfloat)0.0, (GLfloat)0.0};
655
+ light = (GLenum)NUM2INT(arg1);
656
+ pname = (GLenum)NUM2INT(arg2);
657
+ Check_Type(arg3,T_ARRAY);
658
+ ary2cflt(arg3,params,4);
659
+ glLightfv(light,pname,params);
660
+ CHECK_GLERROR_FROM("glLightfv");
661
+ return Qnil;
662
662
  }
663
663
 
664
664
  static VALUE
665
665
  gl_Lightiv(obj,arg1,arg2,arg3)
666
666
  VALUE obj,arg1,arg2,arg3;
667
667
  {
668
- GLenum light;
669
- GLenum pname;
670
- GLint params[4]={0,0,0,0};
671
- light = (GLenum)NUM2INT(arg1);
672
- pname = (GLenum)NUM2INT(arg2);
673
- Check_Type(arg3,T_ARRAY);
674
- ary2cint(arg3,params,4);
675
- glLightiv(light,pname,params);
676
- CHECK_GLERROR_FROM("glLightiv");
677
- return Qnil;
668
+ GLenum light;
669
+ GLenum pname;
670
+ GLint params[4]={0,0,0,0};
671
+ light = (GLenum)NUM2INT(arg1);
672
+ pname = (GLenum)NUM2INT(arg2);
673
+ Check_Type(arg3,T_ARRAY);
674
+ ary2cint(arg3,params,4);
675
+ glLightiv(light,pname,params);
676
+ CHECK_GLERROR_FROM("glLightiv");
677
+ return Qnil;
678
678
  }
679
679
 
680
680
  static VALUE
681
681
  gl_LightModelfv(obj,arg1,arg2)
682
682
  VALUE obj,arg1,arg2;
683
683
  {
684
- GLenum pname;
685
- GLfloat params[4] = {(GLfloat)0.0, (GLfloat)0.0, (GLfloat)0.0, (GLfloat)0.0};
686
- pname = (GLenum)NUM2INT(arg1);
687
- Check_Type(arg2,T_ARRAY);
688
- ary2cflt(arg2,params,4);
689
- glLightModelfv(pname,params);
690
- CHECK_GLERROR_FROM("glLightModelfv");
691
- return Qnil;
684
+ GLenum pname;
685
+ GLfloat params[4] = {(GLfloat)0.0, (GLfloat)0.0, (GLfloat)0.0, (GLfloat)0.0};
686
+ pname = (GLenum)NUM2INT(arg1);
687
+ Check_Type(arg2,T_ARRAY);
688
+ ary2cflt(arg2,params,4);
689
+ glLightModelfv(pname,params);
690
+ CHECK_GLERROR_FROM("glLightModelfv");
691
+ return Qnil;
692
692
  }
693
693
 
694
694
  static VALUE
695
695
  gl_LightModeliv(obj,arg1,arg2)
696
696
  VALUE obj,arg1,arg2;
697
697
  {
698
- GLenum pname;
699
- GLint params[4] = {0,0,0,0};
700
- pname = (GLenum)NUM2INT(arg1);
701
- Check_Type(arg2,T_ARRAY);
702
- ary2cint(arg2,params,4);
703
- glLightModeliv(pname,params);
704
- CHECK_GLERROR_FROM("glLightModeliv");
705
- return Qnil;
698
+ GLenum pname;
699
+ GLint params[4] = {0,0,0,0};
700
+ pname = (GLenum)NUM2INT(arg1);
701
+ Check_Type(arg2,T_ARRAY);
702
+ ary2cint(arg2,params,4);
703
+ glLightModeliv(pname,params);
704
+ CHECK_GLERROR_FROM("glLightModeliv");
705
+ return Qnil;
706
706
  }
707
707
 
708
708
 
@@ -710,50 +710,50 @@ static VALUE
710
710
  gl_Materialfv(obj,arg1,arg2,arg3)
711
711
  VALUE obj,arg1,arg2,arg3;
712
712
  {
713
- GLenum face;
714
- GLenum pname;
715
- GLfloat params[4] = {(GLfloat)0.0, (GLfloat)0.0, (GLfloat)0.0, (GLfloat)0.0};
716
- face = (GLenum)NUM2INT(arg1);
717
- pname = (GLenum)NUM2INT(arg2);
718
- Check_Type(arg3,T_ARRAY);
719
- ary2cflt(arg3,params,4);
720
- glMaterialfv(face,pname,params);
721
- CHECK_GLERROR_FROM("glMaterialfv");
722
- return Qnil;
713
+ GLenum face;
714
+ GLenum pname;
715
+ GLfloat params[4] = {(GLfloat)0.0, (GLfloat)0.0, (GLfloat)0.0, (GLfloat)0.0};
716
+ face = (GLenum)NUM2INT(arg1);
717
+ pname = (GLenum)NUM2INT(arg2);
718
+ Check_Type(arg3,T_ARRAY);
719
+ ary2cflt(arg3,params,4);
720
+ glMaterialfv(face,pname,params);
721
+ CHECK_GLERROR_FROM("glMaterialfv");
722
+ return Qnil;
723
723
  }
724
724
 
725
725
  static VALUE
726
726
  gl_Materialiv(obj,arg1,arg2,arg3)
727
727
  VALUE obj,arg1,arg2,arg3;
728
728
  {
729
- GLenum face;
730
- GLenum pname;
731
- GLint params[4] = {0,0,0,0};
732
- face = (GLenum)NUM2INT(arg1);
733
- pname = (GLenum)NUM2INT(arg2);
734
- Check_Type(arg3,T_ARRAY);
735
- ary2cint(arg3,params,4);
736
- glMaterialiv(face,pname,params);
737
- CHECK_GLERROR_FROM("glMaterialiv");
738
- return Qnil;
729
+ GLenum face;
730
+ GLenum pname;
731
+ GLint params[4] = {0,0,0,0};
732
+ face = (GLenum)NUM2INT(arg1);
733
+ pname = (GLenum)NUM2INT(arg2);
734
+ Check_Type(arg3,T_ARRAY);
735
+ ary2cint(arg3,params,4);
736
+ glMaterialiv(face,pname,params);
737
+ CHECK_GLERROR_FROM("glMaterialiv");
738
+ return Qnil;
739
739
  }
740
740
 
741
741
  static VALUE
742
742
  gl_PolygonStipple(obj,arg1)
743
743
  VALUE obj,arg1;
744
744
  {
745
- if (CheckBufferBinding(GL_PIXEL_UNPACK_BUFFER_BINDING)) {
746
- glPolygonStipple((GLubyte *)NUM2LONG(arg1));
747
- } else {
748
- VALUE data;
749
- data = pack_array_or_pass_string(GL_UNSIGNED_BYTE,arg1);
750
- if (RSTRING_LEN(data) < 128)
751
- rb_raise(rb_eArgError, "string length:%li", RSTRING_LEN(data));
752
-
753
- glPolygonStipple((GLubyte *)RSTRING_PTR(data));
754
- }
755
- CHECK_GLERROR_FROM("glPolygonStipple");
756
- return Qnil;
745
+ if (CheckBufferBinding(GL_PIXEL_UNPACK_BUFFER_BINDING)) {
746
+ glPolygonStipple((GLubyte *)NUM2SIZET(arg1));
747
+ } else {
748
+ VALUE data;
749
+ data = pack_array_or_pass_string(GL_UNSIGNED_BYTE,arg1);
750
+ if (RSTRING_LEN(data) < 128)
751
+ rb_raise(rb_eArgError, "string length:%li", RSTRING_LEN(data));
752
+
753
+ glPolygonStipple((GLubyte *)RSTRING_PTR(data));
754
+ }
755
+ CHECK_GLERROR_FROM("glPolygonStipple");
756
+ return Qnil;
757
757
  }
758
758
 
759
759
 
@@ -761,144 +761,144 @@ static VALUE
761
761
  gl_TexParameterfv(obj,arg1,arg2,arg3)
762
762
  VALUE obj,arg1,arg2,arg3;
763
763
  {
764
- GLenum target;
765
- GLenum pname;
766
- GLfloat params[4] = {(GLfloat)0.0, (GLfloat)0.0, (GLfloat)0.0, (GLfloat)0.0};
767
- target = (GLenum)NUM2INT(arg1);
768
- pname = (GLenum)NUM2INT(arg2);
769
- Check_Type(arg3,T_ARRAY);
770
- ary2cflt(arg3,params,4);
771
- glTexParameterfv(target,pname,params);
772
- CHECK_GLERROR_FROM("glTexParameterfv");
773
- return Qnil;
764
+ GLenum target;
765
+ GLenum pname;
766
+ GLfloat params[4] = {(GLfloat)0.0, (GLfloat)0.0, (GLfloat)0.0, (GLfloat)0.0};
767
+ target = (GLenum)NUM2INT(arg1);
768
+ pname = (GLenum)NUM2INT(arg2);
769
+ Check_Type(arg3,T_ARRAY);
770
+ ary2cflt(arg3,params,4);
771
+ glTexParameterfv(target,pname,params);
772
+ CHECK_GLERROR_FROM("glTexParameterfv");
773
+ return Qnil;
774
774
  }
775
775
 
776
776
  static VALUE
777
777
  gl_TexParameteriv(obj,arg1,arg2,arg3)
778
778
  VALUE obj,arg1,arg2,arg3;
779
779
  {
780
- GLenum target;
781
- GLenum pname;
782
- GLint params[4] = {0,0,0,0};
783
- target = (GLenum)NUM2INT(arg1);
784
- pname = (GLenum)NUM2INT(arg2);
785
- Check_Type(arg3,T_ARRAY);
786
- ary2cint(arg3,params,4);
787
- glTexParameteriv(target,pname,params);
788
- CHECK_GLERROR_FROM("glTexParameteriv");
789
- return Qnil;
780
+ GLenum target;
781
+ GLenum pname;
782
+ GLint params[4] = {0,0,0,0};
783
+ target = (GLenum)NUM2INT(arg1);
784
+ pname = (GLenum)NUM2INT(arg2);
785
+ Check_Type(arg3,T_ARRAY);
786
+ ary2cint(arg3,params,4);
787
+ glTexParameteriv(target,pname,params);
788
+ CHECK_GLERROR_FROM("glTexParameteriv");
789
+ return Qnil;
790
790
  }
791
791
 
792
792
  static VALUE
793
793
  gl_TexImage1D(obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8)
794
794
  VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8;
795
795
  {
796
- GLenum target;
797
- GLint level;
798
- GLint components;
799
- GLsizei width;
800
- GLint border;
801
- GLenum format;
802
- GLenum type;
803
- const char *pixels;
804
- target = (GLenum)NUM2INT(arg1);
805
- level = (GLint)NUM2INT(arg2);
806
- components = (GLint)NUM2INT(arg3);
807
- width = (GLsizei)NUM2UINT(arg4);
808
- border = (GLint)NUM2INT(arg5);
809
- format = (GLenum)NUM2INT(arg6);
810
- type = (GLenum)NUM2INT(arg7);
811
-
812
- if (CheckBufferBinding(GL_PIXEL_UNPACK_BUFFER_BINDING)) {
813
- glTexImage1D(target,level,components,width,border,format,type,(GLvoid *)NUM2LONG(arg8));
814
- CHECK_GLERROR_FROM("glTexImage1D");
815
- return Qnil;
816
- }
817
-
818
- if (target == GL_PROXY_TEXTURE_1D || NIL_P(arg8)) { /* proxy texture, no data read */
819
- pixels = NULL;
820
- } else {
821
- VALUE data;
822
- data = pack_array_or_pass_string(type,arg8);
823
- CheckDataSize(type,format,width,data);
824
- pixels = RSTRING_PTR(data);
825
- }
826
- glTexImage1D(target,level,components,width,border,format,type,pixels);
827
- CHECK_GLERROR_FROM("glTexImage1D");
828
- return Qnil;
796
+ GLenum target;
797
+ GLint level;
798
+ GLint components;
799
+ GLsizei width;
800
+ GLint border;
801
+ GLenum format;
802
+ GLenum type;
803
+ const char *pixels;
804
+ target = (GLenum)NUM2INT(arg1);
805
+ level = (GLint)NUM2INT(arg2);
806
+ components = (GLint)NUM2INT(arg3);
807
+ width = (GLsizei)NUM2UINT(arg4);
808
+ border = (GLint)NUM2INT(arg5);
809
+ format = (GLenum)NUM2INT(arg6);
810
+ type = (GLenum)NUM2INT(arg7);
811
+
812
+ if (CheckBufferBinding(GL_PIXEL_UNPACK_BUFFER_BINDING)) {
813
+ glTexImage1D(target,level,components,width,border,format,type,(GLvoid *)NUM2SIZET(arg8));
814
+ CHECK_GLERROR_FROM("glTexImage1D");
815
+ return Qnil;
816
+ }
817
+
818
+ if (target == GL_PROXY_TEXTURE_1D || NIL_P(arg8)) { /* proxy texture, no data read */
819
+ pixels = NULL;
820
+ } else {
821
+ VALUE data;
822
+ data = pack_array_or_pass_string(type,arg8);
823
+ CheckDataSize(type,format,width,data);
824
+ pixels = RSTRING_PTR(data);
825
+ }
826
+ glTexImage1D(target,level,components,width,border,format,type,pixels);
827
+ CHECK_GLERROR_FROM("glTexImage1D");
828
+ return Qnil;
829
829
  }
830
830
 
831
831
  static VALUE
832
832
  gl_TexImage2D(obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9)
833
833
  VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9;
834
834
  {
835
- GLenum target;
836
- GLint level;
837
- GLint components;
838
- GLsizei width;
839
- GLsizei height;
840
- GLint border;
841
- GLenum format;
842
- GLenum type;
843
- const char *pixels;
844
- target = (GLenum)NUM2INT(arg1);
845
- level = (GLint)NUM2INT(arg2);
846
- components = (GLint)NUM2INT(arg3);
847
- width = (GLsizei)NUM2UINT(arg4);
848
- height = (GLsizei)NUM2UINT(arg5);
849
- border = (GLint)NUM2INT(arg6);
850
- format = (GLenum)NUM2INT(arg7);
851
- type = (GLenum)NUM2INT(arg8);
852
-
853
- if (CheckBufferBinding(GL_PIXEL_UNPACK_BUFFER_BINDING)) {
854
- glTexImage2D(target,level,components,width,height,border,format,type,(GLvoid *)NUM2LONG(arg9));
855
- CHECK_GLERROR_FROM("glTexImage2D");
856
- return Qnil;
857
- }
858
-
859
- if (target == GL_PROXY_TEXTURE_2D || target == GL_PROXY_TEXTURE_1D_ARRAY_EXT || target == GL_PROXY_TEXTURE_CUBE_MAP || NIL_P(arg9)) { /* proxy texture, no data read */
860
- pixels = NULL;
861
- } else {
862
- VALUE data;
863
- data = pack_array_or_pass_string(type,arg9);
864
- CheckDataSize(type,format,width*height,data);
865
- pixels = RSTRING_PTR(data);
866
- }
867
- glTexImage2D(target,level,components,width,height,border,format,type,pixels);
868
- CHECK_GLERROR_FROM("glTexImage2D");
869
- return Qnil;
835
+ GLenum target;
836
+ GLint level;
837
+ GLint components;
838
+ GLsizei width;
839
+ GLsizei height;
840
+ GLint border;
841
+ GLenum format;
842
+ GLenum type;
843
+ const char *pixels;
844
+ target = (GLenum)NUM2INT(arg1);
845
+ level = (GLint)NUM2INT(arg2);
846
+ components = (GLint)NUM2INT(arg3);
847
+ width = (GLsizei)NUM2UINT(arg4);
848
+ height = (GLsizei)NUM2UINT(arg5);
849
+ border = (GLint)NUM2INT(arg6);
850
+ format = (GLenum)NUM2INT(arg7);
851
+ type = (GLenum)NUM2INT(arg8);
852
+
853
+ if (CheckBufferBinding(GL_PIXEL_UNPACK_BUFFER_BINDING)) {
854
+ glTexImage2D(target,level,components,width,height,border,format,type,(GLvoid *)NUM2SIZET(arg9));
855
+ CHECK_GLERROR_FROM("glTexImage2D");
856
+ return Qnil;
857
+ }
858
+
859
+ if (target == GL_PROXY_TEXTURE_2D || target == GL_PROXY_TEXTURE_1D_ARRAY_EXT || target == GL_PROXY_TEXTURE_CUBE_MAP || NIL_P(arg9)) { /* proxy texture, no data read */
860
+ pixels = NULL;
861
+ } else {
862
+ VALUE data;
863
+ data = pack_array_or_pass_string(type,arg9);
864
+ CheckDataSize(type,format,width*height,data);
865
+ pixels = RSTRING_PTR(data);
866
+ }
867
+ glTexImage2D(target,level,components,width,height,border,format,type,pixels);
868
+ CHECK_GLERROR_FROM("glTexImage2D");
869
+ return Qnil;
870
870
  }
871
871
 
872
872
  static VALUE
873
873
  gl_TexEnvfv(obj,arg1,arg2,arg3)
874
874
  VALUE obj,arg1,arg2,arg3;
875
875
  {
876
- GLenum target;
877
- GLenum pname;
878
- GLfloat params[4] = {(GLfloat)0.0, (GLfloat)0.0, (GLfloat)0.0, (GLfloat)0.0};
879
- target = (GLenum)NUM2INT(arg1);
880
- pname = (GLenum)NUM2INT(arg2);
881
- Check_Type(arg3,T_ARRAY);
882
- ary2cflt(arg3,params,4);
883
- glTexEnvfv(target,pname,params);
884
- CHECK_GLERROR_FROM("glTexEnvfv");
885
- return Qnil;
876
+ GLenum target;
877
+ GLenum pname;
878
+ GLfloat params[4] = {(GLfloat)0.0, (GLfloat)0.0, (GLfloat)0.0, (GLfloat)0.0};
879
+ target = (GLenum)NUM2INT(arg1);
880
+ pname = (GLenum)NUM2INT(arg2);
881
+ Check_Type(arg3,T_ARRAY);
882
+ ary2cflt(arg3,params,4);
883
+ glTexEnvfv(target,pname,params);
884
+ CHECK_GLERROR_FROM("glTexEnvfv");
885
+ return Qnil;
886
886
  }
887
887
 
888
888
  static VALUE
889
889
  gl_TexEnviv(obj,arg1,arg2,arg3)
890
890
  VALUE obj,arg1,arg2,arg3;
891
891
  {
892
- GLenum target;
893
- GLenum pname;
894
- GLint params[4] = {0,0,0,0};
895
- target = (GLenum)NUM2INT(arg1);
896
- pname = (GLenum)NUM2INT(arg2);
897
- Check_Type(arg3,T_ARRAY);
898
- ary2cint(arg3,params,4);
899
- glTexEnviv(target,pname,params);
900
- CHECK_GLERROR_FROM("glTexEnviv");
901
- return Qnil;
892
+ GLenum target;
893
+ GLenum pname;
894
+ GLint params[4] = {0,0,0,0};
895
+ target = (GLenum)NUM2INT(arg1);
896
+ pname = (GLenum)NUM2INT(arg2);
897
+ Check_Type(arg3,T_ARRAY);
898
+ ary2cint(arg3,params,4);
899
+ glTexEnviv(target,pname,params);
900
+ CHECK_GLERROR_FROM("glTexEnviv");
901
+ return Qnil;
902
902
  }
903
903
 
904
904
 
@@ -906,16 +906,16 @@ static VALUE
906
906
  gl_TexGendv(obj,arg1,arg2,arg3)
907
907
  VALUE obj,arg1,arg2,arg3;
908
908
  {
909
- GLenum coord;
910
- GLenum pname;
911
- GLdouble params[4] = {0.0,0.0,0.0,0.0};
912
- coord = (GLenum)NUM2INT(arg1);
913
- pname = (GLenum)NUM2INT(arg2);
914
- Check_Type(arg3,T_ARRAY);
915
- ary2cdbl(arg3,params,4);
916
- glTexGendv(coord,pname,params);
917
- CHECK_GLERROR_FROM("glTexGendv");
918
- return Qnil;
909
+ GLenum coord;
910
+ GLenum pname;
911
+ GLdouble params[4] = {0.0,0.0,0.0,0.0};
912
+ coord = (GLenum)NUM2INT(arg1);
913
+ pname = (GLenum)NUM2INT(arg2);
914
+ Check_Type(arg3,T_ARRAY);
915
+ ary2cdbl(arg3,params,4);
916
+ glTexGendv(coord,pname,params);
917
+ CHECK_GLERROR_FROM("glTexGendv");
918
+ return Qnil;
919
919
  }
920
920
 
921
921
 
@@ -923,16 +923,16 @@ static VALUE
923
923
  gl_TexGenfv(obj,arg1,arg2,arg3)
924
924
  VALUE obj,arg1,arg2,arg3;
925
925
  {
926
- GLenum coord;
927
- GLenum pname;
928
- GLfloat params[4] = {(GLfloat)0.0, (GLfloat)0.0, (GLfloat)0.0, (GLfloat)0.0};
929
- coord = (GLenum)NUM2INT(arg1);
930
- pname = (GLenum)NUM2INT(arg2);
931
- Check_Type(arg3,T_ARRAY);
932
- ary2cflt(arg3,params,4);
933
- glTexGenfv(coord,pname,params);
934
- CHECK_GLERROR_FROM("glTexGenfv");
935
- return Qnil;
926
+ GLenum coord;
927
+ GLenum pname;
928
+ GLfloat params[4] = {(GLfloat)0.0, (GLfloat)0.0, (GLfloat)0.0, (GLfloat)0.0};
929
+ coord = (GLenum)NUM2INT(arg1);
930
+ pname = (GLenum)NUM2INT(arg2);
931
+ Check_Type(arg3,T_ARRAY);
932
+ ary2cflt(arg3,params,4);
933
+ glTexGenfv(coord,pname,params);
934
+ CHECK_GLERROR_FROM("glTexGenfv");
935
+ return Qnil;
936
936
  }
937
937
 
938
938
 
@@ -940,31 +940,31 @@ static VALUE
940
940
  gl_TexGeniv(obj,arg1,arg2,arg3)
941
941
  VALUE obj,arg1,arg2,arg3;
942
942
  {
943
- GLenum coord;
944
- GLenum pname;
945
- GLint params[4] = {0,0,0,0};
946
- coord = (GLenum)NUM2INT(arg1);
947
- pname = (GLenum)NUM2INT(arg2);
948
- Check_Type(arg3,T_ARRAY);
949
- ary2cint(arg3,params,4);
950
- glTexGeniv(coord,pname,params);
951
- CHECK_GLERROR_FROM("glTexGeniv");
952
- return Qnil;
943
+ GLenum coord;
944
+ GLenum pname;
945
+ GLint params[4] = {0,0,0,0};
946
+ coord = (GLenum)NUM2INT(arg1);
947
+ pname = (GLenum)NUM2INT(arg2);
948
+ Check_Type(arg3,T_ARRAY);
949
+ ary2cint(arg3,params,4);
950
+ glTexGeniv(coord,pname,params);
951
+ CHECK_GLERROR_FROM("glTexGeniv");
952
+ return Qnil;
953
953
  }
954
954
  static VALUE g_current_feed_buffer;
955
955
  static VALUE
956
956
  gl_FeedbackBuffer(obj,arg1,arg2)
957
957
  VALUE obj,arg1,arg2;
958
958
  {
959
- GLsizei size;
960
- GLenum type;
961
- size = (GLsizei)NUM2UINT(arg1);
962
- type = (GLenum)NUM2INT(arg2);
963
- g_current_feed_buffer = allocate_buffer_with_string(sizeof(GLfloat)*size);
964
- rb_str_freeze(g_current_feed_buffer);
965
- glFeedbackBuffer(size, type, (GLfloat*)RSTRING_PTR(g_current_feed_buffer));
966
- CHECK_GLERROR_FROM("glFeedbackBuffer");
967
- return g_current_feed_buffer;
959
+ GLsizei size;
960
+ GLenum type;
961
+ size = (GLsizei)NUM2UINT(arg1);
962
+ type = (GLenum)NUM2INT(arg2);
963
+ g_current_feed_buffer = allocate_buffer_with_string(sizeof(GLfloat)*size);
964
+ rb_str_freeze(g_current_feed_buffer);
965
+ glFeedbackBuffer(size, type, (GLfloat*)RSTRING_PTR(g_current_feed_buffer));
966
+ CHECK_GLERROR_FROM("glFeedbackBuffer");
967
+ return g_current_feed_buffer;
968
968
  }
969
969
 
970
970
  static VALUE g_current_sel_buffer;
@@ -972,13 +972,13 @@ static VALUE
972
972
  gl_SelectBuffer(obj,arg1)
973
973
  VALUE obj,arg1;
974
974
  {
975
- GLsizei size;
976
- size = (GLsizei)NUM2UINT(arg1);
977
- g_current_sel_buffer = allocate_buffer_with_string(sizeof(GLuint)*size);
978
- rb_str_freeze(g_current_sel_buffer);
979
- glSelectBuffer(size, (GLuint*)RSTRING_PTR(g_current_sel_buffer));
980
- CHECK_GLERROR_FROM("glSelectBuffer");
981
- return g_current_sel_buffer;
975
+ GLsizei size;
976
+ size = (GLsizei)NUM2UINT(arg1);
977
+ g_current_sel_buffer = allocate_buffer_with_string(sizeof(GLuint)*size);
978
+ rb_str_freeze(g_current_sel_buffer);
979
+ glSelectBuffer(size, (GLuint*)RSTRING_PTR(g_current_sel_buffer));
980
+ CHECK_GLERROR_FROM("glSelectBuffer");
981
+ return g_current_sel_buffer;
982
982
  }
983
983
 
984
984
 
@@ -986,172 +986,172 @@ static VALUE
986
986
  gl_Map1d(obj,arg1,arg2,arg3,arg4,arg5,arg6)
987
987
  VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6;
988
988
  {
989
- GLenum target;
990
- GLdouble u1;
991
- GLdouble u2;
992
- GLint stride;
993
- GLint order;
994
- GLdouble *points;
995
-
996
- VALUE work_ary;
997
-
998
- target = (GLenum)NUM2INT(arg1);
999
- u1 = (GLdouble)NUM2DBL(arg2);
1000
- u2 = (GLdouble)NUM2DBL(arg3);
1001
- stride = (GLint)NUM2INT(arg4);
1002
- order = (GLint)NUM2INT(arg5);
1003
- points = ALLOC_N(GLdouble, order*stride);
1004
- work_ary = rb_funcall(arg6,rb_intern("flatten"),0);
1005
- ary2cdbl(work_ary, points, order*stride);
1006
- glMap1d(target, u1, u2, stride, order, points);
1007
- xfree(points);
1008
- CHECK_GLERROR_FROM("glMap1d");
1009
- return Qnil;
989
+ GLenum target;
990
+ GLdouble u1;
991
+ GLdouble u2;
992
+ GLint stride;
993
+ GLint order;
994
+ GLdouble *points;
995
+
996
+ VALUE work_ary;
997
+
998
+ target = (GLenum)NUM2INT(arg1);
999
+ u1 = (GLdouble)NUM2DBL(arg2);
1000
+ u2 = (GLdouble)NUM2DBL(arg3);
1001
+ stride = (GLint)NUM2INT(arg4);
1002
+ order = (GLint)NUM2INT(arg5);
1003
+ points = ALLOC_N(GLdouble, order*stride);
1004
+ work_ary = rb_funcall(arg6,rb_intern("flatten"),0);
1005
+ ary2cdbl(work_ary, points, order*stride);
1006
+ glMap1d(target, u1, u2, stride, order, points);
1007
+ xfree(points);
1008
+ CHECK_GLERROR_FROM("glMap1d");
1009
+ return Qnil;
1010
1010
  }
1011
1011
 
1012
1012
  static VALUE
1013
1013
  gl_Map1f(obj,arg1,arg2,arg3,arg4,arg5,arg6)
1014
1014
  VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6;
1015
1015
  {
1016
- GLenum target;
1017
- GLfloat u1;
1018
- GLfloat u2;
1019
- GLint stride;
1020
- GLint order;
1021
- GLfloat *points;
1022
-
1023
- VALUE work_ary;
1024
-
1025
- target = (GLenum)NUM2INT(arg1);
1026
- u1 = (GLfloat)NUM2DBL(arg2);
1027
- u2 = (GLfloat)NUM2DBL(arg3);
1028
- stride = (GLint)NUM2INT(arg4);
1029
- order = (GLint)NUM2INT(arg5);
1030
- points = ALLOC_N(GLfloat, order*stride);
1031
- work_ary = rb_funcall(arg6,rb_intern("flatten"),0);
1032
- ary2cflt(work_ary, points, order*stride);
1033
- glMap1f(target, u1, u2, stride, order, points);
1034
- xfree(points);
1035
- CHECK_GLERROR_FROM("glMap1f");
1036
- return Qnil;
1016
+ GLenum target;
1017
+ GLfloat u1;
1018
+ GLfloat u2;
1019
+ GLint stride;
1020
+ GLint order;
1021
+ GLfloat *points;
1022
+
1023
+ VALUE work_ary;
1024
+
1025
+ target = (GLenum)NUM2INT(arg1);
1026
+ u1 = (GLfloat)NUM2DBL(arg2);
1027
+ u2 = (GLfloat)NUM2DBL(arg3);
1028
+ stride = (GLint)NUM2INT(arg4);
1029
+ order = (GLint)NUM2INT(arg5);
1030
+ points = ALLOC_N(GLfloat, order*stride);
1031
+ work_ary = rb_funcall(arg6,rb_intern("flatten"),0);
1032
+ ary2cflt(work_ary, points, order*stride);
1033
+ glMap1f(target, u1, u2, stride, order, points);
1034
+ xfree(points);
1035
+ CHECK_GLERROR_FROM("glMap1f");
1036
+ return Qnil;
1037
1037
  }
1038
1038
 
1039
1039
  static VALUE
1040
1040
  gl_Map2d(obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10)
1041
1041
  VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10;
1042
1042
  {
1043
- GLenum target;
1044
- GLdouble u1;
1045
- GLdouble u2;
1046
- GLint ustride;
1047
- GLint uorder;
1048
- GLdouble v1;
1049
- GLdouble v2;
1050
- GLint vstride;
1051
- GLint vorder;
1052
- GLdouble *points;
1053
-
1054
- VALUE work_ary;
1055
-
1056
- target = (GLenum)NUM2INT(arg1);
1057
- u1 = (GLdouble)NUM2INT(arg2);
1058
- u2 = (GLdouble)NUM2INT(arg3);
1059
- ustride = (GLint)NUM2INT(arg4);
1060
- uorder = (GLint)NUM2INT(arg5);
1061
- v1 = (GLdouble)NUM2INT(arg6);
1062
- v2 = (GLdouble)NUM2INT(arg7);
1063
- vstride = (GLint)NUM2INT(arg8);
1064
- vorder = (GLint)NUM2INT(arg9);
1065
- points = ALLOC_N(GLdouble, MAX(ustride*uorder, vstride*vorder));
1066
- work_ary = rb_funcall(arg10,rb_intern("flatten"),0);
1067
- ary2cdbl(work_ary, points, MAX(ustride*uorder, vstride*vorder));
1068
- glMap2d(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points);
1069
- xfree(points);
1070
- CHECK_GLERROR_FROM("glMap2d");
1071
- return Qnil;
1043
+ GLenum target;
1044
+ GLdouble u1;
1045
+ GLdouble u2;
1046
+ GLint ustride;
1047
+ GLint uorder;
1048
+ GLdouble v1;
1049
+ GLdouble v2;
1050
+ GLint vstride;
1051
+ GLint vorder;
1052
+ GLdouble *points;
1053
+
1054
+ VALUE work_ary;
1055
+
1056
+ target = (GLenum)NUM2INT(arg1);
1057
+ u1 = (GLdouble)NUM2INT(arg2);
1058
+ u2 = (GLdouble)NUM2INT(arg3);
1059
+ ustride = (GLint)NUM2INT(arg4);
1060
+ uorder = (GLint)NUM2INT(arg5);
1061
+ v1 = (GLdouble)NUM2INT(arg6);
1062
+ v2 = (GLdouble)NUM2INT(arg7);
1063
+ vstride = (GLint)NUM2INT(arg8);
1064
+ vorder = (GLint)NUM2INT(arg9);
1065
+ points = ALLOC_N(GLdouble, MAX(ustride*uorder, vstride*vorder));
1066
+ work_ary = rb_funcall(arg10,rb_intern("flatten"),0);
1067
+ ary2cdbl(work_ary, points, MAX(ustride*uorder, vstride*vorder));
1068
+ glMap2d(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points);
1069
+ xfree(points);
1070
+ CHECK_GLERROR_FROM("glMap2d");
1071
+ return Qnil;
1072
1072
  }
1073
1073
 
1074
1074
  static VALUE
1075
1075
  gl_Map2f(obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10)
1076
1076
  VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10;
1077
1077
  {
1078
- GLenum target;
1079
- GLfloat u1;
1080
- GLfloat u2;
1081
- GLint ustride;
1082
- GLint uorder;
1083
- GLfloat v1;
1084
- GLfloat v2;
1085
- GLint vstride;
1086
- GLint vorder;
1087
- GLfloat *points;
1088
-
1089
- VALUE work_ary;
1090
-
1091
- target = (GLenum)NUM2INT(arg1);
1092
- u1 = (GLfloat)NUM2INT(arg2);
1093
- u2 = (GLfloat)NUM2INT(arg3);
1094
- ustride = (GLint)NUM2INT(arg4);
1095
- uorder = (GLint)NUM2INT(arg5);
1096
- v1 = (GLfloat)NUM2INT(arg6);
1097
- v2 = (GLfloat)NUM2INT(arg7);
1098
- vstride = (GLint)NUM2INT(arg8);
1099
- vorder = (GLint)NUM2INT(arg9);
1100
- points = ALLOC_N(GLfloat, MAX(ustride*uorder, vstride*vorder));
1101
- work_ary = rb_funcall(arg10,rb_intern("flatten"),0);
1102
- ary2cflt(work_ary, points, MAX(ustride*uorder, vstride*vorder));
1103
- glMap2f(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points);
1104
- xfree(points);
1105
- CHECK_GLERROR_FROM("glMap2f");
1106
- return Qnil;
1078
+ GLenum target;
1079
+ GLfloat u1;
1080
+ GLfloat u2;
1081
+ GLint ustride;
1082
+ GLint uorder;
1083
+ GLfloat v1;
1084
+ GLfloat v2;
1085
+ GLint vstride;
1086
+ GLint vorder;
1087
+ GLfloat *points;
1088
+
1089
+ VALUE work_ary;
1090
+
1091
+ target = (GLenum)NUM2INT(arg1);
1092
+ u1 = (GLfloat)NUM2INT(arg2);
1093
+ u2 = (GLfloat)NUM2INT(arg3);
1094
+ ustride = (GLint)NUM2INT(arg4);
1095
+ uorder = (GLint)NUM2INT(arg5);
1096
+ v1 = (GLfloat)NUM2INT(arg6);
1097
+ v2 = (GLfloat)NUM2INT(arg7);
1098
+ vstride = (GLint)NUM2INT(arg8);
1099
+ vorder = (GLint)NUM2INT(arg9);
1100
+ points = ALLOC_N(GLfloat, MAX(ustride*uorder, vstride*vorder));
1101
+ work_ary = rb_funcall(arg10,rb_intern("flatten"),0);
1102
+ ary2cflt(work_ary, points, MAX(ustride*uorder, vstride*vorder));
1103
+ glMap2f(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points);
1104
+ xfree(points);
1105
+ CHECK_GLERROR_FROM("glMap2f");
1106
+ return Qnil;
1107
1107
  }
1108
1108
 
1109
1109
  static VALUE
1110
1110
  gl_EvalCoord1dv(obj,arg1)
1111
1111
  VALUE obj,arg1;
1112
1112
  {
1113
- GLdouble params[1] = {0.0};
1114
- Check_Type(arg1,T_ARRAY);
1115
- ary2cdbl(arg1,params,1);
1116
- glEvalCoord1dv(params);
1117
- CHECK_GLERROR_FROM("glEvalCoord1dv");
1118
- return Qnil;
1113
+ GLdouble params[1] = {0.0};
1114
+ Check_Type(arg1,T_ARRAY);
1115
+ ary2cdbl(arg1,params,1);
1116
+ glEvalCoord1dv(params);
1117
+ CHECK_GLERROR_FROM("glEvalCoord1dv");
1118
+ return Qnil;
1119
1119
  }
1120
1120
 
1121
1121
  static VALUE
1122
1122
  gl_EvalCoord1fv(obj,arg1)
1123
1123
  VALUE obj,arg1;
1124
1124
  {
1125
- GLfloat params[1] = {(GLfloat)0.0};
1126
- Check_Type(arg1,T_ARRAY);
1127
- ary2cflt(arg1,params,1);
1128
- glEvalCoord1fv(params);
1129
- CHECK_GLERROR_FROM("glEvalCoord1fv");
1130
- return Qnil;
1125
+ GLfloat params[1] = {(GLfloat)0.0};
1126
+ Check_Type(arg1,T_ARRAY);
1127
+ ary2cflt(arg1,params,1);
1128
+ glEvalCoord1fv(params);
1129
+ CHECK_GLERROR_FROM("glEvalCoord1fv");
1130
+ return Qnil;
1131
1131
  }
1132
1132
 
1133
1133
  static VALUE
1134
1134
  gl_EvalCoord2dv(obj,arg1)
1135
1135
  VALUE obj,arg1;
1136
1136
  {
1137
- GLdouble params[2] = {0.0,0.0};
1138
- Check_Type(arg1,T_ARRAY);
1139
- ary2cdbl(arg1,params,2);
1140
- glEvalCoord2dv(params);
1141
- CHECK_GLERROR_FROM("glEvalCoord2fv");
1142
- return Qnil;
1137
+ GLdouble params[2] = {0.0,0.0};
1138
+ Check_Type(arg1,T_ARRAY);
1139
+ ary2cdbl(arg1,params,2);
1140
+ glEvalCoord2dv(params);
1141
+ CHECK_GLERROR_FROM("glEvalCoord2fv");
1142
+ return Qnil;
1143
1143
  }
1144
1144
 
1145
1145
  static VALUE
1146
1146
  gl_EvalCoord2fv(obj,arg1)
1147
1147
  VALUE obj,arg1;
1148
1148
  {
1149
- GLfloat params[2] = {(GLfloat)0.0,(GLfloat)0.0};
1150
- Check_Type(arg1,T_ARRAY);
1151
- ary2cflt(arg1,params,2);
1152
- glEvalCoord2fv(params);
1153
- CHECK_GLERROR_FROM("glEvalCoord2fv");
1154
- return Qnil;
1149
+ GLfloat params[2] = {(GLfloat)0.0,(GLfloat)0.0};
1150
+ Check_Type(arg1,T_ARRAY);
1151
+ ary2cflt(arg1,params,2);
1152
+ glEvalCoord2fv(params);
1153
+ CHECK_GLERROR_FROM("glEvalCoord2fv");
1154
+ return Qnil;
1155
1155
  }
1156
1156
 
1157
1157
 
@@ -1162,33 +1162,33 @@ int argc; \
1162
1162
  VALUE *argv; \
1163
1163
  VALUE obj; \
1164
1164
  { \
1165
- GLenum map; \
1166
- _vartype_ *values; \
1167
- GLsizei size; \
1168
- VALUE args[4]; \
1169
- switch(rb_scan_args(argc, argv, "21", &args[0], &args[1], &args[2])) { \
1170
- default: \
1171
- case 2: \
1172
- if (CheckBufferBinding(GL_PIXEL_UNPACK_BUFFER_BINDING)) \
1173
- rb_raise(rb_eArgError, "Pixel unpack buffer bound, but offset argument missing"); \
1174
- map = (GLenum)NUM2INT(args[0]); \
1175
- Check_Type(args[1],T_ARRAY); \
1176
- size = (int)RARRAY_LENINT(args[1]); \
1177
- values = ALLOC_N(_vartype_,size); \
1178
- _convert_(args[1],values,size); \
1179
- glPixelMap##_type_##v(map,size,values); \
1180
- xfree(values); \
1181
- break; \
1182
- case 3: \
1183
- if (!CheckBufferBinding(GL_PIXEL_UNPACK_BUFFER_BINDING)) \
1184
- rb_raise(rb_eArgError, "Pixel unpack buffer not bound"); \
1185
- map = (GLenum)NUM2INT(args[0]); \
1186
- size = (GLsizei)NUM2INT(args[1]); \
1187
- glPixelMap##_type_##v(map,size,(GLvoid *)NUM2LONG(args[2])); \
1188
- break; \
1189
- } \
1190
- CHECK_GLERROR_FROM("glPixelMap" #_type_ "v"); \
1191
- return Qnil; \
1165
+ GLenum map; \
1166
+ _vartype_ *values; \
1167
+ GLsizei size; \
1168
+ VALUE args[4]; \
1169
+ switch(rb_scan_args(argc, argv, "21", &args[0], &args[1], &args[2])) { \
1170
+ default: \
1171
+ case 2: \
1172
+ if (CheckBufferBinding(GL_PIXEL_UNPACK_BUFFER_BINDING)) \
1173
+ rb_raise(rb_eArgError, "Pixel unpack buffer bound, but offset argument missing"); \
1174
+ map = (GLenum)NUM2INT(args[0]); \
1175
+ Check_Type(args[1],T_ARRAY); \
1176
+ size = (int)RARRAY_LENINT(args[1]); \
1177
+ values = ALLOC_N(_vartype_,size); \
1178
+ _convert_(args[1],values,size); \
1179
+ glPixelMap##_type_##v(map,size,values); \
1180
+ xfree(values); \
1181
+ break; \
1182
+ case 3: \
1183
+ if (!CheckBufferBinding(GL_PIXEL_UNPACK_BUFFER_BINDING)) \
1184
+ rb_raise(rb_eArgError, "Pixel unpack buffer not bound"); \
1185
+ map = (GLenum)NUM2INT(args[0]); \
1186
+ size = (GLsizei)NUM2INT(args[1]); \
1187
+ glPixelMap##_type_##v(map,size,(GLvoid *)NUM2SIZET(args[2])); \
1188
+ break; \
1189
+ } \
1190
+ CHECK_GLERROR_FROM("glPixelMap" #_type_ "v"); \
1191
+ return Qnil; \
1192
1192
  }
1193
1193
 
1194
1194
  GLPIXELMAP_FUNC(f,GLfloat,ary2cflt)
@@ -1203,88 +1203,88 @@ int argc;
1203
1203
  VALUE *argv;
1204
1204
  VALUE obj;
1205
1205
  {
1206
- GLint x;
1207
- GLint y;
1208
- GLsizei width;
1209
- GLsizei height;
1210
- int format;
1211
- int type;
1212
- VALUE pixels;
1213
- VALUE args[7];
1214
- int numargs;
1215
- numargs = rb_scan_args(argc, argv, "61", &args[0], &args[1], &args[2], &args[3], &args[4], &args[5], &args[6]);
1216
- x = (GLint)NUM2INT(args[0]);
1217
- y = (GLint)NUM2INT(args[1]);
1218
- width = (GLsizei)NUM2UINT(args[2]);
1219
- height = (GLsizei)NUM2UINT(args[3]);
1220
- format = NUM2INT(args[4]);
1221
- type = NUM2INT(args[5]);
1222
-
1223
- switch(numargs) {
1224
- default:
1225
- case 6:
1226
- if (CheckBufferBinding(GL_PIXEL_PACK_BUFFER_BINDING))
1227
- rb_raise(rb_eArgError, "Pixel pack buffer bound, but offset argument missing");
1228
- pixels = allocate_buffer_with_string(GetDataSize(type,format,width*height));
1229
- FORCE_PIXEL_STORE_MODE
1230
- glReadPixels(x,y,width,height,format,type,(GLvoid*)RSTRING_PTR(pixels));
1231
- RESTORE_PIXEL_STORE_MODE
1232
- CHECK_GLERROR_FROM("glReadPixels");
1233
- return pixels;
1234
- break;
1235
- case 7:
1236
- if (!CheckBufferBinding(GL_PIXEL_PACK_BUFFER_BINDING))
1237
- rb_raise(rb_eArgError, "Pixel pack buffer not bound");
1238
- FORCE_PIXEL_STORE_MODE
1239
- glReadPixels(x,y,width,height,format,type,(GLvoid*)NUM2LONG(args[6]));
1240
- RESTORE_PIXEL_STORE_MODE
1241
- CHECK_GLERROR_FROM("glReadPixels");
1242
- return Qnil;
1243
- break;
1244
- }
1206
+ GLint x;
1207
+ GLint y;
1208
+ GLsizei width;
1209
+ GLsizei height;
1210
+ int format;
1211
+ int type;
1212
+ VALUE pixels;
1213
+ VALUE args[7];
1214
+ int numargs;
1215
+ numargs = rb_scan_args(argc, argv, "61", &args[0], &args[1], &args[2], &args[3], &args[4], &args[5], &args[6]);
1216
+ x = (GLint)NUM2INT(args[0]);
1217
+ y = (GLint)NUM2INT(args[1]);
1218
+ width = (GLsizei)NUM2UINT(args[2]);
1219
+ height = (GLsizei)NUM2UINT(args[3]);
1220
+ format = NUM2INT(args[4]);
1221
+ type = NUM2INT(args[5]);
1222
+
1223
+ switch(numargs) {
1224
+ default:
1225
+ case 6:
1226
+ if (CheckBufferBinding(GL_PIXEL_PACK_BUFFER_BINDING))
1227
+ rb_raise(rb_eArgError, "Pixel pack buffer bound, but offset argument missing");
1228
+ pixels = allocate_buffer_with_string(GetDataSize(type,format,width*height));
1229
+ FORCE_PIXEL_STORE_MODE
1230
+ glReadPixels(x,y,width,height,format,type,(GLvoid*)RSTRING_PTR(pixels));
1231
+ RESTORE_PIXEL_STORE_MODE
1232
+ CHECK_GLERROR_FROM("glReadPixels");
1233
+ return pixels;
1234
+ break;
1235
+ case 7:
1236
+ if (!CheckBufferBinding(GL_PIXEL_PACK_BUFFER_BINDING))
1237
+ rb_raise(rb_eArgError, "Pixel pack buffer not bound");
1238
+ FORCE_PIXEL_STORE_MODE
1239
+ glReadPixels(x,y,width,height,format,type,(GLvoid*)NUM2SIZET(args[6]));
1240
+ RESTORE_PIXEL_STORE_MODE
1241
+ CHECK_GLERROR_FROM("glReadPixels");
1242
+ return Qnil;
1243
+ break;
1244
+ }
1245
1245
  }
1246
1246
 
1247
1247
  static VALUE
1248
1248
  gl_DrawPixels(obj,arg1,arg2,arg3,arg4,arg5)
1249
1249
  VALUE obj,arg1,arg2,arg3,arg4,arg5;
1250
1250
  {
1251
- GLsizei width;
1252
- GLsizei height;
1253
- GLenum format;
1254
- GLenum type;
1255
- const char *pixels;
1256
- width = (GLsizei)NUM2UINT(arg1);
1257
- height = (GLsizei)NUM2UINT(arg2);
1258
- format = (GLenum)NUM2INT(arg3);
1259
- type = (GLenum)NUM2INT(arg4);
1260
- if (CheckBufferBinding(GL_PIXEL_UNPACK_BUFFER_BINDING)) {
1261
- glDrawPixels(width,height,format,type,(GLvoid *)NUM2LONG(arg5));
1262
- } else {
1263
- VALUE data;
1264
- data = pack_array_or_pass_string(type,arg5);
1265
- CheckDataSize(type,format,width*height,data);
1266
- pixels = RSTRING_PTR(data);
1267
- glDrawPixels(width,height,format,type,pixels);
1268
- }
1269
- CHECK_GLERROR_FROM("glDrawPixels");
1270
- return Qnil;
1251
+ GLsizei width;
1252
+ GLsizei height;
1253
+ GLenum format;
1254
+ GLenum type;
1255
+ const char *pixels;
1256
+ width = (GLsizei)NUM2UINT(arg1);
1257
+ height = (GLsizei)NUM2UINT(arg2);
1258
+ format = (GLenum)NUM2INT(arg3);
1259
+ type = (GLenum)NUM2INT(arg4);
1260
+ if (CheckBufferBinding(GL_PIXEL_UNPACK_BUFFER_BINDING)) {
1261
+ glDrawPixels(width,height,format,type,(GLvoid *)NUM2SIZET(arg5));
1262
+ } else {
1263
+ VALUE data;
1264
+ data = pack_array_or_pass_string(type,arg5);
1265
+ CheckDataSize(type,format,width*height,data);
1266
+ pixels = RSTRING_PTR(data);
1267
+ glDrawPixels(width,height,format,type,pixels);
1268
+ }
1269
+ CHECK_GLERROR_FROM("glDrawPixels");
1270
+ return Qnil;
1271
1271
  }
1272
1272
 
1273
1273
  static VALUE
1274
1274
  gl_GetClipPlane(obj,arg1)
1275
1275
  VALUE obj,arg1;
1276
1276
  {
1277
- GLenum plane;
1278
- GLdouble equation[4] = {0.0,0.0,0.0,0.0};
1279
- VALUE retary;
1280
- int i;
1281
- plane = (GLenum)NUM2INT(arg1);
1282
- glGetClipPlane(plane,equation);
1283
- retary = rb_ary_new2(4);
1284
- for(i=0;i<4;i++)
1285
- rb_ary_push(retary, rb_float_new(equation[i]));
1286
- CHECK_GLERROR_FROM("glGetClipPlane");
1287
- return retary;
1277
+ GLenum plane;
1278
+ GLdouble equation[4] = {0.0,0.0,0.0,0.0};
1279
+ VALUE retary;
1280
+ int i;
1281
+ plane = (GLenum)NUM2INT(arg1);
1282
+ glGetClipPlane(plane,equation);
1283
+ retary = rb_ary_new2(4);
1284
+ for(i=0;i<4;i++)
1285
+ rb_ary_push(retary, rb_float_new(equation[i]));
1286
+ CHECK_GLERROR_FROM("glGetClipPlane");
1287
+ return retary;
1288
1288
  }
1289
1289
 
1290
1290
  #define GLGET_FUNC(_name_,_type_,_conv_) \
@@ -1292,143 +1292,143 @@ static VALUE \
1292
1292
  gl_Get##_name_##v(obj,arg1) \
1293
1293
  VALUE obj,arg1; \
1294
1294
  { \
1295
- GLenum pname; \
1296
- int nitems; \
1297
- VALUE ary, ary2; \
1298
- int i,j; \
1299
- _type_ items[64]; \
1300
- pname = NUM2INT(arg1); \
1301
- switch(pname) { \
1302
- case GL_ACCUM_CLEAR_VALUE: \
1303
- case GL_BLEND_COLOR: \
1304
- case GL_COLOR_CLEAR_VALUE: \
1305
- case GL_COLOR_WRITEMASK: \
1306
- case GL_CURRENT_COLOR: \
1307
- case GL_CURRENT_RASTER_COLOR: \
1308
- case GL_CURRENT_RASTER_POSITION: \
1309
- case GL_CURRENT_RASTER_SECONDARY_COLOR: \
1310
- case GL_CURRENT_RASTER_TEXTURE_COORDS: \
1311
- case GL_CURRENT_TEXTURE_COORDS: \
1312
- case GL_FOG_COLOR: \
1313
- case GL_LIGHT_MODEL_AMBIENT: \
1314
- case GL_MAP2_GRID_DOMAIN: \
1315
- case GL_CURRENT_SECONDARY_COLOR: \
1316
- case GL_SCISSOR_BOX: \
1317
- case GL_TEXTURE_ENV_COLOR: \
1318
- case GL_VIEWPORT: \
1319
- case GL_REFERENCE_PLANE_EQUATION_SGIX: \
1320
- case GL_FOG_OFFSET_VALUE_SGIX: \
1321
- case GL_TEXTURE_ENV_BIAS_SGIX: \
1322
- case GL_CULL_VERTEX_OBJECT_POSITION_EXT: \
1323
- case GL_CULL_VERTEX_EYE_POSITION_EXT: \
1324
- case GL_FRAGMENT_LIGHT_MODEL_AMBIENT_SGIX: \
1325
- case GL_CONSTANT_COLOR0_NV: \
1326
- case GL_CONSTANT_COLOR1_NV: \
1327
- case GL_TEXTURE_COLOR_WRITEMASK_SGIS: \
1328
- case GL_FLOAT_CLEAR_COLOR_VALUE_NV: \
1295
+ GLenum pname; \
1296
+ int nitems; \
1297
+ VALUE ary, ary2; \
1298
+ int i,j; \
1299
+ _type_ items[64]; \
1300
+ pname = NUM2INT(arg1); \
1301
+ switch(pname) { \
1302
+ case GL_ACCUM_CLEAR_VALUE: \
1303
+ case GL_BLEND_COLOR: \
1304
+ case GL_COLOR_CLEAR_VALUE: \
1305
+ case GL_COLOR_WRITEMASK: \
1306
+ case GL_CURRENT_COLOR: \
1307
+ case GL_CURRENT_RASTER_COLOR: \
1308
+ case GL_CURRENT_RASTER_POSITION: \
1309
+ case GL_CURRENT_RASTER_SECONDARY_COLOR: \
1310
+ case GL_CURRENT_RASTER_TEXTURE_COORDS: \
1311
+ case GL_CURRENT_TEXTURE_COORDS: \
1312
+ case GL_FOG_COLOR: \
1313
+ case GL_LIGHT_MODEL_AMBIENT: \
1314
+ case GL_MAP2_GRID_DOMAIN: \
1315
+ case GL_CURRENT_SECONDARY_COLOR: \
1316
+ case GL_SCISSOR_BOX: \
1317
+ case GL_TEXTURE_ENV_COLOR: \
1318
+ case GL_VIEWPORT: \
1319
+ case GL_REFERENCE_PLANE_EQUATION_SGIX: \
1320
+ case GL_FOG_OFFSET_VALUE_SGIX: \
1321
+ case GL_TEXTURE_ENV_BIAS_SGIX: \
1322
+ case GL_CULL_VERTEX_OBJECT_POSITION_EXT: \
1323
+ case GL_CULL_VERTEX_EYE_POSITION_EXT: \
1324
+ case GL_FRAGMENT_LIGHT_MODEL_AMBIENT_SGIX: \
1325
+ case GL_CONSTANT_COLOR0_NV: \
1326
+ case GL_CONSTANT_COLOR1_NV: \
1327
+ case GL_TEXTURE_COLOR_WRITEMASK_SGIS: \
1328
+ case GL_FLOAT_CLEAR_COLOR_VALUE_NV: \
1329
1329
  case GL_RGBA_SIGNED_COMPONENTS_EXT: \
1330
- nitems = 4; \
1331
- break; \
1332
- case GL_CURRENT_NORMAL: \
1333
- case GL_POINT_DISTANCE_ATTENUATION: \
1334
- case GL_SPRITE_AXIS_SGIX: \
1335
- case GL_SPRITE_TRANSLATION_SGIX: \
1336
- case GL_CURRENT_RASTER_NORMAL_SGIX: \
1337
- case GL_CURRENT_TANGENT_EXT: \
1338
- case GL_CURRENT_BINORMAL_EXT: \
1339
- nitems = 3; \
1340
- break; \
1341
- case GL_DEPTH_RANGE: \
1342
- case GL_LINE_WIDTH_RANGE: \
1343
- case GL_MAP1_GRID_DOMAIN: \
1344
- case GL_MAP2_GRID_SEGMENTS: \
1345
- case GL_MAX_VIEWPORT_DIMS: \
1346
- case GL_POINT_SIZE_RANGE: \
1347
- case GL_POLYGON_MODE: \
1348
- case GL_ALIASED_LINE_WIDTH_RANGE: \
1349
- case GL_ALIASED_POINT_SIZE_RANGE: \
1350
- case GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX: \
1351
- case GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX: \
1352
- case GL_FOG_FUNC_SGIS: \
1353
- case GL_DEPTH_BOUNDS_EXT: \
1354
- nitems = 2; \
1355
- break; \
1356
- case GL_MODELVIEW_MATRIX: \
1357
- case GL_PROJECTION_MATRIX: \
1358
- case GL_TEXTURE_MATRIX: \
1359
- case GL_COLOR_MATRIX: \
1360
- case GL_TRANSPOSE_MODELVIEW_MATRIX: \
1361
- case GL_TRANSPOSE_PROJECTION_MATRIX: \
1362
- case GL_TRANSPOSE_TEXTURE_MATRIX: \
1363
- case GL_TRANSPOSE_COLOR_MATRIX: \
1364
- case GL_TRANSPOSE_CURRENT_MATRIX_ARB: \
1365
- case GL_MODELVIEW0_ARB: \
1366
- case GL_MODELVIEW1_ARB: \
1367
- case GL_MODELVIEW2_ARB: \
1368
- case GL_MODELVIEW3_ARB: \
1369
- case GL_MODELVIEW4_ARB: \
1370
- case GL_MODELVIEW5_ARB: \
1371
- case GL_MODELVIEW6_ARB: \
1372
- case GL_MODELVIEW7_ARB: \
1373
- case GL_MODELVIEW8_ARB: \
1374
- case GL_MODELVIEW9_ARB: \
1375
- case GL_MODELVIEW10_ARB: \
1376
- case GL_MODELVIEW11_ARB: \
1377
- case GL_MODELVIEW12_ARB: \
1378
- case GL_MODELVIEW13_ARB: \
1379
- case GL_MODELVIEW14_ARB: \
1380
- case GL_MODELVIEW15_ARB: \
1381
- case GL_MODELVIEW16_ARB: \
1382
- case GL_MODELVIEW17_ARB: \
1383
- case GL_MODELVIEW18_ARB: \
1384
- case GL_MODELVIEW19_ARB: \
1385
- case GL_MODELVIEW20_ARB: \
1386
- case GL_MODELVIEW21_ARB: \
1387
- case GL_MODELVIEW22_ARB: \
1388
- case GL_MODELVIEW23_ARB: \
1389
- case GL_MODELVIEW24_ARB: \
1390
- case GL_MODELVIEW25_ARB: \
1391
- case GL_MODELVIEW26_ARB: \
1392
- case GL_MODELVIEW27_ARB: \
1393
- case GL_MODELVIEW28_ARB: \
1394
- case GL_MODELVIEW29_ARB: \
1395
- case GL_MODELVIEW30_ARB: \
1396
- case GL_MODELVIEW31_ARB: \
1397
- case GL_MATRIX_PALETTE_ARB: \
1398
- case GL_PIXEL_TRANSFORM_2D_MATRIX_EXT: \
1399
- case GL_MODELVIEW1_MATRIX_EXT: \
1400
- case GL_CURRENT_MATRIX_NV: \
1401
- glGet##_name_##v(pname, items); \
1402
- ary = rb_ary_new2(4); \
1403
- for (i = 0; i < 4; i++) { \
1404
- ary2 = rb_ary_new2(4); \
1405
- rb_ary_push(ary, ary2); \
1406
- for (j = 0; j < 4; j++) \
1407
- rb_ary_push(ary2, _conv_(items[i*4+j])); \
1408
- } \
1409
- CHECK_GLERROR_FROM("glGet" #_name_ "v"); \
1410
- return ary; \
1411
- case GL_POLYGON_STIPPLE: \
1412
- glGet##_name_##v(pname, items); \
1413
- CHECK_GLERROR_FROM("glGet" #_name_ "v"); \
1414
- return rb_str_new((const char*)items, 32); \
1415
- case GL_COMPRESSED_TEXTURE_FORMATS: \
1416
- glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &nitems); \
1417
- CHECK_GLERROR_FROM("glGetIntegerv"); \
1418
- if (nitems<=0||nitems>64) \
1419
- return INT2NUM(0); \
1420
- break; \
1421
- default: /* size=1 */ \
1422
- glGet##_name_##v(pname, items); \
1423
- CHECK_GLERROR_FROM("glGet" #_name_ "v"); \
1424
- return _conv_(items[0]); \
1425
- } \
1426
- glGet##_name_##v(pname, items); \
1427
- ary = rb_ary_new2(nitems); \
1428
- for (i = 0; i < nitems; i++) \
1429
- rb_ary_push(ary, _conv_(items[i])); \
1430
- CHECK_GLERROR_FROM("glGet" #_name_ "v"); \
1431
- return ary; \
1330
+ nitems = 4; \
1331
+ break; \
1332
+ case GL_CURRENT_NORMAL: \
1333
+ case GL_POINT_DISTANCE_ATTENUATION: \
1334
+ case GL_SPRITE_AXIS_SGIX: \
1335
+ case GL_SPRITE_TRANSLATION_SGIX: \
1336
+ case GL_CURRENT_RASTER_NORMAL_SGIX: \
1337
+ case GL_CURRENT_TANGENT_EXT: \
1338
+ case GL_CURRENT_BINORMAL_EXT: \
1339
+ nitems = 3; \
1340
+ break; \
1341
+ case GL_DEPTH_RANGE: \
1342
+ case GL_LINE_WIDTH_RANGE: \
1343
+ case GL_MAP1_GRID_DOMAIN: \
1344
+ case GL_MAP2_GRID_SEGMENTS: \
1345
+ case GL_MAX_VIEWPORT_DIMS: \
1346
+ case GL_POINT_SIZE_RANGE: \
1347
+ case GL_POLYGON_MODE: \
1348
+ case GL_ALIASED_LINE_WIDTH_RANGE: \
1349
+ case GL_ALIASED_POINT_SIZE_RANGE: \
1350
+ case GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX: \
1351
+ case GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX: \
1352
+ case GL_FOG_FUNC_SGIS: \
1353
+ case GL_DEPTH_BOUNDS_EXT: \
1354
+ nitems = 2; \
1355
+ break; \
1356
+ case GL_MODELVIEW_MATRIX: \
1357
+ case GL_PROJECTION_MATRIX: \
1358
+ case GL_TEXTURE_MATRIX: \
1359
+ case GL_COLOR_MATRIX: \
1360
+ case GL_TRANSPOSE_MODELVIEW_MATRIX: \
1361
+ case GL_TRANSPOSE_PROJECTION_MATRIX: \
1362
+ case GL_TRANSPOSE_TEXTURE_MATRIX: \
1363
+ case GL_TRANSPOSE_COLOR_MATRIX: \
1364
+ case GL_TRANSPOSE_CURRENT_MATRIX_ARB: \
1365
+ case GL_MODELVIEW0_ARB: \
1366
+ case GL_MODELVIEW1_ARB: \
1367
+ case GL_MODELVIEW2_ARB: \
1368
+ case GL_MODELVIEW3_ARB: \
1369
+ case GL_MODELVIEW4_ARB: \
1370
+ case GL_MODELVIEW5_ARB: \
1371
+ case GL_MODELVIEW6_ARB: \
1372
+ case GL_MODELVIEW7_ARB: \
1373
+ case GL_MODELVIEW8_ARB: \
1374
+ case GL_MODELVIEW9_ARB: \
1375
+ case GL_MODELVIEW10_ARB: \
1376
+ case GL_MODELVIEW11_ARB: \
1377
+ case GL_MODELVIEW12_ARB: \
1378
+ case GL_MODELVIEW13_ARB: \
1379
+ case GL_MODELVIEW14_ARB: \
1380
+ case GL_MODELVIEW15_ARB: \
1381
+ case GL_MODELVIEW16_ARB: \
1382
+ case GL_MODELVIEW17_ARB: \
1383
+ case GL_MODELVIEW18_ARB: \
1384
+ case GL_MODELVIEW19_ARB: \
1385
+ case GL_MODELVIEW20_ARB: \
1386
+ case GL_MODELVIEW21_ARB: \
1387
+ case GL_MODELVIEW22_ARB: \
1388
+ case GL_MODELVIEW23_ARB: \
1389
+ case GL_MODELVIEW24_ARB: \
1390
+ case GL_MODELVIEW25_ARB: \
1391
+ case GL_MODELVIEW26_ARB: \
1392
+ case GL_MODELVIEW27_ARB: \
1393
+ case GL_MODELVIEW28_ARB: \
1394
+ case GL_MODELVIEW29_ARB: \
1395
+ case GL_MODELVIEW30_ARB: \
1396
+ case GL_MODELVIEW31_ARB: \
1397
+ case GL_MATRIX_PALETTE_ARB: \
1398
+ case GL_PIXEL_TRANSFORM_2D_MATRIX_EXT: \
1399
+ case GL_MODELVIEW1_MATRIX_EXT: \
1400
+ case GL_CURRENT_MATRIX_NV: \
1401
+ glGet##_name_##v(pname, items); \
1402
+ ary = rb_ary_new2(4); \
1403
+ for (i = 0; i < 4; i++) { \
1404
+ ary2 = rb_ary_new2(4); \
1405
+ rb_ary_push(ary, ary2); \
1406
+ for (j = 0; j < 4; j++) \
1407
+ rb_ary_push(ary2, _conv_(items[i*4+j])); \
1408
+ } \
1409
+ CHECK_GLERROR_FROM("glGet" #_name_ "v"); \
1410
+ return ary; \
1411
+ case GL_POLYGON_STIPPLE: \
1412
+ glGet##_name_##v(pname, items); \
1413
+ CHECK_GLERROR_FROM("glGet" #_name_ "v"); \
1414
+ return rb_str_new((const char*)items, 32); \
1415
+ case GL_COMPRESSED_TEXTURE_FORMATS: \
1416
+ glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &nitems); \
1417
+ CHECK_GLERROR_FROM("glGetIntegerv"); \
1418
+ if (nitems<=0||nitems>64) \
1419
+ return INT2NUM(0); \
1420
+ break; \
1421
+ default: /* size=1 */ \
1422
+ glGet##_name_##v(pname, items); \
1423
+ CHECK_GLERROR_FROM("glGet" #_name_ "v"); \
1424
+ return _conv_(items[0]); \
1425
+ } \
1426
+ glGet##_name_##v(pname, items); \
1427
+ ary = rb_ary_new2(nitems); \
1428
+ for (i = 0; i < nitems; i++) \
1429
+ rb_ary_push(ary, _conv_(items[i])); \
1430
+ CHECK_GLERROR_FROM("glGet" #_name_ "v"); \
1431
+ return ary; \
1432
1432
  }
1433
1433
 
1434
1434
  GLGET_FUNC(Double,GLdouble,rb_float_new)
@@ -1443,70 +1443,70 @@ static VALUE
1443
1443
  gl_GetLightfv(obj,arg1,arg2)
1444
1444
  VALUE obj,arg1,arg2;
1445
1445
  {
1446
- GLenum light;
1447
- GLenum pname;
1448
- GLsizei size;
1449
- GLfloat params[4] = {(GLfloat)0.0, (GLfloat)0.0, (GLfloat)0.0, (GLfloat)0.0};
1450
- light = (GLenum)NUM2INT(arg1);
1451
- pname = (GLenum)NUM2INT(arg2);
1452
- switch(pname) {
1453
- case GL_AMBIENT:
1454
- case GL_DIFFUSE:
1455
- case GL_SPECULAR:
1456
- case GL_POSITION:
1457
- size = 4;
1458
- break;
1459
- case GL_SPOT_DIRECTION:
1460
- size = 3;
1461
- break;
1462
- case GL_CONSTANT_ATTENUATION:
1463
- case GL_LINEAR_ATTENUATION:
1464
- case GL_QUADRATIC_ATTENUATION:
1465
- case GL_SPOT_EXPONENT:
1466
- case GL_SPOT_CUTOFF:
1467
- size = 1;
1468
- break;
1469
- default:
1470
- rb_raise(rb_eArgError, "unknown pname:%d",pname);
1471
- break; /* not reached */
1472
- }
1473
- glGetLightfv(light,pname,params);
1474
- RET_ARRAY_OR_SINGLE("glGetLightfv", size, rb_float_new, params);
1446
+ GLenum light;
1447
+ GLenum pname;
1448
+ GLsizei size;
1449
+ GLfloat params[4] = {(GLfloat)0.0, (GLfloat)0.0, (GLfloat)0.0, (GLfloat)0.0};
1450
+ light = (GLenum)NUM2INT(arg1);
1451
+ pname = (GLenum)NUM2INT(arg2);
1452
+ switch(pname) {
1453
+ case GL_AMBIENT:
1454
+ case GL_DIFFUSE:
1455
+ case GL_SPECULAR:
1456
+ case GL_POSITION:
1457
+ size = 4;
1458
+ break;
1459
+ case GL_SPOT_DIRECTION:
1460
+ size = 3;
1461
+ break;
1462
+ case GL_CONSTANT_ATTENUATION:
1463
+ case GL_LINEAR_ATTENUATION:
1464
+ case GL_QUADRATIC_ATTENUATION:
1465
+ case GL_SPOT_EXPONENT:
1466
+ case GL_SPOT_CUTOFF:
1467
+ size = 1;
1468
+ break;
1469
+ default:
1470
+ rb_raise(rb_eArgError, "unknown pname:%d",pname);
1471
+ break; /* not reached */
1472
+ }
1473
+ glGetLightfv(light,pname,params);
1474
+ RET_ARRAY_OR_SINGLE("glGetLightfv", size, rb_float_new, params);
1475
1475
  }
1476
1476
 
1477
1477
  static VALUE
1478
1478
  gl_GetLightiv(obj,arg1,arg2)
1479
1479
  VALUE obj,arg1,arg2;
1480
1480
  {
1481
- GLenum light;
1482
- GLenum pname;
1483
- GLsizei size;
1484
- GLint params[4] = {0,0,0,0};
1485
- light = (GLenum)NUM2INT(arg1);
1486
- pname = (GLenum)NUM2INT(arg2);
1487
- switch(pname) {
1488
- case GL_AMBIENT:
1489
- case GL_DIFFUSE:
1490
- case GL_SPECULAR:
1491
- case GL_POSITION:
1492
- size = 4;
1493
- break;
1494
- case GL_SPOT_DIRECTION:
1495
- size = 3;
1496
- break;
1497
- case GL_CONSTANT_ATTENUATION:
1498
- case GL_LINEAR_ATTENUATION:
1499
- case GL_QUADRATIC_ATTENUATION:
1500
- case GL_SPOT_EXPONENT:
1501
- case GL_SPOT_CUTOFF:
1502
- size = 1;
1503
- break;
1504
- default:
1505
- rb_raise(rb_eArgError, "unknown pname:%d",pname);
1506
- break; /* not reached */
1507
- }
1508
- glGetLightiv(light,pname,params);
1509
- RET_ARRAY_OR_SINGLE("glGetLightiv", size, INT2NUM, params);
1481
+ GLenum light;
1482
+ GLenum pname;
1483
+ GLsizei size;
1484
+ GLint params[4] = {0,0,0,0};
1485
+ light = (GLenum)NUM2INT(arg1);
1486
+ pname = (GLenum)NUM2INT(arg2);
1487
+ switch(pname) {
1488
+ case GL_AMBIENT:
1489
+ case GL_DIFFUSE:
1490
+ case GL_SPECULAR:
1491
+ case GL_POSITION:
1492
+ size = 4;
1493
+ break;
1494
+ case GL_SPOT_DIRECTION:
1495
+ size = 3;
1496
+ break;
1497
+ case GL_CONSTANT_ATTENUATION:
1498
+ case GL_LINEAR_ATTENUATION:
1499
+ case GL_QUADRATIC_ATTENUATION:
1500
+ case GL_SPOT_EXPONENT:
1501
+ case GL_SPOT_CUTOFF:
1502
+ size = 1;
1503
+ break;
1504
+ default:
1505
+ rb_raise(rb_eArgError, "unknown pname:%d",pname);
1506
+ break; /* not reached */
1507
+ }
1508
+ glGetLightiv(light,pname,params);
1509
+ RET_ARRAY_OR_SINGLE("glGetLightiv", size, INT2NUM, params);
1510
1510
  }
1511
1511
 
1512
1512
  #define GETMAP_FUNC(_name_,_type_) \
@@ -1514,57 +1514,57 @@ static VALUE \
1514
1514
  gl_##_name_(obj,arg1,arg2) \
1515
1515
  VALUE obj,arg1,arg2; \
1516
1516
  { \
1517
- GLenum target; \
1518
- GLenum query; \
1519
- int dims; \
1520
- int pointsize; \
1521
- int size=0; \
1522
- _type_ *points; \
1523
- GLint order[2] = {0,0}; /* for GL_COEFF, [order] or [uorder,vorder] (MAP1/MAP2) */ \
1524
- target = (GLenum)NUM2INT(arg1); \
1525
- query = (GLenum)NUM2INT(arg2); \
1526
- switch(target) { \
1527
- case GL_MAP1_INDEX: \
1528
- case GL_MAP1_TEXTURE_COORD_1: dims=1; pointsize=1; break; \
1529
- case GL_MAP1_TEXTURE_COORD_2: dims=1; pointsize=2; break; \
1530
- case GL_MAP1_VERTEX_3: \
1531
- case GL_MAP1_NORMAL: \
1532
- case GL_MAP1_TEXTURE_COORD_3: dims=1; pointsize=3; break; \
1533
- case GL_MAP1_COLOR_4: \
1534
- case GL_MAP1_TEXTURE_COORD_4: \
1535
- case GL_MAP1_VERTEX_4: dims=1; pointsize=4; break; \
1536
- case GL_MAP2_INDEX: \
1537
- case GL_MAP2_TEXTURE_COORD_1: dims=2; pointsize=1; break; \
1538
- case GL_MAP2_TEXTURE_COORD_2: dims=2; pointsize=2; break; \
1539
- case GL_MAP2_VERTEX_3: \
1540
- case GL_MAP2_NORMAL: \
1541
- case GL_MAP2_TEXTURE_COORD_3: dims=2; pointsize=3; break; \
1542
- case GL_MAP2_COLOR_4: \
1543
- case GL_MAP2_TEXTURE_COORD_4: \
1544
- case GL_MAP2_VERTEX_4: dims=2; pointsize=4; break; \
1545
- default: \
1546
- rb_raise(rb_eArgError, "unknown target:%d",target); \
1547
- break; /* not reached */ \
1548
- } \
1549
- switch(query) { \
1550
- case GL_ORDER: size = dims; break; \
1551
- case GL_DOMAIN: size = dims*2; break; \
1552
- case GL_COEFF: \
1553
- glGetMapiv(target,GL_ORDER,order); \
1554
- CHECK_GLERROR_FROM("glGetMapiv"); \
1555
- if (dims==1) \
1556
- size = order[0] * pointsize; \
1557
- else \
1558
- size = (order[0]*order[1]) * pointsize; \
1559
- break; \
1560
- default: \
1561
- rb_raise(rb_eArgError, "unknown target:%d",target); \
1562
- break; /* not reached */ \
1563
- } \
1564
- points = ALLOC_N(_type_,size); \
1565
- gl##_name_(target,query,points); \
1517
+ GLenum target; \
1518
+ GLenum query; \
1519
+ int dims; \
1520
+ int pointsize; \
1521
+ int size=0; \
1522
+ _type_ *points; \
1523
+ GLint order[2] = {0,0}; /* for GL_COEFF, [order] or [uorder,vorder] (MAP1/MAP2) */ \
1524
+ target = (GLenum)NUM2INT(arg1); \
1525
+ query = (GLenum)NUM2INT(arg2); \
1526
+ switch(target) { \
1527
+ case GL_MAP1_INDEX: \
1528
+ case GL_MAP1_TEXTURE_COORD_1: dims=1; pointsize=1; break; \
1529
+ case GL_MAP1_TEXTURE_COORD_2: dims=1; pointsize=2; break; \
1530
+ case GL_MAP1_VERTEX_3: \
1531
+ case GL_MAP1_NORMAL: \
1532
+ case GL_MAP1_TEXTURE_COORD_3: dims=1; pointsize=3; break; \
1533
+ case GL_MAP1_COLOR_4: \
1534
+ case GL_MAP1_TEXTURE_COORD_4: \
1535
+ case GL_MAP1_VERTEX_4: dims=1; pointsize=4; break; \
1536
+ case GL_MAP2_INDEX: \
1537
+ case GL_MAP2_TEXTURE_COORD_1: dims=2; pointsize=1; break; \
1538
+ case GL_MAP2_TEXTURE_COORD_2: dims=2; pointsize=2; break; \
1539
+ case GL_MAP2_VERTEX_3: \
1540
+ case GL_MAP2_NORMAL: \
1541
+ case GL_MAP2_TEXTURE_COORD_3: dims=2; pointsize=3; break; \
1542
+ case GL_MAP2_COLOR_4: \
1543
+ case GL_MAP2_TEXTURE_COORD_4: \
1544
+ case GL_MAP2_VERTEX_4: dims=2; pointsize=4; break; \
1545
+ default: \
1546
+ rb_raise(rb_eArgError, "unknown target:%d",target); \
1547
+ break; /* not reached */ \
1548
+ } \
1549
+ switch(query) { \
1550
+ case GL_ORDER: size = dims; break; \
1551
+ case GL_DOMAIN: size = dims*2; break; \
1552
+ case GL_COEFF: \
1553
+ glGetMapiv(target,GL_ORDER,order); \
1554
+ CHECK_GLERROR_FROM("glGetMapiv"); \
1555
+ if (dims==1) \
1556
+ size = order[0] * pointsize; \
1557
+ else \
1558
+ size = (order[0]*order[1]) * pointsize; \
1559
+ break; \
1560
+ default: \
1561
+ rb_raise(rb_eArgError, "unknown target:%d",target); \
1562
+ break; /* not reached */ \
1563
+ } \
1564
+ points = ALLOC_N(_type_,size); \
1565
+ gl##_name_(target,query,points); \
1566
1566
  \
1567
- RET_ARRAY_OR_SINGLE_FREE("gl" #_name_, size, RETCONV_##_type_, points); \
1567
+ RET_ARRAY_OR_SINGLE_FREE("gl" #_name_, size, RETCONV_##_type_, points); \
1568
1568
  }
1569
1569
 
1570
1570
  GETMAP_FUNC(GetMapdv,GLdouble)
@@ -1576,62 +1576,62 @@ static VALUE
1576
1576
  gl_GetMaterialfv(obj,arg1,arg2)
1577
1577
  VALUE obj,arg1,arg2;
1578
1578
  {
1579
- GLenum face;
1580
- GLenum pname;
1581
- GLfloat params[4] = {(GLfloat)0.0, (GLfloat)0.0, (GLfloat)0.0, (GLfloat)0.0};
1582
- int size;
1583
- face = (GLenum)NUM2INT(arg1);
1584
- pname = (GLenum)NUM2INT(arg2);
1585
- switch(pname) {
1586
- case GL_AMBIENT:
1587
- case GL_DIFFUSE:
1588
- case GL_SPECULAR:
1589
- case GL_EMISSION:
1590
- size = 4;
1591
- break;
1592
- case GL_COLOR_INDEXES:
1593
- size = 3;
1594
- break;
1595
- case GL_SHININESS:
1596
- size = 1;
1597
- break;
1598
- default:
1599
- rb_raise(rb_eArgError, "unknown pname:%d",pname);
1600
- break; /* not reached */
1601
- }
1602
- glGetMaterialfv(face,pname,params);
1603
- RET_ARRAY_OR_SINGLE("glGetMaterialfv", size, rb_float_new, params);
1579
+ GLenum face;
1580
+ GLenum pname;
1581
+ GLfloat params[4] = {(GLfloat)0.0, (GLfloat)0.0, (GLfloat)0.0, (GLfloat)0.0};
1582
+ int size;
1583
+ face = (GLenum)NUM2INT(arg1);
1584
+ pname = (GLenum)NUM2INT(arg2);
1585
+ switch(pname) {
1586
+ case GL_AMBIENT:
1587
+ case GL_DIFFUSE:
1588
+ case GL_SPECULAR:
1589
+ case GL_EMISSION:
1590
+ size = 4;
1591
+ break;
1592
+ case GL_COLOR_INDEXES:
1593
+ size = 3;
1594
+ break;
1595
+ case GL_SHININESS:
1596
+ size = 1;
1597
+ break;
1598
+ default:
1599
+ rb_raise(rb_eArgError, "unknown pname:%d",pname);
1600
+ break; /* not reached */
1601
+ }
1602
+ glGetMaterialfv(face,pname,params);
1603
+ RET_ARRAY_OR_SINGLE("glGetMaterialfv", size, rb_float_new, params);
1604
1604
  }
1605
1605
 
1606
1606
  static VALUE
1607
1607
  gl_GetMaterialiv(obj,arg1,arg2)
1608
1608
  VALUE obj,arg1,arg2;
1609
1609
  {
1610
- GLenum face;
1611
- GLenum pname;
1612
- GLint params[4] = {0,0,0,0};
1613
- int size;
1614
- face = (GLenum)NUM2INT(arg1);
1615
- pname = (GLenum)NUM2INT(arg2);
1616
- switch(pname) {
1617
- case GL_AMBIENT:
1618
- case GL_DIFFUSE:
1619
- case GL_SPECULAR:
1620
- case GL_EMISSION:
1621
- size = 4;
1622
- break;
1623
- case GL_COLOR_INDEXES:
1624
- size = 3;
1625
- break;
1626
- case GL_SHININESS:
1627
- size = 1;
1628
- break;
1629
- default:
1630
- rb_raise(rb_eArgError, "unknown pname:%d",pname);
1631
- break; /* not reached */
1632
- }
1633
- glGetMaterialiv(face,pname,params);
1634
- RET_ARRAY_OR_SINGLE("glGetMaterialiv", size, INT2NUM, params);
1610
+ GLenum face;
1611
+ GLenum pname;
1612
+ GLint params[4] = {0,0,0,0};
1613
+ int size;
1614
+ face = (GLenum)NUM2INT(arg1);
1615
+ pname = (GLenum)NUM2INT(arg2);
1616
+ switch(pname) {
1617
+ case GL_AMBIENT:
1618
+ case GL_DIFFUSE:
1619
+ case GL_SPECULAR:
1620
+ case GL_EMISSION:
1621
+ size = 4;
1622
+ break;
1623
+ case GL_COLOR_INDEXES:
1624
+ size = 3;
1625
+ break;
1626
+ case GL_SHININESS:
1627
+ size = 1;
1628
+ break;
1629
+ default:
1630
+ rb_raise(rb_eArgError, "unknown pname:%d",pname);
1631
+ break; /* not reached */
1632
+ }
1633
+ glGetMaterialiv(face,pname,params);
1634
+ RET_ARRAY_OR_SINGLE("glGetMaterialiv", size, INT2NUM, params);
1635
1635
  }
1636
1636
 
1637
1637
  #define GLGETPIXELMAP_FUNC(_type_,_vartype_,_convert_) \
@@ -1641,50 +1641,50 @@ int argc; \
1641
1641
  VALUE *argv; \
1642
1642
  VALUE obj; \
1643
1643
  { \
1644
- GLenum map; \
1645
- GLenum map_size; \
1646
- GLint size = 0; \
1647
- _vartype_ *values; \
1648
- VALUE args[2]; \
1649
- switch (rb_scan_args(argc, argv, "11", &args[0], &args[1])) { \
1650
- default: \
1651
- case 1: \
1652
- if (CheckBufferBinding(GL_PIXEL_PACK_BUFFER_BINDING)) \
1653
- rb_raise(rb_eArgError, \
1644
+ GLenum map; \
1645
+ GLenum map_size; \
1646
+ GLint size = 0; \
1647
+ _vartype_ *values; \
1648
+ VALUE args[2]; \
1649
+ switch (rb_scan_args(argc, argv, "11", &args[0], &args[1])) { \
1650
+ default: \
1651
+ case 1: \
1652
+ if (CheckBufferBinding(GL_PIXEL_PACK_BUFFER_BINDING)) \
1653
+ rb_raise(rb_eArgError, \
1654
1654
  "Pixel pack buffer bound, but offset argument missing"); \
1655
1655
  \
1656
- map = (GLenum)NUM2INT(args[0]); \
1657
- switch(map) { \
1658
- case GL_PIXEL_MAP_I_TO_I: map_size=GL_PIXEL_MAP_I_TO_I_SIZE; break; \
1659
- case GL_PIXEL_MAP_S_TO_S: map_size=GL_PIXEL_MAP_S_TO_S_SIZE; break; \
1660
- case GL_PIXEL_MAP_I_TO_R: map_size=GL_PIXEL_MAP_I_TO_R_SIZE; break; \
1661
- case GL_PIXEL_MAP_I_TO_G: map_size=GL_PIXEL_MAP_I_TO_G_SIZE; break; \
1662
- case GL_PIXEL_MAP_I_TO_B: map_size=GL_PIXEL_MAP_I_TO_B_SIZE; break; \
1663
- case GL_PIXEL_MAP_I_TO_A: map_size=GL_PIXEL_MAP_I_TO_A_SIZE; break; \
1664
- case GL_PIXEL_MAP_R_TO_R: map_size=GL_PIXEL_MAP_R_TO_R_SIZE; break; \
1665
- case GL_PIXEL_MAP_G_TO_G: map_size=GL_PIXEL_MAP_G_TO_G_SIZE; break; \
1666
- case GL_PIXEL_MAP_B_TO_B: map_size=GL_PIXEL_MAP_B_TO_B_SIZE; break; \
1667
- case GL_PIXEL_MAP_A_TO_A: map_size=GL_PIXEL_MAP_A_TO_A_SIZE; break; \
1668
- default: \
1669
- rb_raise(rb_eArgError, "unknown map:%d",map); \
1670
- break; \
1671
- } \
1672
- glGetIntegerv(map_size,&size); \
1673
- CHECK_GLERROR_FROM("glGetIntegerv"); \
1674
- values = ALLOC_N(_vartype_,size); \
1675
- glGetPixelMap##_type_##v(map,values); \
1656
+ map = (GLenum)NUM2INT(args[0]); \
1657
+ switch(map) { \
1658
+ case GL_PIXEL_MAP_I_TO_I: map_size=GL_PIXEL_MAP_I_TO_I_SIZE; break; \
1659
+ case GL_PIXEL_MAP_S_TO_S: map_size=GL_PIXEL_MAP_S_TO_S_SIZE; break; \
1660
+ case GL_PIXEL_MAP_I_TO_R: map_size=GL_PIXEL_MAP_I_TO_R_SIZE; break; \
1661
+ case GL_PIXEL_MAP_I_TO_G: map_size=GL_PIXEL_MAP_I_TO_G_SIZE; break; \
1662
+ case GL_PIXEL_MAP_I_TO_B: map_size=GL_PIXEL_MAP_I_TO_B_SIZE; break; \
1663
+ case GL_PIXEL_MAP_I_TO_A: map_size=GL_PIXEL_MAP_I_TO_A_SIZE; break; \
1664
+ case GL_PIXEL_MAP_R_TO_R: map_size=GL_PIXEL_MAP_R_TO_R_SIZE; break; \
1665
+ case GL_PIXEL_MAP_G_TO_G: map_size=GL_PIXEL_MAP_G_TO_G_SIZE; break; \
1666
+ case GL_PIXEL_MAP_B_TO_B: map_size=GL_PIXEL_MAP_B_TO_B_SIZE; break; \
1667
+ case GL_PIXEL_MAP_A_TO_A: map_size=GL_PIXEL_MAP_A_TO_A_SIZE; break; \
1668
+ default: \
1669
+ rb_raise(rb_eArgError, "unknown map:%d",map); \
1670
+ break; \
1671
+ } \
1672
+ glGetIntegerv(map_size,&size); \
1673
+ CHECK_GLERROR_FROM("glGetIntegerv"); \
1674
+ values = ALLOC_N(_vartype_,size); \
1675
+ glGetPixelMap##_type_##v(map,values); \
1676
1676
  RET_ARRAY_OR_SINGLE_FREE("glGetPixelMap" #_type_ "v", size, _convert_, \
1677
1677
  values); \
1678
- break; \
1679
- case 2: \
1680
- if (!CheckBufferBinding(GL_PIXEL_PACK_BUFFER_BINDING)) \
1681
- rb_raise(rb_eArgError, "Pixel pack buffer not bound"); \
1682
- \
1683
- map = (GLenum)NUM2INT(args[0]); \
1684
- glGetPixelMap##_type_##v(map,(GLvoid*)NUM2LONG(args[1])); \
1685
- CHECK_GLERROR_FROM("glGetPixelMap" #_type_ "v"); \
1686
- return Qnil; \
1687
- } \
1678
+ break; \
1679
+ case 2: \
1680
+ if (!CheckBufferBinding(GL_PIXEL_PACK_BUFFER_BINDING)) \
1681
+ rb_raise(rb_eArgError, "Pixel pack buffer not bound"); \
1682
+ \
1683
+ map = (GLenum)NUM2INT(args[0]); \
1684
+ glGetPixelMap##_type_##v(map,(GLvoid*)NUM2SIZET(args[1])); \
1685
+ CHECK_GLERROR_FROM("glGetPixelMap" #_type_ "v"); \
1686
+ return Qnil; \
1687
+ } \
1688
1688
  }
1689
1689
 
1690
1690
  GLGETPIXELMAP_FUNC(f,GLfloat,rb_float_new)
@@ -1698,38 +1698,38 @@ int argc;
1698
1698
  VALUE *argv;
1699
1699
  VALUE obj;
1700
1700
  {
1701
- VALUE args[1];
1702
- GLubyte mask[128];
1703
- switch(rb_scan_args(argc, argv, "01", &args[0])) {
1704
- default:
1705
- case 0:
1706
- if (CheckBufferBinding(GL_PIXEL_PACK_BUFFER_BINDING))
1707
- rb_raise(rb_eArgError, "Pixel pack buffer bound, but offset argument missing");
1708
- memset(mask, 0x0, sizeof(GLubyte)*128);
1709
- FORCE_PIXEL_STORE_MODE
1710
- glGetPolygonStipple(mask);
1711
- RESTORE_PIXEL_STORE_MODE
1712
- CHECK_GLERROR_FROM("glGetPolygonStipple");
1713
- return rb_str_new((const char*)mask, 128);
1714
- case 1:
1715
- if (!CheckBufferBinding(GL_PIXEL_PACK_BUFFER_BINDING))
1716
- rb_raise(rb_eArgError, "Pixel pack buffer not bound");
1717
- glGetPolygonStipple((GLvoid *)NUM2LONG(args[0]));
1718
- CHECK_GLERROR_FROM("glGetPolygonStipple");
1719
- return Qnil;
1720
- }
1701
+ VALUE args[1];
1702
+ GLubyte mask[128];
1703
+ switch(rb_scan_args(argc, argv, "01", &args[0])) {
1704
+ default:
1705
+ case 0:
1706
+ if (CheckBufferBinding(GL_PIXEL_PACK_BUFFER_BINDING))
1707
+ rb_raise(rb_eArgError, "Pixel pack buffer bound, but offset argument missing");
1708
+ memset(mask, 0x0, sizeof(GLubyte)*128);
1709
+ FORCE_PIXEL_STORE_MODE
1710
+ glGetPolygonStipple(mask);
1711
+ RESTORE_PIXEL_STORE_MODE
1712
+ CHECK_GLERROR_FROM("glGetPolygonStipple");
1713
+ return rb_str_new((const char*)mask, 128);
1714
+ case 1:
1715
+ if (!CheckBufferBinding(GL_PIXEL_PACK_BUFFER_BINDING))
1716
+ rb_raise(rb_eArgError, "Pixel pack buffer not bound");
1717
+ glGetPolygonStipple((GLvoid *)NUM2SIZET(args[0]));
1718
+ CHECK_GLERROR_FROM("glGetPolygonStipple");
1719
+ return Qnil;
1720
+ }
1721
1721
  }
1722
1722
 
1723
1723
  static VALUE
1724
1724
  gl_GetString(obj,arg1)
1725
1725
  VALUE obj,arg1;
1726
1726
  {
1727
- GLenum name;
1728
- const GLubyte *ret;
1729
- name = (GLenum)NUM2INT(arg1);
1730
- ret = glGetString(name);
1731
- CHECK_GLERROR_FROM("glGetString");
1732
- return rb_str_new2((const char*)ret);
1727
+ GLenum name;
1728
+ const GLubyte *ret;
1729
+ name = (GLenum)NUM2INT(arg1);
1730
+ ret = glGetString(name);
1731
+ CHECK_GLERROR_FROM("glGetString");
1732
+ return rb_str_new2((const char*)ret);
1733
1733
  }
1734
1734
 
1735
1735
  #define GETTEXENVFUNC(_name_,_type_) \
@@ -1737,28 +1737,28 @@ static VALUE \
1737
1737
  gl_##_name_(obj,arg1,arg2) \
1738
1738
  VALUE obj,arg1,arg2; \
1739
1739
  { \
1740
- GLenum target; \
1741
- GLenum pname; \
1742
- _type_ params[4] = {(_type_)0.0, (_type_)0.0, (_type_)0.0, (_type_)0.0}; \
1743
- int size; \
1744
- target = (GLenum)NUM2INT(arg1); \
1745
- pname = (GLenum)NUM2INT(arg2); \
1746
- switch(pname) { \
1747
- case GL_TEXTURE_ENV_COLOR: \
1748
- case GL_TEXTURE_ENV_BIAS_SGIX: \
1749
- case GL_CULL_MODES_NV: \
1750
- case GL_OFFSET_TEXTURE_MATRIX_NV: \
1751
- size = 4; \
1752
- break; \
1753
- case GL_CONST_EYE_NV: \
1754
- size = 3; \
1755
- break; \
1756
- default: \
1757
- size = 1; \
1758
- break; \
1759
- } \
1760
- gl##_name_(target,pname,params); \
1761
- RET_ARRAY_OR_SINGLE("gl" #_name_, size, RETCONV_##_type_, params); \
1740
+ GLenum target; \
1741
+ GLenum pname; \
1742
+ _type_ params[4] = {(_type_)0.0, (_type_)0.0, (_type_)0.0, (_type_)0.0}; \
1743
+ int size; \
1744
+ target = (GLenum)NUM2INT(arg1); \
1745
+ pname = (GLenum)NUM2INT(arg2); \
1746
+ switch(pname) { \
1747
+ case GL_TEXTURE_ENV_COLOR: \
1748
+ case GL_TEXTURE_ENV_BIAS_SGIX: \
1749
+ case GL_CULL_MODES_NV: \
1750
+ case GL_OFFSET_TEXTURE_MATRIX_NV: \
1751
+ size = 4; \
1752
+ break; \
1753
+ case GL_CONST_EYE_NV: \
1754
+ size = 3; \
1755
+ break; \
1756
+ default: \
1757
+ size = 1; \
1758
+ break; \
1759
+ } \
1760
+ gl##_name_(target,pname,params); \
1761
+ RET_ARRAY_OR_SINGLE("gl" #_name_, size, RETCONV_##_type_, params); \
1762
1762
  }
1763
1763
 
1764
1764
  GETTEXENVFUNC(GetTexEnvfv,GLfloat)
@@ -1770,23 +1770,23 @@ static VALUE \
1770
1770
  gl_##_name_(obj,arg1,arg2) \
1771
1771
  VALUE obj,arg1,arg2; \
1772
1772
  { \
1773
- GLenum coord; \
1774
- GLenum pname; \
1775
- _type_ params[4] = {(_type_)0.0, (_type_)0.0, (_type_)0.0, (_type_)0.0}; \
1776
- int size; \
1777
- coord = (GLenum)NUM2INT(arg1); \
1778
- pname = (GLenum)NUM2INT(arg2); \
1779
- switch(pname) { \
1780
- case GL_OBJECT_PLANE: \
1781
- case GL_EYE_PLANE: \
1782
- size = 4; \
1783
- break; \
1784
- default: \
1785
- size = 1; \
1786
- break; \
1787
- } \
1788
- gl##_name_(coord,pname,params); \
1789
- RET_ARRAY_OR_SINGLE("gl" #_name_, size, RETCONV_##_type_, params); \
1773
+ GLenum coord; \
1774
+ GLenum pname; \
1775
+ _type_ params[4] = {(_type_)0.0, (_type_)0.0, (_type_)0.0, (_type_)0.0}; \
1776
+ int size; \
1777
+ coord = (GLenum)NUM2INT(arg1); \
1778
+ pname = (GLenum)NUM2INT(arg2); \
1779
+ switch(pname) { \
1780
+ case GL_OBJECT_PLANE: \
1781
+ case GL_EYE_PLANE: \
1782
+ size = 4; \
1783
+ break; \
1784
+ default: \
1785
+ size = 1; \
1786
+ break; \
1787
+ } \
1788
+ gl##_name_(coord,pname,params); \
1789
+ RET_ARRAY_OR_SINGLE("gl" #_name_, size, RETCONV_##_type_, params); \
1790
1790
  }
1791
1791
 
1792
1792
  GETTEXGENFUNC(GetTexGendv,GLdouble)
@@ -1800,128 +1800,128 @@ int argc;
1800
1800
  VALUE *argv;
1801
1801
  VALUE obj;
1802
1802
  {
1803
- GLenum tex;
1804
- GLint lod;
1805
- GLenum format;
1806
- GLenum type;
1807
- GLint width = 0;
1808
- GLint height = 0;
1809
- GLint depth = 0;
1810
- GLint size4d = 0;
1811
- GLint size;
1812
- VALUE pixels;
1813
- VALUE args[5];
1814
- int numargs;
1815
- numargs = rb_scan_args(argc, argv, "41", &args[0], &args[1], &args[2], &args[3], &args[4]);
1816
- tex = (GLenum)NUM2INT(args[0]);
1817
- lod = (GLint)NUM2INT(args[1]);
1818
- format = (GLenum)NUM2INT(args[2]);
1819
- type = (GLenum)NUM2INT(args[3]);
1820
- switch(numargs) {
1821
- default:
1822
- case 4:
1823
- if (CheckBufferBinding(GL_PIXEL_PACK_BUFFER_BINDING))
1824
- rb_raise(rb_eArgError, "Pixel pack buffer bound, but offset argument missing");
1825
-
1826
- size = 1;
1827
- switch(tex) {
1828
- case GL_TEXTURE_4D_SGIS:
1829
- glGetTexLevelParameteriv(tex,lod,GL_TEXTURE_4DSIZE_SGIS,&size4d);
1830
- size *= size4d;
1831
- /* fall through */
1832
- case GL_TEXTURE_3D:
1833
- case GL_TEXTURE_1D_STACK_MESAX:
1834
- case GL_TEXTURE_2D_STACK_MESAX:
1835
- glGetTexLevelParameteriv(tex,lod,GL_TEXTURE_DEPTH,&depth);
1836
- size *= depth;
1837
- /* fall through */
1838
- case GL_TEXTURE_2D:
1839
- case GL_TEXTURE_CUBE_MAP_POSITIVE_X:
1840
- case GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
1841
- case GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
1842
- case GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
1843
- case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
1844
- case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
1845
- case GL_TEXTURE_RECTANGLE_ARB:
1846
- case GL_DETAIL_TEXTURE_2D_SGIS:
1847
- glGetTexLevelParameteriv(tex,lod,GL_TEXTURE_HEIGHT,&height);
1848
- size *= height;
1849
- /* fall through */
1850
- case GL_TEXTURE_1D:
1851
- glGetTexLevelParameteriv(tex,lod,GL_TEXTURE_WIDTH,&width);
1852
- size *= width;
1853
- break;
1854
- default:
1855
- rb_raise(rb_eArgError, "Target type not supported");
1856
- }
1857
- CHECK_GLERROR_FROM("glGetTexLevelParameteriv");
1858
- pixels = allocate_buffer_with_string(GetDataSize(type,format,size));
1859
-
1860
- FORCE_PIXEL_STORE_MODE
1861
- glGetTexImage(tex,lod,format,type,(GLvoid*)RSTRING_PTR(pixels));
1862
- RESTORE_PIXEL_STORE_MODE
1863
- CHECK_GLERROR_FROM("glGetTexImage");
1864
- return pixels;
1865
- break;
1866
- case 5:
1867
- if (!CheckBufferBinding(GL_PIXEL_PACK_BUFFER_BINDING))
1868
- rb_raise(rb_eArgError, "Pixel pack buffer not bound");
1869
-
1870
- FORCE_PIXEL_STORE_MODE
1871
- glGetTexImage(tex,lod,format,type,(GLvoid*)NUM2LONG(args[4]));
1872
- RESTORE_PIXEL_STORE_MODE
1873
- CHECK_GLERROR_FROM("glGetTexImage");
1874
- return Qnil;
1875
- }
1803
+ GLenum tex;
1804
+ GLint lod;
1805
+ GLenum format;
1806
+ GLenum type;
1807
+ GLint width = 0;
1808
+ GLint height = 0;
1809
+ GLint depth = 0;
1810
+ GLint size4d = 0;
1811
+ GLint size;
1812
+ VALUE pixels;
1813
+ VALUE args[5];
1814
+ int numargs;
1815
+ numargs = rb_scan_args(argc, argv, "41", &args[0], &args[1], &args[2], &args[3], &args[4]);
1816
+ tex = (GLenum)NUM2INT(args[0]);
1817
+ lod = (GLint)NUM2INT(args[1]);
1818
+ format = (GLenum)NUM2INT(args[2]);
1819
+ type = (GLenum)NUM2INT(args[3]);
1820
+ switch(numargs) {
1821
+ default:
1822
+ case 4:
1823
+ if (CheckBufferBinding(GL_PIXEL_PACK_BUFFER_BINDING))
1824
+ rb_raise(rb_eArgError, "Pixel pack buffer bound, but offset argument missing");
1825
+
1826
+ size = 1;
1827
+ switch(tex) {
1828
+ case GL_TEXTURE_4D_SGIS:
1829
+ glGetTexLevelParameteriv(tex,lod,GL_TEXTURE_4DSIZE_SGIS,&size4d);
1830
+ size *= size4d;
1831
+ /* fall through */
1832
+ case GL_TEXTURE_3D:
1833
+ case GL_TEXTURE_1D_STACK_MESAX:
1834
+ case GL_TEXTURE_2D_STACK_MESAX:
1835
+ glGetTexLevelParameteriv(tex,lod,GL_TEXTURE_DEPTH,&depth);
1836
+ size *= depth;
1837
+ /* fall through */
1838
+ case GL_TEXTURE_2D:
1839
+ case GL_TEXTURE_CUBE_MAP_POSITIVE_X:
1840
+ case GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
1841
+ case GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
1842
+ case GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
1843
+ case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
1844
+ case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
1845
+ case GL_TEXTURE_RECTANGLE_ARB:
1846
+ case GL_DETAIL_TEXTURE_2D_SGIS:
1847
+ glGetTexLevelParameteriv(tex,lod,GL_TEXTURE_HEIGHT,&height);
1848
+ size *= height;
1849
+ /* fall through */
1850
+ case GL_TEXTURE_1D:
1851
+ glGetTexLevelParameteriv(tex,lod,GL_TEXTURE_WIDTH,&width);
1852
+ size *= width;
1853
+ break;
1854
+ default:
1855
+ rb_raise(rb_eArgError, "Target type not supported");
1856
+ }
1857
+ CHECK_GLERROR_FROM("glGetTexLevelParameteriv");
1858
+ pixels = allocate_buffer_with_string(GetDataSize(type,format,size));
1859
+
1860
+ FORCE_PIXEL_STORE_MODE
1861
+ glGetTexImage(tex,lod,format,type,(GLvoid*)RSTRING_PTR(pixels));
1862
+ RESTORE_PIXEL_STORE_MODE
1863
+ CHECK_GLERROR_FROM("glGetTexImage");
1864
+ return pixels;
1865
+ break;
1866
+ case 5:
1867
+ if (!CheckBufferBinding(GL_PIXEL_PACK_BUFFER_BINDING))
1868
+ rb_raise(rb_eArgError, "Pixel pack buffer not bound");
1869
+
1870
+ FORCE_PIXEL_STORE_MODE
1871
+ glGetTexImage(tex,lod,format,type,(GLvoid*)NUM2SIZET(args[4]));
1872
+ RESTORE_PIXEL_STORE_MODE
1873
+ CHECK_GLERROR_FROM("glGetTexImage");
1874
+ return Qnil;
1875
+ }
1876
1876
  }
1877
1877
 
1878
1878
  static VALUE
1879
1879
  gl_GetTexParameterfv(obj,arg1,arg2)
1880
1880
  VALUE obj,arg1,arg2;
1881
1881
  {
1882
- GLenum target;
1883
- GLenum pname;
1884
- GLfloat params[4] = {(GLfloat)0.0, (GLfloat)0.0, (GLfloat)0.0, (GLfloat)0.0};
1885
- int size;
1886
- target = (GLenum)NUM2INT(arg1);
1887
- pname = (GLenum)NUM2INT(arg2);
1888
- switch(pname) {
1889
- case GL_TEXTURE_BORDER_COLOR:
1890
- case GL_TEXTURE_BORDER_VALUES_NV:
1891
- case GL_POST_TEXTURE_FILTER_BIAS_SGIX:
1892
- case GL_POST_TEXTURE_FILTER_SCALE_SGIX:
1893
- size = 4;
1894
- break;
1895
- default:
1896
- size = 1;
1897
- break;
1898
- }
1899
- glGetTexParameterfv(target,pname,params);
1900
- RET_ARRAY_OR_SINGLE("glGetTexParameterfv", size, RETCONV_GLfloat, params);
1882
+ GLenum target;
1883
+ GLenum pname;
1884
+ GLfloat params[4] = {(GLfloat)0.0, (GLfloat)0.0, (GLfloat)0.0, (GLfloat)0.0};
1885
+ int size;
1886
+ target = (GLenum)NUM2INT(arg1);
1887
+ pname = (GLenum)NUM2INT(arg2);
1888
+ switch(pname) {
1889
+ case GL_TEXTURE_BORDER_COLOR:
1890
+ case GL_TEXTURE_BORDER_VALUES_NV:
1891
+ case GL_POST_TEXTURE_FILTER_BIAS_SGIX:
1892
+ case GL_POST_TEXTURE_FILTER_SCALE_SGIX:
1893
+ size = 4;
1894
+ break;
1895
+ default:
1896
+ size = 1;
1897
+ break;
1898
+ }
1899
+ glGetTexParameterfv(target,pname,params);
1900
+ RET_ARRAY_OR_SINGLE("glGetTexParameterfv", size, RETCONV_GLfloat, params);
1901
1901
  }
1902
1902
 
1903
1903
  static VALUE
1904
1904
  gl_GetTexParameteriv(obj,arg1,arg2)
1905
1905
  VALUE obj,arg1,arg2;
1906
1906
  {
1907
- GLenum target;
1908
- GLenum pname;
1909
- GLint params[4] = {0,0,0,0};
1910
- int size;
1911
- target = (GLenum)NUM2INT(arg1);
1912
- pname = (GLenum)NUM2INT(arg2);
1913
- switch(pname) {
1914
- case GL_TEXTURE_BORDER_COLOR:
1915
- case GL_TEXTURE_BORDER_VALUES_NV:
1916
- case GL_POST_TEXTURE_FILTER_BIAS_SGIX:
1917
- case GL_POST_TEXTURE_FILTER_SCALE_SGIX:
1918
- size = 4;
1919
- break;
1920
- default:
1921
- size = 1;
1922
- break;
1923
- }
1924
- glGetTexParameteriv(target,pname,params);
1907
+ GLenum target;
1908
+ GLenum pname;
1909
+ GLint params[4] = {0,0,0,0};
1910
+ int size;
1911
+ target = (GLenum)NUM2INT(arg1);
1912
+ pname = (GLenum)NUM2INT(arg2);
1913
+ switch(pname) {
1914
+ case GL_TEXTURE_BORDER_COLOR:
1915
+ case GL_TEXTURE_BORDER_VALUES_NV:
1916
+ case GL_POST_TEXTURE_FILTER_BIAS_SGIX:
1917
+ case GL_POST_TEXTURE_FILTER_SCALE_SGIX:
1918
+ size = 4;
1919
+ break;
1920
+ default:
1921
+ size = 1;
1922
+ break;
1923
+ }
1924
+ glGetTexParameteriv(target,pname,params);
1925
1925
  RET_ARRAY_OR_SINGLE_BOOL("glGetTexParameteriv", size, cond_GLBOOL2RUBY,
1926
1926
  pname, params);
1927
1927
  }
@@ -1930,32 +1930,32 @@ static VALUE
1930
1930
  gl_GetTexLevelParameterfv(obj,arg1,arg2,arg3)
1931
1931
  VALUE obj,arg1,arg2,arg3;
1932
1932
  {
1933
- GLenum target;
1934
- GLint level;
1935
- GLenum pname;
1936
- GLfloat params = (GLfloat)0.0;
1937
- target = (GLenum)NUM2INT(arg1);
1938
- level = (GLint)NUM2INT(arg2);
1939
- pname = (GLenum)NUM2INT(arg3);
1940
- glGetTexLevelParameterfv(target,level,pname,&params);
1941
- CHECK_GLERROR_FROM("glGetTexLevelParameterfv");
1942
- return RETCONV_GLfloat(params);
1933
+ GLenum target;
1934
+ GLint level;
1935
+ GLenum pname;
1936
+ GLfloat params = (GLfloat)0.0;
1937
+ target = (GLenum)NUM2INT(arg1);
1938
+ level = (GLint)NUM2INT(arg2);
1939
+ pname = (GLenum)NUM2INT(arg3);
1940
+ glGetTexLevelParameterfv(target,level,pname,&params);
1941
+ CHECK_GLERROR_FROM("glGetTexLevelParameterfv");
1942
+ return RETCONV_GLfloat(params);
1943
1943
  }
1944
1944
 
1945
1945
  static VALUE
1946
1946
  gl_GetTexLevelParameteriv(obj,arg1,arg2,arg3)
1947
1947
  VALUE obj,arg1,arg2,arg3;
1948
1948
  {
1949
- GLenum target;
1950
- GLint level;
1951
- GLenum pname;
1952
- GLint params = 0;
1953
- target = (GLenum)NUM2INT(arg1);
1954
- level = (GLint)NUM2INT(arg2);
1955
- pname = (GLenum)NUM2INT(arg3);
1956
- glGetTexLevelParameteriv(target,level,pname,&params);
1957
- CHECK_GLERROR_FROM("glGetTexLevelParameteriv");
1958
- return cond_GLBOOL2RUBY(pname,params);
1949
+ GLenum target;
1950
+ GLint level;
1951
+ GLenum pname;
1952
+ GLint params = 0;
1953
+ target = (GLenum)NUM2INT(arg1);
1954
+ level = (GLint)NUM2INT(arg2);
1955
+ pname = (GLenum)NUM2INT(arg3);
1956
+ glGetTexLevelParameteriv(target,level,pname,&params);
1957
+ CHECK_GLERROR_FROM("glGetTexLevelParameteriv");
1958
+ return cond_GLBOOL2RUBY(pname,params);
1959
1959
  }
1960
1960
 
1961
1961
 
@@ -1963,53 +1963,53 @@ static VALUE
1963
1963
  gl_LoadMatrixf(obj,arg1)
1964
1964
  VALUE obj,arg1;
1965
1965
  {
1966
- GLfloat m[4*4];
1967
- ary2cmatfloat(arg1, m, 4, 4);
1968
- glLoadMatrixf(m);
1969
- CHECK_GLERROR_FROM("glLoadMatrixf");
1970
- return Qnil;
1966
+ GLfloat m[4*4];
1967
+ ary2cmatfloat(arg1, m, 4, 4);
1968
+ glLoadMatrixf(m);
1969
+ CHECK_GLERROR_FROM("glLoadMatrixf");
1970
+ return Qnil;
1971
1971
  }
1972
1972
 
1973
1973
  static VALUE
1974
1974
  gl_LoadMatrixd(obj,arg1)
1975
1975
  VALUE obj,arg1;
1976
1976
  {
1977
- GLdouble m[4*4];
1978
- ary2cmatdouble(arg1, m, 4, 4);
1979
- glLoadMatrixd(m);
1980
- CHECK_GLERROR_FROM("glLoadMatrixd");
1981
- return Qnil;
1977
+ GLdouble m[4*4];
1978
+ ary2cmatdouble(arg1, m, 4, 4);
1979
+ glLoadMatrixd(m);
1980
+ CHECK_GLERROR_FROM("glLoadMatrixd");
1981
+ return Qnil;
1982
1982
  }
1983
1983
 
1984
1984
  static VALUE
1985
1985
  gl_MultMatrixf(obj,arg1)
1986
1986
  VALUE obj,arg1;
1987
1987
  {
1988
- GLfloat m[4*4];
1989
- ary2cmatfloat(arg1, m, 4, 4);
1990
- glMultMatrixf(m);
1991
- CHECK_GLERROR_FROM("glMultMatrixf");
1992
- return Qnil;
1988
+ GLfloat m[4*4];
1989
+ ary2cmatfloat(arg1, m, 4, 4);
1990
+ glMultMatrixf(m);
1991
+ CHECK_GLERROR_FROM("glMultMatrixf");
1992
+ return Qnil;
1993
1993
  }
1994
1994
 
1995
1995
  static VALUE
1996
1996
  gl_MultMatrixd(obj,arg1)
1997
1997
  VALUE obj,arg1;
1998
1998
  {
1999
- GLdouble m[4*4];
2000
- ary2cmatdouble(arg1, m, 4, 4);
2001
- glMultMatrixd(m);
2002
- CHECK_GLERROR_FROM("glMultMatrixd");
2003
- return Qnil;
1999
+ GLdouble m[4*4];
2000
+ ary2cmatdouble(arg1, m, 4, 4);
2001
+ glMultMatrixd(m);
2002
+ CHECK_GLERROR_FROM("glMultMatrixd");
2003
+ return Qnil;
2004
2004
  }
2005
2005
 
2006
2006
 
2007
2007
  static VALUE g_Vertex_ptr;
2008
2008
  static VALUE g_Normal_ptr;
2009
- static VALUE g_Color_ptr;
2010
- static VALUE g_Index_ptr;
2011
- static VALUE g_TexCoord_ptr;
2012
- static VALUE g_EdgeFlag_ptr;
2009
+ static VALUE g_Color_ptr;
2010
+ static VALUE g_Index_ptr;
2011
+ static VALUE g_TexCoord_ptr;
2012
+ static VALUE g_EdgeFlag_ptr;
2013
2013
  VALUE g_FogCoord_ptr; /* OpenGL 1.4 */
2014
2014
  VALUE g_SecondaryColor_ptr; /* OpenGL 1.4 */
2015
2015
  #define POINTER_FUNC(_func_) \
@@ -2017,24 +2017,24 @@ static VALUE \
2017
2017
  gl_##_func_##Pointer(obj, arg1, arg2, arg3, arg4) \
2018
2018
  VALUE obj, arg1, arg2, arg3, arg4; \
2019
2019
  { \
2020
- GLint size; \
2021
- GLenum type; \
2022
- GLsizei stride; \
2023
- size = (GLint)NUM2INT(arg1); \
2024
- type = (GLenum)NUM2INT(arg2); \
2025
- stride = (GLsizei)NUM2UINT(arg3); \
2026
- if (CheckBufferBinding(GL_ARRAY_BUFFER_BINDING)) { \
2027
- g_##_func_##_ptr = arg4; \
2028
- gl##_func_##Pointer(size, type, stride, (const GLvoid*)NUM2LONG(arg4)); \
2029
- } else { \
2030
- VALUE data; \
2031
- data = pack_array_or_pass_string(type,arg4); \
2032
- rb_str_freeze(data); \
2033
- g_##_func_##_ptr = data; \
2034
- gl##_func_##Pointer(size, type, stride, (const GLvoid*)RSTRING_PTR(data)); \
2035
- } \
2036
- CHECK_GLERROR_FROM("gl" #_func_ "Pointer"); \
2037
- return Qnil; \
2020
+ GLint size; \
2021
+ GLenum type; \
2022
+ GLsizei stride; \
2023
+ size = (GLint)NUM2INT(arg1); \
2024
+ type = (GLenum)NUM2INT(arg2); \
2025
+ stride = (GLsizei)NUM2UINT(arg3); \
2026
+ if (CheckBufferBinding(GL_ARRAY_BUFFER_BINDING)) { \
2027
+ g_##_func_##_ptr = arg4; \
2028
+ gl##_func_##Pointer(size, type, stride, (const GLvoid*)NUM2SIZET(arg4)); \
2029
+ } else { \
2030
+ VALUE data; \
2031
+ data = pack_array_or_pass_string(type,arg4); \
2032
+ rb_str_freeze(data); \
2033
+ g_##_func_##_ptr = data; \
2034
+ gl##_func_##Pointer(size, type, stride, (const GLvoid*)RSTRING_PTR(data)); \
2035
+ } \
2036
+ CHECK_GLERROR_FROM("gl" #_func_ "Pointer"); \
2037
+ return Qnil; \
2038
2038
  }
2039
2039
 
2040
2040
  POINTER_FUNC(Vertex)
@@ -2047,135 +2047,135 @@ static VALUE
2047
2047
  gl_DrawElements(obj,arg1,arg2,arg3,arg4)
2048
2048
  VALUE obj,arg1,arg2,arg3,arg4;
2049
2049
  {
2050
- GLenum mode;
2051
- GLsizei count;
2052
- GLenum type;
2053
- mode = (GLenum)NUM2INT(arg1);
2054
- count = (GLsizei)NUM2UINT(arg2);
2055
- type = (GLenum)NUM2INT(arg3);
2056
- if (CheckBufferBinding(GL_ELEMENT_ARRAY_BUFFER_BINDING)) {
2057
- glDrawElements(mode, count, type, (const GLvoid*)NUM2LONG(arg4));
2058
- } else {
2059
- VALUE data;
2060
- data = pack_array_or_pass_string(type,arg4);
2061
- glDrawElements(mode, count, type, (const GLvoid*)RSTRING_PTR(data));
2062
- }
2063
- CHECK_GLERROR_FROM("glDrawElements");
2064
- return Qnil;
2050
+ GLenum mode;
2051
+ GLsizei count;
2052
+ GLenum type;
2053
+ mode = (GLenum)NUM2INT(arg1);
2054
+ count = (GLsizei)NUM2UINT(arg2);
2055
+ type = (GLenum)NUM2INT(arg3);
2056
+ if (CheckBufferBinding(GL_ELEMENT_ARRAY_BUFFER_BINDING)) {
2057
+ glDrawElements(mode, count, type, (const GLvoid*)NUM2SIZET(arg4));
2058
+ } else {
2059
+ VALUE data;
2060
+ data = pack_array_or_pass_string(type,arg4);
2061
+ glDrawElements(mode, count, type, (const GLvoid*)RSTRING_PTR(data));
2062
+ }
2063
+ CHECK_GLERROR_FROM("glDrawElements");
2064
+ return Qnil;
2065
2065
  }
2066
2066
 
2067
2067
  static VALUE
2068
2068
  gl_EdgeFlagPointer(obj,arg1,arg2)
2069
2069
  VALUE obj,arg1,arg2;
2070
2070
  {
2071
- GLsizei stride;
2072
- stride = (GLsizei)NUM2UINT(arg1);
2073
- if (CheckBufferBinding(GL_ARRAY_BUFFER_BINDING)) {
2074
- g_EdgeFlag_ptr = arg2;
2075
- glEdgeFlagPointer(stride, (const GLvoid*) NUM2LONG(arg2));
2076
- } else {
2077
- VALUE data;
2078
- data = pack_array_or_pass_string(GL_UNSIGNED_BYTE,arg2);
2079
- rb_str_freeze(data);
2080
- g_EdgeFlag_ptr = data;
2081
- glEdgeFlagPointer(stride, (const GLvoid*)RSTRING_PTR(data));
2082
- }
2083
- CHECK_GLERROR_FROM("glEdgeFlagPointer");
2084
- return Qnil;
2071
+ GLsizei stride;
2072
+ stride = (GLsizei)NUM2UINT(arg1);
2073
+ if (CheckBufferBinding(GL_ARRAY_BUFFER_BINDING)) {
2074
+ g_EdgeFlag_ptr = arg2;
2075
+ glEdgeFlagPointer(stride, (const GLvoid*) NUM2SIZET(arg2));
2076
+ } else {
2077
+ VALUE data;
2078
+ data = pack_array_or_pass_string(GL_UNSIGNED_BYTE,arg2);
2079
+ rb_str_freeze(data);
2080
+ g_EdgeFlag_ptr = data;
2081
+ glEdgeFlagPointer(stride, (const GLvoid*)RSTRING_PTR(data));
2082
+ }
2083
+ CHECK_GLERROR_FROM("glEdgeFlagPointer");
2084
+ return Qnil;
2085
2085
  }
2086
2086
 
2087
2087
  static VALUE
2088
2088
  gl_GetPointerv(obj,arg1)
2089
2089
  VALUE obj,arg1;
2090
2090
  {
2091
- GLenum pname;
2092
- pname = (GLenum)NUM2INT(arg1);
2093
- switch (pname) {
2094
- case GL_VERTEX_ARRAY_POINTER:
2095
- return g_Vertex_ptr;
2096
- case GL_NORMAL_ARRAY_POINTER:
2097
- return g_Normal_ptr;
2098
- case GL_COLOR_ARRAY_POINTER:
2099
- return g_Color_ptr;
2100
- case GL_INDEX_ARRAY_POINTER:
2101
- return g_Index_ptr;
2102
- case GL_TEXTURE_COORD_ARRAY_POINTER:
2103
- return g_TexCoord_ptr;
2104
- case GL_EDGE_FLAG_ARRAY_POINTER:
2105
- return g_EdgeFlag_ptr;
2106
- case GL_FOG_COORD_ARRAY_POINTER:
2107
- return g_FogCoord_ptr;
2108
- case GL_SECONDARY_COLOR_ARRAY_POINTER:
2109
- return g_SecondaryColor_ptr;
2110
- case GL_FEEDBACK_BUFFER_POINTER:
2111
- return g_current_feed_buffer;
2112
- case GL_SELECTION_BUFFER_POINTER:
2113
- return g_current_sel_buffer;
2114
- default:
2115
- rb_raise(rb_eArgError, "Invalid pname %d",pname);
2116
- break; /* not reached */
2117
- }
2118
- return Qnil;
2091
+ GLenum pname;
2092
+ pname = (GLenum)NUM2INT(arg1);
2093
+ switch (pname) {
2094
+ case GL_VERTEX_ARRAY_POINTER:
2095
+ return g_Vertex_ptr;
2096
+ case GL_NORMAL_ARRAY_POINTER:
2097
+ return g_Normal_ptr;
2098
+ case GL_COLOR_ARRAY_POINTER:
2099
+ return g_Color_ptr;
2100
+ case GL_INDEX_ARRAY_POINTER:
2101
+ return g_Index_ptr;
2102
+ case GL_TEXTURE_COORD_ARRAY_POINTER:
2103
+ return g_TexCoord_ptr;
2104
+ case GL_EDGE_FLAG_ARRAY_POINTER:
2105
+ return g_EdgeFlag_ptr;
2106
+ case GL_FOG_COORD_ARRAY_POINTER:
2107
+ return g_FogCoord_ptr;
2108
+ case GL_SECONDARY_COLOR_ARRAY_POINTER:
2109
+ return g_SecondaryColor_ptr;
2110
+ case GL_FEEDBACK_BUFFER_POINTER:
2111
+ return g_current_feed_buffer;
2112
+ case GL_SELECTION_BUFFER_POINTER:
2113
+ return g_current_sel_buffer;
2114
+ default:
2115
+ rb_raise(rb_eArgError, "Invalid pname %d",pname);
2116
+ break; /* not reached */
2117
+ }
2118
+ return Qnil;
2119
2119
  }
2120
2120
 
2121
2121
  static VALUE
2122
2122
  gl_IndexPointer(obj,arg1,arg2,arg3)
2123
2123
  VALUE obj,arg1,arg2,arg3;
2124
2124
  {
2125
- GLenum type;
2126
- GLsizei stride;
2127
- type = (GLenum)NUM2INT(arg1);
2128
- stride = (GLsizei)NUM2UINT(arg2);
2129
- if (CheckBufferBinding(GL_ARRAY_BUFFER_BINDING)) {
2130
- g_Index_ptr = arg3;
2131
- glIndexPointer(type, stride, (const GLvoid*)NUM2LONG(arg3));
2132
- } else {
2133
- VALUE data;
2134
- data = pack_array_or_pass_string(type,arg3);
2135
- g_Index_ptr = data;
2136
- glIndexPointer(type, stride, (const GLvoid*)RSTRING_PTR(data));
2137
- }
2138
- CHECK_GLERROR_FROM("glIndexPointer");
2139
- return Qnil;
2125
+ GLenum type;
2126
+ GLsizei stride;
2127
+ type = (GLenum)NUM2INT(arg1);
2128
+ stride = (GLsizei)NUM2UINT(arg2);
2129
+ if (CheckBufferBinding(GL_ARRAY_BUFFER_BINDING)) {
2130
+ g_Index_ptr = arg3;
2131
+ glIndexPointer(type, stride, (const GLvoid*)NUM2SIZET(arg3));
2132
+ } else {
2133
+ VALUE data;
2134
+ data = pack_array_or_pass_string(type,arg3);
2135
+ g_Index_ptr = data;
2136
+ glIndexPointer(type, stride, (const GLvoid*)RSTRING_PTR(data));
2137
+ }
2138
+ CHECK_GLERROR_FROM("glIndexPointer");
2139
+ return Qnil;
2140
2140
  }
2141
2141
 
2142
2142
  static VALUE
2143
2143
  gl_InterleavedArrays(obj,arg1,arg2,arg3)
2144
2144
  VALUE obj,arg1,arg2,arg3;
2145
2145
  {
2146
- GLenum format;
2147
- GLsizei stride;
2148
- VALUE data;
2149
- format = (GLenum)NUM2INT(arg1);
2150
- stride = (GLsizei)NUM2UINT(arg2);
2151
- /* FIXME: add support for GL_C4UB_V2F,GL_C4UB_V3F, GL_T2F_C4UB_V3 */
2152
- data = pack_array_or_pass_string(GL_FLOAT,arg3);
2153
- rb_str_freeze(data);
2154
- glInterleavedArrays(format, stride, (const GLvoid*)RSTRING_PTR(data));
2155
- CHECK_GLERROR_FROM("glInterleavedArrays");
2156
- return Qnil;
2146
+ GLenum format;
2147
+ GLsizei stride;
2148
+ VALUE data;
2149
+ format = (GLenum)NUM2INT(arg1);
2150
+ stride = (GLsizei)NUM2UINT(arg2);
2151
+ /* FIXME: add support for GL_C4UB_V2F,GL_C4UB_V3F, GL_T2F_C4UB_V3 */
2152
+ data = pack_array_or_pass_string(GL_FLOAT,arg3);
2153
+ rb_str_freeze(data);
2154
+ glInterleavedArrays(format, stride, (const GLvoid*)RSTRING_PTR(data));
2155
+ CHECK_GLERROR_FROM("glInterleavedArrays");
2156
+ return Qnil;
2157
2157
  }
2158
2158
 
2159
2159
  static VALUE
2160
2160
  gl_NormalPointer(obj,arg1,arg2,arg3)
2161
2161
  VALUE obj,arg1,arg2,arg3;
2162
2162
  {
2163
- GLenum type;
2164
- GLsizei stride;
2165
- type = (GLenum)NUM2INT(arg1);
2166
- stride = (GLsizei)NUM2UINT(arg2);
2167
- if (CheckBufferBinding(GL_ARRAY_BUFFER_BINDING)) {
2168
- g_Normal_ptr = arg3;
2169
- glNormalPointer(type, stride, (const GLvoid*)NUM2LONG(arg3));
2170
- } else {
2171
- VALUE data;
2172
- data = pack_array_or_pass_string(type,arg3);
2173
- rb_str_freeze(data);
2174
- g_Normal_ptr = data;
2175
- glNormalPointer(type, stride, (const GLvoid*)RSTRING_PTR(data));
2176
- }
2177
- CHECK_GLERROR_FROM("glNormalPointer");
2178
- return Qnil;
2163
+ GLenum type;
2164
+ GLsizei stride;
2165
+ type = (GLenum)NUM2INT(arg1);
2166
+ stride = (GLsizei)NUM2UINT(arg2);
2167
+ if (CheckBufferBinding(GL_ARRAY_BUFFER_BINDING)) {
2168
+ g_Normal_ptr = arg3;
2169
+ glNormalPointer(type, stride, (const GLvoid*)NUM2SIZET(arg3));
2170
+ } else {
2171
+ VALUE data;
2172
+ data = pack_array_or_pass_string(type,arg3);
2173
+ rb_str_freeze(data);
2174
+ g_Normal_ptr = data;
2175
+ glNormalPointer(type, stride, (const GLvoid*)RSTRING_PTR(data));
2176
+ }
2177
+ CHECK_GLERROR_FROM("glNormalPointer");
2178
+ return Qnil;
2179
2179
  }
2180
2180
 
2181
2181
 
@@ -2183,99 +2183,99 @@ static VALUE
2183
2183
  gl_TexSubImage1D(obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7)
2184
2184
  VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7;
2185
2185
  {
2186
- GLenum target;
2187
- GLint level;
2188
- GLint xoffset;
2189
- GLsizei width;
2190
- GLenum format;
2191
- GLenum type;
2192
- VALUE data;
2193
- target = (GLenum)NUM2INT(arg1);
2194
- level = (GLint)NUM2INT(arg2);
2195
- xoffset = (GLint)NUM2INT(arg3);
2196
- width = (GLsizei)NUM2UINT(arg4);
2197
- format = (GLenum)NUM2INT(arg5);
2198
- type = (GLenum)NUM2INT(arg6);
2199
-
2200
- if (CheckBufferBinding(GL_PIXEL_UNPACK_BUFFER_BINDING)) {
2201
- glTexSubImage1D(target,level,xoffset,width,format,type,(GLvoid *)NUM2LONG(arg7));
2202
- CHECK_GLERROR_FROM("glTexSubImage1D");
2203
- return Qnil;
2204
- }
2186
+ GLenum target;
2187
+ GLint level;
2188
+ GLint xoffset;
2189
+ GLsizei width;
2190
+ GLenum format;
2191
+ GLenum type;
2192
+ VALUE data;
2193
+ target = (GLenum)NUM2INT(arg1);
2194
+ level = (GLint)NUM2INT(arg2);
2195
+ xoffset = (GLint)NUM2INT(arg3);
2196
+ width = (GLsizei)NUM2UINT(arg4);
2197
+ format = (GLenum)NUM2INT(arg5);
2198
+ type = (GLenum)NUM2INT(arg6);
2199
+
2200
+ if (CheckBufferBinding(GL_PIXEL_UNPACK_BUFFER_BINDING)) {
2201
+ glTexSubImage1D(target,level,xoffset,width,format,type,(GLvoid *)NUM2SIZET(arg7));
2202
+ CHECK_GLERROR_FROM("glTexSubImage1D");
2203
+ return Qnil;
2204
+ }
2205
2205
 
2206
- data = pack_array_or_pass_string(type,arg7);
2207
- CheckDataSize(type,format,width,data);
2206
+ data = pack_array_or_pass_string(type,arg7);
2207
+ CheckDataSize(type,format,width,data);
2208
2208
 
2209
- glTexSubImage1D(target,level,xoffset,width,format,type,RSTRING_PTR(data));
2210
- CHECK_GLERROR_FROM("glTexSubImage1D");
2211
- return Qnil;
2209
+ glTexSubImage1D(target,level,xoffset,width,format,type,RSTRING_PTR(data));
2210
+ CHECK_GLERROR_FROM("glTexSubImage1D");
2211
+ return Qnil;
2212
2212
  }
2213
2213
 
2214
2214
  static VALUE
2215
2215
  gl_TexSubImage2D(obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9)
2216
2216
  VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9;
2217
2217
  {
2218
- GLenum target;
2219
- GLint level;
2220
- GLint xoffset;
2221
- GLint yoffset;
2222
- GLsizei width;
2223
- GLsizei height;
2224
- GLenum format;
2225
- GLenum type;
2226
- VALUE data;
2227
- target = (GLenum)NUM2INT(arg1);
2228
- level = (GLint)NUM2INT(arg2);
2229
- xoffset = (GLint)NUM2INT(arg3);
2230
- yoffset = (GLint)NUM2INT(arg4);
2231
- width = (GLsizei)NUM2UINT(arg5);
2232
- height = (GLsizei)NUM2UINT(arg6);
2233
- format = (GLenum)NUM2INT(arg7);
2234
- type = (GLenum)NUM2INT(arg8);
2235
-
2236
- if (CheckBufferBinding(GL_PIXEL_UNPACK_BUFFER_BINDING)) {
2237
- glTexSubImage2D(target,level,xoffset,yoffset,width,height,format,type,(GLvoid *)NUM2LONG(arg9));
2238
- CHECK_GLERROR_FROM("glTexSubImage2D");
2239
- return Qnil;
2240
- }
2241
-
2242
- data = pack_array_or_pass_string(type,arg9);
2243
- CheckDataSize(type,format,width*height,data);
2244
-
2245
- glTexSubImage2D(target,level,xoffset,yoffset,width,height,format,type,RSTRING_PTR(data));
2246
- CHECK_GLERROR_FROM("glTexSubImage2D");
2247
- return Qnil;
2218
+ GLenum target;
2219
+ GLint level;
2220
+ GLint xoffset;
2221
+ GLint yoffset;
2222
+ GLsizei width;
2223
+ GLsizei height;
2224
+ GLenum format;
2225
+ GLenum type;
2226
+ VALUE data;
2227
+ target = (GLenum)NUM2INT(arg1);
2228
+ level = (GLint)NUM2INT(arg2);
2229
+ xoffset = (GLint)NUM2INT(arg3);
2230
+ yoffset = (GLint)NUM2INT(arg4);
2231
+ width = (GLsizei)NUM2UINT(arg5);
2232
+ height = (GLsizei)NUM2UINT(arg6);
2233
+ format = (GLenum)NUM2INT(arg7);
2234
+ type = (GLenum)NUM2INT(arg8);
2235
+
2236
+ if (CheckBufferBinding(GL_PIXEL_UNPACK_BUFFER_BINDING)) {
2237
+ glTexSubImage2D(target,level,xoffset,yoffset,width,height,format,type,(GLvoid *)NUM2SIZET(arg9));
2238
+ CHECK_GLERROR_FROM("glTexSubImage2D");
2239
+ return Qnil;
2240
+ }
2241
+
2242
+ data = pack_array_or_pass_string(type,arg9);
2243
+ CheckDataSize(type,format,width*height,data);
2244
+
2245
+ glTexSubImage2D(target,level,xoffset,yoffset,width,height,format,type,RSTRING_PTR(data));
2246
+ CHECK_GLERROR_FROM("glTexSubImage2D");
2247
+ return Qnil;
2248
2248
  }
2249
2249
 
2250
2250
  static VALUE
2251
2251
  gl_AreTexturesResident(obj,arg1)
2252
2252
  VALUE obj,arg1;
2253
2253
  {
2254
- GLuint *textures;
2255
- GLboolean *residences;
2256
- GLsizei size;
2257
- GLboolean r;
2258
- VALUE retary;
2259
- VALUE ary;
2260
- int i;
2261
- ary = rb_Array(arg1);
2262
- size = (int)RARRAY_LENINT(ary);
2263
- textures = ALLOC_N(GLuint,size);
2264
- residences = ALLOC_N(GLboolean,size);
2265
- ary2cuint(ary,textures,size);
2266
- r = glAreTexturesResident(size,textures,residences);
2267
- retary = rb_ary_new2(size);
2268
- if (r==GL_TRUE) { /* all are resident */
2269
- for(i=0;i<size;i++)
2270
- rb_ary_push(retary, GLBOOL2RUBY(GL_TRUE));
2271
- } else {
2272
- for(i=0;i<size;i++)
2273
- rb_ary_push(retary, GLBOOL2RUBY(residences[i]));
2274
- }
2275
- xfree(textures);
2276
- xfree(residences);
2277
- CHECK_GLERROR_FROM("glAreTexturesResident");
2278
- return retary;
2254
+ GLuint *textures;
2255
+ GLboolean *residences;
2256
+ GLsizei size;
2257
+ GLboolean r;
2258
+ VALUE retary;
2259
+ VALUE ary;
2260
+ int i;
2261
+ ary = rb_Array(arg1);
2262
+ size = (int)RARRAY_LENINT(ary);
2263
+ textures = ALLOC_N(GLuint,size);
2264
+ residences = ALLOC_N(GLboolean,size);
2265
+ ary2cuint(ary,textures,size);
2266
+ r = glAreTexturesResident(size,textures,residences);
2267
+ retary = rb_ary_new2(size);
2268
+ if (r==GL_TRUE) { /* all are resident */
2269
+ for(i=0;i<size;i++)
2270
+ rb_ary_push(retary, GLBOOL2RUBY(GL_TRUE));
2271
+ } else {
2272
+ for(i=0;i<size;i++)
2273
+ rb_ary_push(retary, GLBOOL2RUBY(residences[i]));
2274
+ }
2275
+ xfree(textures);
2276
+ xfree(residences);
2277
+ CHECK_GLERROR_FROM("glAreTexturesResident");
2278
+ return retary;
2279
2279
  }
2280
2280
 
2281
2281
  GL_FUNC_GENOBJECTS(GenTextures)
@@ -2285,34 +2285,34 @@ static VALUE
2285
2285
  gl_PrioritizeTextures(obj,arg1,arg2)
2286
2286
  VALUE obj,arg1,arg2;
2287
2287
  {
2288
- GLuint *textures;
2289
- GLclampf *priorities;
2290
- GLsizei size;
2291
- Check_Type(arg1,T_ARRAY);
2292
- Check_Type(arg2,T_ARRAY);
2293
- if ((size = (GLsizei)RARRAY_LENINT(arg1)) != (GLsizei)RARRAY_LENINT(arg2))
2294
- rb_raise(rb_eArgError, "passed arrays must have the same length");
2295
- textures = ALLOC_N(GLuint,size);
2296
- priorities = ALLOC_N(GLclampf,size);
2297
- ary2cuint(arg1,textures,size);
2298
- ary2cflt(arg2,priorities,size);
2299
- glPrioritizeTextures(size,textures,priorities);
2300
- xfree(textures);
2301
- xfree(priorities);
2302
- CHECK_GLERROR_FROM("glPrioritizeTextures");
2303
- return Qnil;
2288
+ GLuint *textures;
2289
+ GLclampf *priorities;
2290
+ GLsizei size;
2291
+ Check_Type(arg1,T_ARRAY);
2292
+ Check_Type(arg2,T_ARRAY);
2293
+ if ((size = (GLsizei)RARRAY_LENINT(arg1)) != (GLsizei)RARRAY_LENINT(arg2))
2294
+ rb_raise(rb_eArgError, "passed arrays must have the same length");
2295
+ textures = ALLOC_N(GLuint,size);
2296
+ priorities = ALLOC_N(GLclampf,size);
2297
+ ary2cuint(arg1,textures,size);
2298
+ ary2cflt(arg2,priorities,size);
2299
+ glPrioritizeTextures(size,textures,priorities);
2300
+ xfree(textures);
2301
+ xfree(priorities);
2302
+ CHECK_GLERROR_FROM("glPrioritizeTextures");
2303
+ return Qnil;
2304
2304
  }
2305
2305
 
2306
2306
  static VALUE
2307
2307
  gl_Indexubv(obj,arg1)
2308
2308
  VALUE obj,arg1;
2309
2309
  {
2310
- GLubyte c[1] = {0};
2311
- Check_Type(arg1,T_ARRAY);
2312
- ary2cubyte(arg1,c,1);
2313
- glIndexubv(c);
2314
- CHECK_GLERROR_FROM("glIndexubv");
2315
- return Qnil;
2310
+ GLubyte c[1] = {0};
2311
+ Check_Type(arg1,T_ARRAY);
2312
+ ary2cubyte(arg1,c,1);
2313
+ glIndexubv(c);
2314
+ CHECK_GLERROR_FROM("glIndexubv");
2315
+ return Qnil;
2316
2316
  }
2317
2317
 
2318
2318
 
@@ -2325,33 +2325,33 @@ int argc; \
2325
2325
  VALUE *argv; \
2326
2326
  VALUE obj; \
2327
2327
  { \
2328
- int num; \
2329
- VALUE args[4]; \
2330
- VALUE ary; \
2331
- switch (num = rb_scan_args(argc, argv, "13", &args[0], &args[1], &args[2], &args[3])) { \
2332
- case 1: \
2328
+ int num; \
2329
+ VALUE args[4]; \
2330
+ VALUE ary; \
2331
+ switch (num = rb_scan_args(argc, argv, "13", &args[0], &args[1], &args[2], &args[3])) { \
2332
+ case 1: \
2333
2333
  ary = rb_convert_type(args[0], T_ARRAY, "Array", "to_a"); \
2334
- switch (RARRAY_LEN(ary)) { \
2335
- case 3: \
2336
- gl_Color3##_type_(obj,RARRAY_PTR(ary)[0],RARRAY_PTR(ary)[1],RARRAY_PTR(ary)[2]); \
2337
- break; \
2338
- case 4: \
2339
- gl_Color4##_type_(obj,RARRAY_PTR(ary)[0],RARRAY_PTR(ary)[1],RARRAY_PTR(ary)[2],RARRAY_PTR(ary)[3]); \
2340
- break; \
2341
- default: \
2342
- rb_raise(rb_eArgError, "array length:%li", RARRAY_LEN(ary)); \
2343
- } \
2344
- break; \
2345
- case 3: \
2346
- gl_Color3##_type_(obj,args[0], args[1], args[2]); \
2347
- break; \
2348
- case 4: \
2349
- gl_Color4##_type_(obj,args[0], args[1], args[2], args[3]); \
2350
- break; \
2351
- default: \
2352
- rb_raise(rb_eArgError, "arg length:%d", num); \
2353
- } \
2354
- return Qnil; \
2334
+ switch (RARRAY_LEN(ary)) { \
2335
+ case 3: \
2336
+ gl_Color3##_type_(obj,RARRAY_PTR(ary)[0],RARRAY_PTR(ary)[1],RARRAY_PTR(ary)[2]); \
2337
+ break; \
2338
+ case 4: \
2339
+ gl_Color4##_type_(obj,RARRAY_PTR(ary)[0],RARRAY_PTR(ary)[1],RARRAY_PTR(ary)[2],RARRAY_PTR(ary)[3]); \
2340
+ break; \
2341
+ default: \
2342
+ rb_raise(rb_eArgError, "array length:%li", RARRAY_LEN(ary)); \
2343
+ } \
2344
+ break; \
2345
+ case 3: \
2346
+ gl_Color3##_type_(obj,args[0], args[1], args[2]); \
2347
+ break; \
2348
+ case 4: \
2349
+ gl_Color4##_type_(obj,args[0], args[1], args[2], args[3]); \
2350
+ break; \
2351
+ default: \
2352
+ rb_raise(rb_eArgError, "arg length:%d", num); \
2353
+ } \
2354
+ return Qnil; \
2355
2355
  }
2356
2356
 
2357
2357
  GLCOLOR_VFUNC(b)
@@ -2371,27 +2371,27 @@ int argc; \
2371
2371
  VALUE *argv; \
2372
2372
  VALUE obj; \
2373
2373
  { \
2374
- int num; \
2375
- VALUE args[3]; \
2376
- VALUE ary; \
2377
- switch (num = rb_scan_args(argc, argv, "12", &args[0], &args[1], &args[2])) { \
2378
- case 1: \
2374
+ int num; \
2375
+ VALUE args[3]; \
2376
+ VALUE ary; \
2377
+ switch (num = rb_scan_args(argc, argv, "12", &args[0], &args[1], &args[2])) { \
2378
+ case 1: \
2379
2379
  ary = rb_convert_type(args[0], T_ARRAY, "Array", "to_a"); \
2380
- switch (RARRAY_LEN(ary)) { \
2381
- case 3: \
2382
- gl_Normal3##_type_(obj,RARRAY_PTR(ary)[0], RARRAY_PTR(ary)[1],RARRAY_PTR(ary)[2]); \
2383
- break; \
2384
- default: \
2385
- rb_raise(rb_eArgError, "array length: %li", RARRAY_LEN(ary)); \
2386
- } \
2387
- break; \
2388
- case 3: \
2389
- gl_Normal3##_type_(obj,args[0], args[1], args[2]); \
2390
- break; \
2391
- default: \
2392
- rb_raise(rb_eArgError, "arg length:%d",num); \
2393
- } \
2394
- return Qnil; \
2380
+ switch (RARRAY_LEN(ary)) { \
2381
+ case 3: \
2382
+ gl_Normal3##_type_(obj,RARRAY_PTR(ary)[0], RARRAY_PTR(ary)[1],RARRAY_PTR(ary)[2]); \
2383
+ break; \
2384
+ default: \
2385
+ rb_raise(rb_eArgError, "array length: %li", RARRAY_LEN(ary)); \
2386
+ } \
2387
+ break; \
2388
+ case 3: \
2389
+ gl_Normal3##_type_(obj,args[0], args[1], args[2]); \
2390
+ break; \
2391
+ default: \
2392
+ rb_raise(rb_eArgError, "arg length:%d",num); \
2393
+ } \
2394
+ return Qnil; \
2395
2395
  }
2396
2396
 
2397
2397
  GLNORMAL_VFUNC(b)
@@ -2408,39 +2408,39 @@ int argc; \
2408
2408
  VALUE *argv; \
2409
2409
  VALUE obj; \
2410
2410
  { \
2411
- int num; \
2412
- VALUE args[4]; \
2413
- VALUE ary; \
2414
- switch (num = rb_scan_args(argc, argv, "13", &args[0], &args[1], &args[2], &args[3])) { \
2415
- case 1: \
2411
+ int num; \
2412
+ VALUE args[4]; \
2413
+ VALUE ary; \
2414
+ switch (num = rb_scan_args(argc, argv, "13", &args[0], &args[1], &args[2], &args[3])) { \
2415
+ case 1: \
2416
2416
  ary = rb_convert_type(args[0], T_ARRAY, "Array", "to_a"); \
2417
- switch (RARRAY_LEN(ary)) { \
2418
- case 2: \
2419
- gl_RasterPos2##_type_(obj,RARRAY_PTR(ary)[0],RARRAY_PTR(ary)[1]); \
2420
- break; \
2421
- case 3: \
2422
- gl_RasterPos3##_type_(obj,RARRAY_PTR(ary)[0],RARRAY_PTR(ary)[1],RARRAY_PTR(ary)[2]); \
2423
- break; \
2424
- case 4: \
2425
- gl_RasterPos4##_type_(obj,RARRAY_PTR(ary)[0],RARRAY_PTR(ary)[1],RARRAY_PTR(ary)[2],RARRAY_PTR(ary)[3]); \
2426
- break; \
2427
- default: \
2428
- rb_raise(rb_eArgError, "array length:%d", num); \
2429
- } \
2430
- break; \
2431
- case 2: \
2432
- gl_RasterPos2##_type_(obj,args[0], args[1]); \
2433
- break; \
2434
- case 3: \
2435
- gl_RasterPos3##_type_(obj,args[0], args[1], args[2]); \
2436
- break; \
2437
- case 4: \
2438
- gl_RasterPos4##_type_(obj,args[0], args[1], args[2], args[3]); \
2439
- break; \
2440
- default: \
2441
- rb_raise(rb_eArgError, "too many arguments"); \
2442
- } \
2443
- return Qnil; \
2417
+ switch (RARRAY_LEN(ary)) { \
2418
+ case 2: \
2419
+ gl_RasterPos2##_type_(obj,RARRAY_PTR(ary)[0],RARRAY_PTR(ary)[1]); \
2420
+ break; \
2421
+ case 3: \
2422
+ gl_RasterPos3##_type_(obj,RARRAY_PTR(ary)[0],RARRAY_PTR(ary)[1],RARRAY_PTR(ary)[2]); \
2423
+ break; \
2424
+ case 4: \
2425
+ gl_RasterPos4##_type_(obj,RARRAY_PTR(ary)[0],RARRAY_PTR(ary)[1],RARRAY_PTR(ary)[2],RARRAY_PTR(ary)[3]); \
2426
+ break; \
2427
+ default: \
2428
+ rb_raise(rb_eArgError, "array length:%d", num); \
2429
+ } \
2430
+ break; \
2431
+ case 2: \
2432
+ gl_RasterPos2##_type_(obj,args[0], args[1]); \
2433
+ break; \
2434
+ case 3: \
2435
+ gl_RasterPos3##_type_(obj,args[0], args[1], args[2]); \
2436
+ break; \
2437
+ case 4: \
2438
+ gl_RasterPos4##_type_(obj,args[0], args[1], args[2], args[3]); \
2439
+ break; \
2440
+ default: \
2441
+ rb_raise(rb_eArgError, "too many arguments"); \
2442
+ } \
2443
+ return Qnil; \
2444
2444
  }
2445
2445
 
2446
2446
  GLRASTERPOS_VFUNC(d)
@@ -2456,32 +2456,32 @@ int argc; \
2456
2456
  VALUE *argv; \
2457
2457
  VALUE obj; \
2458
2458
  { \
2459
- int num; \
2460
- VALUE args[4]; \
2461
- VALUE ary1, ary2; \
2462
- switch (num = rb_scan_args(argc, argv, "22", &args[0], &args[1], &args[2], &args[3])) { \
2463
- case 2: \
2459
+ int num; \
2460
+ VALUE args[4]; \
2461
+ VALUE ary1, ary2; \
2462
+ switch (num = rb_scan_args(argc, argv, "22", &args[0], &args[1], &args[2], &args[3])) { \
2463
+ case 2: \
2464
2464
  ary1 = rb_convert_type(args[0], T_ARRAY, "Array", "to_a"); \
2465
2465
  ary2 = rb_convert_type(args[1], T_ARRAY, "Array", "to_a"); \
2466
2466
  if (RARRAY_LEN(ary1) != 2) \
2467
- rb_raise(rb_eArgError, "first array must be of length 2 (was %li)", \
2467
+ rb_raise(rb_eArgError, "first array must be of length 2 (was %li)", \
2468
2468
  RARRAY_LEN(ary1)); \
2469
2469
  \
2470
2470
  if (RARRAY_LEN(ary2) != 2) \
2471
- rb_raise(rb_eArgError, "second array must be of length 2 (was %li)", \
2471
+ rb_raise(rb_eArgError, "second array must be of length 2 (was %li)", \
2472
2472
  RARRAY_LEN(ary2)); \
2473
2473
  \
2474
2474
  gl_Rect##_type_(obj, \
2475
2475
  RARRAY_PTR(ary1)[0], RARRAY_PTR(ary1)[1], \
2476
2476
  RARRAY_PTR(ary2)[0], RARRAY_PTR(ary2)[1]); \
2477
- break; \
2478
- case 4: \
2479
- gl_Rect##_type_(obj,args[0], args[1], args[2], args[3]); \
2480
- break; \
2481
- default: \
2482
- rb_raise(rb_eArgError, "arg length: %d", num); \
2483
- } \
2484
- return Qnil; \
2477
+ break; \
2478
+ case 4: \
2479
+ gl_Rect##_type_(obj,args[0], args[1], args[2], args[3]); \
2480
+ break; \
2481
+ default: \
2482
+ rb_raise(rb_eArgError, "arg length: %d", num); \
2483
+ } \
2484
+ return Qnil; \
2485
2485
  }
2486
2486
 
2487
2487
  GLRECT_VFUNC(d)
@@ -2497,43 +2497,43 @@ int argc; \
2497
2497
  VALUE *argv; \
2498
2498
  VALUE obj; \
2499
2499
  { \
2500
- int num; \
2501
- VALUE args[4]; \
2502
- VALUE ary; \
2503
- switch (num = rb_scan_args(argc, argv, "13", &args[0], &args[1], &args[2], &args[3])) { \
2504
- case 1: \
2500
+ int num; \
2501
+ VALUE args[4]; \
2502
+ VALUE ary; \
2503
+ switch (num = rb_scan_args(argc, argv, "13", &args[0], &args[1], &args[2], &args[3])) { \
2504
+ case 1: \
2505
2505
  ary = rb_convert_type(args[0], T_ARRAY, "Array", "to_a"); \
2506
- switch (RARRAY_LEN(ary)) { \
2507
- case 1: \
2508
- gl_TexCoord1##_type_(obj,RARRAY_PTR(ary)[0]); \
2509
- break; \
2510
- case 2: \
2511
- gl_TexCoord2##_type_(obj,RARRAY_PTR(ary)[0],RARRAY_PTR(ary)[1]); \
2512
- break; \
2513
- case 3: \
2514
- gl_TexCoord3##_type_(obj,RARRAY_PTR(ary)[0],RARRAY_PTR(ary)[1],RARRAY_PTR(ary)[2]); \
2515
- break; \
2516
- case 4: \
2517
- gl_TexCoord4##_type_(obj,RARRAY_PTR(ary)[0],RARRAY_PTR(ary)[1],RARRAY_PTR(ary)[2],RARRAY_PTR(ary)[3]); \
2518
- break; \
2519
- default: \
2520
- rb_raise(rb_eArgError, "array length: %d", num); \
2521
- } \
2522
- break; \
2523
- case 2: \
2524
- gl_TexCoord2##_type_(obj,args[0], args[1]); \
2525
- break; \
2526
- case 3: \
2527
- gl_TexCoord3##_type_(obj,args[0], args[1], args[2]); \
2528
- break; \
2529
- case 4: \
2530
- gl_TexCoord4##_type_(obj,args[0], args[1], args[2], args[3]); \
2531
- break; \
2532
- default: \
2533
- rb_raise(rb_eArgError, "too many arguments"); \
2534
- break; \
2535
- } \
2536
- return Qnil; \
2506
+ switch (RARRAY_LEN(ary)) { \
2507
+ case 1: \
2508
+ gl_TexCoord1##_type_(obj,RARRAY_PTR(ary)[0]); \
2509
+ break; \
2510
+ case 2: \
2511
+ gl_TexCoord2##_type_(obj,RARRAY_PTR(ary)[0],RARRAY_PTR(ary)[1]); \
2512
+ break; \
2513
+ case 3: \
2514
+ gl_TexCoord3##_type_(obj,RARRAY_PTR(ary)[0],RARRAY_PTR(ary)[1],RARRAY_PTR(ary)[2]); \
2515
+ break; \
2516
+ case 4: \
2517
+ gl_TexCoord4##_type_(obj,RARRAY_PTR(ary)[0],RARRAY_PTR(ary)[1],RARRAY_PTR(ary)[2],RARRAY_PTR(ary)[3]); \
2518
+ break; \
2519
+ default: \
2520
+ rb_raise(rb_eArgError, "array length: %d", num); \
2521
+ } \
2522
+ break; \
2523
+ case 2: \
2524
+ gl_TexCoord2##_type_(obj,args[0], args[1]); \
2525
+ break; \
2526
+ case 3: \
2527
+ gl_TexCoord3##_type_(obj,args[0], args[1], args[2]); \
2528
+ break; \
2529
+ case 4: \
2530
+ gl_TexCoord4##_type_(obj,args[0], args[1], args[2], args[3]); \
2531
+ break; \
2532
+ default: \
2533
+ rb_raise(rb_eArgError, "too many arguments"); \
2534
+ break; \
2535
+ } \
2536
+ return Qnil; \
2537
2537
  }
2538
2538
 
2539
2539
  GLTEXCOORD_VFUNC(d)
@@ -2549,39 +2549,39 @@ int argc; \
2549
2549
  VALUE *argv; \
2550
2550
  VALUE obj; \
2551
2551
  { \
2552
- VALUE args[4]; \
2553
- VALUE ary; \
2554
- switch (rb_scan_args(argc, argv, "13", &args[0], &args[1], &args[2], &args[3])) { \
2555
- case 1: \
2552
+ VALUE args[4]; \
2553
+ VALUE ary; \
2554
+ switch (rb_scan_args(argc, argv, "13", &args[0], &args[1], &args[2], &args[3])) { \
2555
+ case 1: \
2556
2556
  ary = rb_convert_type(args[0], T_ARRAY, "Array", "to_a"); \
2557
- switch (RARRAY_LEN(ary)) { \
2558
- case 2: \
2559
- gl_Vertex2##_type_(obj,RARRAY_PTR(ary)[0],RARRAY_PTR(ary)[1]); \
2560
- break; \
2561
- case 3: \
2562
- gl_Vertex3##_type_(obj,RARRAY_PTR(ary)[0],RARRAY_PTR(ary)[1],RARRAY_PTR(ary)[2]); \
2563
- break; \
2564
- case 4: \
2565
- gl_Vertex4##_type_(obj,RARRAY_PTR(ary)[0],RARRAY_PTR(ary)[1],RARRAY_PTR(ary)[2],RARRAY_PTR(ary)[3]); \
2566
- break; \
2567
- default: \
2568
- rb_raise(rb_eRuntimeError, "glVertex vertex num error!: %ld", RARRAY_LEN(ary)); \
2569
- } \
2570
- break; \
2571
- case 2: \
2572
- gl_Vertex2##_type_(obj,args[0], args[1]); \
2573
- break; \
2574
- case 3: \
2575
- gl_Vertex3##_type_(obj,args[0], args[1], args[2]); \
2576
- break; \
2577
- case 4: \
2578
- gl_Vertex4##_type_(obj,args[0], args[1], args[2], args[3]); \
2579
- break; \
2580
- default: \
2581
- rb_raise(rb_eArgError, "too many arguments"); \
2582
- break; \
2583
- } \
2584
- return Qnil; \
2557
+ switch (RARRAY_LEN(ary)) { \
2558
+ case 2: \
2559
+ gl_Vertex2##_type_(obj,RARRAY_PTR(ary)[0],RARRAY_PTR(ary)[1]); \
2560
+ break; \
2561
+ case 3: \
2562
+ gl_Vertex3##_type_(obj,RARRAY_PTR(ary)[0],RARRAY_PTR(ary)[1],RARRAY_PTR(ary)[2]); \
2563
+ break; \
2564
+ case 4: \
2565
+ gl_Vertex4##_type_(obj,RARRAY_PTR(ary)[0],RARRAY_PTR(ary)[1],RARRAY_PTR(ary)[2],RARRAY_PTR(ary)[3]); \
2566
+ break; \
2567
+ default: \
2568
+ rb_raise(rb_eRuntimeError, "glVertex vertex num error!: %ld", RARRAY_LEN(ary)); \
2569
+ } \
2570
+ break; \
2571
+ case 2: \
2572
+ gl_Vertex2##_type_(obj,args[0], args[1]); \
2573
+ break; \
2574
+ case 3: \
2575
+ gl_Vertex3##_type_(obj,args[0], args[1], args[2]); \
2576
+ break; \
2577
+ case 4: \
2578
+ gl_Vertex4##_type_(obj,args[0], args[1], args[2], args[3]); \
2579
+ break; \
2580
+ default: \
2581
+ rb_raise(rb_eArgError, "too many arguments"); \
2582
+ break; \
2583
+ } \
2584
+ return Qnil; \
2585
2585
  }
2586
2586
 
2587
2587
  GLVERTEX_VFUNC(d)
@@ -2596,12 +2596,12 @@ static VALUE
2596
2596
  gl_LightModel(obj,arg1,arg2)
2597
2597
  VALUE obj,arg1,arg2;
2598
2598
  {
2599
- if (TYPE(arg2) == T_ARRAY)
2600
- gl_LightModelfv(obj,arg1,arg2);
2601
- else
2602
- gl_LightModelf(obj,arg1,arg2);
2599
+ if (TYPE(arg2) == T_ARRAY)
2600
+ gl_LightModelfv(obj,arg1,arg2);
2601
+ else
2602
+ gl_LightModelf(obj,arg1,arg2);
2603
2603
 
2604
- return Qnil;
2604
+ return Qnil;
2605
2605
  }
2606
2606
 
2607
2607
  static VALUE
@@ -2609,467 +2609,467 @@ gl_Material(VALUE self, VALUE face, VALUE pname, VALUE param)
2609
2609
  {
2610
2610
  VALUE ary;
2611
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);
2612
+ if (RB_TYPE_P(param, T_ARRAY)) {
2613
+ gl_Materialfv(self, face, pname, param);
2614
+ } else if (rb_respond_to(param, rb_intern("to_a")) && (ary = rb_convert_type(param, T_ARRAY, "Array", "to_a"))) {
2615
+ gl_Materialfv(self, face, pname, ary);
2616
2616
  } else {
2617
- gl_Materialf(self, face, pname, param);
2617
+ gl_Materialf(self, face, pname, param);
2618
2618
  }
2619
2619
 
2620
- return Qnil;
2620
+ return Qnil;
2621
2621
  }
2622
2622
 
2623
2623
  static VALUE
2624
2624
  gl_Fog(obj,arg1,arg2)
2625
2625
  VALUE obj,arg1,arg2;
2626
2626
  {
2627
- if (TYPE(arg2) == T_ARRAY)
2628
- gl_Fogfv(obj,arg1,arg2);
2629
- else
2630
- gl_Fogf(obj,arg1,arg2);
2627
+ if (TYPE(arg2) == T_ARRAY)
2628
+ gl_Fogfv(obj,arg1,arg2);
2629
+ else
2630
+ gl_Fogf(obj,arg1,arg2);
2631
2631
 
2632
- return Qnil;
2632
+ return Qnil;
2633
2633
  }
2634
2634
 
2635
2635
  static VALUE
2636
2636
  gl_Light(obj,arg1,arg2,arg3)
2637
2637
  VALUE obj,arg1,arg2,arg3;
2638
2638
  {
2639
- if (TYPE(arg3) == T_ARRAY)
2640
- gl_Lightfv(obj,arg1,arg2,arg3);
2641
- else
2642
- gl_Lightf(obj,arg1,arg2,arg3);
2639
+ if (TYPE(arg3) == T_ARRAY)
2640
+ gl_Lightfv(obj,arg1,arg2,arg3);
2641
+ else
2642
+ gl_Lightf(obj,arg1,arg2,arg3);
2643
2643
 
2644
- return Qnil;
2644
+ return Qnil;
2645
2645
  }
2646
2646
 
2647
2647
  static VALUE
2648
2648
  gl_TexParameter(obj,arg1,arg2,arg3)
2649
2649
  VALUE obj,arg1,arg2,arg3;
2650
2650
  {
2651
- if (TYPE(arg3) == T_ARRAY)
2652
- gl_TexParameterfv(obj,arg1,arg2,arg3);
2653
- else
2654
- gl_TexParameterf(obj,arg1,arg2,arg3);
2651
+ if (TYPE(arg3) == T_ARRAY)
2652
+ gl_TexParameterfv(obj,arg1,arg2,arg3);
2653
+ else
2654
+ gl_TexParameterf(obj,arg1,arg2,arg3);
2655
2655
 
2656
- return Qnil;
2656
+ return Qnil;
2657
2657
  }
2658
2658
 
2659
2659
  static VALUE
2660
2660
  gl_TexEnv(obj,arg1,arg2,arg3)
2661
2661
  VALUE obj,arg1,arg2,arg3;
2662
2662
  {
2663
- if (TYPE(arg3) == T_ARRAY)
2664
- gl_TexEnvfv(obj,arg1,arg2,arg3);
2665
- else
2666
- gl_TexEnvf(obj,arg1,arg2,arg3);
2663
+ if (TYPE(arg3) == T_ARRAY)
2664
+ gl_TexEnvfv(obj,arg1,arg2,arg3);
2665
+ else
2666
+ gl_TexEnvf(obj,arg1,arg2,arg3);
2667
2667
 
2668
- return Qnil;
2668
+ return Qnil;
2669
2669
  }
2670
2670
 
2671
2671
  static VALUE
2672
2672
  gl_TexGen(obj,arg1,arg2,arg3)
2673
2673
  VALUE obj,arg1,arg2,arg3;
2674
2674
  {
2675
- if (TYPE(arg3) == T_ARRAY)
2676
- gl_TexGenfv(obj,arg1,arg2,arg3);
2677
- else
2678
- gl_TexGenf(obj,arg1,arg2,arg3);
2675
+ if (TYPE(arg3) == T_ARRAY)
2676
+ gl_TexGenfv(obj,arg1,arg2,arg3);
2677
+ else
2678
+ gl_TexGenf(obj,arg1,arg2,arg3);
2679
2679
 
2680
- return Qnil;
2680
+ return Qnil;
2681
2681
  }
2682
2682
 
2683
2683
  /* init */
2684
2684
  void gl_init_functions_1_0__1_1(VALUE module)
2685
2685
  {
2686
- g_FogCoord_ptr = 0; /* for use in gl-1.4.c */
2687
- g_SecondaryColor_ptr = 0; /* for use in gl-1.4.c */
2688
-
2689
- /* OpenGL 1.0 functions */
2690
- rb_define_module_function(module, "glNewList", gl_NewList, 2);
2691
- rb_define_module_function(module, "glEndList", gl_EndList, 0);
2692
- rb_define_module_function(module, "glCallList", gl_CallList, 1);
2693
- rb_define_module_function(module, "glCallLists", gl_CallLists, 2);
2694
- rb_define_module_function(module, "glDeleteLists", gl_DeleteLists, 2);
2695
- rb_define_module_function(module, "glGenLists", gl_GenLists, 1);
2696
- rb_define_module_function(module, "glListBase", gl_ListBase, 1);
2697
- rb_define_module_function(module, "glBegin", gl_Begin, 1);
2698
- rb_define_module_function(module, "glBitmap", gl_Bitmap, 7);
2699
- rb_define_module_function(module, "glColor3b", gl_Color3b, 3);
2700
- rb_define_module_function(module, "glColor3d", gl_Color3d, 3);
2701
- rb_define_module_function(module, "glColor3f", gl_Color3f, 3);
2702
- rb_define_module_function(module, "glColor3i", gl_Color3i, 3);
2703
- rb_define_module_function(module, "glColor3s", gl_Color3s, 3);
2704
- rb_define_module_function(module, "glColor3ub", gl_Color3ub, 3);
2705
- rb_define_module_function(module, "glColor3ui", gl_Color3ui, 3);
2706
- rb_define_module_function(module, "glColor3us", gl_Color3us, 3);
2707
- rb_define_module_function(module, "glColor4b", gl_Color4b, 4);
2708
- rb_define_module_function(module, "glColor4d", gl_Color4d, 4);
2709
- rb_define_module_function(module, "glColor4f", gl_Color4f, 4);
2710
- rb_define_module_function(module, "glColor4i", gl_Color4i, 4);
2711
- rb_define_module_function(module, "glColor4s", gl_Color4s, 4);
2712
- rb_define_module_function(module, "glColor4ub", gl_Color4ub, 4);
2713
- rb_define_module_function(module, "glColor4ui", gl_Color4ui, 4);
2714
- rb_define_module_function(module, "glColor4us", gl_Color4us, 4);
2715
- rb_define_module_function(module, "glEdgeFlag", gl_EdgeFlag, 1);
2716
- rb_define_module_function(module, "glEdgeFlagv", gl_EdgeFlagv, 1);
2717
- rb_define_module_function(module, "glEnd", gl_End, 0);
2718
- rb_define_module_function(module, "glIndexd", gl_Indexd, 1);
2719
- rb_define_module_function(module, "glIndexdv", gl_Indexdv, 1);
2720
- rb_define_module_function(module, "glIndexf", gl_Indexf, 1);
2721
- rb_define_module_function(module, "glIndexfv", gl_Indexfv, 1);
2722
- rb_define_module_function(module, "glIndexi", gl_Indexi, 1);
2723
- rb_define_module_function(module, "glIndexiv", gl_Indexiv, 1);
2724
- rb_define_module_function(module, "glIndexs", gl_Indexs, 1);
2725
- rb_define_module_function(module, "glIndexsv", gl_Indexsv, 1);
2726
- rb_define_module_function(module, "glNormal3b", gl_Normal3b, 3);
2727
- rb_define_module_function(module, "glNormal3d", gl_Normal3d, 3);
2728
- rb_define_module_function(module, "glNormal3f", gl_Normal3f, 3);
2729
- rb_define_module_function(module, "glNormal3i", gl_Normal3i, 3);
2730
- rb_define_module_function(module, "glNormal3s", gl_Normal3s, 3);
2731
- rb_define_module_function(module, "glRasterPos2d", gl_RasterPos2d, 2);
2732
- rb_define_module_function(module, "glRasterPos2f", gl_RasterPos2f, 2);
2733
- rb_define_module_function(module, "glRasterPos2i", gl_RasterPos2i, 2);
2734
- rb_define_module_function(module, "glRasterPos2s", gl_RasterPos2s, 2);
2735
- rb_define_module_function(module, "glRasterPos3d", gl_RasterPos3d, 3);
2736
- rb_define_module_function(module, "glRasterPos3f", gl_RasterPos3f, 3);
2737
- rb_define_module_function(module, "glRasterPos3i", gl_RasterPos3i, 3);
2738
- rb_define_module_function(module, "glRasterPos3s", gl_RasterPos3s, 3);
2739
- rb_define_module_function(module, "glRasterPos4d", gl_RasterPos4d, 4);
2740
- rb_define_module_function(module, "glRasterPos4f", gl_RasterPos4f, 4);
2741
- rb_define_module_function(module, "glRasterPos4i", gl_RasterPos4i, 4);
2742
- rb_define_module_function(module, "glRasterPos4s", gl_RasterPos4s, 4);
2743
- rb_define_module_function(module, "glRectd", gl_Rectd, 4);
2744
- rb_define_module_function(module, "glRectf", gl_Rectf, 4);
2745
- rb_define_module_function(module, "glRecti", gl_Recti, 4);
2746
- rb_define_module_function(module, "glRects", gl_Rects, 4);
2747
- rb_define_module_function(module, "glTexCoord1d", gl_TexCoord1d, 1);
2748
- rb_define_module_function(module, "glTexCoord1f", gl_TexCoord1f, 1);
2749
- rb_define_module_function(module, "glTexCoord1i", gl_TexCoord1i, 1);
2750
- rb_define_module_function(module, "glTexCoord1s", gl_TexCoord1s, 1);
2751
- rb_define_module_function(module, "glTexCoord2d", gl_TexCoord2d, 2);
2752
- rb_define_module_function(module, "glTexCoord2f", gl_TexCoord2f, 2);
2753
- rb_define_module_function(module, "glTexCoord2i", gl_TexCoord2i, 2);
2754
- rb_define_module_function(module, "glTexCoord2s", gl_TexCoord2s, 2);
2755
- rb_define_module_function(module, "glTexCoord3d", gl_TexCoord3d, 3);
2756
- rb_define_module_function(module, "glTexCoord3f", gl_TexCoord3f, 3);
2757
- rb_define_module_function(module, "glTexCoord3i", gl_TexCoord3i, 3);
2758
- rb_define_module_function(module, "glTexCoord3s", gl_TexCoord3s, 3);
2759
- rb_define_module_function(module, "glTexCoord4d", gl_TexCoord4d, 4);
2760
- rb_define_module_function(module, "glTexCoord4f", gl_TexCoord4f, 4);
2761
- rb_define_module_function(module, "glTexCoord4i", gl_TexCoord4i, 4);
2762
- rb_define_module_function(module, "glTexCoord4s", gl_TexCoord4s, 4);
2763
- rb_define_module_function(module, "glVertex2d", gl_Vertex2d, 2);
2764
- rb_define_module_function(module, "glVertex2f", gl_Vertex2f, 2);
2765
- rb_define_module_function(module, "glVertex2i", gl_Vertex2i, 2);
2766
- rb_define_module_function(module, "glVertex2s", gl_Vertex2s, 2);
2767
- rb_define_module_function(module, "glVertex3d", gl_Vertex3d, 3);
2768
- rb_define_module_function(module, "glVertex3f", gl_Vertex3f, 3);
2769
- rb_define_module_function(module, "glVertex3i", gl_Vertex3i, 3);
2770
- rb_define_module_function(module, "glVertex3s", gl_Vertex3s, 3);
2771
- rb_define_module_function(module, "glVertex4d", gl_Vertex4d, 4);
2772
- rb_define_module_function(module, "glVertex4f", gl_Vertex4f, 4);
2773
- rb_define_module_function(module, "glVertex4i", gl_Vertex4i, 4);
2774
- rb_define_module_function(module, "glVertex4s", gl_Vertex4s, 4);
2775
- rb_define_module_function(module, "glClipPlane", gl_ClipPlane, 2);
2776
- rb_define_module_function(module, "glColorMaterial", gl_ColorMaterial, 2);
2777
- rb_define_module_function(module, "glCullFace", gl_CullFace, 1);
2778
- rb_define_module_function(module, "glFogf", gl_Fogf, 2);
2779
- rb_define_module_function(module, "glFogfv", gl_Fogfv, 2);
2780
- rb_define_module_function(module, "glFogi", gl_Fogi, 2);
2781
- rb_define_module_function(module, "glFogiv", gl_Fogiv, 2);
2782
- rb_define_module_function(module, "glFrontFace", gl_FrontFace, 1);
2783
- rb_define_module_function(module, "glHint", gl_Hint, 2);
2784
- rb_define_module_function(module, "glLightf", gl_Lightf, 3);
2785
- rb_define_module_function(module, "glLightfv", gl_Lightfv, 3);
2786
- rb_define_module_function(module, "glLighti", gl_Lighti, 3);
2787
- rb_define_module_function(module, "glLightiv", gl_Lightiv, 3);
2788
- rb_define_module_function(module, "glLightModelf", gl_LightModelf, 2);
2789
- rb_define_module_function(module, "glLightModelfv", gl_LightModelfv, 2);
2790
- rb_define_module_function(module, "glLightModeli", gl_LightModeli, 2);
2791
- rb_define_module_function(module, "glLightModeliv", gl_LightModeliv, 2);
2792
- rb_define_module_function(module, "glLineStipple", gl_LineStipple, 2);
2793
- rb_define_module_function(module, "glLineWidth", gl_LineWidth, 1);
2794
- rb_define_module_function(module, "glMaterialf", gl_Materialf, 3);
2795
- rb_define_module_function(module, "glMaterialfv", gl_Materialfv, 3);
2796
- rb_define_module_function(module, "glMateriali", gl_Materiali, 3);
2797
- rb_define_module_function(module, "glMaterialiv", gl_Materialiv, 3);
2798
- rb_define_module_function(module, "glPointSize", gl_PointSize, 1);
2799
- rb_define_module_function(module, "glPolygonMode", gl_PolygonMode, 2);
2800
- rb_define_module_function(module, "glPolygonStipple", gl_PolygonStipple, 1);
2801
- rb_define_module_function(module, "glScissor", gl_Scissor, 4);
2802
- rb_define_module_function(module, "glShadeModel", gl_ShadeModel, 1);
2803
- rb_define_module_function(module, "glTexParameterf", gl_TexParameterf, 3);
2804
- rb_define_module_function(module, "glTexParameterfv", gl_TexParameterfv, 3);
2805
- rb_define_module_function(module, "glTexParameteri", gl_TexParameteri, 3);
2806
- rb_define_module_function(module, "glTexParameteriv", gl_TexParameteriv, 3);
2807
- rb_define_module_function(module, "glTexImage1D", gl_TexImage1D, 8);
2808
- rb_define_module_function(module, "glTexImage2D", gl_TexImage2D, 9);
2809
- rb_define_module_function(module, "glTexEnvf", gl_TexEnvf, 3);
2810
- rb_define_module_function(module, "glTexEnvfv", gl_TexEnvfv, 3);
2811
- rb_define_module_function(module, "glTexEnvi", gl_TexEnvi, 3);
2812
- rb_define_module_function(module, "glTexEnviv", gl_TexEnviv, 3);
2813
- rb_define_module_function(module, "glTexGend", gl_TexGend, 3);
2814
- rb_define_module_function(module, "glTexGendv", gl_TexGendv, 3);
2815
- rb_define_module_function(module, "glTexGenf", gl_TexGenf, 3);
2816
- rb_define_module_function(module, "glTexGenfv", gl_TexGenfv, 3);
2817
- rb_define_module_function(module, "glTexGeni", gl_TexGeni, 3);
2818
- rb_define_module_function(module, "glTexGeniv", gl_TexGeniv, 3);
2819
- rb_define_module_function(module, "glFeedbackBuffer", gl_FeedbackBuffer, 2);
2820
- rb_define_module_function(module, "glSelectBuffer", gl_SelectBuffer, 1);
2821
- rb_define_module_function(module, "glRenderMode", gl_RenderMode, 1);
2822
- rb_define_module_function(module, "glInitNames", gl_InitNames, 0);
2823
- rb_define_module_function(module, "glLoadName", gl_LoadName, 1);
2824
- rb_define_module_function(module, "glPassThrough", gl_PassThrough, 1);
2825
- rb_define_module_function(module, "glPopName", gl_PopName, 0);
2826
- rb_define_module_function(module, "glPushName", gl_PushName, 1);
2827
- rb_define_module_function(module, "glDrawBuffer", gl_DrawBuffer, 1);
2828
- rb_define_module_function(module, "glClear", gl_Clear, 1);
2829
- rb_define_module_function(module, "glClearAccum", gl_ClearAccum, 4);
2830
- rb_define_module_function(module, "glClearIndex", gl_ClearIndex, 1);
2831
- rb_define_module_function(module, "glClearColor", gl_ClearColor, 4);
2832
- rb_define_module_function(module, "glClearStencil", gl_ClearStencil, 1);
2833
- rb_define_module_function(module, "glClearDepth", gl_ClearDepth, 1);
2834
- rb_define_module_function(module, "glStencilMask", gl_StencilMask, 1);
2835
- rb_define_module_function(module, "glColorMask", gl_ColorMask, 4);
2836
- rb_define_module_function(module, "glDepthMask", gl_DepthMask, 1);
2837
- rb_define_module_function(module, "glIndexMask", gl_IndexMask, 1);
2838
- rb_define_module_function(module, "glAccum", gl_Accum, 2);
2839
- rb_define_module_function(module, "glDisable", gl_Disable, -1);
2840
- rb_define_module_function(module, "glEnable", gl_Enable, -1);
2841
- rb_define_module_function(module, "glFinish", gl_Finish, 0);
2842
- rb_define_module_function(module, "glFlush", gl_Flush, 0);
2843
- rb_define_module_function(module, "glPopAttrib", gl_PopAttrib, 0);
2844
- rb_define_module_function(module, "glPushAttrib", gl_PushAttrib, 1);
2845
- rb_define_module_function(module, "glMap1d", gl_Map1d, 6);
2846
- rb_define_module_function(module, "glMap1f", gl_Map1f, 6);
2847
- rb_define_module_function(module, "glMap2d", gl_Map2d, 10);
2848
- rb_define_module_function(module, "glMap2f", gl_Map2f, 10);
2849
- rb_define_module_function(module, "glMapGrid1d", gl_MapGrid1d, 3);
2850
- rb_define_module_function(module, "glMapGrid1f", gl_MapGrid1f, 3);
2851
- rb_define_module_function(module, "glMapGrid2d", gl_MapGrid2d, 6);
2852
- rb_define_module_function(module, "glMapGrid2f", gl_MapGrid2f, 6);
2853
- rb_define_module_function(module, "glEvalCoord1d", gl_EvalCoord1d, 1);
2854
- rb_define_module_function(module, "glEvalCoord1dv", gl_EvalCoord1dv, 1);
2855
- rb_define_module_function(module, "glEvalCoord1f", gl_EvalCoord1f, 1);
2856
- rb_define_module_function(module, "glEvalCoord1fv", gl_EvalCoord1fv, 1);
2857
- rb_define_module_function(module, "glEvalCoord2d", gl_EvalCoord2d, 2);
2858
- rb_define_module_function(module, "glEvalCoord2dv", gl_EvalCoord2dv, 1);
2859
- rb_define_module_function(module, "glEvalCoord2f", gl_EvalCoord2f, 2);
2860
- rb_define_module_function(module, "glEvalCoord2fv", gl_EvalCoord2fv, 1);
2861
- rb_define_module_function(module, "glEvalMesh1", gl_EvalMesh1, 3);
2862
- rb_define_module_function(module, "glEvalPoint1", gl_EvalPoint1, 1);
2863
- rb_define_module_function(module, "glEvalMesh2", gl_EvalMesh2, 5);
2864
- rb_define_module_function(module, "glEvalPoint2", gl_EvalPoint2, 2);
2865
- rb_define_module_function(module, "glAlphaFunc", gl_AlphaFunc, 2);
2866
- rb_define_module_function(module, "glBlendFunc", gl_BlendFunc, 2);
2867
- rb_define_module_function(module, "glLogicOp", gl_LogicOp, 1);
2868
- rb_define_module_function(module, "glStencilFunc", gl_StencilFunc, 3);
2869
- rb_define_module_function(module, "glStencilOp", gl_StencilOp, 3);
2870
- rb_define_module_function(module, "glDepthFunc", gl_DepthFunc, 1);
2871
- rb_define_module_function(module, "glPixelZoom", gl_PixelZoom, 2);
2872
- rb_define_module_function(module, "glPixelTransferf", gl_PixelTransferf, 2);
2873
- rb_define_module_function(module, "glPixelTransferi", gl_PixelTransferi, 2);
2874
- rb_define_module_function(module, "glPixelStoref", gl_PixelStoref, 2);
2875
- rb_define_module_function(module, "glPixelStorei", gl_PixelStorei, 2);
2876
- rb_define_module_function(module, "glPixelMapfv", gl_PixelMapfv, -1);
2877
- rb_define_module_function(module, "glPixelMapuiv", gl_PixelMapuiv, -1);
2878
- rb_define_module_function(module, "glPixelMapusv", gl_PixelMapusv, -1);
2879
- rb_define_module_function(module, "glReadBuffer", gl_ReadBuffer, 1);
2880
- rb_define_module_function(module, "glCopyPixels", gl_CopyPixels, 5);
2881
- rb_define_module_function(module, "glReadPixels", gl_ReadPixels, -1);
2882
- rb_define_module_function(module, "glDrawPixels", gl_DrawPixels, 5);
2883
- rb_define_module_function(module, "glGetBooleanv", gl_GetBooleanv, 1);
2884
- rb_define_module_function(module, "glGetClipPlane", gl_GetClipPlane, 1);
2885
- rb_define_module_function(module, "glGetDoublev", gl_GetDoublev, 1);
2886
- rb_define_module_function(module, "glGetError", gl_GetError, 0);
2887
- rb_define_module_function(module, "glGetFloatv", gl_GetFloatv, 1);
2888
- rb_define_module_function(module, "glGetIntegerv", gl_GetIntegerv, 1);
2889
- rb_define_module_function(module, "glGetLightfv", gl_GetLightfv, 2);
2890
- rb_define_module_function(module, "glGetLightiv", gl_GetLightiv, 2);
2891
- rb_define_module_function(module, "glGetMapdv", gl_GetMapdv, 2);
2892
- rb_define_module_function(module, "glGetMapfv", gl_GetMapfv, 2);
2893
- rb_define_module_function(module, "glGetMapiv", gl_GetMapiv, 2);
2894
- rb_define_module_function(module, "glGetMaterialfv", gl_GetMaterialfv, 2);
2895
- rb_define_module_function(module, "glGetMaterialiv", gl_GetMaterialiv, 2);
2896
- rb_define_module_function(module, "glGetPixelMapfv", gl_GetPixelMapfv, -1);
2897
- rb_define_module_function(module, "glGetPixelMapuiv", gl_GetPixelMapuiv, -1);
2898
- rb_define_module_function(module, "glGetPixelMapusv", gl_GetPixelMapusv, -1);
2899
- rb_define_module_function(module, "glGetPolygonStipple", gl_GetPolygonStipple, -1);
2900
- rb_define_module_function(module, "glGetString", gl_GetString, 1);
2901
- rb_define_module_function(module, "glGetTexEnvfv", gl_GetTexEnvfv, 2);
2902
- rb_define_module_function(module, "glGetTexEnviv", gl_GetTexEnviv, 2);
2903
- rb_define_module_function(module, "glGetTexGendv", gl_GetTexGendv, 2);
2904
- rb_define_module_function(module, "glGetTexGenfv", gl_GetTexGenfv, 2);
2905
- rb_define_module_function(module, "glGetTexGeniv", gl_GetTexGeniv, 2);
2906
- rb_define_module_function(module, "glGetTexImage", gl_GetTexImage, -1);
2907
- rb_define_module_function(module, "glGetTexParameterfv", gl_GetTexParameterfv, 2);
2908
- rb_define_module_function(module, "glGetTexParameteriv", gl_GetTexParameteriv, 2);
2909
- rb_define_module_function(module, "glGetTexLevelParameterfv", gl_GetTexLevelParameterfv, 3);
2910
- rb_define_module_function(module, "glGetTexLevelParameteriv", gl_GetTexLevelParameteriv, 3);
2911
- rb_define_module_function(module, "glIsEnabled", gl_IsEnabled, 1);
2912
- rb_define_module_function(module, "glIsList", gl_IsList, 1);
2913
- rb_define_module_function(module, "glDepthRange", gl_DepthRange, 2);
2914
- rb_define_module_function(module, "glFrustum", gl_Frustum, 6);
2915
- rb_define_module_function(module, "glLoadIdentity", gl_LoadIdentity, 0);
2916
- rb_define_module_function(module, "glLoadMatrixf", gl_LoadMatrixf, 1);
2917
- rb_define_module_function(module, "glLoadMatrixd", gl_LoadMatrixd, 1);
2918
- rb_define_module_function(module, "glMatrixMode", gl_MatrixMode, 1);
2919
- rb_define_module_function(module, "glMultMatrixf", gl_MultMatrixf, 1);
2920
- rb_define_module_function(module, "glMultMatrixd", gl_MultMatrixd, 1);
2921
- rb_define_module_function(module, "glOrtho", gl_Ortho, 6);
2922
- rb_define_module_function(module, "glPopMatrix", gl_PopMatrix, 0);
2923
- rb_define_module_function(module, "glPushMatrix", gl_PushMatrix, 0);
2924
- rb_define_module_function(module, "glRotated", gl_Rotated, 4);
2925
- rb_define_module_function(module, "glRotatef", gl_Rotatef, 4);
2926
- rb_define_module_function(module, "glScaled", gl_Scaled, 3);
2927
- rb_define_module_function(module, "glScalef", gl_Scalef, 3);
2928
- rb_define_module_function(module, "glTranslated", gl_Translated, 3);
2929
- rb_define_module_function(module, "glTranslatef", gl_Translatef, 3);
2930
- rb_define_module_function(module, "glViewport", gl_Viewport, 4);
2931
-
2932
- /* OpenGL 1.1 functions */
2933
- rb_define_module_function(module, "glArrayElement", gl_ArrayElement, 1);
2934
- rb_define_module_function(module, "glColorPointer", gl_ColorPointer, 4);
2935
- rb_define_module_function(module, "glDisableClientState", gl_DisableClientState, -1);
2936
- rb_define_module_function(module, "glDrawArrays", gl_DrawArrays, 3);
2937
- rb_define_module_function(module, "glDrawElements", gl_DrawElements, 4);
2938
- rb_define_module_function(module, "glEdgeFlagPointer", gl_EdgeFlagPointer, 2);
2939
- rb_define_module_function(module, "glEnableClientState", gl_EnableClientState, -1);
2940
- rb_define_module_function(module, "glGetPointerv", gl_GetPointerv, 1);
2941
- rb_define_module_function(module, "glIndexPointer", gl_IndexPointer, 3);
2942
- rb_define_module_function(module, "glInterleavedArrays", gl_InterleavedArrays, 3);
2943
- rb_define_module_function(module, "glNormalPointer", gl_NormalPointer, 3);
2944
- rb_define_module_function(module, "glTexCoordPointer", gl_TexCoordPointer, 4);
2945
- rb_define_module_function(module, "glVertexPointer", gl_VertexPointer, 4);
2946
- rb_define_module_function(module, "glPolygonOffset", gl_PolygonOffset, 2);
2947
- rb_define_module_function(module, "glCopyTexImage1D", gl_CopyTexImage1D, 7);
2948
- rb_define_module_function(module, "glCopyTexImage2D", gl_CopyTexImage2D, 8);
2949
- rb_define_module_function(module, "glCopyTexSubImage1D", gl_CopyTexSubImage1D, 6);
2950
- rb_define_module_function(module, "glCopyTexSubImage2D", gl_CopyTexSubImage2D, 8);
2951
- rb_define_module_function(module, "glTexSubImage1D", gl_TexSubImage1D, 7);
2952
- rb_define_module_function(module, "glTexSubImage2D", gl_TexSubImage2D, 9);
2953
- rb_define_module_function(module, "glAreTexturesResident", gl_AreTexturesResident, 1);
2954
- rb_define_module_function(module, "glBindTexture", gl_BindTexture, 2);
2955
- rb_define_module_function(module, "glDeleteTextures", gl_DeleteTextures, 1);
2956
- rb_define_module_function(module, "glGenTextures", gl_GenTextures, 1);
2957
- rb_define_module_function(module, "glIsTexture", gl_IsTexture, 1);
2958
- rb_define_module_function(module, "glPrioritizeTextures", gl_PrioritizeTextures, 2);
2959
- rb_define_module_function(module, "glIndexub", gl_Indexub, 1);
2960
- rb_define_module_function(module, "glIndexubv", gl_Indexubv, 1);
2961
- rb_define_module_function(module, "glPopClientAttrib", gl_PopClientAttrib, 0);
2962
- rb_define_module_function(module, "glPushClientAttrib", gl_PushClientAttrib, 1);
2963
-
2964
- /* additional functions */
2965
- rb_define_module_function(module, "glColor", gl_Colordv, -1);
2966
- rb_define_module_function(module, "glColor3bv", gl_Colorbv, -1);
2967
- rb_define_module_function(module, "glColor3dv", gl_Colordv, -1);
2968
- rb_define_module_function(module, "glColor3fv", gl_Colorfv, -1);
2969
- rb_define_module_function(module, "glColor3iv", gl_Coloriv, -1);
2970
- rb_define_module_function(module, "glColor3sv", gl_Colorsv, -1);
2971
- rb_define_module_function(module, "glColor3ubv", gl_Colorubv, -1);
2972
- rb_define_module_function(module, "glColor3uiv", gl_Coloruiv, -1);
2973
- rb_define_module_function(module, "glColor3usv", gl_Colorusv, -1);
2974
- rb_define_module_function(module, "glColor4bv", gl_Colorbv, -1);
2975
- rb_define_module_function(module, "glColor4dv", gl_Colordv, -1);
2976
- rb_define_module_function(module, "glColor4fv", gl_Colorfv, -1);
2977
- rb_define_module_function(module, "glColor4iv", gl_Coloriv, -1);
2978
- rb_define_module_function(module, "glColor4sv", gl_Colorsv, -1);
2979
- rb_define_module_function(module, "glColor4ubv", gl_Colorubv, -1);
2980
- rb_define_module_function(module, "glColor4uiv", gl_Coloruiv, -1);
2981
- rb_define_module_function(module, "glColor4usv", gl_Colorusv, -1);
2982
-
2983
- rb_define_module_function(module, "glNormal", gl_Normaldv, -1);
2984
- rb_define_module_function(module, "glNormal3bv", gl_Normalbv, -1);
2985
- rb_define_module_function(module, "glNormal3dv", gl_Normaldv, -1);
2986
- rb_define_module_function(module, "glNormal3fv", gl_Normalfv, -1);
2987
- rb_define_module_function(module, "glNormal3iv", gl_Normaliv, -1);
2988
- rb_define_module_function(module, "glNormal3sv", gl_Normalsv, -1);
2989
-
2990
- rb_define_module_function(module, "glRasterPos", gl_RasterPosdv, -1);
2991
- rb_define_module_function(module, "glRasterPos2dv", gl_RasterPosdv, -1);
2992
- rb_define_module_function(module, "glRasterPos2fv", gl_RasterPosfv, -1);
2993
- rb_define_module_function(module, "glRasterPos2iv", gl_RasterPosiv, -1);
2994
- rb_define_module_function(module, "glRasterPos2sv", gl_RasterPossv, -1);
2995
- rb_define_module_function(module, "glRasterPos3dv", gl_RasterPosdv, -1);
2996
- rb_define_module_function(module, "glRasterPos3fv", gl_RasterPosfv, -1);
2997
- rb_define_module_function(module, "glRasterPos3iv", gl_RasterPosiv, -1);
2998
- rb_define_module_function(module, "glRasterPos3sv", gl_RasterPossv, -1);
2999
- rb_define_module_function(module, "glRasterPos4dv", gl_RasterPosdv, -1);
3000
- rb_define_module_function(module, "glRasterPos4fv", gl_RasterPosfv, -1);
3001
- rb_define_module_function(module, "glRasterPos4iv", gl_RasterPosiv, -1);
3002
- rb_define_module_function(module, "glRasterPos4sv", gl_RasterPossv, -1);
3003
-
3004
- rb_define_module_function(module, "glRect", gl_Rectdv, -1);
3005
- rb_define_module_function(module, "glRectdv", gl_Rectdv, -1);
3006
- rb_define_module_function(module, "glRectfv", gl_Rectfv, -1);
3007
- rb_define_module_function(module, "glRectiv", gl_Rectiv, -1);
3008
- rb_define_module_function(module, "glRectsv", gl_Rectsv, -1);
3009
-
3010
- rb_define_module_function(module, "glTexCoord", gl_TexCoorddv, -1);
3011
- rb_define_module_function(module, "glTexCoord1dv", gl_TexCoorddv, -1);
3012
- rb_define_module_function(module, "glTexCoord1fv", gl_TexCoordfv, -1);
3013
- rb_define_module_function(module, "glTexCoord1iv", gl_TexCoordiv, -1);
3014
- rb_define_module_function(module, "glTexCoord1sv", gl_TexCoordsv, -1);
3015
- rb_define_module_function(module, "glTexCoord2dv", gl_TexCoorddv, -1);
3016
- rb_define_module_function(module, "glTexCoord2fv", gl_TexCoordfv, -1);
3017
- rb_define_module_function(module, "glTexCoord2iv", gl_TexCoordiv, -1);
3018
- rb_define_module_function(module, "glTexCoord2sv", gl_TexCoordsv, -1);
3019
- rb_define_module_function(module, "glTexCoord3dv", gl_TexCoorddv, -1);
3020
- rb_define_module_function(module, "glTexCoord3fv", gl_TexCoordfv, -1);
3021
- rb_define_module_function(module, "glTexCoord3iv", gl_TexCoordiv, -1);
3022
- rb_define_module_function(module, "glTexCoord3sv", gl_TexCoordsv, -1);
3023
- rb_define_module_function(module, "glTexCoord4dv", gl_TexCoorddv, -1);
3024
- rb_define_module_function(module, "glTexCoord4fv", gl_TexCoordfv, -1);
3025
- rb_define_module_function(module, "glTexCoord4iv", gl_TexCoordiv, -1);
3026
- rb_define_module_function(module, "glTexCoord4sv", gl_TexCoordsv, -1);
3027
-
3028
- rb_define_module_function(module, "glVertex", gl_Vertexdv, -1);
3029
- rb_define_module_function(module, "glVertex2dv", gl_Vertexdv, -1);
3030
- rb_define_module_function(module, "glVertex2fv", gl_Vertexfv, -1);
3031
- rb_define_module_function(module, "glVertex2iv", gl_Vertexiv, -1);
3032
- rb_define_module_function(module, "glVertex2sv", gl_Vertexsv, -1);
3033
- rb_define_module_function(module, "glVertex3dv", gl_Vertexdv, -1);
3034
- rb_define_module_function(module, "glVertex3fv", gl_Vertexfv, -1);
3035
- rb_define_module_function(module, "glVertex3iv", gl_Vertexiv, -1);
3036
- rb_define_module_function(module, "glVertex3sv", gl_Vertexsv, -1);
3037
- rb_define_module_function(module, "glVertex4dv", gl_Vertexdv, -1);
3038
- rb_define_module_function(module, "glVertex4fv", gl_Vertexfv, -1);
3039
- rb_define_module_function(module, "glVertex4iv", gl_Vertexiv, -1);
3040
- rb_define_module_function(module, "glVertex4sv", gl_Vertexsv, -1);
3041
-
3042
- /* these simply calls normal or vector (*v) function depending on
3043
- if array or single value is passed to them */
3044
- rb_define_module_function(module, "glLightModel", gl_LightModel, 2);
3045
- rb_define_module_function(module, "glMaterial", gl_Material, 3);
3046
- rb_define_module_function(module, "glFog", gl_Fog, 2);
3047
- rb_define_module_function(module, "glLight", gl_Light, 3);
3048
- rb_define_module_function(module, "glTexParameter", gl_TexParameter, 3);
3049
- rb_define_module_function(module, "glTexEnv", gl_TexEnv, 3);
3050
- rb_define_module_function(module, "glTexGen", gl_TexGen, 3);
3051
-
3052
- /* aliases */
3053
- rb_define_module_function(module, "glMultMatrix", gl_MultMatrixd, 1);
3054
- rb_define_module_function(module, "glLoadMatrix", gl_LoadMatrixd, 1);
3055
- rb_define_module_function(module, "glRotate", gl_Rotated, 4);
3056
- rb_define_module_function(module, "glScale", gl_Scaled, 3);
3057
- rb_define_module_function(module, "glTranslate", gl_Translated, 3);
3058
-
3059
- rb_define_module_function(module, "glPixelStore", gl_PixelStoref, 2);
3060
- rb_define_module_function(module, "glPixelTransfer", gl_PixelTransferf, 2);
3061
- rb_define_module_function(module, "glIndex", gl_Indexi, 1);
3062
- rb_define_module_function(module, "glGetMaterial", gl_GetMaterialfv, 2);
3063
- rb_define_module_function(module, "glGetDouble", gl_GetDoublev, 1);
3064
-
3065
- rb_global_variable(&g_current_sel_buffer);
3066
- rb_global_variable(&g_current_feed_buffer);
3067
- rb_global_variable(&g_Vertex_ptr);
3068
- rb_global_variable(&g_Normal_ptr);
3069
- rb_global_variable(&g_Color_ptr);
3070
- rb_global_variable(&g_Index_ptr);
3071
- rb_global_variable(&g_TexCoord_ptr);
3072
- rb_global_variable(&g_EdgeFlag_ptr);
3073
- rb_global_variable(&g_FogCoord_ptr);
3074
- rb_global_variable(&g_SecondaryColor_ptr);
2686
+ g_FogCoord_ptr = 0; /* for use in gl-1.4.c */
2687
+ g_SecondaryColor_ptr = 0; /* for use in gl-1.4.c */
2688
+
2689
+ /* OpenGL 1.0 functions */
2690
+ rb_define_module_function(module, "glNewList", gl_NewList, 2);
2691
+ rb_define_module_function(module, "glEndList", gl_EndList, 0);
2692
+ rb_define_module_function(module, "glCallList", gl_CallList, 1);
2693
+ rb_define_module_function(module, "glCallLists", gl_CallLists, 2);
2694
+ rb_define_module_function(module, "glDeleteLists", gl_DeleteLists, 2);
2695
+ rb_define_module_function(module, "glGenLists", gl_GenLists, 1);
2696
+ rb_define_module_function(module, "glListBase", gl_ListBase, 1);
2697
+ rb_define_module_function(module, "glBegin", gl_Begin, 1);
2698
+ rb_define_module_function(module, "glBitmap", gl_Bitmap, 7);
2699
+ rb_define_module_function(module, "glColor3b", gl_Color3b, 3);
2700
+ rb_define_module_function(module, "glColor3d", gl_Color3d, 3);
2701
+ rb_define_module_function(module, "glColor3f", gl_Color3f, 3);
2702
+ rb_define_module_function(module, "glColor3i", gl_Color3i, 3);
2703
+ rb_define_module_function(module, "glColor3s", gl_Color3s, 3);
2704
+ rb_define_module_function(module, "glColor3ub", gl_Color3ub, 3);
2705
+ rb_define_module_function(module, "glColor3ui", gl_Color3ui, 3);
2706
+ rb_define_module_function(module, "glColor3us", gl_Color3us, 3);
2707
+ rb_define_module_function(module, "glColor4b", gl_Color4b, 4);
2708
+ rb_define_module_function(module, "glColor4d", gl_Color4d, 4);
2709
+ rb_define_module_function(module, "glColor4f", gl_Color4f, 4);
2710
+ rb_define_module_function(module, "glColor4i", gl_Color4i, 4);
2711
+ rb_define_module_function(module, "glColor4s", gl_Color4s, 4);
2712
+ rb_define_module_function(module, "glColor4ub", gl_Color4ub, 4);
2713
+ rb_define_module_function(module, "glColor4ui", gl_Color4ui, 4);
2714
+ rb_define_module_function(module, "glColor4us", gl_Color4us, 4);
2715
+ rb_define_module_function(module, "glEdgeFlag", gl_EdgeFlag, 1);
2716
+ rb_define_module_function(module, "glEdgeFlagv", gl_EdgeFlagv, 1);
2717
+ rb_define_module_function(module, "glEnd", gl_End, 0);
2718
+ rb_define_module_function(module, "glIndexd", gl_Indexd, 1);
2719
+ rb_define_module_function(module, "glIndexdv", gl_Indexdv, 1);
2720
+ rb_define_module_function(module, "glIndexf", gl_Indexf, 1);
2721
+ rb_define_module_function(module, "glIndexfv", gl_Indexfv, 1);
2722
+ rb_define_module_function(module, "glIndexi", gl_Indexi, 1);
2723
+ rb_define_module_function(module, "glIndexiv", gl_Indexiv, 1);
2724
+ rb_define_module_function(module, "glIndexs", gl_Indexs, 1);
2725
+ rb_define_module_function(module, "glIndexsv", gl_Indexsv, 1);
2726
+ rb_define_module_function(module, "glNormal3b", gl_Normal3b, 3);
2727
+ rb_define_module_function(module, "glNormal3d", gl_Normal3d, 3);
2728
+ rb_define_module_function(module, "glNormal3f", gl_Normal3f, 3);
2729
+ rb_define_module_function(module, "glNormal3i", gl_Normal3i, 3);
2730
+ rb_define_module_function(module, "glNormal3s", gl_Normal3s, 3);
2731
+ rb_define_module_function(module, "glRasterPos2d", gl_RasterPos2d, 2);
2732
+ rb_define_module_function(module, "glRasterPos2f", gl_RasterPos2f, 2);
2733
+ rb_define_module_function(module, "glRasterPos2i", gl_RasterPos2i, 2);
2734
+ rb_define_module_function(module, "glRasterPos2s", gl_RasterPos2s, 2);
2735
+ rb_define_module_function(module, "glRasterPos3d", gl_RasterPos3d, 3);
2736
+ rb_define_module_function(module, "glRasterPos3f", gl_RasterPos3f, 3);
2737
+ rb_define_module_function(module, "glRasterPos3i", gl_RasterPos3i, 3);
2738
+ rb_define_module_function(module, "glRasterPos3s", gl_RasterPos3s, 3);
2739
+ rb_define_module_function(module, "glRasterPos4d", gl_RasterPos4d, 4);
2740
+ rb_define_module_function(module, "glRasterPos4f", gl_RasterPos4f, 4);
2741
+ rb_define_module_function(module, "glRasterPos4i", gl_RasterPos4i, 4);
2742
+ rb_define_module_function(module, "glRasterPos4s", gl_RasterPos4s, 4);
2743
+ rb_define_module_function(module, "glRectd", gl_Rectd, 4);
2744
+ rb_define_module_function(module, "glRectf", gl_Rectf, 4);
2745
+ rb_define_module_function(module, "glRecti", gl_Recti, 4);
2746
+ rb_define_module_function(module, "glRects", gl_Rects, 4);
2747
+ rb_define_module_function(module, "glTexCoord1d", gl_TexCoord1d, 1);
2748
+ rb_define_module_function(module, "glTexCoord1f", gl_TexCoord1f, 1);
2749
+ rb_define_module_function(module, "glTexCoord1i", gl_TexCoord1i, 1);
2750
+ rb_define_module_function(module, "glTexCoord1s", gl_TexCoord1s, 1);
2751
+ rb_define_module_function(module, "glTexCoord2d", gl_TexCoord2d, 2);
2752
+ rb_define_module_function(module, "glTexCoord2f", gl_TexCoord2f, 2);
2753
+ rb_define_module_function(module, "glTexCoord2i", gl_TexCoord2i, 2);
2754
+ rb_define_module_function(module, "glTexCoord2s", gl_TexCoord2s, 2);
2755
+ rb_define_module_function(module, "glTexCoord3d", gl_TexCoord3d, 3);
2756
+ rb_define_module_function(module, "glTexCoord3f", gl_TexCoord3f, 3);
2757
+ rb_define_module_function(module, "glTexCoord3i", gl_TexCoord3i, 3);
2758
+ rb_define_module_function(module, "glTexCoord3s", gl_TexCoord3s, 3);
2759
+ rb_define_module_function(module, "glTexCoord4d", gl_TexCoord4d, 4);
2760
+ rb_define_module_function(module, "glTexCoord4f", gl_TexCoord4f, 4);
2761
+ rb_define_module_function(module, "glTexCoord4i", gl_TexCoord4i, 4);
2762
+ rb_define_module_function(module, "glTexCoord4s", gl_TexCoord4s, 4);
2763
+ rb_define_module_function(module, "glVertex2d", gl_Vertex2d, 2);
2764
+ rb_define_module_function(module, "glVertex2f", gl_Vertex2f, 2);
2765
+ rb_define_module_function(module, "glVertex2i", gl_Vertex2i, 2);
2766
+ rb_define_module_function(module, "glVertex2s", gl_Vertex2s, 2);
2767
+ rb_define_module_function(module, "glVertex3d", gl_Vertex3d, 3);
2768
+ rb_define_module_function(module, "glVertex3f", gl_Vertex3f, 3);
2769
+ rb_define_module_function(module, "glVertex3i", gl_Vertex3i, 3);
2770
+ rb_define_module_function(module, "glVertex3s", gl_Vertex3s, 3);
2771
+ rb_define_module_function(module, "glVertex4d", gl_Vertex4d, 4);
2772
+ rb_define_module_function(module, "glVertex4f", gl_Vertex4f, 4);
2773
+ rb_define_module_function(module, "glVertex4i", gl_Vertex4i, 4);
2774
+ rb_define_module_function(module, "glVertex4s", gl_Vertex4s, 4);
2775
+ rb_define_module_function(module, "glClipPlane", gl_ClipPlane, 2);
2776
+ rb_define_module_function(module, "glColorMaterial", gl_ColorMaterial, 2);
2777
+ rb_define_module_function(module, "glCullFace", gl_CullFace, 1);
2778
+ rb_define_module_function(module, "glFogf", gl_Fogf, 2);
2779
+ rb_define_module_function(module, "glFogfv", gl_Fogfv, 2);
2780
+ rb_define_module_function(module, "glFogi", gl_Fogi, 2);
2781
+ rb_define_module_function(module, "glFogiv", gl_Fogiv, 2);
2782
+ rb_define_module_function(module, "glFrontFace", gl_FrontFace, 1);
2783
+ rb_define_module_function(module, "glHint", gl_Hint, 2);
2784
+ rb_define_module_function(module, "glLightf", gl_Lightf, 3);
2785
+ rb_define_module_function(module, "glLightfv", gl_Lightfv, 3);
2786
+ rb_define_module_function(module, "glLighti", gl_Lighti, 3);
2787
+ rb_define_module_function(module, "glLightiv", gl_Lightiv, 3);
2788
+ rb_define_module_function(module, "glLightModelf", gl_LightModelf, 2);
2789
+ rb_define_module_function(module, "glLightModelfv", gl_LightModelfv, 2);
2790
+ rb_define_module_function(module, "glLightModeli", gl_LightModeli, 2);
2791
+ rb_define_module_function(module, "glLightModeliv", gl_LightModeliv, 2);
2792
+ rb_define_module_function(module, "glLineStipple", gl_LineStipple, 2);
2793
+ rb_define_module_function(module, "glLineWidth", gl_LineWidth, 1);
2794
+ rb_define_module_function(module, "glMaterialf", gl_Materialf, 3);
2795
+ rb_define_module_function(module, "glMaterialfv", gl_Materialfv, 3);
2796
+ rb_define_module_function(module, "glMateriali", gl_Materiali, 3);
2797
+ rb_define_module_function(module, "glMaterialiv", gl_Materialiv, 3);
2798
+ rb_define_module_function(module, "glPointSize", gl_PointSize, 1);
2799
+ rb_define_module_function(module, "glPolygonMode", gl_PolygonMode, 2);
2800
+ rb_define_module_function(module, "glPolygonStipple", gl_PolygonStipple, 1);
2801
+ rb_define_module_function(module, "glScissor", gl_Scissor, 4);
2802
+ rb_define_module_function(module, "glShadeModel", gl_ShadeModel, 1);
2803
+ rb_define_module_function(module, "glTexParameterf", gl_TexParameterf, 3);
2804
+ rb_define_module_function(module, "glTexParameterfv", gl_TexParameterfv, 3);
2805
+ rb_define_module_function(module, "glTexParameteri", gl_TexParameteri, 3);
2806
+ rb_define_module_function(module, "glTexParameteriv", gl_TexParameteriv, 3);
2807
+ rb_define_module_function(module, "glTexImage1D", gl_TexImage1D, 8);
2808
+ rb_define_module_function(module, "glTexImage2D", gl_TexImage2D, 9);
2809
+ rb_define_module_function(module, "glTexEnvf", gl_TexEnvf, 3);
2810
+ rb_define_module_function(module, "glTexEnvfv", gl_TexEnvfv, 3);
2811
+ rb_define_module_function(module, "glTexEnvi", gl_TexEnvi, 3);
2812
+ rb_define_module_function(module, "glTexEnviv", gl_TexEnviv, 3);
2813
+ rb_define_module_function(module, "glTexGend", gl_TexGend, 3);
2814
+ rb_define_module_function(module, "glTexGendv", gl_TexGendv, 3);
2815
+ rb_define_module_function(module, "glTexGenf", gl_TexGenf, 3);
2816
+ rb_define_module_function(module, "glTexGenfv", gl_TexGenfv, 3);
2817
+ rb_define_module_function(module, "glTexGeni", gl_TexGeni, 3);
2818
+ rb_define_module_function(module, "glTexGeniv", gl_TexGeniv, 3);
2819
+ rb_define_module_function(module, "glFeedbackBuffer", gl_FeedbackBuffer, 2);
2820
+ rb_define_module_function(module, "glSelectBuffer", gl_SelectBuffer, 1);
2821
+ rb_define_module_function(module, "glRenderMode", gl_RenderMode, 1);
2822
+ rb_define_module_function(module, "glInitNames", gl_InitNames, 0);
2823
+ rb_define_module_function(module, "glLoadName", gl_LoadName, 1);
2824
+ rb_define_module_function(module, "glPassThrough", gl_PassThrough, 1);
2825
+ rb_define_module_function(module, "glPopName", gl_PopName, 0);
2826
+ rb_define_module_function(module, "glPushName", gl_PushName, 1);
2827
+ rb_define_module_function(module, "glDrawBuffer", gl_DrawBuffer, 1);
2828
+ rb_define_module_function(module, "glClear", gl_Clear, 1);
2829
+ rb_define_module_function(module, "glClearAccum", gl_ClearAccum, 4);
2830
+ rb_define_module_function(module, "glClearIndex", gl_ClearIndex, 1);
2831
+ rb_define_module_function(module, "glClearColor", gl_ClearColor, 4);
2832
+ rb_define_module_function(module, "glClearStencil", gl_ClearStencil, 1);
2833
+ rb_define_module_function(module, "glClearDepth", gl_ClearDepth, 1);
2834
+ rb_define_module_function(module, "glStencilMask", gl_StencilMask, 1);
2835
+ rb_define_module_function(module, "glColorMask", gl_ColorMask, 4);
2836
+ rb_define_module_function(module, "glDepthMask", gl_DepthMask, 1);
2837
+ rb_define_module_function(module, "glIndexMask", gl_IndexMask, 1);
2838
+ rb_define_module_function(module, "glAccum", gl_Accum, 2);
2839
+ rb_define_module_function(module, "glDisable", gl_Disable, -1);
2840
+ rb_define_module_function(module, "glEnable", gl_Enable, -1);
2841
+ rb_define_module_function(module, "glFinish", gl_Finish, 0);
2842
+ rb_define_module_function(module, "glFlush", gl_Flush, 0);
2843
+ rb_define_module_function(module, "glPopAttrib", gl_PopAttrib, 0);
2844
+ rb_define_module_function(module, "glPushAttrib", gl_PushAttrib, 1);
2845
+ rb_define_module_function(module, "glMap1d", gl_Map1d, 6);
2846
+ rb_define_module_function(module, "glMap1f", gl_Map1f, 6);
2847
+ rb_define_module_function(module, "glMap2d", gl_Map2d, 10);
2848
+ rb_define_module_function(module, "glMap2f", gl_Map2f, 10);
2849
+ rb_define_module_function(module, "glMapGrid1d", gl_MapGrid1d, 3);
2850
+ rb_define_module_function(module, "glMapGrid1f", gl_MapGrid1f, 3);
2851
+ rb_define_module_function(module, "glMapGrid2d", gl_MapGrid2d, 6);
2852
+ rb_define_module_function(module, "glMapGrid2f", gl_MapGrid2f, 6);
2853
+ rb_define_module_function(module, "glEvalCoord1d", gl_EvalCoord1d, 1);
2854
+ rb_define_module_function(module, "glEvalCoord1dv", gl_EvalCoord1dv, 1);
2855
+ rb_define_module_function(module, "glEvalCoord1f", gl_EvalCoord1f, 1);
2856
+ rb_define_module_function(module, "glEvalCoord1fv", gl_EvalCoord1fv, 1);
2857
+ rb_define_module_function(module, "glEvalCoord2d", gl_EvalCoord2d, 2);
2858
+ rb_define_module_function(module, "glEvalCoord2dv", gl_EvalCoord2dv, 1);
2859
+ rb_define_module_function(module, "glEvalCoord2f", gl_EvalCoord2f, 2);
2860
+ rb_define_module_function(module, "glEvalCoord2fv", gl_EvalCoord2fv, 1);
2861
+ rb_define_module_function(module, "glEvalMesh1", gl_EvalMesh1, 3);
2862
+ rb_define_module_function(module, "glEvalPoint1", gl_EvalPoint1, 1);
2863
+ rb_define_module_function(module, "glEvalMesh2", gl_EvalMesh2, 5);
2864
+ rb_define_module_function(module, "glEvalPoint2", gl_EvalPoint2, 2);
2865
+ rb_define_module_function(module, "glAlphaFunc", gl_AlphaFunc, 2);
2866
+ rb_define_module_function(module, "glBlendFunc", gl_BlendFunc, 2);
2867
+ rb_define_module_function(module, "glLogicOp", gl_LogicOp, 1);
2868
+ rb_define_module_function(module, "glStencilFunc", gl_StencilFunc, 3);
2869
+ rb_define_module_function(module, "glStencilOp", gl_StencilOp, 3);
2870
+ rb_define_module_function(module, "glDepthFunc", gl_DepthFunc, 1);
2871
+ rb_define_module_function(module, "glPixelZoom", gl_PixelZoom, 2);
2872
+ rb_define_module_function(module, "glPixelTransferf", gl_PixelTransferf, 2);
2873
+ rb_define_module_function(module, "glPixelTransferi", gl_PixelTransferi, 2);
2874
+ rb_define_module_function(module, "glPixelStoref", gl_PixelStoref, 2);
2875
+ rb_define_module_function(module, "glPixelStorei", gl_PixelStorei, 2);
2876
+ rb_define_module_function(module, "glPixelMapfv", gl_PixelMapfv, -1);
2877
+ rb_define_module_function(module, "glPixelMapuiv", gl_PixelMapuiv, -1);
2878
+ rb_define_module_function(module, "glPixelMapusv", gl_PixelMapusv, -1);
2879
+ rb_define_module_function(module, "glReadBuffer", gl_ReadBuffer, 1);
2880
+ rb_define_module_function(module, "glCopyPixels", gl_CopyPixels, 5);
2881
+ rb_define_module_function(module, "glReadPixels", gl_ReadPixels, -1);
2882
+ rb_define_module_function(module, "glDrawPixels", gl_DrawPixels, 5);
2883
+ rb_define_module_function(module, "glGetBooleanv", gl_GetBooleanv, 1);
2884
+ rb_define_module_function(module, "glGetClipPlane", gl_GetClipPlane, 1);
2885
+ rb_define_module_function(module, "glGetDoublev", gl_GetDoublev, 1);
2886
+ rb_define_module_function(module, "glGetError", gl_GetError, 0);
2887
+ rb_define_module_function(module, "glGetFloatv", gl_GetFloatv, 1);
2888
+ rb_define_module_function(module, "glGetIntegerv", gl_GetIntegerv, 1);
2889
+ rb_define_module_function(module, "glGetLightfv", gl_GetLightfv, 2);
2890
+ rb_define_module_function(module, "glGetLightiv", gl_GetLightiv, 2);
2891
+ rb_define_module_function(module, "glGetMapdv", gl_GetMapdv, 2);
2892
+ rb_define_module_function(module, "glGetMapfv", gl_GetMapfv, 2);
2893
+ rb_define_module_function(module, "glGetMapiv", gl_GetMapiv, 2);
2894
+ rb_define_module_function(module, "glGetMaterialfv", gl_GetMaterialfv, 2);
2895
+ rb_define_module_function(module, "glGetMaterialiv", gl_GetMaterialiv, 2);
2896
+ rb_define_module_function(module, "glGetPixelMapfv", gl_GetPixelMapfv, -1);
2897
+ rb_define_module_function(module, "glGetPixelMapuiv", gl_GetPixelMapuiv, -1);
2898
+ rb_define_module_function(module, "glGetPixelMapusv", gl_GetPixelMapusv, -1);
2899
+ rb_define_module_function(module, "glGetPolygonStipple", gl_GetPolygonStipple, -1);
2900
+ rb_define_module_function(module, "glGetString", gl_GetString, 1);
2901
+ rb_define_module_function(module, "glGetTexEnvfv", gl_GetTexEnvfv, 2);
2902
+ rb_define_module_function(module, "glGetTexEnviv", gl_GetTexEnviv, 2);
2903
+ rb_define_module_function(module, "glGetTexGendv", gl_GetTexGendv, 2);
2904
+ rb_define_module_function(module, "glGetTexGenfv", gl_GetTexGenfv, 2);
2905
+ rb_define_module_function(module, "glGetTexGeniv", gl_GetTexGeniv, 2);
2906
+ rb_define_module_function(module, "glGetTexImage", gl_GetTexImage, -1);
2907
+ rb_define_module_function(module, "glGetTexParameterfv", gl_GetTexParameterfv, 2);
2908
+ rb_define_module_function(module, "glGetTexParameteriv", gl_GetTexParameteriv, 2);
2909
+ rb_define_module_function(module, "glGetTexLevelParameterfv", gl_GetTexLevelParameterfv, 3);
2910
+ rb_define_module_function(module, "glGetTexLevelParameteriv", gl_GetTexLevelParameteriv, 3);
2911
+ rb_define_module_function(module, "glIsEnabled", gl_IsEnabled, 1);
2912
+ rb_define_module_function(module, "glIsList", gl_IsList, 1);
2913
+ rb_define_module_function(module, "glDepthRange", gl_DepthRange, 2);
2914
+ rb_define_module_function(module, "glFrustum", gl_Frustum, 6);
2915
+ rb_define_module_function(module, "glLoadIdentity", gl_LoadIdentity, 0);
2916
+ rb_define_module_function(module, "glLoadMatrixf", gl_LoadMatrixf, 1);
2917
+ rb_define_module_function(module, "glLoadMatrixd", gl_LoadMatrixd, 1);
2918
+ rb_define_module_function(module, "glMatrixMode", gl_MatrixMode, 1);
2919
+ rb_define_module_function(module, "glMultMatrixf", gl_MultMatrixf, 1);
2920
+ rb_define_module_function(module, "glMultMatrixd", gl_MultMatrixd, 1);
2921
+ rb_define_module_function(module, "glOrtho", gl_Ortho, 6);
2922
+ rb_define_module_function(module, "glPopMatrix", gl_PopMatrix, 0);
2923
+ rb_define_module_function(module, "glPushMatrix", gl_PushMatrix, 0);
2924
+ rb_define_module_function(module, "glRotated", gl_Rotated, 4);
2925
+ rb_define_module_function(module, "glRotatef", gl_Rotatef, 4);
2926
+ rb_define_module_function(module, "glScaled", gl_Scaled, 3);
2927
+ rb_define_module_function(module, "glScalef", gl_Scalef, 3);
2928
+ rb_define_module_function(module, "glTranslated", gl_Translated, 3);
2929
+ rb_define_module_function(module, "glTranslatef", gl_Translatef, 3);
2930
+ rb_define_module_function(module, "glViewport", gl_Viewport, 4);
2931
+
2932
+ /* OpenGL 1.1 functions */
2933
+ rb_define_module_function(module, "glArrayElement", gl_ArrayElement, 1);
2934
+ rb_define_module_function(module, "glColorPointer", gl_ColorPointer, 4);
2935
+ rb_define_module_function(module, "glDisableClientState", gl_DisableClientState, -1);
2936
+ rb_define_module_function(module, "glDrawArrays", gl_DrawArrays, 3);
2937
+ rb_define_module_function(module, "glDrawElements", gl_DrawElements, 4);
2938
+ rb_define_module_function(module, "glEdgeFlagPointer", gl_EdgeFlagPointer, 2);
2939
+ rb_define_module_function(module, "glEnableClientState", gl_EnableClientState, -1);
2940
+ rb_define_module_function(module, "glGetPointerv", gl_GetPointerv, 1);
2941
+ rb_define_module_function(module, "glIndexPointer", gl_IndexPointer, 3);
2942
+ rb_define_module_function(module, "glInterleavedArrays", gl_InterleavedArrays, 3);
2943
+ rb_define_module_function(module, "glNormalPointer", gl_NormalPointer, 3);
2944
+ rb_define_module_function(module, "glTexCoordPointer", gl_TexCoordPointer, 4);
2945
+ rb_define_module_function(module, "glVertexPointer", gl_VertexPointer, 4);
2946
+ rb_define_module_function(module, "glPolygonOffset", gl_PolygonOffset, 2);
2947
+ rb_define_module_function(module, "glCopyTexImage1D", gl_CopyTexImage1D, 7);
2948
+ rb_define_module_function(module, "glCopyTexImage2D", gl_CopyTexImage2D, 8);
2949
+ rb_define_module_function(module, "glCopyTexSubImage1D", gl_CopyTexSubImage1D, 6);
2950
+ rb_define_module_function(module, "glCopyTexSubImage2D", gl_CopyTexSubImage2D, 8);
2951
+ rb_define_module_function(module, "glTexSubImage1D", gl_TexSubImage1D, 7);
2952
+ rb_define_module_function(module, "glTexSubImage2D", gl_TexSubImage2D, 9);
2953
+ rb_define_module_function(module, "glAreTexturesResident", gl_AreTexturesResident, 1);
2954
+ rb_define_module_function(module, "glBindTexture", gl_BindTexture, 2);
2955
+ rb_define_module_function(module, "glDeleteTextures", gl_DeleteTextures, 1);
2956
+ rb_define_module_function(module, "glGenTextures", gl_GenTextures, 1);
2957
+ rb_define_module_function(module, "glIsTexture", gl_IsTexture, 1);
2958
+ rb_define_module_function(module, "glPrioritizeTextures", gl_PrioritizeTextures, 2);
2959
+ rb_define_module_function(module, "glIndexub", gl_Indexub, 1);
2960
+ rb_define_module_function(module, "glIndexubv", gl_Indexubv, 1);
2961
+ rb_define_module_function(module, "glPopClientAttrib", gl_PopClientAttrib, 0);
2962
+ rb_define_module_function(module, "glPushClientAttrib", gl_PushClientAttrib, 1);
2963
+
2964
+ /* additional functions */
2965
+ rb_define_module_function(module, "glColor", gl_Colordv, -1);
2966
+ rb_define_module_function(module, "glColor3bv", gl_Colorbv, -1);
2967
+ rb_define_module_function(module, "glColor3dv", gl_Colordv, -1);
2968
+ rb_define_module_function(module, "glColor3fv", gl_Colorfv, -1);
2969
+ rb_define_module_function(module, "glColor3iv", gl_Coloriv, -1);
2970
+ rb_define_module_function(module, "glColor3sv", gl_Colorsv, -1);
2971
+ rb_define_module_function(module, "glColor3ubv", gl_Colorubv, -1);
2972
+ rb_define_module_function(module, "glColor3uiv", gl_Coloruiv, -1);
2973
+ rb_define_module_function(module, "glColor3usv", gl_Colorusv, -1);
2974
+ rb_define_module_function(module, "glColor4bv", gl_Colorbv, -1);
2975
+ rb_define_module_function(module, "glColor4dv", gl_Colordv, -1);
2976
+ rb_define_module_function(module, "glColor4fv", gl_Colorfv, -1);
2977
+ rb_define_module_function(module, "glColor4iv", gl_Coloriv, -1);
2978
+ rb_define_module_function(module, "glColor4sv", gl_Colorsv, -1);
2979
+ rb_define_module_function(module, "glColor4ubv", gl_Colorubv, -1);
2980
+ rb_define_module_function(module, "glColor4uiv", gl_Coloruiv, -1);
2981
+ rb_define_module_function(module, "glColor4usv", gl_Colorusv, -1);
2982
+
2983
+ rb_define_module_function(module, "glNormal", gl_Normaldv, -1);
2984
+ rb_define_module_function(module, "glNormal3bv", gl_Normalbv, -1);
2985
+ rb_define_module_function(module, "glNormal3dv", gl_Normaldv, -1);
2986
+ rb_define_module_function(module, "glNormal3fv", gl_Normalfv, -1);
2987
+ rb_define_module_function(module, "glNormal3iv", gl_Normaliv, -1);
2988
+ rb_define_module_function(module, "glNormal3sv", gl_Normalsv, -1);
2989
+
2990
+ rb_define_module_function(module, "glRasterPos", gl_RasterPosdv, -1);
2991
+ rb_define_module_function(module, "glRasterPos2dv", gl_RasterPosdv, -1);
2992
+ rb_define_module_function(module, "glRasterPos2fv", gl_RasterPosfv, -1);
2993
+ rb_define_module_function(module, "glRasterPos2iv", gl_RasterPosiv, -1);
2994
+ rb_define_module_function(module, "glRasterPos2sv", gl_RasterPossv, -1);
2995
+ rb_define_module_function(module, "glRasterPos3dv", gl_RasterPosdv, -1);
2996
+ rb_define_module_function(module, "glRasterPos3fv", gl_RasterPosfv, -1);
2997
+ rb_define_module_function(module, "glRasterPos3iv", gl_RasterPosiv, -1);
2998
+ rb_define_module_function(module, "glRasterPos3sv", gl_RasterPossv, -1);
2999
+ rb_define_module_function(module, "glRasterPos4dv", gl_RasterPosdv, -1);
3000
+ rb_define_module_function(module, "glRasterPos4fv", gl_RasterPosfv, -1);
3001
+ rb_define_module_function(module, "glRasterPos4iv", gl_RasterPosiv, -1);
3002
+ rb_define_module_function(module, "glRasterPos4sv", gl_RasterPossv, -1);
3003
+
3004
+ rb_define_module_function(module, "glRect", gl_Rectdv, -1);
3005
+ rb_define_module_function(module, "glRectdv", gl_Rectdv, -1);
3006
+ rb_define_module_function(module, "glRectfv", gl_Rectfv, -1);
3007
+ rb_define_module_function(module, "glRectiv", gl_Rectiv, -1);
3008
+ rb_define_module_function(module, "glRectsv", gl_Rectsv, -1);
3009
+
3010
+ rb_define_module_function(module, "glTexCoord", gl_TexCoorddv, -1);
3011
+ rb_define_module_function(module, "glTexCoord1dv", gl_TexCoorddv, -1);
3012
+ rb_define_module_function(module, "glTexCoord1fv", gl_TexCoordfv, -1);
3013
+ rb_define_module_function(module, "glTexCoord1iv", gl_TexCoordiv, -1);
3014
+ rb_define_module_function(module, "glTexCoord1sv", gl_TexCoordsv, -1);
3015
+ rb_define_module_function(module, "glTexCoord2dv", gl_TexCoorddv, -1);
3016
+ rb_define_module_function(module, "glTexCoord2fv", gl_TexCoordfv, -1);
3017
+ rb_define_module_function(module, "glTexCoord2iv", gl_TexCoordiv, -1);
3018
+ rb_define_module_function(module, "glTexCoord2sv", gl_TexCoordsv, -1);
3019
+ rb_define_module_function(module, "glTexCoord3dv", gl_TexCoorddv, -1);
3020
+ rb_define_module_function(module, "glTexCoord3fv", gl_TexCoordfv, -1);
3021
+ rb_define_module_function(module, "glTexCoord3iv", gl_TexCoordiv, -1);
3022
+ rb_define_module_function(module, "glTexCoord3sv", gl_TexCoordsv, -1);
3023
+ rb_define_module_function(module, "glTexCoord4dv", gl_TexCoorddv, -1);
3024
+ rb_define_module_function(module, "glTexCoord4fv", gl_TexCoordfv, -1);
3025
+ rb_define_module_function(module, "glTexCoord4iv", gl_TexCoordiv, -1);
3026
+ rb_define_module_function(module, "glTexCoord4sv", gl_TexCoordsv, -1);
3027
+
3028
+ rb_define_module_function(module, "glVertex", gl_Vertexdv, -1);
3029
+ rb_define_module_function(module, "glVertex2dv", gl_Vertexdv, -1);
3030
+ rb_define_module_function(module, "glVertex2fv", gl_Vertexfv, -1);
3031
+ rb_define_module_function(module, "glVertex2iv", gl_Vertexiv, -1);
3032
+ rb_define_module_function(module, "glVertex2sv", gl_Vertexsv, -1);
3033
+ rb_define_module_function(module, "glVertex3dv", gl_Vertexdv, -1);
3034
+ rb_define_module_function(module, "glVertex3fv", gl_Vertexfv, -1);
3035
+ rb_define_module_function(module, "glVertex3iv", gl_Vertexiv, -1);
3036
+ rb_define_module_function(module, "glVertex3sv", gl_Vertexsv, -1);
3037
+ rb_define_module_function(module, "glVertex4dv", gl_Vertexdv, -1);
3038
+ rb_define_module_function(module, "glVertex4fv", gl_Vertexfv, -1);
3039
+ rb_define_module_function(module, "glVertex4iv", gl_Vertexiv, -1);
3040
+ rb_define_module_function(module, "glVertex4sv", gl_Vertexsv, -1);
3041
+
3042
+ /* these simply calls normal or vector (*v) function depending on
3043
+ if array or single value is passed to them */
3044
+ rb_define_module_function(module, "glLightModel", gl_LightModel, 2);
3045
+ rb_define_module_function(module, "glMaterial", gl_Material, 3);
3046
+ rb_define_module_function(module, "glFog", gl_Fog, 2);
3047
+ rb_define_module_function(module, "glLight", gl_Light, 3);
3048
+ rb_define_module_function(module, "glTexParameter", gl_TexParameter, 3);
3049
+ rb_define_module_function(module, "glTexEnv", gl_TexEnv, 3);
3050
+ rb_define_module_function(module, "glTexGen", gl_TexGen, 3);
3051
+
3052
+ /* aliases */
3053
+ rb_define_module_function(module, "glMultMatrix", gl_MultMatrixd, 1);
3054
+ rb_define_module_function(module, "glLoadMatrix", gl_LoadMatrixd, 1);
3055
+ rb_define_module_function(module, "glRotate", gl_Rotated, 4);
3056
+ rb_define_module_function(module, "glScale", gl_Scaled, 3);
3057
+ rb_define_module_function(module, "glTranslate", gl_Translated, 3);
3058
+
3059
+ rb_define_module_function(module, "glPixelStore", gl_PixelStoref, 2);
3060
+ rb_define_module_function(module, "glPixelTransfer", gl_PixelTransferf, 2);
3061
+ rb_define_module_function(module, "glIndex", gl_Indexi, 1);
3062
+ rb_define_module_function(module, "glGetMaterial", gl_GetMaterialfv, 2);
3063
+ rb_define_module_function(module, "glGetDouble", gl_GetDoublev, 1);
3064
+
3065
+ rb_global_variable(&g_current_sel_buffer);
3066
+ rb_global_variable(&g_current_feed_buffer);
3067
+ rb_global_variable(&g_Vertex_ptr);
3068
+ rb_global_variable(&g_Normal_ptr);
3069
+ rb_global_variable(&g_Color_ptr);
3070
+ rb_global_variable(&g_Index_ptr);
3071
+ rb_global_variable(&g_TexCoord_ptr);
3072
+ rb_global_variable(&g_EdgeFlag_ptr);
3073
+ rb_global_variable(&g_FogCoord_ptr);
3074
+ rb_global_variable(&g_SecondaryColor_ptr);
3075
3075
  }