opengl 0.8.0 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (145) hide show
  1. checksums.yaml +7 -0
  2. checksums.yaml.gz.sig +1 -0
  3. data.tar.gz.sig +0 -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/test_case.rb +1 -2
  103. data/test/dummy.xorg.conf +140 -0
  104. data/test/test_gl.rb +18 -22
  105. data/test/test_gl_10_11.rb +220 -220
  106. data/test/test_gl_12.rb +11 -122
  107. data/test/test_gl_13.rb +202 -210
  108. data/test/test_gl_14.rb +16 -19
  109. data/test/test_gl_15.rb +2 -4
  110. data/test/test_gl_20.rb +45 -58
  111. data/test/test_gl_21.rb +46 -163
  112. data/test/test_gl_ext_arb.rb +54 -72
  113. data/test/test_gl_ext_ati.rb +0 -2
  114. data/test/test_gl_ext_ext.rb +66 -66
  115. data/test/test_gl_ext_gremedy.rb +8 -15
  116. data/test/test_gl_ext_nv.rb +109 -112
  117. data/test/test_opengl_buffer.rb +8 -25
  118. data/utils/README +0 -5
  119. data/utils/enumgen.rb +72 -76
  120. data/utils/extlistgen.rb +55 -55
  121. metadata +87 -66
  122. metadata.gz.sig +2 -0
  123. data/Rakefile.cross +0 -107
  124. data/docs/build_install.txt +0 -119
  125. data/docs/extensions.txt.in +0 -348
  126. data/docs/history.txt +0 -66
  127. data/docs/requirements_and_design.txt +0 -117
  128. data/docs/roadmap.txt +0 -28
  129. data/docs/scientific_use.txt +0 -35
  130. data/docs/supplies/page_template.html +0 -71
  131. data/docs/thanks.txt +0 -29
  132. data/docs/tutorial.txt +0 -469
  133. data/ext/opengl/glu-enums.c +0 -164
  134. data/ext/opengl/glu-enums.h +0 -463
  135. data/ext/opengl/glu.c +0 -1534
  136. data/ext/opengl/glut.c +0 -1145
  137. data/ext/opengl/glut_callbacks.c +0 -845
  138. data/lib/glu.rb +0 -1
  139. data/lib/glut.rb +0 -1
  140. data/test/test_glu.rb +0 -309
  141. data/utils/mkdn2html.rb +0 -59
  142. data/utils/post-mkdn2html.rb +0 -91
  143. data/website/images/ogl.jpg +0 -0
  144. data/website/images/tab_bottom.gif +0 -0
  145. data/website/style.css +0 -198
@@ -31,16 +31,16 @@ void check_for_glerror(const char *caller)
31
31
  return;
32
32
  } else { /* process errors */
33
33
  const char *error_string;
34
- const char *from = "";
34
+ const char *from = "";
35
35
  int queued_errors = 0;
36
36
  char message[BUFSIZE];
37
37
  VALUE exc;
38
38
 
39
- if (caller) {
40
- from = " for ";
41
- } else {
42
- caller = "";
43
- }
39
+ if (caller) {
40
+ from = " for ";
41
+ } else {
42
+ caller = "";
43
+ }
44
44
 
45
45
  /* check for queued errors */
46
46
  for(queued_errors = 0;
@@ -64,7 +64,7 @@ void check_for_glerror(const char *caller)
64
64
  snprintf(message, BUFSIZE, "%s%s%s", error_string, from, caller);
65
65
  } else {
66
66
  snprintf(message, BUFSIZE, "%s%s%s [%i queued error(s) cleaned]",
67
- error_string, from, caller, queued_errors);
67
+ error_string, from, caller, queued_errors);
68
68
  }
69
69
 
70
70
  exc = rb_funcall(Class_GLError, rb_intern("new"), 2, rb_str_new2(message), INT2NUM(error));
@@ -21,8 +21,8 @@ extern VALUE inside_begin_end;
21
21
  void check_for_glerror(const char *);
22
22
 
23
23
  #define CHECK_GLERROR_FROM(caller) \
24
- do { \
25
- if (error_checking == Qtrue && inside_begin_end == Qfalse) \
26
- check_for_glerror(caller); \
27
- } while (0)
24
+ do { \
25
+ if (error_checking == Qtrue && inside_begin_end == Qfalse) \
26
+ check_for_glerror(caller); \
27
+ } while (0)
28
28
 
@@ -24,12 +24,12 @@ static VALUE \
24
24
  gl_##_name_(obj,arg1) \
25
25
  VALUE obj,arg1; \
26
26
  { \
27
- _type_ m[4*4]; \
28
- LOAD_GL_FUNC(gl##_name_, "GL_ARB_transpose_matrix"); \
29
- _conv_(arg1, m, 4, 4); \
30
- fptr_gl##_name_(m); \
31
- CHECK_GLERROR_FROM("gl" #_name_); \
32
- return Qnil; \
27
+ _type_ m[4*4]; \
28
+ LOAD_GL_FUNC(gl##_name_, "GL_ARB_transpose_matrix"); \
29
+ _conv_(arg1, m, 4, 4); \
30
+ fptr_gl##_name_(m); \
31
+ CHECK_GLERROR_FROM("gl" #_name_); \
32
+ return Qnil; \
33
33
  }
34
34
 
35
35
  TRANSPOSEMATRIX_FUNC(LoadTransposeMatrixfARB,GLfloat,ary2cmatfloat)
@@ -48,20 +48,20 @@ GL_FUNC_LOAD_2(PointParameterfARB,GLvoid, GLenum,GLfloat, "GL_ARB_point_paramete
48
48
  static void (APIENTRY * fptr_glPointParameterfvARB)(GLenum,GLfloat *);
49
49
  static VALUE gl_PointParameterfvARB(VALUE obj,VALUE arg1,VALUE arg2)
50
50
  {
51
- GLfloat params[3] = {(GLfloat)0.0,(GLfloat)0.0,(GLfloat)0.0};
52
- GLenum pname;
53
- GLint size;
54
- LOAD_GL_FUNC(glPointParameterfvARB, "GL_ARB_point_parameters");
55
- pname = NUM2UINT(arg1);
56
- Check_Type(arg2,T_ARRAY);
57
- if (pname==GL_POINT_DISTANCE_ATTENUATION)
58
- size = 3;
59
- else
60
- size = 1;
61
- ary2cflt(arg2,params,size);
62
- fptr_glPointParameterfvARB(pname,params);
63
- CHECK_GLERROR_FROM("glPointParameterfvARB");
64
- return Qnil;
51
+ GLfloat params[3] = {(GLfloat)0.0,(GLfloat)0.0,(GLfloat)0.0};
52
+ GLenum pname;
53
+ GLint size;
54
+ LOAD_GL_FUNC(glPointParameterfvARB, "GL_ARB_point_parameters");
55
+ pname = NUM2UINT(arg1);
56
+ Check_Type(arg2,T_ARRAY);
57
+ if (pname==GL_POINT_DISTANCE_ATTENUATION)
58
+ size = 3;
59
+ else
60
+ size = 1;
61
+ ary2cflt(arg2,params,size);
62
+ fptr_glPointParameterfvARB(pname,params);
63
+ CHECK_GLERROR_FROM("glPointParameterfvARB");
64
+ return Qnil;
65
65
  }
66
66
 
67
67
  /* #25 GL_ARB_window_pos */
@@ -78,15 +78,15 @@ GL_FUNC_LOAD_3(WindowPos3sARB,GLvoid, GLshort,GLshort,GLshort, "GL_ARB_window_po
78
78
  static void (APIENTRY * fptr_gl##_name_)(const _type_ *); \
79
79
  static VALUE gl_##_name_(VALUE obj,VALUE arg1) \
80
80
  { \
81
- _type_ cary[_size_]; \
82
- LOAD_GL_FUNC(gl##_name_, _ext_); \
83
- Check_Type(arg1,T_ARRAY); \
84
- if (RARRAY_LEN(arg1) != _size_) \
85
- rb_raise(rb_eArgError, "Incorrect array length - must have '%i' elements.",_size_); \
86
- _conv_(arg1,cary,_size_); \
87
- fptr_gl##_name_(cary); \
88
- CHECK_GLERROR_FROM("gl" #_name_); \
89
- return Qnil; \
81
+ _type_ cary[_size_]; \
82
+ LOAD_GL_FUNC(gl##_name_, _ext_); \
83
+ Check_Type(arg1,T_ARRAY); \
84
+ if (RARRAY_LEN(arg1) != _size_) \
85
+ rb_raise(rb_eArgError, "Incorrect array length - must have '%i' elements.",_size_); \
86
+ _conv_(arg1,cary,_size_); \
87
+ fptr_gl##_name_(cary); \
88
+ CHECK_GLERROR_FROM("gl" #_name_); \
89
+ return Qnil; \
90
90
  }
91
91
 
92
92
  WINDOWPOSFUNCV(WindowPos2dvARB,GLdouble,ary2cdbl,2,"GL_ARB_window_pos")
@@ -104,46 +104,46 @@ WINDOWPOSFUNCV(WindowPos3svARB,GLshort,ary2cshort,3,"GL_ARB_window_pos")
104
104
  static void (APIENTRY * fptr_glProgramStringARB)(GLenum,GLenum,GLsizei,const void *);
105
105
  static VALUE gl_ProgramStringARB(VALUE obj,VALUE arg1,VALUE arg2,VALUE arg3)
106
106
  {
107
- LOAD_GL_FUNC(glProgramStringARB, "GL_ARB_vertex_program");
108
- Check_Type(arg3,T_STRING);
109
- fptr_glProgramStringARB((GLenum)NUM2INT(arg1),(GLenum)NUM2INT(arg2),(GLsizei)RSTRING_LENINT(arg3),RSTRING_PTR(arg3));
110
- CHECK_GLERROR_FROM("glProgramStringARB");
111
- return Qnil;
107
+ LOAD_GL_FUNC(glProgramStringARB, "GL_ARB_vertex_program");
108
+ Check_Type(arg3,T_STRING);
109
+ fptr_glProgramStringARB((GLenum)NUM2INT(arg1),(GLenum)NUM2INT(arg2),(GLsizei)RSTRING_LENINT(arg3),RSTRING_PTR(arg3));
110
+ CHECK_GLERROR_FROM("glProgramStringARB");
111
+ return Qnil;
112
112
  }
113
113
 
114
114
  static void (APIENTRY * fptr_glGetProgramivARB)(GLenum,GLenum,GLint *);
115
115
  static VALUE gl_GetProgramivARB(VALUE obj,VALUE arg1,VALUE arg2)
116
116
  {
117
- GLint ret = 0;
118
- LOAD_GL_FUNC(glGetProgramivARB, "GL_ARB_vertex_program");
119
- fptr_glGetProgramivARB(NUM2INT(arg1),NUM2INT(arg2),&ret);
120
- CHECK_GLERROR_FROM("glGetProgramivARB");
121
- return cond_GLBOOL2RUBY(NUM2INT(arg2),ret);
117
+ GLint ret = 0;
118
+ LOAD_GL_FUNC(glGetProgramivARB, "GL_ARB_vertex_program");
119
+ fptr_glGetProgramivARB(NUM2INT(arg1),NUM2INT(arg2),&ret);
120
+ CHECK_GLERROR_FROM("glGetProgramivARB");
121
+ return cond_GLBOOL2RUBY(NUM2INT(arg2),ret);
122
122
  }
123
123
 
124
124
  static void (APIENTRY * fptr_glGetProgramStringARB)(GLenum,GLenum,void *string);
125
125
  static VALUE gl_GetProgramStringARB(VALUE obj,VALUE arg1,VALUE arg2)
126
126
  {
127
- GLsizei len = 0;
128
- char *buffer;
129
- VALUE ret_buffer;
130
-
131
- LOAD_GL_FUNC(glGetProgramStringARB, "GL_ARB_vertex_program");
132
- LOAD_GL_FUNC(glGetProgramivARB, "GL_ARB_vertex_program");
133
-
134
- fptr_glGetProgramivARB(NUM2INT(arg1),GL_PROGRAM_LENGTH_ARB,&len);
135
- CHECK_GLERROR_FROM("glGetProgramivARB");
136
- if (len<=0)
137
- return rb_str_new2("");
138
-
139
- buffer = ALLOC_N(GLchar,len+1);
140
- memset(buffer,0,sizeof(GLchar) * (len+1));
141
- fptr_glGetProgramStringARB(NUM2INT(arg1),NUM2INT(arg2),buffer);
142
- ret_buffer = rb_str_new2(buffer);
143
- xfree(buffer);
144
-
145
- CHECK_GLERROR_FROM("glGetProgramStringARB");
146
- return ret_buffer;
127
+ GLsizei len = 0;
128
+ char *buffer;
129
+ VALUE ret_buffer;
130
+
131
+ LOAD_GL_FUNC(glGetProgramStringARB, "GL_ARB_vertex_program");
132
+ LOAD_GL_FUNC(glGetProgramivARB, "GL_ARB_vertex_program");
133
+
134
+ fptr_glGetProgramivARB(NUM2INT(arg1),GL_PROGRAM_LENGTH_ARB,&len);
135
+ CHECK_GLERROR_FROM("glGetProgramivARB");
136
+ if (len<=0)
137
+ return rb_str_new2("");
138
+
139
+ buffer = ALLOC_N(GLchar,len+1);
140
+ memset(buffer,0,sizeof(GLchar) * (len+1));
141
+ fptr_glGetProgramStringARB(NUM2INT(arg1),NUM2INT(arg2),buffer);
142
+ ret_buffer = rb_str_new2(buffer);
143
+ xfree(buffer);
144
+
145
+ CHECK_GLERROR_FROM("glGetProgramStringARB");
146
+ return ret_buffer;
147
147
  }
148
148
 
149
149
  GL_FUNC_GENOBJECTS_LOAD(GenProgramsARB,"GL_ARB_vertex_program")
@@ -158,35 +158,35 @@ extern VALUE g_VertexAttrib_ptr[];
158
158
  static void (APIENTRY * fptr_glVertexAttribPointerARB)(GLuint,GLint,GLenum,GLboolean,GLsizei,const GLvoid *);
159
159
  static VALUE gl_VertexAttribPointerARB(VALUE obj,VALUE arg1,VALUE arg2,VALUE arg3,VALUE arg4,VALUE arg5,VALUE arg6)
160
160
  {
161
- GLuint index;
162
- GLuint size;
163
- GLenum type;
164
- GLboolean normalized;
165
- GLsizei stride;
166
-
167
- LOAD_GL_FUNC(glVertexAttribPointerARB, "GL_ARB_vertex_program");
168
-
169
- index = (GLuint)NUM2UINT(arg1);
170
- size = (GLuint)NUM2UINT(arg2);
171
- type = (GLenum)NUM2INT(arg3);
172
- normalized = (GLboolean)RUBYBOOL2GL(arg4);
173
- stride = (GLsizei)NUM2UINT(arg5);
174
- if (index>_MAX_VERTEX_ATTRIBS)
175
- rb_raise(rb_eArgError, "Index too large, maximum allowed value '%i'",_MAX_VERTEX_ATTRIBS);
176
-
177
- if (CheckBufferBinding(GL_ARRAY_BUFFER_BINDING)) {
178
- g_VertexAttrib_ptr[index] = arg6;
179
- fptr_glVertexAttribPointerARB(index,size,type,normalized,stride,(GLvoid *)NUM2LONG(arg6));
180
- } else {
181
- VALUE data;
182
- data = pack_array_or_pass_string(type,arg6);
183
- rb_str_freeze(data);
184
- g_VertexAttrib_ptr[index] = data;
185
- fptr_glVertexAttribPointerARB(index,size,type,normalized,stride,(GLvoid *)RSTRING_PTR(data));
186
- }
187
-
188
- CHECK_GLERROR_FROM("glVertexAttribPointerARB");
189
- return Qnil;
161
+ GLuint index;
162
+ GLuint size;
163
+ GLenum type;
164
+ GLboolean normalized;
165
+ GLsizei stride;
166
+
167
+ LOAD_GL_FUNC(glVertexAttribPointerARB, "GL_ARB_vertex_program");
168
+
169
+ index = (GLuint)NUM2UINT(arg1);
170
+ size = (GLuint)NUM2UINT(arg2);
171
+ type = (GLenum)NUM2INT(arg3);
172
+ normalized = (GLboolean)RUBYBOOL2GL(arg4);
173
+ stride = (GLsizei)NUM2UINT(arg5);
174
+ if (index>_MAX_VERTEX_ATTRIBS)
175
+ rb_raise(rb_eArgError, "Index too large, maximum allowed value '%i'",_MAX_VERTEX_ATTRIBS);
176
+
177
+ if (CheckBufferBinding(GL_ARRAY_BUFFER_BINDING)) {
178
+ g_VertexAttrib_ptr[index] = arg6;
179
+ fptr_glVertexAttribPointerARB(index,size,type,normalized,stride,(GLvoid *)NUM2SIZET(arg6));
180
+ } else {
181
+ VALUE data;
182
+ data = pack_array_or_pass_string(type,arg6);
183
+ rb_str_freeze(data);
184
+ g_VertexAttrib_ptr[index] = data;
185
+ fptr_glVertexAttribPointerARB(index,size,type,normalized,stride,(GLvoid *)RSTRING_PTR(data));
186
+ }
187
+
188
+ CHECK_GLERROR_FROM("glVertexAttribPointerARB");
189
+ return Qnil;
190
190
  }
191
191
 
192
192
 
@@ -195,13 +195,13 @@ static VALUE
195
195
  gl_GetVertexAttribPointervARB(obj,arg1)
196
196
  VALUE obj,arg1;
197
197
  {
198
- GLuint index;
199
- LOAD_GL_FUNC(glGetVertexAttribPointervARB, "GL_ARB_vertex_program");
200
- index =(GLuint) NUM2INT(arg1);
201
- if (index>_MAX_VERTEX_ATTRIBS)
202
- rb_raise(rb_eArgError, "Index too large, maximum allowed value '%i'",_MAX_VERTEX_ATTRIBS);
198
+ GLuint index;
199
+ LOAD_GL_FUNC(glGetVertexAttribPointervARB, "GL_ARB_vertex_program");
200
+ index =(GLuint) NUM2INT(arg1);
201
+ if (index>_MAX_VERTEX_ATTRIBS)
202
+ rb_raise(rb_eArgError, "Index too large, maximum allowed value '%i'",_MAX_VERTEX_ATTRIBS);
203
203
 
204
- return g_VertexAttrib_ptr[index];
204
+ return g_VertexAttrib_ptr[index];
205
205
  }
206
206
 
207
207
  GL_FUNC_LOAD_6(ProgramEnvParameter4dARB,GLvoid, GLenum,GLuint,GLdouble,GLdouble,GLdouble,GLdouble, "GL_ARB_vertex_program")
@@ -215,12 +215,12 @@ static VALUE \
215
215
  gl_##_name_(obj,arg1,arg2,arg3) \
216
216
  VALUE obj,arg1,arg2,arg3; \
217
217
  { \
218
- _type_ cary[4]; \
219
- LOAD_GL_FUNC(gl##_name_, _extension_); \
220
- _conv_(arg3,cary,4); \
221
- fptr_gl##_name_(NUM2UINT(arg1),NUM2UINT(arg2),cary); \
222
- CHECK_GLERROR_FROM("gl" #_name_); \
223
- return Qnil; \
218
+ _type_ cary[4]; \
219
+ LOAD_GL_FUNC(gl##_name_, _extension_); \
220
+ _conv_(arg3,cary,4); \
221
+ fptr_gl##_name_(NUM2UINT(arg1),NUM2UINT(arg2),cary); \
222
+ CHECK_GLERROR_FROM("gl" #_name_); \
223
+ return Qnil; \
224
224
  }
225
225
 
226
226
  PROGRAMPARAM_FUNC_V(ProgramEnvParameter4dvARB,GLdouble,ary2cdbl,"GL_ARB_vertex_program")
@@ -235,10 +235,10 @@ static VALUE \
235
235
  gl_##_name_(obj,arg1,arg2) \
236
236
  VALUE obj,arg1,arg2; \
237
237
  { \
238
- _type_ cary[4] = {(_type_)0.0,(_type_)0.0,(_type_)0.0,(_type_)0.0}; \
239
- LOAD_GL_FUNC(gl##_name_, _extension_); \
240
- fptr_gl##_name_(NUM2UINT(arg1),NUM2UINT(arg2),cary); \
241
- RET_ARRAY_OR_SINGLE("gl" #_name_, 4, RETCONV_##_type_, cary); \
238
+ _type_ cary[4] = {(_type_)0.0,(_type_)0.0,(_type_)0.0,(_type_)0.0}; \
239
+ LOAD_GL_FUNC(gl##_name_, _extension_); \
240
+ fptr_gl##_name_(NUM2UINT(arg1),NUM2UINT(arg2),cary); \
241
+ RET_ARRAY_OR_SINGLE("gl" #_name_, 4, RETCONV_##_type_, cary); \
242
242
  }
243
243
 
244
244
  GETPROGRAMPARAM_FUNC(GetProgramEnvParameterdvARB,GLdouble,"GL_ARB_vertex_program")
@@ -268,14 +268,14 @@ static VALUE \
268
268
  gl_##_name_(obj,arg1,arg2) \
269
269
  VALUE obj,arg1,arg2; \
270
270
  { \
271
- GLuint index; \
272
- _type_ v[_size_]; \
273
- LOAD_GL_FUNC(gl##_name_, _extension_); \
274
- index = (GLuint)NUM2UINT(arg1); \
275
- _conv_(arg2,v,_size_); \
276
- fptr_gl##_name_(index,v); \
277
- CHECK_GLERROR_FROM("gl" #_name_); \
278
- return Qnil; \
271
+ GLuint index; \
272
+ _type_ v[_size_]; \
273
+ LOAD_GL_FUNC(gl##_name_, _extension_); \
274
+ index = (GLuint)NUM2UINT(arg1); \
275
+ _conv_(arg2,v,_size_); \
276
+ fptr_gl##_name_(index,v); \
277
+ CHECK_GLERROR_FROM("gl" #_name_); \
278
+ return Qnil; \
279
279
  }
280
280
 
281
281
  VERTEXATTRIB_FUNC_V(VertexAttrib4NbvARB,GLbyte,ary2cbyte,4,"GL_ARB_vertex_program")
@@ -309,19 +309,19 @@ static VALUE \
309
309
  gl_##_name_(obj,arg1,arg2) \
310
310
  VALUE obj,arg1,arg2; \
311
311
  { \
312
- GLuint index; \
313
- GLenum pname; \
314
- _type_ params[4] = {0,0,0,0}; \
315
- GLint size; \
316
- LOAD_GL_FUNC(gl##_name_, _extension_); \
317
- index = (GLuint)NUM2UINT(arg1); \
318
- pname = (GLenum)NUM2INT(arg2); \
319
- if (pname==GL_CURRENT_VERTEX_ATTRIB_ARB) \
320
- size = 4; \
321
- else \
322
- size = 1; \
323
- fptr_gl##_name_(index,pname,params); \
324
- RET_ARRAY_OR_SINGLE("gl" #_name_, size, RETCONV_##_type_, params); \
312
+ GLuint index; \
313
+ GLenum pname; \
314
+ _type_ params[4] = {0,0,0,0}; \
315
+ GLint size; \
316
+ LOAD_GL_FUNC(gl##_name_, _extension_); \
317
+ index = (GLuint)NUM2UINT(arg1); \
318
+ pname = (GLenum)NUM2INT(arg2); \
319
+ if (pname==GL_CURRENT_VERTEX_ATTRIB_ARB) \
320
+ size = 4; \
321
+ else \
322
+ size = 1; \
323
+ fptr_gl##_name_(index,pname,params); \
324
+ RET_ARRAY_OR_SINGLE("gl" #_name_, size, RETCONV_##_type_, params); \
325
325
  }
326
326
 
327
327
  GETVERTEXATTRIB_FUNC(GetVertexAttribdvARB,GLdouble,"GL_ARB_vertex_program")
@@ -334,18 +334,18 @@ static VALUE
334
334
  gl_GetVertexAttribivARB(obj,arg1,arg2)
335
335
  VALUE obj,arg1,arg2;
336
336
  {
337
- GLuint index;
338
- GLenum pname;
339
- GLint params[4] = {0,0,0,0};
340
- GLint size;
341
- LOAD_GL_FUNC(glGetVertexAttribivARB, "GL_ARB_vertex_program");
342
- index = (GLuint)NUM2UINT(arg1);
343
- pname = (GLenum)NUM2INT(arg2);
344
- if (pname==GL_CURRENT_VERTEX_ATTRIB)
345
- size = 4;
346
- else
347
- size = 1;
348
- fptr_glGetVertexAttribivARB(index,pname,params);
337
+ GLuint index;
338
+ GLenum pname;
339
+ GLint params[4] = {0,0,0,0};
340
+ GLint size;
341
+ LOAD_GL_FUNC(glGetVertexAttribivARB, "GL_ARB_vertex_program");
342
+ index = (GLuint)NUM2UINT(arg1);
343
+ pname = (GLenum)NUM2INT(arg2);
344
+ if (pname==GL_CURRENT_VERTEX_ATTRIB)
345
+ size = 4;
346
+ else
347
+ size = 1;
348
+ fptr_glGetVertexAttribivARB(index,pname,params);
349
349
  RET_ARRAY_OR_SINGLE_BOOL("glGetVertexAttribivARB", size, cond_GLBOOL2RUBY,
350
350
  pname, params);
351
351
  }
@@ -362,11 +362,11 @@ GL_FUNC_LOAD_1(EndQueryARB,GLvoid, GLenum, "GL_ARB_occlusion_query")
362
362
  static void (APIENTRY * fptr_gl##_name_)(GLuint,GLenum,_type_ *); \
363
363
  static VALUE gl_##_name_(VALUE obj,VALUE arg1,VALUE arg2) \
364
364
  { \
365
- _type_ ret = 0; \
366
- LOAD_GL_FUNC(gl##_name_, "GL_ARB_occlusion_query"); \
367
- fptr_gl##_name_(NUM2INT(arg1),NUM2INT(arg2),&ret); \
368
- CHECK_GLERROR_FROM("gl" #_name_); \
369
- return _conv_(NUM2INT(arg2),ret); \
365
+ _type_ ret = 0; \
366
+ LOAD_GL_FUNC(gl##_name_, "GL_ARB_occlusion_query"); \
367
+ fptr_gl##_name_(NUM2INT(arg1),NUM2INT(arg2),&ret); \
368
+ CHECK_GLERROR_FROM("gl" #_name_); \
369
+ return _conv_(NUM2INT(arg2),ret); \
370
370
  }
371
371
 
372
372
  GETQUERY_FUNC(GetQueryivARB,GLint,cond_GLBOOL2RUBY)
@@ -391,17 +391,17 @@ static VALUE
391
391
  gl_ShaderSourceARB(obj,arg1,arg2)
392
392
  VALUE obj,arg1,arg2;
393
393
  {
394
- GLuint shader;
395
- GLint length;
396
- GLchar *str;
397
- LOAD_GL_FUNC(glShaderSourceARB, "GL_ARB_shader_objects");
398
- shader = (GLuint)NUM2UINT(arg1);
399
- Check_Type(arg2,T_STRING);
400
- str = RSTRING_PTR(arg2);
401
- length = (GLint)RSTRING_LENINT(arg2);
402
- fptr_glShaderSourceARB(shader,1,&str,&length);
403
- CHECK_GLERROR_FROM("glShaderSourceARB");
404
- return Qnil;
394
+ GLuint shader;
395
+ GLint length;
396
+ GLchar *str;
397
+ LOAD_GL_FUNC(glShaderSourceARB, "GL_ARB_shader_objects");
398
+ shader = (GLuint)NUM2UINT(arg1);
399
+ Check_Type(arg2,T_STRING);
400
+ str = RSTRING_PTR(arg2);
401
+ length = (GLint)RSTRING_LENINT(arg2);
402
+ fptr_glShaderSourceARB(shader,1,&str,&length);
403
+ CHECK_GLERROR_FROM("glShaderSourceARB");
404
+ return Qnil;
405
405
  }
406
406
 
407
407
  GL_FUNC_LOAD_2(Uniform1fARB,GLvoid, GLint,GLfloat, "GL_ARB_shader_objects")
@@ -419,21 +419,21 @@ static VALUE \
419
419
  gl_##_name_(obj,arg1,arg2) \
420
420
  VALUE obj,arg1,arg2; \
421
421
  { \
422
- GLint location; \
423
- GLsizei count; \
424
- _type_ *value; \
425
- LOAD_GL_FUNC(gl##_name_, "GL_ARB_shader_objects"); \
426
- Check_Type(arg2,T_ARRAY); \
427
- count = (GLsizei)RARRAY_LENINT(arg2); \
428
- if (count<=0 || (count % _size_) != 0) \
429
- rb_raise(rb_eArgError, "Parameter array size must be multiplication of %i",_size_); \
430
- location = (GLint)NUM2INT(arg1); \
431
- value = ALLOC_N(_type_,count); \
432
- _conv_(arg2,value,count); \
433
- fptr_gl##_name_(location,count / _size_,value); \
434
- xfree(value); \
435
- CHECK_GLERROR_FROM("gl" #_name_); \
436
- return Qnil; \
422
+ GLint location; \
423
+ GLsizei count; \
424
+ _type_ *value; \
425
+ LOAD_GL_FUNC(gl##_name_, "GL_ARB_shader_objects"); \
426
+ Check_Type(arg2,T_ARRAY); \
427
+ count = (GLsizei)RARRAY_LENINT(arg2); \
428
+ if (count<=0 || (count % _size_) != 0) \
429
+ rb_raise(rb_eArgError, "Parameter array size must be multiplication of %i",_size_); \
430
+ location = (GLint)NUM2INT(arg1); \
431
+ value = ALLOC_N(_type_,count); \
432
+ _conv_(arg2,value,count); \
433
+ fptr_gl##_name_(location,count / _size_,value); \
434
+ xfree(value); \
435
+ CHECK_GLERROR_FROM("gl" #_name_); \
436
+ return Qnil; \
437
437
  }
438
438
 
439
439
  GLUNIFORM_VFUNC(Uniform1fvARB,GLfloat,ary2cflt,1)
@@ -452,20 +452,20 @@ static VALUE \
452
452
  gl_##_name_(obj,arg1,arg2,arg3) \
453
453
  VALUE obj,arg1,arg2,arg3; \
454
454
  { \
455
- GLint location; \
456
- GLsizei count; \
457
- GLboolean transpose; \
458
- GLfloat *value; \
459
- LOAD_GL_FUNC(gl##_name_, "GL_ARB_shader_objects"); \
460
- location = (GLint)NUM2INT(arg1); \
461
- count = (GLsizei)RARRAY_LENINT(rb_funcall(rb_Array(arg3),rb_intern("flatten"),0)); \
462
- transpose = (GLboolean)RUBYBOOL2GL(arg2); \
463
- value = ALLOC_N(GLfloat, count); \
464
- ary2cmatfloatcount(arg3,value,_size_,_size_); \
465
- fptr_gl##_name_(location,count / (_size_*_size_),transpose,value); \
466
- xfree(value); \
467
- CHECK_GLERROR_FROM("gl" #_name_); \
468
- return Qnil; \
455
+ GLint location; \
456
+ GLsizei count; \
457
+ GLboolean transpose; \
458
+ GLfloat *value; \
459
+ LOAD_GL_FUNC(gl##_name_, "GL_ARB_shader_objects"); \
460
+ location = (GLint)NUM2INT(arg1); \
461
+ count = (GLsizei)RARRAY_LENINT(rb_funcall(rb_Array(arg3),rb_intern("flatten"),0)); \
462
+ transpose = (GLboolean)RUBYBOOL2GL(arg2); \
463
+ value = ALLOC_N(GLfloat, count); \
464
+ ary2cmatfloatcount(arg3,value,_size_,_size_); \
465
+ fptr_gl##_name_(location,count / (_size_*_size_),transpose,value); \
466
+ xfree(value); \
467
+ CHECK_GLERROR_FROM("gl" #_name_); \
468
+ return Qnil; \
469
469
  }
470
470
 
471
471
  UNIFORMMATRIX_FUNC(UniformMatrix2fvARB,2)
@@ -479,15 +479,15 @@ static VALUE \
479
479
  gl_##_name_(obj,arg1,arg2) \
480
480
  VALUE obj,arg1,arg2; \
481
481
  { \
482
- GLuint program; \
483
- GLenum pname; \
484
- _type_ params = 0; \
485
- LOAD_GL_FUNC(gl##_name_, "GL_ARB_shader_objects"); \
486
- program = (GLuint)NUM2UINT(arg1); \
487
- pname = (GLenum)NUM2INT(arg2); \
488
- fptr_gl##_name_(program,pname,&params); \
489
- CHECK_GLERROR_FROM("gl" #_name_); \
490
- return _conv_(pname,params); \
482
+ GLuint program; \
483
+ GLenum pname; \
484
+ _type_ params = 0; \
485
+ LOAD_GL_FUNC(gl##_name_, "GL_ARB_shader_objects"); \
486
+ program = (GLuint)NUM2UINT(arg1); \
487
+ pname = (GLenum)NUM2INT(arg2); \
488
+ fptr_gl##_name_(program,pname,&params); \
489
+ CHECK_GLERROR_FROM("gl" #_name_); \
490
+ return _conv_(pname,params); \
491
491
  }
492
492
 
493
493
  GETOBJECTPARAMETER_FUNC(GetObjectParameterivARB,GLint,cond_GLBOOL2RUBY)
@@ -500,21 +500,21 @@ static VALUE
500
500
  gl_GetInfoLogARB(obj,arg1)
501
501
  VALUE obj,arg1;
502
502
  {
503
- GLuint program;
504
- GLint max_size = 0;
505
- GLsizei ret_length = 0;
506
- VALUE buffer;
507
- LOAD_GL_FUNC(glGetInfoLogARB, "GL_ARB_shader_objects");
508
- LOAD_GL_FUNC(glGetObjectParameterivARB, "GL_ARB_shader_objects");
509
- program = (GLuint)NUM2UINT(arg1);
510
- fptr_glGetObjectParameterivARB(program,GL_OBJECT_INFO_LOG_LENGTH_ARB,&max_size);
511
- CHECK_GLERROR_FROM("glGetObjectParameterivARB");
512
- if (max_size<=0)
513
- return rb_str_new2("");
514
- buffer = allocate_buffer_with_string(max_size);
515
- fptr_glGetInfoLogARB(program,max_size,&ret_length,RSTRING_PTR(buffer));
516
- CHECK_GLERROR_FROM("glGetInfoLogARB");
517
- return buffer;
503
+ GLuint program;
504
+ GLint max_size = 0;
505
+ GLsizei ret_length = 0;
506
+ VALUE buffer;
507
+ LOAD_GL_FUNC(glGetInfoLogARB, "GL_ARB_shader_objects");
508
+ LOAD_GL_FUNC(glGetObjectParameterivARB, "GL_ARB_shader_objects");
509
+ program = (GLuint)NUM2UINT(arg1);
510
+ fptr_glGetObjectParameterivARB(program,GL_OBJECT_INFO_LOG_LENGTH_ARB,&max_size);
511
+ CHECK_GLERROR_FROM("glGetObjectParameterivARB");
512
+ if (max_size<=0)
513
+ return rb_str_new2("");
514
+ buffer = allocate_buffer_with_string(max_size);
515
+ fptr_glGetInfoLogARB(program,max_size,&ret_length,RSTRING_PTR(buffer));
516
+ CHECK_GLERROR_FROM("glGetInfoLogARB");
517
+ return buffer;
518
518
  }
519
519
 
520
520
  static void (APIENTRY * fptr_glGetShaderSourceARB)(GLuint,GLsizei,GLsizei *,GLchar *);
@@ -522,21 +522,21 @@ static VALUE
522
522
  gl_GetShaderSourceARB(obj,arg1)
523
523
  VALUE obj,arg1;
524
524
  {
525
- GLuint shader;
526
- GLint max_size = 0;
527
- GLsizei ret_length = 0;
528
- VALUE buffer;
529
- LOAD_GL_FUNC(glGetShaderSourceARB, "GL_ARB_shader_objects");
530
- LOAD_GL_FUNC(glGetObjectParameterivARB, "GL_ARB_shader_objects");
531
- shader = (GLuint)NUM2UINT(arg1);
532
- fptr_glGetObjectParameterivARB(shader,GL_OBJECT_SHADER_SOURCE_LENGTH_ARB,&max_size);
533
- CHECK_GLERROR_FROM("glGetObjectParameterivARB");
534
- if (max_size==0)
535
- rb_raise(rb_eTypeError, "Can't determine maximum shader source length");
536
- buffer = allocate_buffer_with_string(max_size-1);
537
- fptr_glGetShaderSourceARB(shader,max_size,&ret_length,RSTRING_PTR(buffer));
538
- CHECK_GLERROR_FROM("glGetShaderSourceARB");
539
- return buffer;
525
+ GLuint shader;
526
+ GLint max_size = 0;
527
+ GLsizei ret_length = 0;
528
+ VALUE buffer;
529
+ LOAD_GL_FUNC(glGetShaderSourceARB, "GL_ARB_shader_objects");
530
+ LOAD_GL_FUNC(glGetObjectParameterivARB, "GL_ARB_shader_objects");
531
+ shader = (GLuint)NUM2UINT(arg1);
532
+ fptr_glGetObjectParameterivARB(shader,GL_OBJECT_SHADER_SOURCE_LENGTH_ARB,&max_size);
533
+ CHECK_GLERROR_FROM("glGetObjectParameterivARB");
534
+ if (max_size==0)
535
+ rb_raise(rb_eTypeError, "Can't determine maximum shader source length");
536
+ buffer = allocate_buffer_with_string(max_size-1);
537
+ fptr_glGetShaderSourceARB(shader,max_size,&ret_length,RSTRING_PTR(buffer));
538
+ CHECK_GLERROR_FROM("glGetShaderSourceARB");
539
+ return buffer;
540
540
  }
541
541
 
542
542
  static void (APIENTRY * fptr_glGetActiveUniformARB)(GLuint,GLuint,GLsizei,GLsizei*,GLint*,GLenum*,GLchar*);
@@ -544,32 +544,33 @@ static VALUE
544
544
  gl_GetActiveUniformARB(obj,arg1,arg2)
545
545
  VALUE obj,arg1,arg2;
546
546
  {
547
- GLuint program;
548
- GLuint index;
549
- GLsizei max_size = 0;
550
- GLsizei written = 0;
551
- GLint uniform_size = 0;
552
- GLenum uniform_type = 0;
553
- VALUE buffer;
554
- VALUE retary;
555
- LOAD_GL_FUNC(glGetActiveUniformARB, "GL_ARB_shader_objects");
556
- LOAD_GL_FUNC(glGetObjectParameterivARB, "GL_EXT_sahder_objects");
557
- program = (GLuint)NUM2UINT(arg1);
558
- index = (GLuint)NUM2UINT(arg2);
559
- fptr_glGetObjectParameterivARB(program,GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB,&max_size);
560
- CHECK_GLERROR_FROM("glGetObjectParameterivARB");
561
- if (max_size==0)
562
- rb_raise(rb_eTypeError, "Can't determine maximum uniform name length");
563
- buffer = allocate_buffer_with_string(max_size-1);
564
- fptr_glGetActiveUniformARB(program,index,max_size,&written,&uniform_size,&uniform_type,RSTRING_PTR(buffer));
565
-
566
- rb_str_set_len(buffer, strnlen(RSTRING_PTR(buffer), max_size));
567
- retary = rb_ary_new2(3);
568
- rb_ary_push(retary, INT2NUM(uniform_size));
569
- rb_ary_push(retary, INT2NUM(uniform_type));
570
- rb_ary_push(retary, buffer);
571
- CHECK_GLERROR_FROM("glGetACtiveUniformARB");
572
- return retary;
547
+ GLuint program;
548
+ GLuint index;
549
+ GLsizei max_size = 0;
550
+ GLsizei written = 0;
551
+ GLint uniform_size = 0;
552
+ GLenum uniform_type = 0;
553
+ VALUE buffer;
554
+ VALUE retary;
555
+ LOAD_GL_FUNC(glGetActiveUniformARB, "GL_ARB_shader_objects");
556
+ LOAD_GL_FUNC(glGetObjectParameterivARB, "GL_ARB_shader_objects");
557
+ program = (GLuint)NUM2UINT(arg1);
558
+ index = (GLuint)NUM2UINT(arg2);
559
+ fptr_glGetObjectParameterivARB(program,GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB,&max_size);
560
+ CHECK_GLERROR_FROM("glGetObjectParameterivARB");
561
+ /* Can't determine maximum uniform name length, so presume it */
562
+ if (max_size==0) max_size = 256;
563
+ buffer = allocate_buffer_with_string(max_size-1);
564
+
565
+ fptr_glGetActiveUniformARB(program,index,max_size,&written,&uniform_size,&uniform_type,RSTRING_PTR(buffer));
566
+
567
+ rb_str_set_len(buffer, written);
568
+ retary = rb_ary_new2(3);
569
+ rb_ary_push(retary, INT2NUM(uniform_size));
570
+ rb_ary_push(retary, INT2NUM(uniform_type));
571
+ rb_ary_push(retary, buffer);
572
+ CHECK_GLERROR_FROM("glGetACtiveUniformARB");
573
+ return retary;
573
574
  }
574
575
 
575
576
  #define GETUNIFORM_FUNC(_name_,_type_) \
@@ -578,29 +579,29 @@ static VALUE \
578
579
  gl_##_name_(obj,arg1,arg2) \
579
580
  VALUE obj,arg1,arg2; \
580
581
  { \
581
- GLuint program; \
582
- GLint location; \
583
- _type_ params[16]; \
584
- GLint unused = 0; \
585
- GLenum uniform_type = 0; \
586
- GLint uniform_size = 0; \
582
+ GLuint program; \
583
+ GLint location; \
584
+ _type_ params[16]; \
585
+ GLint unused = 0; \
586
+ GLenum uniform_type = 0; \
587
+ GLint uniform_size = 0; \
587
588
  \
588
- LOAD_GL_FUNC(gl##_name_, "GL_ARB_shader_objects"); \
589
- LOAD_GL_FUNC(glGetActiveUniformARB, "GL_ARB_shader_objects"); \
590
- program = (GLuint)NUM2UINT(arg1); \
591
- location = (GLint)NUM2INT(arg2); \
589
+ LOAD_GL_FUNC(gl##_name_, "GL_ARB_shader_objects"); \
590
+ LOAD_GL_FUNC(glGetActiveUniformARB, "GL_ARB_shader_objects"); \
591
+ program = (GLuint)NUM2UINT(arg1); \
592
+ location = (GLint)NUM2INT(arg2); \
592
593
  \
593
- fptr_glGetActiveUniformARB(program,location,0,NULL,&unused,&uniform_type,NULL); \
594
- CHECK_GLERROR_FROM("glGetActiveUniformARB"); \
595
- if (uniform_type==0) \
596
- rb_raise(rb_eTypeError, "Can't determine the uniform's type"); \
594
+ fptr_glGetActiveUniformARB(program,location,0,NULL,&unused,&uniform_type,NULL); \
595
+ CHECK_GLERROR_FROM("glGetActiveUniformARB"); \
596
+ if (uniform_type==0) \
597
+ rb_raise(rb_eTypeError, "Can't determine the uniform's type"); \
597
598
  \
598
- uniform_size = get_uniform_size(uniform_type); \
599
+ uniform_size = get_uniform_size(uniform_type); \
599
600
  \
600
- memset(params,0,16*sizeof(_type_)); \
601
- fptr_gl##_name_(program,location,params); \
601
+ memset(params,0,16*sizeof(_type_)); \
602
+ fptr_gl##_name_(program,location,params); \
602
603
  CHECK_GLERROR_FROM("gl" #_name_); \
603
- RET_ARRAY_OR_SINGLE("gl" #_name_, uniform_size, RETCONV_##_type_, params); \
604
+ RET_ARRAY_OR_SINGLE("gl" #_name_, uniform_size, RETCONV_##_type_, params); \
604
605
  }
605
606
 
606
607
  GETUNIFORM_FUNC(GetUniformfvARB,GLfloat)
@@ -612,14 +613,14 @@ static VALUE
612
613
  gl_GetUniformLocationARB(obj,arg1,arg2)
613
614
  VALUE obj,arg1,arg2;
614
615
  {
615
- GLuint program;
616
- GLint ret;
617
- LOAD_GL_FUNC(glGetUniformLocationARB, "GL_ARB_shader_objects");
618
- program=(GLuint)NUM2UINT(arg1);
619
- Check_Type(arg2,T_STRING);
620
- ret = fptr_glGetUniformLocationARB(program,RSTRING_PTR(arg2));
621
- CHECK_GLERROR_FROM("glGetUniformLocationARB");
622
- return INT2NUM(ret);
616
+ GLuint program;
617
+ GLint ret;
618
+ LOAD_GL_FUNC(glGetUniformLocationARB, "GL_ARB_shader_objects");
619
+ program=(GLuint)NUM2UINT(arg1);
620
+ Check_Type(arg2,T_STRING);
621
+ ret = fptr_glGetUniformLocationARB(program,RSTRING_PTR(arg2));
622
+ CHECK_GLERROR_FROM("glGetUniformLocationARB");
623
+ return INT2NUM(ret);
623
624
  }
624
625
 
625
626
  static void (APIENTRY * fptr_glGetAttachedObjectsARB)(GLuint,GLsizei,GLsizei *,GLuint *);
@@ -627,19 +628,19 @@ static VALUE
627
628
  gl_GetAttachedObjectsARB(obj,arg1)
628
629
  VALUE obj,arg1;
629
630
  {
630
- GLuint program;
631
- GLint shaders_num = 0;
632
- GLuint *shaders;
633
- GLsizei count = 0;
634
- LOAD_GL_FUNC(glGetAttachedObjectsARB, "GL_ARB_shader_objects");
635
- LOAD_GL_FUNC(glGetObjectParameterivARB, "GL_ARB_shader_objects");
636
- program = (GLuint)NUM2UINT(arg1);
637
- fptr_glGetObjectParameterivARB(program,GL_OBJECT_ATTACHED_OBJECTS_ARB,&shaders_num);
638
- CHECK_GLERROR_FROM("glGetObjectParameterivARB");
639
- if (shaders_num<=0)
640
- return Qnil;
641
- shaders = ALLOC_N(GLuint,shaders_num);
642
- fptr_glGetAttachedObjectsARB(program,shaders_num,&count,shaders);
631
+ GLuint program;
632
+ GLint shaders_num = 0;
633
+ GLuint *shaders;
634
+ GLsizei count = 0;
635
+ LOAD_GL_FUNC(glGetAttachedObjectsARB, "GL_ARB_shader_objects");
636
+ LOAD_GL_FUNC(glGetObjectParameterivARB, "GL_ARB_shader_objects");
637
+ program = (GLuint)NUM2UINT(arg1);
638
+ fptr_glGetObjectParameterivARB(program,GL_OBJECT_ATTACHED_OBJECTS_ARB,&shaders_num);
639
+ CHECK_GLERROR_FROM("glGetObjectParameterivARB");
640
+ if (shaders_num<=0)
641
+ return Qnil;
642
+ shaders = ALLOC_N(GLuint,shaders_num);
643
+ fptr_glGetAttachedObjectsARB(program,shaders_num,&count,shaders);
643
644
  RET_ARRAY_OR_SINGLE_FREE("glGetAttachedObjectsARB", count, RETCONV_GLuint,
644
645
  shaders);
645
646
  }
@@ -651,15 +652,15 @@ static VALUE
651
652
  gl_BindAttribLocationARB(obj,arg1,arg2,arg3)
652
653
  VALUE obj,arg1,arg2,arg3;
653
654
  {
654
- GLuint program;
655
- GLuint index;
656
- LOAD_GL_FUNC(glBindAttribLocationARB, "GL_ARB_vertex_shader");
657
- program = (GLuint)NUM2UINT(arg1);
658
- index = (GLuint)NUM2UINT(arg2);
659
- Check_Type(arg3, T_STRING);
660
- fptr_glBindAttribLocationARB(program,index,RSTRING_PTR(arg3));
661
- CHECK_GLERROR_FROM("glBindAttribLocationARB");
662
- return Qnil;
655
+ GLuint program;
656
+ GLuint index;
657
+ LOAD_GL_FUNC(glBindAttribLocationARB, "GL_ARB_vertex_shader");
658
+ program = (GLuint)NUM2UINT(arg1);
659
+ index = (GLuint)NUM2UINT(arg2);
660
+ Check_Type(arg3, T_STRING);
661
+ fptr_glBindAttribLocationARB(program,index,RSTRING_PTR(arg3));
662
+ CHECK_GLERROR_FROM("glBindAttribLocationARB");
663
+ return Qnil;
663
664
  }
664
665
 
665
666
  static void (APIENTRY * fptr_glGetActiveAttribARB)(GLuint,GLuint,GLsizei,GLsizei *,GLint *,GLenum *,GLchar *);
@@ -667,30 +668,33 @@ static VALUE
667
668
  gl_GetActiveAttribARB(obj,arg1,arg2)
668
669
  VALUE obj,arg1,arg2;
669
670
  {
670
- GLuint program;
671
- GLuint index;
672
- GLsizei max_size = 0;
673
- GLsizei written = 0;
674
- GLint attrib_size = 0;
675
- GLenum attrib_type = 0;
676
- VALUE buffer;
677
- VALUE retary;
678
- LOAD_GL_FUNC(glGetActiveAttribARB, "GL_ARB_vertex_shader");
679
- LOAD_GL_FUNC(glGetObjectParameterivARB, "GL_ARB_vertex_shader");
680
- program = (GLuint)NUM2UINT(arg1);
681
- index = (GLuint)NUM2UINT(arg2);
682
- fptr_glGetObjectParameterivARB(program,GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB,&max_size);
683
- CHECK_GLERROR_FROM("glGetObjectParameterivARB");
684
- if (max_size==0)
685
- rb_raise(rb_eTypeError, "Can't determine maximum attribute name length");
686
- buffer = allocate_buffer_with_string(max_size-1);
687
- fptr_glGetActiveAttribARB(program,index,max_size,&written,&attrib_size,&attrib_type,RSTRING_PTR(buffer));
688
- retary = rb_ary_new2(3);
689
- rb_ary_push(retary, INT2NUM(attrib_size));
690
- rb_ary_push(retary, INT2NUM(attrib_type));
691
- rb_ary_push(retary, buffer);
692
- CHECK_GLERROR_FROM("glGetActiveAttribARB");
693
- return retary;
671
+ GLuint program;
672
+ GLuint index;
673
+ GLsizei max_size = 0;
674
+ GLsizei written = 0;
675
+ GLint attrib_size = 0;
676
+ GLenum attrib_type = 0;
677
+ VALUE buffer;
678
+ VALUE retary;
679
+ LOAD_GL_FUNC(glGetActiveAttribARB, "GL_ARB_vertex_shader");
680
+ LOAD_GL_FUNC(glGetObjectParameterivARB, "GL_ARB_vertex_shader");
681
+ program = (GLuint)NUM2UINT(arg1);
682
+ index = (GLuint)NUM2UINT(arg2);
683
+ fptr_glGetObjectParameterivARB(program,GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB,&max_size);
684
+ CHECK_GLERROR_FROM("glGetObjectParameterivARB");
685
+ /* Can't determine maximum attribute name length, so presume it */
686
+ if (max_size==0) max_size = 256;
687
+ buffer = allocate_buffer_with_string(max_size-1);
688
+
689
+ fptr_glGetActiveAttribARB(program,index,max_size,&written,&attrib_size,&attrib_type,RSTRING_PTR(buffer));
690
+
691
+ rb_str_set_len(buffer, written);
692
+ retary = rb_ary_new2(3);
693
+ rb_ary_push(retary, INT2NUM(attrib_size));
694
+ rb_ary_push(retary, INT2NUM(attrib_type));
695
+ rb_ary_push(retary, buffer);
696
+ CHECK_GLERROR_FROM("glGetActiveAttribARB");
697
+ return retary;
694
698
  }
695
699
 
696
700
  static GLint (APIENTRY * fptr_glGetAttribLocationARB)(GLuint,const GLchar*);
@@ -698,14 +702,14 @@ static VALUE
698
702
  gl_GetAttribLocationARB(obj,arg1,arg2)
699
703
  VALUE obj,arg1,arg2;
700
704
  {
701
- GLuint program;
702
- GLint ret;
703
- LOAD_GL_FUNC(glGetAttribLocationARB, "GL_ARB_shader_objects");
704
- program=(GLuint)NUM2UINT(arg1);
705
- Check_Type(arg2,T_STRING);
706
- ret = fptr_glGetAttribLocationARB(program,RSTRING_PTR(arg2));
707
- CHECK_GLERROR_FROM("glGetAttribLocationARB");
708
- return INT2NUM(ret);
705
+ GLuint program;
706
+ GLint ret;
707
+ LOAD_GL_FUNC(glGetAttribLocationARB, "GL_ARB_shader_objects");
708
+ program=(GLuint)NUM2UINT(arg1);
709
+ Check_Type(arg2,T_STRING);
710
+ ret = fptr_glGetAttribLocationARB(program,RSTRING_PTR(arg2));
711
+ CHECK_GLERROR_FROM("glGetAttribLocationARB");
712
+ return INT2NUM(ret);
709
713
  }
710
714
 
711
715
 
@@ -715,157 +719,157 @@ GL_FUNC_LOAD_2(ClampColorARB,GLvoid, GLenum,GLenum, "GL_ARB_color_buffer_float")
715
719
  void gl_init_functions_ext_arb(VALUE module)
716
720
  {
717
721
  /* #3 GL_ARB_transpose_matrix */
718
- rb_define_module_function(module, "glLoadTransposeMatrixfARB", gl_LoadTransposeMatrixfARB, 1);
719
- rb_define_module_function(module, "glLoadTransposeMatrixdARB", gl_LoadTransposeMatrixdARB, 1);
720
- rb_define_module_function(module, "glMultTransposeMatrixfARB", gl_MultTransposeMatrixfARB, 1);
721
- rb_define_module_function(module, "glMultTransposeMatrixdARB", gl_MultTransposeMatrixdARB, 1);
722
+ rb_define_module_function(module, "glLoadTransposeMatrixfARB", gl_LoadTransposeMatrixfARB, 1);
723
+ rb_define_module_function(module, "glLoadTransposeMatrixdARB", gl_LoadTransposeMatrixdARB, 1);
724
+ rb_define_module_function(module, "glMultTransposeMatrixfARB", gl_MultTransposeMatrixfARB, 1);
725
+ rb_define_module_function(module, "glMultTransposeMatrixdARB", gl_MultTransposeMatrixdARB, 1);
722
726
 
723
727
  /* #5 GL_ARB_multisample */
724
- rb_define_module_function(module, "glSampleCoverageARB", gl_SampleCoverageARB, 2);
728
+ rb_define_module_function(module, "glSampleCoverageARB", gl_SampleCoverageARB, 2);
725
729
 
726
730
  /* #14 GL_ARB_point_parameters */
727
- rb_define_module_function(module, "glPointParameterfARB", gl_PointParameterfARB, 2);
728
- rb_define_module_function(module, "glPointParameterfvARB", gl_PointParameterfvARB, 2);
731
+ rb_define_module_function(module, "glPointParameterfARB", gl_PointParameterfARB, 2);
732
+ rb_define_module_function(module, "glPointParameterfvARB", gl_PointParameterfvARB, 2);
729
733
 
730
734
  /* #26 GL_ARB_window_pos */
731
- rb_define_module_function(module, "glWindowPos2dARB", gl_WindowPos2dARB, 2);
732
- rb_define_module_function(module, "glWindowPos2fARB", gl_WindowPos2fARB, 2);
733
- rb_define_module_function(module, "glWindowPos2iARB", gl_WindowPos2iARB, 2);
734
- rb_define_module_function(module, "glWindowPos2sARB", gl_WindowPos2sARB, 2);
735
- rb_define_module_function(module, "glWindowPos3dARB", gl_WindowPos3dARB, 3);
736
- rb_define_module_function(module, "glWindowPos3fARB", gl_WindowPos3fARB, 3);
737
- rb_define_module_function(module, "glWindowPos3iARB", gl_WindowPos3iARB, 3);
738
- rb_define_module_function(module, "glWindowPos3sARB", gl_WindowPos3sARB, 3);
739
-
740
- rb_define_module_function(module, "glWindowPos2dvARB", gl_WindowPos2dvARB, 1);
741
- rb_define_module_function(module, "glWindowPos2fvARB", gl_WindowPos2fvARB, 1);
742
- rb_define_module_function(module, "glWindowPos2ivARB", gl_WindowPos2ivARB, 1);
743
- rb_define_module_function(module, "glWindowPos2svARB", gl_WindowPos2svARB, 1);
744
- rb_define_module_function(module, "glWindowPos3dvARB", gl_WindowPos3dvARB, 1);
745
- rb_define_module_function(module, "glWindowPos3fvARB", gl_WindowPos3fvARB, 1);
746
- rb_define_module_function(module, "glWindowPos3ivARB", gl_WindowPos3ivARB, 1);
747
- rb_define_module_function(module, "glWindowPos3svARB", gl_WindowPos3svARB, 1);
735
+ rb_define_module_function(module, "glWindowPos2dARB", gl_WindowPos2dARB, 2);
736
+ rb_define_module_function(module, "glWindowPos2fARB", gl_WindowPos2fARB, 2);
737
+ rb_define_module_function(module, "glWindowPos2iARB", gl_WindowPos2iARB, 2);
738
+ rb_define_module_function(module, "glWindowPos2sARB", gl_WindowPos2sARB, 2);
739
+ rb_define_module_function(module, "glWindowPos3dARB", gl_WindowPos3dARB, 3);
740
+ rb_define_module_function(module, "glWindowPos3fARB", gl_WindowPos3fARB, 3);
741
+ rb_define_module_function(module, "glWindowPos3iARB", gl_WindowPos3iARB, 3);
742
+ rb_define_module_function(module, "glWindowPos3sARB", gl_WindowPos3sARB, 3);
743
+
744
+ rb_define_module_function(module, "glWindowPos2dvARB", gl_WindowPos2dvARB, 1);
745
+ rb_define_module_function(module, "glWindowPos2fvARB", gl_WindowPos2fvARB, 1);
746
+ rb_define_module_function(module, "glWindowPos2ivARB", gl_WindowPos2ivARB, 1);
747
+ rb_define_module_function(module, "glWindowPos2svARB", gl_WindowPos2svARB, 1);
748
+ rb_define_module_function(module, "glWindowPos3dvARB", gl_WindowPos3dvARB, 1);
749
+ rb_define_module_function(module, "glWindowPos3fvARB", gl_WindowPos3fvARB, 1);
750
+ rb_define_module_function(module, "glWindowPos3ivARB", gl_WindowPos3ivARB, 1);
751
+ rb_define_module_function(module, "glWindowPos3svARB", gl_WindowPos3svARB, 1);
748
752
 
749
753
  /* #26 GL_ARB_vertex_program */
750
- rb_define_module_function(module, "glProgramStringARB", gl_ProgramStringARB, 3);
751
- rb_define_module_function(module, "glGetProgramStringARB", gl_GetProgramStringARB, 2);
752
- rb_define_module_function(module, "glGetProgramivARB", gl_GetProgramivARB, 2);
753
- rb_define_module_function(module, "glBindProgramARB", gl_BindProgramARB, 2);
754
- rb_define_module_function(module, "glGenProgramsARB", gl_GenProgramsARB, 1);
755
- rb_define_module_function(module, "glDeleteProgramsARB", gl_DeleteProgramsARB, 1);
756
- rb_define_module_function(module, "glIsProgramARB", gl_IsProgramARB, 1);
757
- rb_define_module_function(module, "glEnableVertexAttribArrayARB", gl_EnableVertexAttribArrayARB, 1);
758
- rb_define_module_function(module, "glDisableVertexAttribArrayARB", gl_DisableVertexAttribArrayARB, 1);
759
- rb_define_module_function(module, "glVertexAttribPointerARB", gl_VertexAttribPointerARB, 6);
760
- rb_define_module_function(module, "glGetVertexAttribPointervARB", gl_GetVertexAttribPointervARB, 1);
761
- rb_define_module_function(module, "glProgramEnvParameter4dARB", gl_ProgramEnvParameter4dARB, 6);
762
- rb_define_module_function(module, "glProgramEnvParameter4fARB", gl_ProgramEnvParameter4fARB, 6);
763
- rb_define_module_function(module, "glProgramLocalParameter4dARB", gl_ProgramLocalParameter4dARB, 6);
764
- rb_define_module_function(module, "glProgramLocalParameter4fARB", gl_ProgramLocalParameter4fARB, 6);
765
- rb_define_module_function(module, "glProgramEnvParameter4dvARB", gl_ProgramEnvParameter4dvARB, 3);
766
- rb_define_module_function(module, "glProgramEnvParameter4fvARB", gl_ProgramEnvParameter4fvARB, 3);
767
- rb_define_module_function(module, "glProgramLocalParameter4dvARB", gl_ProgramLocalParameter4dvARB, 3);
768
- rb_define_module_function(module, "glProgramLocalParameter4fvARB", gl_ProgramLocalParameter4fvARB, 3);
769
- rb_define_module_function(module, "glGetProgramEnvParameterdvARB", gl_GetProgramEnvParameterdvARB, 2);
770
- rb_define_module_function(module, "glGetProgramEnvParameterfvARB", gl_GetProgramEnvParameterfvARB, 2);
771
- rb_define_module_function(module, "glGetProgramLocalParameterdvARB", gl_GetProgramLocalParameterdvARB, 2);
772
- rb_define_module_function(module, "glGetProgramLocalParameterfvARB", gl_GetProgramLocalParameterfvARB, 2);
773
- rb_define_module_function(module, "glVertexAttrib1dARB", gl_VertexAttrib1dARB, 2);
774
- rb_define_module_function(module, "glVertexAttrib1fARB", gl_VertexAttrib1fARB, 2);
775
- rb_define_module_function(module, "glVertexAttrib1sARB", gl_VertexAttrib1sARB, 2);
776
- rb_define_module_function(module, "glVertexAttrib2dARB", gl_VertexAttrib2dARB, 3);
777
- rb_define_module_function(module, "glVertexAttrib2fARB", gl_VertexAttrib2fARB, 3);
778
- rb_define_module_function(module, "glVertexAttrib2sARB", gl_VertexAttrib2sARB, 3);
779
- rb_define_module_function(module, "glVertexAttrib3dARB", gl_VertexAttrib3dARB, 4);
780
- rb_define_module_function(module, "glVertexAttrib3fARB", gl_VertexAttrib3fARB, 4);
781
- rb_define_module_function(module, "glVertexAttrib3sARB", gl_VertexAttrib3sARB, 4);
782
- rb_define_module_function(module, "glVertexAttrib4NbvARB", gl_VertexAttrib4NbvARB, 2);
783
- rb_define_module_function(module, "glVertexAttrib4NivARB", gl_VertexAttrib4NivARB, 2);
784
- rb_define_module_function(module, "glVertexAttrib4NsvARB", gl_VertexAttrib4NsvARB, 2);
785
- rb_define_module_function(module, "glVertexAttrib4NubARB", gl_VertexAttrib4NubARB, 5);
786
- rb_define_module_function(module, "glVertexAttrib4NubvARB", gl_VertexAttrib4NubvARB, 2);
787
- rb_define_module_function(module, "glVertexAttrib4NuivARB", gl_VertexAttrib4NuivARB, 2);
788
- rb_define_module_function(module, "glVertexAttrib4NusvARB", gl_VertexAttrib4NusvARB, 2);
789
- rb_define_module_function(module, "glVertexAttrib4bvARB", gl_VertexAttrib4bvARB, 2);
790
- rb_define_module_function(module, "glVertexAttrib4dARB", gl_VertexAttrib4dARB, 5);
791
- rb_define_module_function(module, "glVertexAttrib4fARB", gl_VertexAttrib4fARB, 5);
792
- rb_define_module_function(module, "glVertexAttrib4ivARB", gl_VertexAttrib4ivARB, 2);
793
- rb_define_module_function(module, "glVertexAttrib4sARB", gl_VertexAttrib4sARB, 5);
794
- rb_define_module_function(module, "glVertexAttrib4ubvARB", gl_VertexAttrib4ubvARB, 2);
795
- rb_define_module_function(module, "glVertexAttrib4uivARB", gl_VertexAttrib4uivARB, 2);
796
- rb_define_module_function(module, "glVertexAttrib4usvARB", gl_VertexAttrib4usvARB, 2);
797
- rb_define_module_function(module, "glVertexAttrib1dvARB", gl_VertexAttrib1dvARB, 2);
798
- rb_define_module_function(module, "glVertexAttrib1fvARB", gl_VertexAttrib1fvARB, 2);
799
- rb_define_module_function(module, "glVertexAttrib1svARB", gl_VertexAttrib1svARB, 2);
800
- rb_define_module_function(module, "glVertexAttrib2dvARB", gl_VertexAttrib2dvARB, 2);
801
- rb_define_module_function(module, "glVertexAttrib2fvARB", gl_VertexAttrib2fvARB, 2);
802
- rb_define_module_function(module, "glVertexAttrib2svARB", gl_VertexAttrib2svARB, 2);
803
- rb_define_module_function(module, "glVertexAttrib3dvARB", gl_VertexAttrib3dvARB, 2);
804
- rb_define_module_function(module, "glVertexAttrib3fvARB", gl_VertexAttrib3fvARB, 2);
805
- rb_define_module_function(module, "glVertexAttrib3svARB", gl_VertexAttrib3svARB, 2);
806
- rb_define_module_function(module, "glVertexAttrib4dvARB", gl_VertexAttrib4dvARB, 2);
807
- rb_define_module_function(module, "glVertexAttrib4fvARB", gl_VertexAttrib4fvARB, 2);
808
- rb_define_module_function(module, "glVertexAttrib4svARB", gl_VertexAttrib4svARB, 2);
809
- rb_define_module_function(module, "glGetVertexAttribdvARB", gl_GetVertexAttribdvARB, 2);
810
- rb_define_module_function(module, "glGetVertexAttribfvARB", gl_GetVertexAttribfvARB, 2);
811
- rb_define_module_function(module, "glGetVertexAttribivARB", gl_GetVertexAttribivARB, 2);
754
+ rb_define_module_function(module, "glProgramStringARB", gl_ProgramStringARB, 3);
755
+ rb_define_module_function(module, "glGetProgramStringARB", gl_GetProgramStringARB, 2);
756
+ rb_define_module_function(module, "glGetProgramivARB", gl_GetProgramivARB, 2);
757
+ rb_define_module_function(module, "glBindProgramARB", gl_BindProgramARB, 2);
758
+ rb_define_module_function(module, "glGenProgramsARB", gl_GenProgramsARB, 1);
759
+ rb_define_module_function(module, "glDeleteProgramsARB", gl_DeleteProgramsARB, 1);
760
+ rb_define_module_function(module, "glIsProgramARB", gl_IsProgramARB, 1);
761
+ rb_define_module_function(module, "glEnableVertexAttribArrayARB", gl_EnableVertexAttribArrayARB, 1);
762
+ rb_define_module_function(module, "glDisableVertexAttribArrayARB", gl_DisableVertexAttribArrayARB, 1);
763
+ rb_define_module_function(module, "glVertexAttribPointerARB", gl_VertexAttribPointerARB, 6);
764
+ rb_define_module_function(module, "glGetVertexAttribPointervARB", gl_GetVertexAttribPointervARB, 1);
765
+ rb_define_module_function(module, "glProgramEnvParameter4dARB", gl_ProgramEnvParameter4dARB, 6);
766
+ rb_define_module_function(module, "glProgramEnvParameter4fARB", gl_ProgramEnvParameter4fARB, 6);
767
+ rb_define_module_function(module, "glProgramLocalParameter4dARB", gl_ProgramLocalParameter4dARB, 6);
768
+ rb_define_module_function(module, "glProgramLocalParameter4fARB", gl_ProgramLocalParameter4fARB, 6);
769
+ rb_define_module_function(module, "glProgramEnvParameter4dvARB", gl_ProgramEnvParameter4dvARB, 3);
770
+ rb_define_module_function(module, "glProgramEnvParameter4fvARB", gl_ProgramEnvParameter4fvARB, 3);
771
+ rb_define_module_function(module, "glProgramLocalParameter4dvARB", gl_ProgramLocalParameter4dvARB, 3);
772
+ rb_define_module_function(module, "glProgramLocalParameter4fvARB", gl_ProgramLocalParameter4fvARB, 3);
773
+ rb_define_module_function(module, "glGetProgramEnvParameterdvARB", gl_GetProgramEnvParameterdvARB, 2);
774
+ rb_define_module_function(module, "glGetProgramEnvParameterfvARB", gl_GetProgramEnvParameterfvARB, 2);
775
+ rb_define_module_function(module, "glGetProgramLocalParameterdvARB", gl_GetProgramLocalParameterdvARB, 2);
776
+ rb_define_module_function(module, "glGetProgramLocalParameterfvARB", gl_GetProgramLocalParameterfvARB, 2);
777
+ rb_define_module_function(module, "glVertexAttrib1dARB", gl_VertexAttrib1dARB, 2);
778
+ rb_define_module_function(module, "glVertexAttrib1fARB", gl_VertexAttrib1fARB, 2);
779
+ rb_define_module_function(module, "glVertexAttrib1sARB", gl_VertexAttrib1sARB, 2);
780
+ rb_define_module_function(module, "glVertexAttrib2dARB", gl_VertexAttrib2dARB, 3);
781
+ rb_define_module_function(module, "glVertexAttrib2fARB", gl_VertexAttrib2fARB, 3);
782
+ rb_define_module_function(module, "glVertexAttrib2sARB", gl_VertexAttrib2sARB, 3);
783
+ rb_define_module_function(module, "glVertexAttrib3dARB", gl_VertexAttrib3dARB, 4);
784
+ rb_define_module_function(module, "glVertexAttrib3fARB", gl_VertexAttrib3fARB, 4);
785
+ rb_define_module_function(module, "glVertexAttrib3sARB", gl_VertexAttrib3sARB, 4);
786
+ rb_define_module_function(module, "glVertexAttrib4NbvARB", gl_VertexAttrib4NbvARB, 2);
787
+ rb_define_module_function(module, "glVertexAttrib4NivARB", gl_VertexAttrib4NivARB, 2);
788
+ rb_define_module_function(module, "glVertexAttrib4NsvARB", gl_VertexAttrib4NsvARB, 2);
789
+ rb_define_module_function(module, "glVertexAttrib4NubARB", gl_VertexAttrib4NubARB, 5);
790
+ rb_define_module_function(module, "glVertexAttrib4NubvARB", gl_VertexAttrib4NubvARB, 2);
791
+ rb_define_module_function(module, "glVertexAttrib4NuivARB", gl_VertexAttrib4NuivARB, 2);
792
+ rb_define_module_function(module, "glVertexAttrib4NusvARB", gl_VertexAttrib4NusvARB, 2);
793
+ rb_define_module_function(module, "glVertexAttrib4bvARB", gl_VertexAttrib4bvARB, 2);
794
+ rb_define_module_function(module, "glVertexAttrib4dARB", gl_VertexAttrib4dARB, 5);
795
+ rb_define_module_function(module, "glVertexAttrib4fARB", gl_VertexAttrib4fARB, 5);
796
+ rb_define_module_function(module, "glVertexAttrib4ivARB", gl_VertexAttrib4ivARB, 2);
797
+ rb_define_module_function(module, "glVertexAttrib4sARB", gl_VertexAttrib4sARB, 5);
798
+ rb_define_module_function(module, "glVertexAttrib4ubvARB", gl_VertexAttrib4ubvARB, 2);
799
+ rb_define_module_function(module, "glVertexAttrib4uivARB", gl_VertexAttrib4uivARB, 2);
800
+ rb_define_module_function(module, "glVertexAttrib4usvARB", gl_VertexAttrib4usvARB, 2);
801
+ rb_define_module_function(module, "glVertexAttrib1dvARB", gl_VertexAttrib1dvARB, 2);
802
+ rb_define_module_function(module, "glVertexAttrib1fvARB", gl_VertexAttrib1fvARB, 2);
803
+ rb_define_module_function(module, "glVertexAttrib1svARB", gl_VertexAttrib1svARB, 2);
804
+ rb_define_module_function(module, "glVertexAttrib2dvARB", gl_VertexAttrib2dvARB, 2);
805
+ rb_define_module_function(module, "glVertexAttrib2fvARB", gl_VertexAttrib2fvARB, 2);
806
+ rb_define_module_function(module, "glVertexAttrib2svARB", gl_VertexAttrib2svARB, 2);
807
+ rb_define_module_function(module, "glVertexAttrib3dvARB", gl_VertexAttrib3dvARB, 2);
808
+ rb_define_module_function(module, "glVertexAttrib3fvARB", gl_VertexAttrib3fvARB, 2);
809
+ rb_define_module_function(module, "glVertexAttrib3svARB", gl_VertexAttrib3svARB, 2);
810
+ rb_define_module_function(module, "glVertexAttrib4dvARB", gl_VertexAttrib4dvARB, 2);
811
+ rb_define_module_function(module, "glVertexAttrib4fvARB", gl_VertexAttrib4fvARB, 2);
812
+ rb_define_module_function(module, "glVertexAttrib4svARB", gl_VertexAttrib4svARB, 2);
813
+ rb_define_module_function(module, "glGetVertexAttribdvARB", gl_GetVertexAttribdvARB, 2);
814
+ rb_define_module_function(module, "glGetVertexAttribfvARB", gl_GetVertexAttribfvARB, 2);
815
+ rb_define_module_function(module, "glGetVertexAttribivARB", gl_GetVertexAttribivARB, 2);
812
816
 
813
817
  /* #29 GL_ARB_occlusion_query */
814
- rb_define_module_function(module, "glGenQueriesARB", gl_GenQueriesARB, 1);
815
- rb_define_module_function(module, "glDeleteQueriesARB", gl_DeleteQueriesARB, 1);
816
- rb_define_module_function(module, "glIsQueryARB", gl_IsQueryARB, 1);
817
- rb_define_module_function(module, "glBeginQueryARB", gl_BeginQueryARB, 2);
818
- rb_define_module_function(module, "glEndQueryARB", gl_EndQueryARB, 1);
819
- rb_define_module_function(module, "glGetQueryivARB", gl_GetQueryivARB, 2);
820
- rb_define_module_function(module, "glGetQueryObjectivARB", gl_GetQueryObjectivARB, 2);
821
- rb_define_module_function(module, "glGetQueryObjectuivARB", gl_GetQueryObjectuivARB, 2);
818
+ rb_define_module_function(module, "glGenQueriesARB", gl_GenQueriesARB, 1);
819
+ rb_define_module_function(module, "glDeleteQueriesARB", gl_DeleteQueriesARB, 1);
820
+ rb_define_module_function(module, "glIsQueryARB", gl_IsQueryARB, 1);
821
+ rb_define_module_function(module, "glBeginQueryARB", gl_BeginQueryARB, 2);
822
+ rb_define_module_function(module, "glEndQueryARB", gl_EndQueryARB, 1);
823
+ rb_define_module_function(module, "glGetQueryivARB", gl_GetQueryivARB, 2);
824
+ rb_define_module_function(module, "glGetQueryObjectivARB", gl_GetQueryObjectivARB, 2);
825
+ rb_define_module_function(module, "glGetQueryObjectuivARB", gl_GetQueryObjectuivARB, 2);
822
826
 
823
827
  /* #30 GL_ARB_shader_objects */
824
- rb_define_module_function(module, "glDeleteObjectARB", gl_DeleteObjectARB, 1);
825
- rb_define_module_function(module, "glGetHandleARB", gl_GetHandleARB, 1);
826
- rb_define_module_function(module, "glDetachObjectARB", gl_DetachObjectARB, 2);
827
- rb_define_module_function(module, "glCreateShaderObjectARB", gl_CreateShaderObjectARB, 1);
828
- rb_define_module_function(module, "glShaderSourceARB", gl_ShaderSourceARB, 2);
829
- rb_define_module_function(module, "glCompileShaderARB", gl_CompileShaderARB, 1);
830
- rb_define_module_function(module, "glCreateProgramObjectARB", gl_CreateProgramObjectARB, 0);
831
- rb_define_module_function(module, "glAttachObjectARB", gl_AttachObjectARB, 2);
832
- rb_define_module_function(module, "glLinkProgramARB", gl_LinkProgramARB, 1);
833
- rb_define_module_function(module, "glUseProgramObjectARB", gl_UseProgramObjectARB, 1);
834
- rb_define_module_function(module, "glValidateProgramARB", gl_ValidateProgramARB, 1);
835
- rb_define_module_function(module, "glUniform1fARB", gl_Uniform1fARB, 2);
836
- rb_define_module_function(module, "glUniform2fARB", gl_Uniform2fARB, 3);
837
- rb_define_module_function(module, "glUniform3fARB", gl_Uniform3fARB, 4);
838
- rb_define_module_function(module, "glUniform4fARB", gl_Uniform4fARB, 5);
839
- rb_define_module_function(module, "glUniform1iARB", gl_Uniform1iARB, 2);
840
- rb_define_module_function(module, "glUniform2iARB", gl_Uniform2iARB, 3);
841
- rb_define_module_function(module, "glUniform3iARB", gl_Uniform3iARB, 4);
842
- rb_define_module_function(module, "glUniform4iARB", gl_Uniform4iARB, 5);
843
- rb_define_module_function(module, "glUniform1fvARB", gl_Uniform1fvARB, 2);
844
- rb_define_module_function(module, "glUniform2fvARB", gl_Uniform2fvARB, 2);
845
- rb_define_module_function(module, "glUniform3fvARB", gl_Uniform3fvARB, 2);
846
- rb_define_module_function(module, "glUniform4fvARB", gl_Uniform4fvARB, 2);
847
- rb_define_module_function(module, "glUniform1ivARB", gl_Uniform1ivARB, 2);
848
- rb_define_module_function(module, "glUniform2ivARB", gl_Uniform2ivARB, 2);
849
- rb_define_module_function(module, "glUniform3ivARB", gl_Uniform3ivARB, 2);
850
- rb_define_module_function(module, "glUniform4ivARB", gl_Uniform4ivARB, 2);
851
- rb_define_module_function(module, "glUniformMatrix2fvARB", gl_UniformMatrix2fvARB, 3);
852
- rb_define_module_function(module, "glUniformMatrix3fvARB", gl_UniformMatrix3fvARB, 3);
853
- rb_define_module_function(module, "glUniformMatrix4fvARB", gl_UniformMatrix4fvARB, 3);
854
- rb_define_module_function(module, "glGetObjectParameterfvARB", gl_GetObjectParameterfvARB, 2);
855
- rb_define_module_function(module, "glGetObjectParameterivARB", gl_GetObjectParameterivARB, 2);
856
- rb_define_module_function(module, "glGetInfoLogARB", gl_GetInfoLogARB, 1);
857
- rb_define_module_function(module, "glGetShaderSourceARB", gl_GetShaderSourceARB, 1);
858
- rb_define_module_function(module, "glGetAttachedObjectsARB", gl_GetAttachedObjectsARB, 1);
859
- rb_define_module_function(module, "glGetUniformLocationARB", gl_GetUniformLocationARB, 2);
860
- rb_define_module_function(module, "glGetActiveUniformARB", gl_GetActiveUniformARB, 2);
861
- rb_define_module_function(module, "glGetUniformfvARB", gl_GetUniformfvARB, 2);
862
- rb_define_module_function(module, "glGetUniformivARB", gl_GetUniformivARB, 2);
828
+ rb_define_module_function(module, "glDeleteObjectARB", gl_DeleteObjectARB, 1);
829
+ rb_define_module_function(module, "glGetHandleARB", gl_GetHandleARB, 1);
830
+ rb_define_module_function(module, "glDetachObjectARB", gl_DetachObjectARB, 2);
831
+ rb_define_module_function(module, "glCreateShaderObjectARB", gl_CreateShaderObjectARB, 1);
832
+ rb_define_module_function(module, "glShaderSourceARB", gl_ShaderSourceARB, 2);
833
+ rb_define_module_function(module, "glCompileShaderARB", gl_CompileShaderARB, 1);
834
+ rb_define_module_function(module, "glCreateProgramObjectARB", gl_CreateProgramObjectARB, 0);
835
+ rb_define_module_function(module, "glAttachObjectARB", gl_AttachObjectARB, 2);
836
+ rb_define_module_function(module, "glLinkProgramARB", gl_LinkProgramARB, 1);
837
+ rb_define_module_function(module, "glUseProgramObjectARB", gl_UseProgramObjectARB, 1);
838
+ rb_define_module_function(module, "glValidateProgramARB", gl_ValidateProgramARB, 1);
839
+ rb_define_module_function(module, "glUniform1fARB", gl_Uniform1fARB, 2);
840
+ rb_define_module_function(module, "glUniform2fARB", gl_Uniform2fARB, 3);
841
+ rb_define_module_function(module, "glUniform3fARB", gl_Uniform3fARB, 4);
842
+ rb_define_module_function(module, "glUniform4fARB", gl_Uniform4fARB, 5);
843
+ rb_define_module_function(module, "glUniform1iARB", gl_Uniform1iARB, 2);
844
+ rb_define_module_function(module, "glUniform2iARB", gl_Uniform2iARB, 3);
845
+ rb_define_module_function(module, "glUniform3iARB", gl_Uniform3iARB, 4);
846
+ rb_define_module_function(module, "glUniform4iARB", gl_Uniform4iARB, 5);
847
+ rb_define_module_function(module, "glUniform1fvARB", gl_Uniform1fvARB, 2);
848
+ rb_define_module_function(module, "glUniform2fvARB", gl_Uniform2fvARB, 2);
849
+ rb_define_module_function(module, "glUniform3fvARB", gl_Uniform3fvARB, 2);
850
+ rb_define_module_function(module, "glUniform4fvARB", gl_Uniform4fvARB, 2);
851
+ rb_define_module_function(module, "glUniform1ivARB", gl_Uniform1ivARB, 2);
852
+ rb_define_module_function(module, "glUniform2ivARB", gl_Uniform2ivARB, 2);
853
+ rb_define_module_function(module, "glUniform3ivARB", gl_Uniform3ivARB, 2);
854
+ rb_define_module_function(module, "glUniform4ivARB", gl_Uniform4ivARB, 2);
855
+ rb_define_module_function(module, "glUniformMatrix2fvARB", gl_UniformMatrix2fvARB, 3);
856
+ rb_define_module_function(module, "glUniformMatrix3fvARB", gl_UniformMatrix3fvARB, 3);
857
+ rb_define_module_function(module, "glUniformMatrix4fvARB", gl_UniformMatrix4fvARB, 3);
858
+ rb_define_module_function(module, "glGetObjectParameterfvARB", gl_GetObjectParameterfvARB, 2);
859
+ rb_define_module_function(module, "glGetObjectParameterivARB", gl_GetObjectParameterivARB, 2);
860
+ rb_define_module_function(module, "glGetInfoLogARB", gl_GetInfoLogARB, 1);
861
+ rb_define_module_function(module, "glGetShaderSourceARB", gl_GetShaderSourceARB, 1);
862
+ rb_define_module_function(module, "glGetAttachedObjectsARB", gl_GetAttachedObjectsARB, 1);
863
+ rb_define_module_function(module, "glGetUniformLocationARB", gl_GetUniformLocationARB, 2);
864
+ rb_define_module_function(module, "glGetActiveUniformARB", gl_GetActiveUniformARB, 2);
865
+ rb_define_module_function(module, "glGetUniformfvARB", gl_GetUniformfvARB, 2);
866
+ rb_define_module_function(module, "glGetUniformivARB", gl_GetUniformivARB, 2);
863
867
 
864
868
  /* #31 GL_ARB_vertex_shader */
865
- rb_define_module_function(module, "glBindAttribLocationARB", gl_BindAttribLocationARB, 3);
866
- rb_define_module_function(module, "glGetActiveAttribARB", gl_GetActiveAttribARB, 2);
867
- rb_define_module_function(module, "glGetAttribLocationARB", gl_GetAttribLocationARB, 2);
869
+ rb_define_module_function(module, "glBindAttribLocationARB", gl_BindAttribLocationARB, 3);
870
+ rb_define_module_function(module, "glGetActiveAttribARB", gl_GetActiveAttribARB, 2);
871
+ rb_define_module_function(module, "glGetAttribLocationARB", gl_GetAttribLocationARB, 2);
868
872
 
869
873
  /* #39 GL_ARB_color_buffer_float */
870
- rb_define_module_function(module, "glClampColorARB", gl_ClampColorARB, 2);
874
+ rb_define_module_function(module, "glClampColorARB", gl_ClampColorARB, 2);
871
875
  }