danabr75-opengl 0.10.0

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. data/.autotest +29 -0
  3. data/.gemtest +0 -0
  4. data/.gitignore +6 -0
  5. data/.travis.yml +19 -0
  6. data/Gemfile +8 -0
  7. data/History.md +101 -0
  8. data/MIT-LICENSE +18 -0
  9. data/Manifest.txt +142 -0
  10. data/README.rdoc +105 -0
  11. data/Rakefile +170 -0
  12. data/danabr75-opengl.gemspec +32 -0
  13. data/examples/NeHe/NeHe.png +0 -0
  14. data/examples/NeHe/crate.png +0 -0
  15. data/examples/NeHe/glass.png +0 -0
  16. data/examples/NeHe/nehe_lesson02.rb +117 -0
  17. data/examples/NeHe/nehe_lesson03.rb +123 -0
  18. data/examples/NeHe/nehe_lesson04.rb +132 -0
  19. data/examples/NeHe/nehe_lesson05.rb +182 -0
  20. data/examples/NeHe/nehe_lesson06.rb +186 -0
  21. data/examples/NeHe/nehe_lesson07.rb +240 -0
  22. data/examples/NeHe/nehe_lesson08.rb +255 -0
  23. data/examples/NeHe/nehe_lesson09.rb +203 -0
  24. data/examples/NeHe/nehe_lesson11.rb +176 -0
  25. data/examples/NeHe/nehe_lesson12.rb +203 -0
  26. data/examples/NeHe/nehe_lesson16.rb +211 -0
  27. data/examples/NeHe/nehe_lesson19.rb +209 -0
  28. data/examples/NeHe/nehe_lesson36.rb +308 -0
  29. data/examples/NeHe/particle.png +0 -0
  30. data/examples/NeHe/star.png +0 -0
  31. data/examples/NeHe/tim.png +0 -0
  32. data/examples/OrangeBook/3Dlabs-License.txt +33 -0
  33. data/examples/OrangeBook/brick.frag +36 -0
  34. data/examples/OrangeBook/brick.rb +378 -0
  35. data/examples/OrangeBook/brick.vert +41 -0
  36. data/examples/OrangeBook/particle.frag +17 -0
  37. data/examples/OrangeBook/particle.rb +408 -0
  38. data/examples/OrangeBook/particle.vert +38 -0
  39. data/examples/README +16 -0
  40. data/examples/RedBook/aapoly.rb +143 -0
  41. data/examples/RedBook/aargb.rb +121 -0
  42. data/examples/RedBook/accanti.rb +164 -0
  43. data/examples/RedBook/accpersp.rb +217 -0
  44. data/examples/RedBook/alpha.rb +125 -0
  45. data/examples/RedBook/alpha3D.rb +160 -0
  46. data/examples/RedBook/bezcurve.rb +107 -0
  47. data/examples/RedBook/bezmesh.rb +139 -0
  48. data/examples/RedBook/checker.rb +126 -0
  49. data/examples/RedBook/clip.rb +97 -0
  50. data/examples/RedBook/colormat.rb +137 -0
  51. data/examples/RedBook/cube.rb +71 -0
  52. data/examples/RedBook/depthcue.rb +101 -0
  53. data/examples/RedBook/dof.rb +206 -0
  54. data/examples/RedBook/double.rb +107 -0
  55. data/examples/RedBook/drawf.rb +93 -0
  56. data/examples/RedBook/feedback.rb +147 -0
  57. data/examples/RedBook/fog.rb +168 -0
  58. data/examples/RedBook/font.rb +153 -0
  59. data/examples/RedBook/hello.rb +81 -0
  60. data/examples/RedBook/image.rb +139 -0
  61. data/examples/RedBook/jitter.rb +207 -0
  62. data/examples/RedBook/light.rb +157 -0
  63. data/examples/RedBook/lines.rb +130 -0
  64. data/examples/RedBook/list.rb +113 -0
  65. data/examples/RedBook/material.rb +276 -0
  66. data/examples/RedBook/mipmap.rb +158 -0
  67. data/examples/RedBook/model.rb +115 -0
  68. data/examples/RedBook/movelight.rb +134 -0
  69. data/examples/RedBook/pickdepth.rb +181 -0
  70. data/examples/RedBook/planet.rb +110 -0
  71. data/examples/RedBook/quadric.rb +160 -0
  72. data/examples/RedBook/robot.rb +117 -0
  73. data/examples/RedBook/select.rb +198 -0
  74. data/examples/RedBook/smooth.rb +97 -0
  75. data/examples/RedBook/stencil.rb +165 -0
  76. data/examples/RedBook/stroke.rb +169 -0
  77. data/examples/RedBook/surface.rb +168 -0
  78. data/examples/RedBook/teaambient.rb +134 -0
  79. data/examples/RedBook/teapots.rb +184 -0
  80. data/examples/RedBook/tess.rb +185 -0
  81. data/examples/RedBook/texbind.rb +149 -0
  82. data/examples/RedBook/texgen.rb +171 -0
  83. data/examples/RedBook/texturesurf.rb +130 -0
  84. data/examples/RedBook/varray.rb +161 -0
  85. data/examples/RedBook/wrap.rb +150 -0
  86. data/examples/misc/OGLBench.rb +338 -0
  87. data/examples/misc/anisotropic.rb +196 -0
  88. data/examples/misc/fbo_test.rb +357 -0
  89. data/examples/misc/font-glut.rb +47 -0
  90. data/examples/misc/glfwtest.rb +30 -0
  91. data/examples/misc/plane.rb +161 -0
  92. data/examples/misc/readpixel.rb +66 -0
  93. data/examples/misc/sdltest.rb +36 -0
  94. data/examples/misc/trislam.rb +829 -0
  95. data/ext/opengl/GL/gl.h +2115 -0
  96. data/ext/opengl/GL/glext.h +11770 -0
  97. data/ext/opengl/common.h +372 -0
  98. data/ext/opengl/conv.h +247 -0
  99. data/ext/opengl/extconf.rb +19 -0
  100. data/ext/opengl/fptr_struct.h +912 -0
  101. data/ext/opengl/funcdef.h +279 -0
  102. data/ext/opengl/gl-1.0-1.1.c +3345 -0
  103. data/ext/opengl/gl-1.2.c +155 -0
  104. data/ext/opengl/gl-1.3.c +447 -0
  105. data/ext/opengl/gl-1.4.c +346 -0
  106. data/ext/opengl/gl-1.5.c +225 -0
  107. data/ext/opengl/gl-2.0.c +665 -0
  108. data/ext/opengl/gl-2.1.c +57 -0
  109. data/ext/opengl/gl-3.0.c +502 -0
  110. data/ext/opengl/gl-enums.c +4853 -0
  111. data/ext/opengl/gl-enums.h +14528 -0
  112. data/ext/opengl/gl-error.c +110 -0
  113. data/ext/opengl/gl-error.h +25 -0
  114. data/ext/opengl/gl-ext-3dfx.c +27 -0
  115. data/ext/opengl/gl-ext-arb.c +880 -0
  116. data/ext/opengl/gl-ext-ati.c +41 -0
  117. data/ext/opengl/gl-ext-ext.c +885 -0
  118. data/ext/opengl/gl-ext-gremedy.c +41 -0
  119. data/ext/opengl/gl-ext-nv.c +679 -0
  120. data/ext/opengl/gl.c +265 -0
  121. data/ext/opengl/gl_buffer.c +202 -0
  122. data/ext/opengl/glimpl.c +187 -0
  123. data/ext/opengl/glimpl.h +47 -0
  124. data/ext/opengl/opengl.c +9 -0
  125. data/lib/gl.rb +1 -0
  126. data/lib/opengl.rb +79 -0
  127. data/lib/opengl/bindings_version.rb +4 -0
  128. data/lib/opengl/implementation.rb +38 -0
  129. data/lib/opengl/test_case.rb +86 -0
  130. data/test/dummy.xorg.conf +140 -0
  131. data/test/test_gl.rb +45 -0
  132. data/test/test_gl_10_11.rb +1363 -0
  133. data/test/test_gl_12.rb +71 -0
  134. data/test/test_gl_13.rb +221 -0
  135. data/test/test_gl_14.rb +218 -0
  136. data/test/test_gl_15.rb +258 -0
  137. data/test/test_gl_20.rb +417 -0
  138. data/test/test_gl_21.rb +436 -0
  139. data/test/test_gl_ext_arb.rb +508 -0
  140. data/test/test_gl_ext_ati.rb +28 -0
  141. data/test/test_gl_ext_ext.rb +608 -0
  142. data/test/test_gl_ext_gremedy.rb +29 -0
  143. data/test/test_gl_ext_nv.rb +349 -0
  144. data/test/test_glimpl.rb +23 -0
  145. data/test/test_opengl_buffer.rb +122 -0
  146. data/utils/README +6 -0
  147. data/utils/enumgen.rb +108 -0
  148. data/utils/extlistgen.rb +90 -0
  149. metadata +326 -0
@@ -0,0 +1,665 @@
1
+ /*
2
+ * Copyright (C) 2007 Jan Dvorak <jan.dvorak@kraxnet.cz>
3
+ *
4
+ * This program is distributed under the terms of the MIT license.
5
+ * See the included MIT-LICENSE file for the terms of this license.
6
+ *
7
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
8
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
9
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
10
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
11
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
12
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
13
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
14
+ */
15
+
16
+ #include "common.h"
17
+
18
+ GL_FUNC_LOAD_2(BlendEquationSeparate,GLvoid, GLenum,GLenum, "2.0")
19
+ GL_FUNC_LOAD_4(StencilOpSeparate,GLvoid, GLenum,GLenum,GLenum,GLenum, "2.0")
20
+ GL_FUNC_LOAD_2(AttachShader,GLvoid, GLuint,GLuint, "2.0")
21
+ GL_FUNC_LOAD_1(CompileShader,GLvoid, GLuint, "2.0")
22
+ GL_FUNC_LOAD_1(DeleteProgram,GLvoid, GLuint, "2.0")
23
+ GL_FUNC_LOAD_1(DeleteShader,GLvoid, GLuint, "2.0")
24
+ GL_FUNC_LOAD_2(DetachShader,GLvoid, GLuint,GLuint, "2.0")
25
+ GL_FUNC_LOAD_1(DisableVertexAttribArray,GLvoid, GLuint, "2.0")
26
+ GL_FUNC_LOAD_1(EnableVertexAttribArray,GLvoid, GLuint, "2.0")
27
+ GL_FUNC_LOAD_1(LinkProgram,GLvoid, GLuint, "2.0")
28
+ GL_FUNC_LOAD_1(UseProgram,GLvoid, GLuint, "2.0")
29
+ GL_FUNC_LOAD_1(ValidateProgram,GLvoid, GLuint, "2.0")
30
+ GL_FUNC_LOAD_4(StencilFuncSeparate,GLvoid, GLenum,GLenum,GLint,GLuint, "2.0")
31
+ GL_FUNC_LOAD_2(StencilMaskSeparate,GLvoid, GLenum,GLuint, "2.0")
32
+ GL_FUNC_LOAD_0(CreateProgram,GLuint, "2.0")
33
+ GL_FUNC_LOAD_1(CreateShader,GLuint, GLenum, "2.0")
34
+ GL_FUNC_LOAD_1(IsProgram,GLboolean, GLuint, "2.0")
35
+ GL_FUNC_LOAD_1(IsShader,GLboolean, GLuint, "2.0")
36
+ GL_FUNC_LOAD_2(Uniform1f,GLvoid, GLint,GLfloat, "2.0")
37
+ GL_FUNC_LOAD_2(Uniform1i,GLvoid, GLint,GLint, "2.0")
38
+ GL_FUNC_LOAD_3(Uniform2f,GLvoid, GLint,GLfloat,GLfloat, "2.0")
39
+ GL_FUNC_LOAD_3(Uniform2i,GLvoid, GLint,GLint,GLint, "2.0")
40
+ GL_FUNC_LOAD_4(Uniform3f,GLvoid, GLint,GLfloat,GLfloat,GLfloat, "2.0")
41
+ GL_FUNC_LOAD_4(Uniform3i,GLvoid, GLint,GLint,GLint,GLint, "2.0")
42
+ GL_FUNC_LOAD_5(Uniform4f,GLvoid, GLint,GLfloat,GLfloat,GLfloat,GLfloat, "2.0")
43
+ GL_FUNC_LOAD_5(Uniform4i,GLvoid, GLint,GLint,GLint,GLint,GLint, "2.0")
44
+ GL_FUNC_LOAD_2(VertexAttrib1d,GLvoid, GLuint,GLdouble, "2.0")
45
+ GL_FUNC_LOAD_2(VertexAttrib1f,GLvoid, GLuint,GLfloat, "2.0")
46
+ GL_FUNC_LOAD_2(VertexAttrib1s,GLvoid, GLuint,GLshort, "2.0")
47
+ GL_FUNC_LOAD_3(VertexAttrib2d,GLvoid, GLuint,GLdouble,GLdouble, "2.0")
48
+ GL_FUNC_LOAD_3(VertexAttrib2f,GLvoid, GLuint,GLfloat,GLfloat, "2.0")
49
+ GL_FUNC_LOAD_3(VertexAttrib2s,GLvoid, GLuint,GLshort,GLshort, "2.0")
50
+ GL_FUNC_LOAD_4(VertexAttrib3d,GLvoid, GLuint,GLdouble,GLdouble,GLdouble, "2.0")
51
+ GL_FUNC_LOAD_4(VertexAttrib3f,GLvoid, GLuint,GLfloat,GLfloat,GLfloat, "2.0")
52
+ GL_FUNC_LOAD_4(VertexAttrib3s,GLvoid, GLuint,GLshort,GLshort,GLshort, "2.0")
53
+ GL_FUNC_LOAD_5(VertexAttrib4d,GLvoid, GLuint,GLdouble,GLdouble,GLdouble,GLdouble, "2.0")
54
+ GL_FUNC_LOAD_5(VertexAttrib4f,GLvoid, GLuint,GLfloat,GLfloat,GLfloat,GLfloat, "2.0")
55
+ GL_FUNC_LOAD_5(VertexAttrib4s,GLvoid, GLuint,GLshort,GLshort,GLshort,GLshort, "2.0")
56
+ GL_FUNC_LOAD_5(VertexAttrib4Nub,GLvoid, GLuint,GLubyte,GLubyte,GLubyte,GLubyte, "2.0")
57
+
58
+ static VALUE
59
+ gl_DrawBuffers(obj,arg1)
60
+ VALUE obj,arg1;
61
+ {
62
+ GLsizei size;
63
+ GLenum *buffers;
64
+ DECL_GL_FUNC_PTR(GLvoid,glDrawBuffers,(GLsizei,GLenum *));
65
+ LOAD_GL_FUNC(glDrawBuffers, "2.0");
66
+ Check_Type(arg1,T_ARRAY);
67
+ size = (GLsizei)RARRAY_LENINT(arg1);
68
+ buffers = ALLOC_N(GLenum,size);
69
+ ary2cuint(arg1,buffers,size);
70
+ fptr_glDrawBuffers(size,buffers);
71
+ xfree(buffers);
72
+ CHECK_GLERROR_FROM("glDrawBuffers");
73
+ return Qnil;
74
+ }
75
+
76
+ static VALUE
77
+ gl_BindAttribLocation(obj,arg1,arg2,arg3)
78
+ VALUE obj,arg1,arg2,arg3;
79
+ {
80
+ GLuint program;
81
+ GLuint index;
82
+ DECL_GL_FUNC_PTR(GLvoid,glBindAttribLocation,(GLuint,GLuint,GLchar *));
83
+ LOAD_GL_FUNC(glBindAttribLocation, "2.0");
84
+ program = (GLuint)NUM2UINT(arg1);
85
+ index = (GLuint)NUM2UINT(arg2);
86
+ Check_Type(arg3, T_STRING);
87
+ fptr_glBindAttribLocation(program,index,RSTRING_PTR(arg3));
88
+ CHECK_GLERROR_FROM("glBindAttribLocation");
89
+ return Qnil;
90
+ }
91
+
92
+ static VALUE
93
+ gl_GetProgramiv(obj,arg1,arg2)
94
+ VALUE obj,arg1,arg2;
95
+ {
96
+ GLuint program;
97
+ GLenum pname;
98
+ GLint params = 0;
99
+ DECL_GL_FUNC_PTR(GLvoid,glGetProgramiv,(GLuint,GLenum,GLint *));
100
+ LOAD_GL_FUNC(glGetProgramiv, "2.0");
101
+ program = (GLuint)NUM2UINT(arg1);
102
+ pname = (GLenum)NUM2INT(arg2);
103
+ fptr_glGetProgramiv(program,pname,&params);
104
+ CHECK_GLERROR_FROM("glGetProgramiv");
105
+ return cond_GLBOOL2RUBY(pname,params);
106
+ }
107
+
108
+ static VALUE
109
+ gl_GetActiveAttrib(obj,arg1,arg2)
110
+ VALUE obj,arg1,arg2;
111
+ {
112
+ GLuint program;
113
+ GLuint index;
114
+ GLsizei max_size = 0;
115
+ GLsizei written = 0;
116
+ GLint attrib_size = 0;
117
+ GLenum attrib_type = 0;
118
+ VALUE buffer;
119
+ VALUE retary;
120
+ DECL_GL_FUNC_PTR(GLvoid,glGetActiveAttrib,(GLuint,GLuint,GLsizei,GLsizei *,GLint *,GLenum *,GLchar *));
121
+ DECL_GL_FUNC_PTR(GLvoid,glGetProgramiv,(GLuint,GLenum,GLint *));
122
+ LOAD_GL_FUNC(glGetActiveAttrib, "2.0");
123
+ LOAD_GL_FUNC(glGetProgramiv, "2.0");
124
+ program = (GLuint)NUM2UINT(arg1);
125
+ index = (GLuint)NUM2UINT(arg2);
126
+ fptr_glGetProgramiv(program,GL_ACTIVE_ATTRIBUTE_MAX_LENGTH,&max_size);
127
+ CHECK_GLERROR_FROM("glGetProgramiv");
128
+ /* Can't determine maximum attribute name length, so presume it */
129
+ if (max_size==0) max_size = 256;
130
+ buffer = allocate_buffer_with_string(max_size-1);
131
+
132
+ fptr_glGetActiveAttrib(program,index,max_size,&written,&attrib_size,&attrib_type,RSTRING_PTR(buffer));
133
+
134
+ rb_str_set_len(buffer, written);
135
+ retary = rb_ary_new2(3);
136
+ rb_ary_push(retary, INT2NUM(attrib_size));
137
+ rb_ary_push(retary, INT2NUM(attrib_type));
138
+ rb_ary_push(retary, buffer);
139
+ CHECK_GLERROR_FROM("glGetActiveAttrib");
140
+ return retary;
141
+ }
142
+
143
+ static VALUE
144
+ gl_GetActiveUniform(obj,arg1,arg2)
145
+ VALUE obj,arg1,arg2;
146
+ {
147
+ GLuint program;
148
+ GLuint index;
149
+ GLsizei max_size = 0;
150
+ GLsizei written = 0;
151
+ GLint uniform_size = 0;
152
+ GLenum uniform_type = 0;
153
+ VALUE buffer;
154
+ VALUE retary;
155
+ DECL_GL_FUNC_PTR(GLvoid,glGetActiveUniform,(GLuint,GLuint,GLsizei,GLsizei*,GLint*,GLenum*,GLchar*));
156
+ DECL_GL_FUNC_PTR(GLvoid,glGetProgramiv,(GLuint,GLenum,GLint *));
157
+ LOAD_GL_FUNC(glGetActiveUniform, "2.0");
158
+ LOAD_GL_FUNC(glGetProgramiv, "2.0");
159
+ program = (GLuint)NUM2UINT(arg1);
160
+ index = (GLuint)NUM2UINT(arg2);
161
+ fptr_glGetProgramiv(program,GL_ACTIVE_UNIFORM_MAX_LENGTH,&max_size);
162
+ CHECK_GLERROR_FROM("glGetProgramiv");
163
+ /* Can't determine maximum uniform name length, so presume it */
164
+ if (max_size==0) max_size = 256;
165
+ buffer = allocate_buffer_with_string(max_size-1);
166
+
167
+ fptr_glGetActiveUniform(program,index,max_size,&written,&uniform_size,&uniform_type,RSTRING_PTR(buffer));
168
+
169
+ rb_str_set_len(buffer, written);
170
+ retary = rb_ary_new2(3);
171
+ rb_ary_push(retary, INT2NUM(uniform_size));
172
+ rb_ary_push(retary, INT2NUM(uniform_type));
173
+ rb_ary_push(retary, buffer);
174
+ CHECK_GLERROR_FROM("glGetActiveUniform");
175
+ return retary;
176
+ }
177
+
178
+ static VALUE
179
+ gl_GetAttachedShaders(obj,arg1)
180
+ VALUE obj,arg1;
181
+ {
182
+ GLuint program;
183
+ GLint shaders_num = 0;
184
+ GLuint *shaders;
185
+ GLsizei count = 0;
186
+ DECL_GL_FUNC_PTR(GLvoid,glGetAttachedShaders,(GLuint,GLsizei,GLsizei *,GLuint *));
187
+ DECL_GL_FUNC_PTR(GLvoid,glGetProgramiv,(GLuint,GLenum,GLint *));
188
+ LOAD_GL_FUNC(glGetAttachedShaders, "2.0");
189
+ LOAD_GL_FUNC(glGetProgramiv, "2.0");
190
+ program = (GLuint)NUM2UINT(arg1);
191
+ fptr_glGetProgramiv(program,GL_ATTACHED_SHADERS,&shaders_num);
192
+ CHECK_GLERROR_FROM("glGetProgramiv");
193
+ if (shaders_num<=0)
194
+ return Qnil;
195
+ shaders = ALLOC_N(GLuint,shaders_num);
196
+ fptr_glGetAttachedShaders(program,shaders_num,&count,shaders);
197
+ RET_ARRAY_OR_SINGLE_FREE("glGetAttachedShaders", count, RETCONV_GLuint,
198
+ shaders);
199
+ }
200
+
201
+ static VALUE
202
+ gl_GetAttribLocation(obj,arg1,arg2)
203
+ VALUE obj,arg1,arg2;
204
+ {
205
+ GLuint program;
206
+ GLint ret;
207
+ DECL_GL_FUNC_PTR(GLint,glGetAttribLocation,(GLuint, GLchar *));
208
+ LOAD_GL_FUNC(glGetAttribLocation, "2.0");
209
+ program=(GLuint)NUM2UINT(arg1);
210
+ Check_Type(arg2,T_STRING);
211
+ ret = fptr_glGetAttribLocation(program,RSTRING_PTR(arg2));
212
+ CHECK_GLERROR_FROM("glGetAttribLocation");
213
+ return INT2NUM(ret);
214
+ }
215
+
216
+ static VALUE
217
+ gl_GetProgramInfoLog(obj,arg1)
218
+ VALUE obj,arg1;
219
+ {
220
+ GLuint program;
221
+ GLint max_size = 0;
222
+ GLsizei ret_length = 0;
223
+ VALUE buffer;
224
+ DECL_GL_FUNC_PTR(GLvoid,glGetProgramInfoLog,(GLuint,GLsizei,GLsizei *,GLchar *));
225
+ DECL_GL_FUNC_PTR(GLvoid,glGetProgramiv,(GLuint,GLenum,GLint *));
226
+ LOAD_GL_FUNC(glGetProgramInfoLog, "2.0");
227
+ LOAD_GL_FUNC(glGetProgramiv, "2.0");
228
+ program = (GLuint)NUM2UINT(arg1);
229
+ fptr_glGetProgramiv(program,GL_INFO_LOG_LENGTH,&max_size);
230
+ CHECK_GLERROR_FROM("glGetProgramiv");
231
+ if (max_size<=0)
232
+ return rb_str_new2("");
233
+ buffer = allocate_buffer_with_string(max_size);
234
+ fptr_glGetProgramInfoLog(program,max_size,&ret_length,RSTRING_PTR(buffer));
235
+ rb_str_set_len(buffer, ret_length);
236
+ CHECK_GLERROR_FROM("glGetProgramInfoLog");
237
+ return buffer;
238
+ }
239
+
240
+ static VALUE
241
+ gl_GetShaderiv(obj,arg1,arg2)
242
+ VALUE obj,arg1,arg2;
243
+ {
244
+ GLuint program;
245
+ GLenum pname;
246
+ GLint params = 0;
247
+ DECL_GL_FUNC_PTR(GLvoid,glGetShaderiv,(GLuint,GLenum,GLint *));
248
+ LOAD_GL_FUNC(glGetShaderiv, "2.0");
249
+ program = (GLuint)NUM2UINT(arg1);
250
+ pname = (GLenum)NUM2INT(arg2);
251
+ fptr_glGetShaderiv(program,pname,&params);
252
+ CHECK_GLERROR_FROM("glGetShaderiv");
253
+ return cond_GLBOOL2RUBY(pname,params);
254
+ }
255
+
256
+ static VALUE
257
+ gl_GetShaderInfoLog(obj,arg1)
258
+ VALUE obj,arg1;
259
+ {
260
+ GLuint program;
261
+ GLint max_size = 0;
262
+ GLsizei ret_length = 0;
263
+ VALUE ret_buffer;
264
+ GLchar *buffer;
265
+ DECL_GL_FUNC_PTR(GLvoid,glGetShaderInfoLog,(GLuint,GLsizei,GLsizei *,GLchar *));
266
+ DECL_GL_FUNC_PTR(GLvoid,glGetShaderiv,(GLuint,GLenum,GLint *));
267
+ LOAD_GL_FUNC(glGetShaderInfoLog, "2.0");
268
+ LOAD_GL_FUNC(glGetShaderiv, "2.0");
269
+ program = (GLuint)NUM2UINT(arg1);
270
+ fptr_glGetShaderiv(program,GL_INFO_LOG_LENGTH,&max_size);
271
+ CHECK_GLERROR_FROM("glGetShaderiv");
272
+ if (max_size<=0)
273
+ return rb_str_new2("");
274
+ buffer = ALLOC_N(GLchar,max_size+1);
275
+ memset(buffer,0,sizeof(GLchar) * (max_size+1));
276
+ fptr_glGetShaderInfoLog(program,max_size,&ret_length,buffer);
277
+ ret_buffer = rb_str_new(buffer, ret_length);
278
+ xfree(buffer);
279
+ CHECK_GLERROR_FROM("glGetShaderInfoLog");
280
+ return ret_buffer;
281
+ }
282
+
283
+ static VALUE
284
+ gl_GetShaderSource(obj,arg1)
285
+ VALUE obj,arg1;
286
+ {
287
+ GLuint shader;
288
+ GLint max_size = 0;
289
+ GLsizei ret_length = 0;
290
+ VALUE buffer;
291
+ DECL_GL_FUNC_PTR(GLvoid,glGetShaderSource,(GLuint,GLsizei,GLsizei *,GLchar *));
292
+ DECL_GL_FUNC_PTR(GLvoid,glGetShaderiv,(GLuint,GLenum,GLint *));
293
+ LOAD_GL_FUNC(glGetShaderSource, "2.0");
294
+ LOAD_GL_FUNC(glGetShaderiv, "2.0");
295
+ shader = (GLuint)NUM2UINT(arg1);
296
+ fptr_glGetShaderiv(shader,GL_SHADER_SOURCE_LENGTH,&max_size);
297
+ CHECK_GLERROR_FROM("glGetShaderiv");
298
+ if (max_size==0)
299
+ rb_raise(rb_eTypeError, "Can't determine maximum shader source length");
300
+ buffer = allocate_buffer_with_string(max_size-1);
301
+ fptr_glGetShaderSource(shader,max_size,&ret_length,RSTRING_PTR(buffer));
302
+ CHECK_GLERROR_FROM("glGetShaderSource");
303
+ return buffer;
304
+ }
305
+
306
+ static VALUE
307
+ gl_GetUniformLocation(obj,arg1,arg2)
308
+ VALUE obj,arg1,arg2;
309
+ {
310
+ GLuint program;
311
+ GLint ret;
312
+ DECL_GL_FUNC_PTR(GLint,glGetUniformLocation,(GLuint,const GLchar*));
313
+ LOAD_GL_FUNC(glGetUniformLocation, "2.0");
314
+ program=(GLuint)NUM2UINT(arg1);
315
+ Check_Type(arg2,T_STRING);
316
+ ret = fptr_glGetUniformLocation(program, RSTRING_PTR(arg2));
317
+
318
+ CHECK_GLERROR_FROM("glGetUniformLocation");
319
+ return INT2NUM(ret);
320
+ }
321
+
322
+ #define GETUNIFORM_FUNC(_name_,_type_) \
323
+ static VALUE \
324
+ gl_##_name_(obj,arg1,arg2) \
325
+ VALUE obj,arg1,arg2; \
326
+ { \
327
+ GLuint program; \
328
+ GLint location; \
329
+ _type_ params[16]; \
330
+ GLint unused = 0; \
331
+ GLenum uniform_type = 0; \
332
+ GLint uniform_size = 0; \
333
+ \
334
+ DECL_GL_FUNC_PTR(GLvoid,gl##_name_,(GLuint,GLint,_type_ *)); \
335
+ DECL_GL_FUNC_PTR(GLvoid,glGetActiveUniform,(GLuint,GLuint,GLsizei,GLsizei*,GLint*,GLenum*,GLchar*)); \
336
+ LOAD_GL_FUNC(gl##_name_, "2.0"); \
337
+ LOAD_GL_FUNC(glGetActiveUniform, "2.0"); \
338
+ program = (GLuint)NUM2UINT(arg1); \
339
+ location = (GLint)NUM2INT(arg2); \
340
+ \
341
+ fptr_glGetActiveUniform(program,location,0,NULL,&unused,&uniform_type,NULL); \
342
+ CHECK_GLERROR_FROM("glGetActiveUniform"); \
343
+ if (uniform_type==0) \
344
+ rb_raise(rb_eTypeError, "Can't determine the uniform's type"); \
345
+ \
346
+ uniform_size = get_uniform_size(uniform_type); \
347
+ \
348
+ memset(params,0,16*sizeof(_type_)); \
349
+ fptr_gl##_name_(program,location,params); \
350
+ RET_ARRAY_OR_SINGLE("gl" #_name_, uniform_size, RETCONV_##_type_, params); \
351
+ }
352
+
353
+ GETUNIFORM_FUNC(GetUniformfv,GLfloat)
354
+ GETUNIFORM_FUNC(GetUniformiv,GLint)
355
+ #undef GETUNIFORM_FUNC
356
+
357
+ #define GETVERTEXATTRIB_FUNC(_name_,_type_) \
358
+ static VALUE \
359
+ gl_##_name_(obj,arg1,arg2) \
360
+ VALUE obj,arg1,arg2; \
361
+ { \
362
+ GLuint index; \
363
+ GLenum pname; \
364
+ _type_ params[4] = {0,0,0,0}; \
365
+ GLint size; \
366
+ DECL_GL_FUNC_PTR(GLvoid,gl##_name_,(GLuint,GLenum,_type_ *)); \
367
+ LOAD_GL_FUNC(gl##_name_, "2.0"); \
368
+ index = (GLuint)NUM2UINT(arg1); \
369
+ pname = (GLenum)NUM2INT(arg2); \
370
+ if (pname==GL_CURRENT_VERTEX_ATTRIB) \
371
+ size = 4; \
372
+ else \
373
+ size = 1; \
374
+ fptr_gl##_name_(index,pname,params); \
375
+ RET_ARRAY_OR_SINGLE("gl" #_name_, size, RETCONV_##_type_, params); \
376
+ }
377
+
378
+ GETVERTEXATTRIB_FUNC(GetVertexAttribdv,GLdouble)
379
+ GETVERTEXATTRIB_FUNC(GetVertexAttribfv,GLfloat)
380
+ //GETVERTEXATTRIB_FUNC(GetVertexAttribiv,GLint,cond_GLBOOL2RUBY)
381
+ #undef GETVERTEXATTRIB_FUNC
382
+
383
+ static VALUE
384
+ gl_GetVertexAttribiv(obj,arg1,arg2)
385
+ VALUE obj,arg1,arg2;
386
+ {
387
+ GLuint index;
388
+ GLenum pname;
389
+ GLint params[4] = {0,0,0,0};
390
+ GLint size;
391
+ DECL_GL_FUNC_PTR(GLvoid,glGetVertexAttribiv,(GLuint,GLenum,GLint *));
392
+ LOAD_GL_FUNC(glGetVertexAttribiv, "2.0");
393
+ index = (GLuint)NUM2UINT(arg1);
394
+ pname = (GLenum)NUM2INT(arg2);
395
+ if (pname==GL_CURRENT_VERTEX_ATTRIB)
396
+ size = 4;
397
+ else
398
+ size = 1;
399
+ fptr_glGetVertexAttribiv(index,pname,params);
400
+ RET_ARRAY_OR_SINGLE_BOOL("glGetVertexAttribiv", size, cond_GLBOOL2RUBY,
401
+ pname, params);
402
+ }
403
+
404
+ static VALUE
405
+ gl_GetVertexAttribPointerv(obj,arg1)
406
+ VALUE obj,arg1;
407
+ {
408
+ GLuint index;
409
+ DECL_GL_FUNC_PTR(GLvoid,glGetVertexAttribPointerv,(GLuint,GLenum,GLvoid **));
410
+ LOAD_GL_FUNC(glGetVertexAttribPointerv, "2.0");
411
+ index =(GLuint) NUM2INT(arg1);
412
+ if (index>_MAX_VERTEX_ATTRIBS)
413
+ rb_raise(rb_eArgError, "Index too large, maximum allowed value '%i'",_MAX_VERTEX_ATTRIBS);
414
+
415
+ return GET_GLIMPL_VARIABLE(VertexAttrib_ptr)[index];
416
+ }
417
+
418
+ static VALUE
419
+ gl_ShaderSource(obj,arg1,arg2)
420
+ VALUE obj,arg1,arg2;
421
+ {
422
+ GLuint shader;
423
+ GLint length;
424
+ GLchar *str;
425
+ DECL_GL_FUNC_PTR(GLvoid,glShaderSource,(GLuint,GLsizei,GLchar**,GLint *));
426
+ LOAD_GL_FUNC(glShaderSource, "2.0");
427
+ shader = (GLuint)NUM2UINT(arg1);
428
+ Check_Type(arg2,T_STRING);
429
+ str = RSTRING_PTR(arg2);
430
+ length = (GLint)RSTRING_LENINT(arg2);
431
+ fptr_glShaderSource(shader,1,&str,&length);
432
+ CHECK_GLERROR_FROM("glShaderSource");
433
+ return Qnil;
434
+ }
435
+
436
+ #define UNIFORM_FUNC_V(_name_,_type_,_conv_,_size_) \
437
+ static VALUE \
438
+ gl_##_name_(obj,arg1,arg2) \
439
+ VALUE obj,arg1,arg2; \
440
+ { \
441
+ GLint location; \
442
+ GLsizei count; \
443
+ _type_ *value; \
444
+ DECL_GL_FUNC_PTR(GLvoid,gl##_name_,(GLint,GLsizei,_type_ *)); \
445
+ LOAD_GL_FUNC(gl##_name_,"2.0"); \
446
+ Check_Type(arg2,T_ARRAY); \
447
+ count = (GLsizei)RARRAY_LENINT(arg2); \
448
+ if (count<=0 || (count % _size_) != 0) \
449
+ rb_raise(rb_eArgError, "Parameter array size must be multiplication of %i",_size_); \
450
+ location = (GLint)NUM2INT(arg1); \
451
+ value = ALLOC_N(_type_,count); \
452
+ _conv_(arg2,value,count); \
453
+ fptr_gl##_name_(location,count / _size_,value); \
454
+ xfree(value); \
455
+ CHECK_GLERROR_FROM("gl" #_name_); \
456
+ return Qnil; \
457
+ }
458
+
459
+ UNIFORM_FUNC_V(Uniform1fv,GLfloat,ary2cflt,1)
460
+ UNIFORM_FUNC_V(Uniform1iv,GLint,ary2cint,1)
461
+ UNIFORM_FUNC_V(Uniform2fv,GLfloat,ary2cflt,2)
462
+ UNIFORM_FUNC_V(Uniform2iv,GLint,ary2cint,2)
463
+ UNIFORM_FUNC_V(Uniform3fv,GLfloat,ary2cflt,3)
464
+ UNIFORM_FUNC_V(Uniform3iv,GLint,ary2cint,3)
465
+ UNIFORM_FUNC_V(Uniform4fv,GLfloat,ary2cflt,4)
466
+ UNIFORM_FUNC_V(Uniform4iv,GLint,ary2cint,4)
467
+ #undef UNIFORM_FUNC_V
468
+
469
+ #define UNIFORMMATRIX_FUNC(_name_,_size_) \
470
+ static VALUE \
471
+ gl_##_name_(obj,arg1,arg2,arg3) \
472
+ VALUE obj,arg1,arg2,arg3; \
473
+ { \
474
+ GLint location; \
475
+ GLsizei count; \
476
+ GLboolean transpose; \
477
+ GLfloat *value; \
478
+ DECL_GL_FUNC_PTR(GLvoid,gl##_name_,(GLint,GLsizei,GLboolean,GLfloat *)); \
479
+ LOAD_GL_FUNC(gl##_name_, "2.0"); \
480
+ location = (GLint)NUM2INT(arg1); \
481
+ count = (GLsizei)RARRAY_LENINT(rb_funcall(rb_Array(arg3), rb_intern("flatten"), 0)); \
482
+ transpose = (GLboolean)RUBYBOOL2GL(arg2); \
483
+ value = ALLOC_N(GLfloat, count); \
484
+ ary2cmatfloatcount(arg3,value,_size_,_size_); \
485
+ fptr_gl##_name_(location,count / (_size_*_size_),transpose,value); \
486
+ xfree(value); \
487
+ CHECK_GLERROR_FROM("gl" #_name_); \
488
+ return Qnil; \
489
+ }
490
+
491
+ UNIFORMMATRIX_FUNC(UniformMatrix2fv,2)
492
+ UNIFORMMATRIX_FUNC(UniformMatrix3fv,3)
493
+ UNIFORMMATRIX_FUNC(UniformMatrix4fv,4)
494
+ #undef UNIFORMMATRIX_FUNC
495
+
496
+ #define VERTEXATTRIB_FUNC_V(_name_,_type_,_conv_,_size_) \
497
+ static VALUE \
498
+ gl_##_name_(obj,arg1,arg2) \
499
+ VALUE obj,arg1,arg2; \
500
+ { \
501
+ GLuint index; \
502
+ _type_ v[_size_]; \
503
+ DECL_GL_FUNC_PTR(GLvoid,gl##_name_,(GLuint,_type_ *)); \
504
+ LOAD_GL_FUNC(gl##_name_, "2.0"); \
505
+ index = (GLuint)NUM2UINT(arg1); \
506
+ _conv_(arg2,v,_size_); \
507
+ fptr_gl##_name_(index,v); \
508
+ CHECK_GLERROR_FROM("gl" #_name_); \
509
+ return Qnil; \
510
+ }
511
+
512
+ VERTEXATTRIB_FUNC_V(VertexAttrib4Nbv,GLbyte,ary2cbyte,4)
513
+ VERTEXATTRIB_FUNC_V(VertexAttrib4Niv,GLint,ary2cint,4)
514
+ VERTEXATTRIB_FUNC_V(VertexAttrib4Nsv,GLshort,ary2cshort,4)
515
+ VERTEXATTRIB_FUNC_V(VertexAttrib4Nubv,GLubyte,ary2cubyte,4)
516
+ VERTEXATTRIB_FUNC_V(VertexAttrib4Nuiv,GLuint,ary2cuint,4)
517
+ VERTEXATTRIB_FUNC_V(VertexAttrib4Nusv,GLushort,ary2cushort,4)
518
+ VERTEXATTRIB_FUNC_V(VertexAttrib4uiv,GLuint,ary2cuint,4)
519
+ VERTEXATTRIB_FUNC_V(VertexAttrib4ubv,GLubyte,ary2cubyte,4)
520
+ VERTEXATTRIB_FUNC_V(VertexAttrib4usv,GLushort,ary2cushort,4)
521
+ VERTEXATTRIB_FUNC_V(VertexAttrib4bv,GLbyte,ary2cbyte,4)
522
+ VERTEXATTRIB_FUNC_V(VertexAttrib4iv,GLint,ary2cint,4)
523
+ VERTEXATTRIB_FUNC_V(VertexAttrib4dv,GLdouble,ary2cdbl,4)
524
+ VERTEXATTRIB_FUNC_V(VertexAttrib4fv,GLfloat,ary2cflt,4)
525
+ VERTEXATTRIB_FUNC_V(VertexAttrib4sv,GLshort,ary2cshort,4)
526
+ VERTEXATTRIB_FUNC_V(VertexAttrib3dv,GLdouble,ary2cdbl,3)
527
+ VERTEXATTRIB_FUNC_V(VertexAttrib3fv,GLfloat,ary2cflt,3)
528
+ VERTEXATTRIB_FUNC_V(VertexAttrib3sv,GLshort,ary2cshort,3)
529
+ VERTEXATTRIB_FUNC_V(VertexAttrib2dv,GLdouble,ary2cdbl,2)
530
+ VERTEXATTRIB_FUNC_V(VertexAttrib2fv,GLfloat,ary2cflt,2)
531
+ VERTEXATTRIB_FUNC_V(VertexAttrib2sv,GLshort,ary2cshort,2)
532
+ VERTEXATTRIB_FUNC_V(VertexAttrib1dv,GLdouble,ary2cdbl,1)
533
+ VERTEXATTRIB_FUNC_V(VertexAttrib1fv,GLfloat,ary2cflt,1)
534
+ VERTEXATTRIB_FUNC_V(VertexAttrib1sv,GLshort,ary2cshort,1)
535
+ #undef VERTEXATTRIB_FUNC_V
536
+
537
+ static VALUE
538
+ gl_VertexAttribPointer(obj,arg1,arg2,arg3,arg4,arg5,arg6)
539
+ VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6;
540
+ {
541
+ GLuint index;
542
+ GLuint size;
543
+ GLenum type;
544
+ GLboolean normalized;
545
+ GLsizei stride;
546
+ DECL_GL_FUNC_PTR(GLvoid,glVertexAttribPointer,(GLuint,GLint,GLenum,GLboolean,GLsizei,GLvoid *));
547
+ LOAD_GL_FUNC(glVertexAttribPointer, "2.0");
548
+ index = (GLuint)NUM2UINT(arg1);
549
+ size = (GLuint)NUM2UINT(arg2);
550
+ type = (GLenum)NUM2INT(arg3);
551
+ normalized = (GLboolean)RUBYBOOL2GL(arg4);
552
+ stride = (GLsizei)NUM2UINT(arg5);
553
+ if (index>_MAX_VERTEX_ATTRIBS)
554
+ rb_raise(rb_eArgError, "Index too large, maximum allowed value '%i'",_MAX_VERTEX_ATTRIBS);
555
+
556
+ if (CHECK_BUFFER_BINDING(GL_ARRAY_BUFFER_BINDING)) {
557
+ GET_GLIMPL_VARIABLE(VertexAttrib_ptr)[index] = arg6;
558
+ fptr_glVertexAttribPointer(index,size,type,normalized,stride,(GLvoid *)NUM2SIZET(arg6));
559
+ } else {
560
+ VALUE data;
561
+ data = pack_array_or_pass_string(type,arg6);
562
+ rb_str_freeze(data);
563
+ GET_GLIMPL_VARIABLE(VertexAttrib_ptr)[index] = data;
564
+ fptr_glVertexAttribPointer(index,size,type,normalized,stride,(GLvoid *)RSTRING_PTR(data));
565
+ }
566
+ CHECK_GLERROR_FROM("glVertexAttribPointer");
567
+ return Qnil;
568
+ }
569
+
570
+ void gl_init_functions_2_0(VALUE klass)
571
+ {
572
+ rb_define_method(klass, "glBlendEquationSeparate", gl_BlendEquationSeparate, 2);
573
+ rb_define_method(klass, "glDrawBuffers", gl_DrawBuffers, 1);
574
+ rb_define_method(klass, "glStencilOpSeparate", gl_StencilOpSeparate, 4);
575
+ rb_define_method(klass, "glStencilFuncSeparate", gl_StencilFuncSeparate, 4);
576
+ rb_define_method(klass, "glStencilMaskSeparate", gl_StencilMaskSeparate, 2);
577
+ rb_define_method(klass, "glAttachShader", gl_AttachShader, 2);
578
+ rb_define_method(klass, "glBindAttribLocation", gl_BindAttribLocation, 3);
579
+ rb_define_method(klass, "glCompileShader", gl_CompileShader, 1);
580
+ rb_define_method(klass, "glCreateProgram", gl_CreateProgram, 0);
581
+ rb_define_method(klass, "glCreateShader", gl_CreateShader, 1);
582
+ rb_define_method(klass, "glDeleteProgram", gl_DeleteProgram, 1);
583
+ rb_define_method(klass, "glDeleteShader", gl_DeleteShader, 1);
584
+ rb_define_method(klass, "glDetachShader", gl_DetachShader, 2);
585
+ rb_define_method(klass, "glDisableVertexAttribArray", gl_DisableVertexAttribArray, 1);
586
+ rb_define_method(klass, "glEnableVertexAttribArray", gl_EnableVertexAttribArray, 1);
587
+ rb_define_method(klass, "glGetActiveAttrib", gl_GetActiveAttrib, 2);
588
+ rb_define_method(klass, "glGetActiveUniform", gl_GetActiveUniform, 2);
589
+ rb_define_method(klass, "glGetAttachedShaders", gl_GetAttachedShaders, 1);
590
+ rb_define_method(klass, "glGetAttribLocation", gl_GetAttribLocation, 2);
591
+ rb_define_method(klass, "glGetProgramiv", gl_GetProgramiv, 2);
592
+ rb_define_method(klass, "glGetProgramInfoLog", gl_GetProgramInfoLog, 1);
593
+ rb_define_method(klass, "glGetShaderiv", gl_GetShaderiv, 2);
594
+ rb_define_method(klass, "glGetShaderInfoLog", gl_GetShaderInfoLog, 1);
595
+ rb_define_method(klass, "glGetShaderSource", gl_GetShaderSource, 1);
596
+ rb_define_method(klass, "glGetUniformLocation", gl_GetUniformLocation, 2);
597
+ rb_define_method(klass, "glGetUniformfv", gl_GetUniformfv, 2);
598
+ rb_define_method(klass, "glGetUniformiv", gl_GetUniformiv, 2);
599
+ rb_define_method(klass, "glGetVertexAttribdv", gl_GetVertexAttribdv, 2);
600
+ rb_define_method(klass, "glGetVertexAttribfv", gl_GetVertexAttribfv, 2);
601
+ rb_define_method(klass, "glGetVertexAttribiv", gl_GetVertexAttribiv, 2);
602
+ rb_define_method(klass, "glGetVertexAttribPointerv", gl_GetVertexAttribPointerv, 1);
603
+ rb_define_method(klass, "glIsProgram", gl_IsProgram, 1);
604
+ rb_define_method(klass, "glIsShader", gl_IsShader, 1);
605
+ rb_define_method(klass, "glLinkProgram", gl_LinkProgram, 1);
606
+ rb_define_method(klass, "glShaderSource", gl_ShaderSource, 2);
607
+ rb_define_method(klass, "glUseProgram", gl_UseProgram, 1);
608
+ rb_define_method(klass, "glUniform1f", gl_Uniform1f, 2);
609
+ rb_define_method(klass, "glUniform2f", gl_Uniform2f, 3);
610
+ rb_define_method(klass, "glUniform3f", gl_Uniform3f, 4);
611
+ rb_define_method(klass, "glUniform4f", gl_Uniform4f, 5);
612
+ rb_define_method(klass, "glUniform1i", gl_Uniform1i, 2);
613
+ rb_define_method(klass, "glUniform2i", gl_Uniform2i, 3);
614
+ rb_define_method(klass, "glUniform3i", gl_Uniform3i, 4);
615
+ rb_define_method(klass, "glUniform4i", gl_Uniform4i, 5);
616
+ rb_define_method(klass, "glUniform1fv", gl_Uniform1fv, 2);
617
+ rb_define_method(klass, "glUniform2fv", gl_Uniform2fv, 2);
618
+ rb_define_method(klass, "glUniform3fv", gl_Uniform3fv, 2);
619
+ rb_define_method(klass, "glUniform4fv", gl_Uniform4fv, 2);
620
+ rb_define_method(klass, "glUniform1iv", gl_Uniform1iv, 2);
621
+ rb_define_method(klass, "glUniform2iv", gl_Uniform2iv, 2);
622
+ rb_define_method(klass, "glUniform3iv", gl_Uniform3iv, 2);
623
+ rb_define_method(klass, "glUniform4iv", gl_Uniform4iv, 2);
624
+ rb_define_method(klass, "glUniformMatrix2fv", gl_UniformMatrix2fv, 3);
625
+ rb_define_method(klass, "glUniformMatrix3fv", gl_UniformMatrix3fv, 3);
626
+ rb_define_method(klass, "glUniformMatrix4fv", gl_UniformMatrix4fv, 3);
627
+ rb_define_method(klass, "glValidateProgram", gl_ValidateProgram, 1);
628
+ rb_define_method(klass, "glVertexAttrib1d", gl_VertexAttrib1d, 2);
629
+ rb_define_method(klass, "glVertexAttrib1f", gl_VertexAttrib1f, 2);
630
+ rb_define_method(klass, "glVertexAttrib1s", gl_VertexAttrib1s, 2);
631
+ rb_define_method(klass, "glVertexAttrib2d", gl_VertexAttrib2d, 3);
632
+ rb_define_method(klass, "glVertexAttrib2f", gl_VertexAttrib2f, 3);
633
+ rb_define_method(klass, "glVertexAttrib2s", gl_VertexAttrib2s, 3);
634
+ rb_define_method(klass, "glVertexAttrib3d", gl_VertexAttrib3d, 4);
635
+ rb_define_method(klass, "glVertexAttrib3f", gl_VertexAttrib3f, 4);
636
+ rb_define_method(klass, "glVertexAttrib3s", gl_VertexAttrib3s, 4);
637
+ rb_define_method(klass, "glVertexAttrib4Nbv", gl_VertexAttrib4Nbv, 2);
638
+ rb_define_method(klass, "glVertexAttrib4Niv", gl_VertexAttrib4Niv, 2);
639
+ rb_define_method(klass, "glVertexAttrib4Nsv", gl_VertexAttrib4Nsv, 2);
640
+ rb_define_method(klass, "glVertexAttrib4Nub", gl_VertexAttrib4Nub, 5);
641
+ rb_define_method(klass, "glVertexAttrib4Nubv", gl_VertexAttrib4Nubv, 2);
642
+ rb_define_method(klass, "glVertexAttrib4Nuiv", gl_VertexAttrib4Nuiv, 2);
643
+ rb_define_method(klass, "glVertexAttrib4Nusv", gl_VertexAttrib4Nusv, 2);
644
+ rb_define_method(klass, "glVertexAttrib4bv", gl_VertexAttrib4bv, 2);
645
+ rb_define_method(klass, "glVertexAttrib4d", gl_VertexAttrib4d, 5);
646
+ rb_define_method(klass, "glVertexAttrib4f", gl_VertexAttrib4f, 5);
647
+ rb_define_method(klass, "glVertexAttrib4iv", gl_VertexAttrib4iv, 2);
648
+ rb_define_method(klass, "glVertexAttrib4s", gl_VertexAttrib4s, 5);
649
+ rb_define_method(klass, "glVertexAttrib4ubv", gl_VertexAttrib4ubv, 2);
650
+ rb_define_method(klass, "glVertexAttrib4uiv", gl_VertexAttrib4uiv, 2);
651
+ rb_define_method(klass, "glVertexAttrib4usv", gl_VertexAttrib4usv, 2);
652
+ rb_define_method(klass, "glVertexAttrib1dv", gl_VertexAttrib1dv, 2);
653
+ rb_define_method(klass, "glVertexAttrib1fv", gl_VertexAttrib1fv, 2);
654
+ rb_define_method(klass, "glVertexAttrib1sv", gl_VertexAttrib1sv, 2);
655
+ rb_define_method(klass, "glVertexAttrib2dv", gl_VertexAttrib2dv, 2);
656
+ rb_define_method(klass, "glVertexAttrib2fv", gl_VertexAttrib2fv, 2);
657
+ rb_define_method(klass, "glVertexAttrib2sv", gl_VertexAttrib2sv, 2);
658
+ rb_define_method(klass, "glVertexAttrib3dv", gl_VertexAttrib3dv, 2);
659
+ rb_define_method(klass, "glVertexAttrib3fv", gl_VertexAttrib3fv, 2);
660
+ rb_define_method(klass, "glVertexAttrib3sv", gl_VertexAttrib3sv, 2);
661
+ rb_define_method(klass, "glVertexAttrib4dv", gl_VertexAttrib4dv, 2);
662
+ rb_define_method(klass, "glVertexAttrib4fv", gl_VertexAttrib4fv, 2);
663
+ rb_define_method(klass, "glVertexAttrib4sv", gl_VertexAttrib4sv, 2);
664
+ rb_define_method(klass, "glVertexAttribPointer", gl_VertexAttribPointer, 6);
665
+ }