opengl 0.9.0-x64-mingw32

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 +3 -0
  3. data.tar.gz.sig +0 -0
  4. data/.autotest +29 -0
  5. data/.gemtest +0 -0
  6. data/.gitignore +6 -0
  7. data/.travis.yml +19 -0
  8. data/History.rdoc +77 -0
  9. data/MIT-LICENSE +18 -0
  10. data/Manifest.txt +138 -0
  11. data/README.rdoc +102 -0
  12. data/Rakefile +60 -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 +155 -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/common.h +428 -0
  96. data/ext/opengl/conv.h +244 -0
  97. data/ext/opengl/extconf.rb +47 -0
  98. data/ext/opengl/funcdef.h +313 -0
  99. data/ext/opengl/gl-1.0-1.1.c +3075 -0
  100. data/ext/opengl/gl-1.2.c +155 -0
  101. data/ext/opengl/gl-1.3.c +443 -0
  102. data/ext/opengl/gl-1.4.c +348 -0
  103. data/ext/opengl/gl-1.5.c +224 -0
  104. data/ext/opengl/gl-2.0.c +667 -0
  105. data/ext/opengl/gl-2.1.c +57 -0
  106. data/ext/opengl/gl-3.0.c +493 -0
  107. data/ext/opengl/gl-enums.c +4873 -0
  108. data/ext/opengl/gl-enums.h +14588 -0
  109. data/ext/opengl/gl-error.c +112 -0
  110. data/ext/opengl/gl-error.h +28 -0
  111. data/ext/opengl/gl-ext-3dfx.c +27 -0
  112. data/ext/opengl/gl-ext-arb.c +875 -0
  113. data/ext/opengl/gl-ext-ati.c +41 -0
  114. data/ext/opengl/gl-ext-ext.c +889 -0
  115. data/ext/opengl/gl-ext-gremedy.c +41 -0
  116. data/ext/opengl/gl-ext-nv.c +680 -0
  117. data/ext/opengl/gl-types.h +67 -0
  118. data/ext/opengl/gl.c +220 -0
  119. data/ext/opengl/gl_buffer.c +177 -0
  120. data/ext/opengl/opengl.c +7 -0
  121. data/lib/gl.rb +1 -0
  122. data/lib/opengl.rb +53 -0
  123. data/lib/opengl/2.0/opengl.so +0 -0
  124. data/lib/opengl/2.1/opengl.so +0 -0
  125. data/lib/opengl/test_case.rb +86 -0
  126. data/test/dummy.xorg.conf +140 -0
  127. data/test/test_gl.rb +38 -0
  128. data/test/test_gl_10_11.rb +1363 -0
  129. data/test/test_gl_12.rb +71 -0
  130. data/test/test_gl_13.rb +221 -0
  131. data/test/test_gl_14.rb +218 -0
  132. data/test/test_gl_15.rb +258 -0
  133. data/test/test_gl_20.rb +417 -0
  134. data/test/test_gl_21.rb +436 -0
  135. data/test/test_gl_ext_arb.rb +508 -0
  136. data/test/test_gl_ext_ati.rb +28 -0
  137. data/test/test_gl_ext_ext.rb +608 -0
  138. data/test/test_gl_ext_gremedy.rb +29 -0
  139. data/test/test_gl_ext_nv.rb +349 -0
  140. data/test/test_opengl_buffer.rb +120 -0
  141. data/utils/README +6 -0
  142. data/utils/enumgen.rb +108 -0
  143. data/utils/extlistgen.rb +90 -0
  144. metadata +319 -0
  145. metadata.gz.sig +1 -0
@@ -0,0 +1,667 @@
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 void (APIENTRY * fptr_glDrawBuffers)(GLsizei,GLenum *);
59
+ static VALUE
60
+ gl_DrawBuffers(obj,arg1)
61
+ VALUE obj,arg1;
62
+ {
63
+ GLsizei size;
64
+ GLenum *buffers;
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 void (APIENTRY * fptr_glBindAttribLocation)(GLuint,GLuint,GLchar *);
77
+ static VALUE
78
+ gl_BindAttribLocation(obj,arg1,arg2,arg3)
79
+ VALUE obj,arg1,arg2,arg3;
80
+ {
81
+ GLuint program;
82
+ GLuint index;
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 void (APIENTRY * fptr_glGetProgramiv)(GLuint,GLenum,GLint *);
93
+ static VALUE
94
+ gl_GetProgramiv(obj,arg1,arg2)
95
+ VALUE obj,arg1,arg2;
96
+ {
97
+ GLuint program;
98
+ GLenum pname;
99
+ GLint params = 0;
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 void (APIENTRY * fptr_glGetActiveAttrib)(GLuint,GLuint,GLsizei,GLsizei *,GLint *,GLenum *,GLchar *);
109
+ static VALUE
110
+ gl_GetActiveAttrib(obj,arg1,arg2)
111
+ VALUE obj,arg1,arg2;
112
+ {
113
+ GLuint program;
114
+ GLuint index;
115
+ GLsizei max_size = 0;
116
+ GLsizei written = 0;
117
+ GLint attrib_size = 0;
118
+ GLenum attrib_type = 0;
119
+ VALUE buffer;
120
+ VALUE retary;
121
+ LOAD_GL_FUNC(glGetActiveAttrib, "2.0");
122
+ LOAD_GL_FUNC(glGetProgramiv, "2.0");
123
+ program = (GLuint)NUM2UINT(arg1);
124
+ index = (GLuint)NUM2UINT(arg2);
125
+ fptr_glGetProgramiv(program,GL_ACTIVE_ATTRIBUTE_MAX_LENGTH,&max_size);
126
+ CHECK_GLERROR_FROM("glGetProgramiv");
127
+ /* Can't determine maximum attribute name length, so presume it */
128
+ if (max_size==0) max_size = 256;
129
+ buffer = allocate_buffer_with_string(max_size-1);
130
+
131
+ fptr_glGetActiveAttrib(program,index,max_size,&written,&attrib_size,&attrib_type,RSTRING_PTR(buffer));
132
+
133
+ rb_str_set_len(buffer, written);
134
+ retary = rb_ary_new2(3);
135
+ rb_ary_push(retary, INT2NUM(attrib_size));
136
+ rb_ary_push(retary, INT2NUM(attrib_type));
137
+ rb_ary_push(retary, buffer);
138
+ CHECK_GLERROR_FROM("glGetActiveAttrib");
139
+ return retary;
140
+ }
141
+
142
+ static void (APIENTRY * fptr_glGetActiveUniform)(GLuint,GLuint,GLsizei,GLsizei*,GLint*,GLenum*,GLchar*);
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
+ LOAD_GL_FUNC(glGetActiveUniform, "2.0");
156
+ LOAD_GL_FUNC(glGetProgramiv, "2.0");
157
+ program = (GLuint)NUM2UINT(arg1);
158
+ index = (GLuint)NUM2UINT(arg2);
159
+ fptr_glGetProgramiv(program,GL_ACTIVE_UNIFORM_MAX_LENGTH,&max_size);
160
+ CHECK_GLERROR_FROM("glGetProgramiv");
161
+ /* Can't determine maximum uniform name length, so presume it */
162
+ if (max_size==0) max_size = 256;
163
+ buffer = allocate_buffer_with_string(max_size-1);
164
+
165
+ fptr_glGetActiveUniform(program,index,max_size,&written,&uniform_size,&uniform_type,RSTRING_PTR(buffer));
166
+
167
+ rb_str_set_len(buffer, written);
168
+ retary = rb_ary_new2(3);
169
+ rb_ary_push(retary, INT2NUM(uniform_size));
170
+ rb_ary_push(retary, INT2NUM(uniform_type));
171
+ rb_ary_push(retary, buffer);
172
+ CHECK_GLERROR_FROM("glGetActiveUniform");
173
+ return retary;
174
+ }
175
+
176
+ static void (APIENTRY * fptr_glGetAttachedShaders)(GLuint,GLsizei,GLsizei *,GLuint *);
177
+ static VALUE
178
+ gl_GetAttachedShaders(obj,arg1)
179
+ VALUE obj,arg1;
180
+ {
181
+ GLuint program;
182
+ GLint shaders_num = 0;
183
+ GLuint *shaders;
184
+ GLsizei count = 0;
185
+ LOAD_GL_FUNC(glGetAttachedShaders, "2.0");
186
+ LOAD_GL_FUNC(glGetProgramiv, "2.0");
187
+ program = (GLuint)NUM2UINT(arg1);
188
+ fptr_glGetProgramiv(program,GL_ATTACHED_SHADERS,&shaders_num);
189
+ CHECK_GLERROR_FROM("glGetProgramiv");
190
+ if (shaders_num<=0)
191
+ return Qnil;
192
+ shaders = ALLOC_N(GLuint,shaders_num);
193
+ fptr_glGetAttachedShaders(program,shaders_num,&count,shaders);
194
+ RET_ARRAY_OR_SINGLE_FREE("glGetAttachedShaders", count, RETCONV_GLuint,
195
+ shaders);
196
+ }
197
+
198
+ static GLint (APIENTRY * fptr_glGetAttribLocation)(GLuint, GLchar *);
199
+ static VALUE
200
+ gl_GetAttribLocation(obj,arg1,arg2)
201
+ VALUE obj,arg1,arg2;
202
+ {
203
+ GLuint program;
204
+ GLint ret;
205
+ LOAD_GL_FUNC(glGetAttribLocation, "2.0");
206
+ program=(GLuint)NUM2UINT(arg1);
207
+ Check_Type(arg2,T_STRING);
208
+ ret = fptr_glGetAttribLocation(program,RSTRING_PTR(arg2));
209
+ CHECK_GLERROR_FROM("glGetAttribLocation");
210
+ return INT2NUM(ret);
211
+ }
212
+
213
+ static void (APIENTRY * fptr_glGetProgramInfoLog)(GLuint,GLsizei,GLsizei *,GLchar *);
214
+ static VALUE
215
+ gl_GetProgramInfoLog(obj,arg1)
216
+ VALUE obj,arg1;
217
+ {
218
+ GLuint program;
219
+ GLint max_size = 0;
220
+ GLsizei ret_length = 0;
221
+ VALUE buffer;
222
+ LOAD_GL_FUNC(glGetProgramInfoLog, "2.0");
223
+ LOAD_GL_FUNC(glGetProgramiv, "2.0");
224
+ program = (GLuint)NUM2UINT(arg1);
225
+ fptr_glGetProgramiv(program,GL_INFO_LOG_LENGTH,&max_size);
226
+ CHECK_GLERROR_FROM("glGetProgramiv");
227
+ if (max_size<=0)
228
+ return rb_str_new2("");
229
+ buffer = allocate_buffer_with_string(max_size);
230
+ fptr_glGetProgramInfoLog(program,max_size,&ret_length,RSTRING_PTR(buffer));
231
+ rb_str_set_len(buffer, ret_length);
232
+ CHECK_GLERROR_FROM("glGetProgramInfoLog");
233
+ return buffer;
234
+ }
235
+
236
+ static void (APIENTRY * fptr_glGetShaderiv)(GLuint,GLenum,GLint *);
237
+ static VALUE
238
+ gl_GetShaderiv(obj,arg1,arg2)
239
+ VALUE obj,arg1,arg2;
240
+ {
241
+ GLuint program;
242
+ GLenum pname;
243
+ GLint params = 0;
244
+ LOAD_GL_FUNC(glGetShaderiv, "2.0");
245
+ program = (GLuint)NUM2UINT(arg1);
246
+ pname = (GLenum)NUM2INT(arg2);
247
+ fptr_glGetShaderiv(program,pname,&params);
248
+ CHECK_GLERROR_FROM("glGetShaderiv");
249
+ return cond_GLBOOL2RUBY(pname,params);
250
+ }
251
+
252
+ static void (APIENTRY * fptr_glGetShaderInfoLog)(GLuint,GLsizei,GLsizei *,GLchar *);
253
+ static VALUE
254
+ gl_GetShaderInfoLog(obj,arg1)
255
+ VALUE obj,arg1;
256
+ {
257
+ GLuint program;
258
+ GLint max_size = 0;
259
+ GLsizei ret_length = 0;
260
+ VALUE ret_buffer;
261
+ GLchar *buffer;
262
+ LOAD_GL_FUNC(glGetShaderInfoLog, "2.0");
263
+ LOAD_GL_FUNC(glGetShaderiv, "2.0");
264
+ program = (GLuint)NUM2UINT(arg1);
265
+ fptr_glGetShaderiv(program,GL_INFO_LOG_LENGTH,&max_size);
266
+ CHECK_GLERROR_FROM("glGetShaderiv");
267
+ if (max_size<=0)
268
+ return rb_str_new2("");
269
+ buffer = ALLOC_N(GLchar,max_size+1);
270
+ memset(buffer,0,sizeof(GLchar) * (max_size+1));
271
+ fptr_glGetShaderInfoLog(program,max_size,&ret_length,buffer);
272
+ ret_buffer = rb_str_new(buffer, ret_length);
273
+ xfree(buffer);
274
+ CHECK_GLERROR_FROM("glGetShaderInfoLog");
275
+ return ret_buffer;
276
+ }
277
+
278
+ static void (APIENTRY * fptr_glGetShaderSource)(GLuint,GLsizei,GLsizei *,GLchar *);
279
+ static VALUE
280
+ gl_GetShaderSource(obj,arg1)
281
+ VALUE obj,arg1;
282
+ {
283
+ GLuint shader;
284
+ GLint max_size = 0;
285
+ GLsizei ret_length = 0;
286
+ VALUE buffer;
287
+ LOAD_GL_FUNC(glGetShaderSource, "2.0");
288
+ LOAD_GL_FUNC(glGetShaderiv, "2.0");
289
+ shader = (GLuint)NUM2UINT(arg1);
290
+ fptr_glGetShaderiv(shader,GL_SHADER_SOURCE_LENGTH,&max_size);
291
+ CHECK_GLERROR_FROM("glGetShaderiv");
292
+ if (max_size==0)
293
+ rb_raise(rb_eTypeError, "Can't determine maximum shader source length");
294
+ buffer = allocate_buffer_with_string(max_size-1);
295
+ fptr_glGetShaderSource(shader,max_size,&ret_length,RSTRING_PTR(buffer));
296
+ CHECK_GLERROR_FROM("glGetShaderSource");
297
+ return buffer;
298
+ }
299
+
300
+ static GLint (APIENTRY * fptr_glGetUniformLocation)(GLuint,const GLchar*);
301
+ static VALUE
302
+ gl_GetUniformLocation(obj,arg1,arg2)
303
+ VALUE obj,arg1,arg2;
304
+ {
305
+ GLuint program;
306
+ GLint ret;
307
+ LOAD_GL_FUNC(glGetUniformLocation, "2.0");
308
+ program=(GLuint)NUM2UINT(arg1);
309
+ Check_Type(arg2,T_STRING);
310
+ ret = fptr_glGetUniformLocation(program, RSTRING_PTR(arg2));
311
+
312
+ CHECK_GLERROR_FROM("glGetUniformLocation");
313
+ return INT2NUM(ret);
314
+ }
315
+
316
+ #define GETUNIFORM_FUNC(_name_,_type_) \
317
+ static void (APIENTRY * fptr_gl##_name_)(GLuint,GLint,_type_ *); \
318
+ static VALUE \
319
+ gl_##_name_(obj,arg1,arg2) \
320
+ VALUE obj,arg1,arg2; \
321
+ { \
322
+ GLuint program; \
323
+ GLint location; \
324
+ _type_ params[16]; \
325
+ GLint unused = 0; \
326
+ GLenum uniform_type = 0; \
327
+ GLint uniform_size = 0; \
328
+ \
329
+ LOAD_GL_FUNC(gl##_name_, "2.0"); \
330
+ LOAD_GL_FUNC(glGetActiveUniform, "2.0"); \
331
+ program = (GLuint)NUM2UINT(arg1); \
332
+ location = (GLint)NUM2INT(arg2); \
333
+ \
334
+ fptr_glGetActiveUniform(program,location,0,NULL,&unused,&uniform_type,NULL); \
335
+ CHECK_GLERROR_FROM("glGetActiveUniform"); \
336
+ if (uniform_type==0) \
337
+ rb_raise(rb_eTypeError, "Can't determine the uniform's type"); \
338
+ \
339
+ uniform_size = get_uniform_size(uniform_type); \
340
+ \
341
+ memset(params,0,16*sizeof(_type_)); \
342
+ fptr_gl##_name_(program,location,params); \
343
+ RET_ARRAY_OR_SINGLE("gl" #_name_, uniform_size, RETCONV_##_type_, params); \
344
+ }
345
+
346
+ GETUNIFORM_FUNC(GetUniformfv,GLfloat)
347
+ GETUNIFORM_FUNC(GetUniformiv,GLint)
348
+ #undef GETUNIFORM_FUNC
349
+
350
+ #define GETVERTEXATTRIB_FUNC(_name_,_type_) \
351
+ static void (APIENTRY * fptr_gl##_name_)(GLuint,GLenum,_type_ *); \
352
+ static VALUE \
353
+ gl_##_name_(obj,arg1,arg2) \
354
+ VALUE obj,arg1,arg2; \
355
+ { \
356
+ GLuint index; \
357
+ GLenum pname; \
358
+ _type_ params[4] = {0,0,0,0}; \
359
+ GLint size; \
360
+ LOAD_GL_FUNC(gl##_name_, "2.0"); \
361
+ index = (GLuint)NUM2UINT(arg1); \
362
+ pname = (GLenum)NUM2INT(arg2); \
363
+ if (pname==GL_CURRENT_VERTEX_ATTRIB) \
364
+ size = 4; \
365
+ else \
366
+ size = 1; \
367
+ fptr_gl##_name_(index,pname,params); \
368
+ RET_ARRAY_OR_SINGLE("gl" #_name_, size, RETCONV_##_type_, params); \
369
+ }
370
+
371
+ GETVERTEXATTRIB_FUNC(GetVertexAttribdv,GLdouble)
372
+ GETVERTEXATTRIB_FUNC(GetVertexAttribfv,GLfloat)
373
+ //GETVERTEXATTRIB_FUNC(GetVertexAttribiv,GLint,cond_GLBOOL2RUBY)
374
+ #undef GETVERTEXATTRIB_FUNC
375
+
376
+ static void (APIENTRY * fptr_glGetVertexAttribiv)(GLuint,GLenum,GLint *);
377
+ static VALUE
378
+ gl_GetVertexAttribiv(obj,arg1,arg2)
379
+ VALUE obj,arg1,arg2;
380
+ {
381
+ GLuint index;
382
+ GLenum pname;
383
+ GLint params[4] = {0,0,0,0};
384
+ GLint size;
385
+ LOAD_GL_FUNC(glGetVertexAttribiv, "2.0");
386
+ index = (GLuint)NUM2UINT(arg1);
387
+ pname = (GLenum)NUM2INT(arg2);
388
+ if (pname==GL_CURRENT_VERTEX_ATTRIB)
389
+ size = 4;
390
+ else
391
+ size = 1;
392
+ fptr_glGetVertexAttribiv(index,pname,params);
393
+ RET_ARRAY_OR_SINGLE_BOOL("glGetVertexAttribiv", size, cond_GLBOOL2RUBY,
394
+ pname, params);
395
+ }
396
+
397
+
398
+ VALUE g_VertexAttrib_ptr[_MAX_VERTEX_ATTRIBS];
399
+
400
+ static void (APIENTRY * fptr_glGetVertexAttribPointerv)(GLuint,GLenum,GLvoid **);
401
+ static VALUE
402
+ gl_GetVertexAttribPointerv(obj,arg1)
403
+ VALUE obj,arg1;
404
+ {
405
+ GLuint index;
406
+ LOAD_GL_FUNC(glGetVertexAttribPointerv, "2.0");
407
+ index =(GLuint) NUM2INT(arg1);
408
+ if (index>_MAX_VERTEX_ATTRIBS)
409
+ rb_raise(rb_eArgError, "Index too large, maximum allowed value '%i'",_MAX_VERTEX_ATTRIBS);
410
+
411
+ return g_VertexAttrib_ptr[index];
412
+ }
413
+
414
+ static void (APIENTRY * fptr_glShaderSource)(GLuint,GLsizei,GLchar**,GLint *);
415
+ static VALUE
416
+ gl_ShaderSource(obj,arg1,arg2)
417
+ VALUE obj,arg1,arg2;
418
+ {
419
+ GLuint shader;
420
+ GLint length;
421
+ GLchar *str;
422
+ LOAD_GL_FUNC(glShaderSource, "2.0");
423
+ shader = (GLuint)NUM2UINT(arg1);
424
+ Check_Type(arg2,T_STRING);
425
+ str = RSTRING_PTR(arg2);
426
+ length = (GLint)RSTRING_LENINT(arg2);
427
+ fptr_glShaderSource(shader,1,&str,&length);
428
+ CHECK_GLERROR_FROM("glShaderSource");
429
+ return Qnil;
430
+ }
431
+
432
+ #define UNIFORM_FUNC_V(_name_,_type_,_conv_,_size_) \
433
+ static void (APIENTRY * fptr_gl##_name_)(GLint,GLsizei,_type_ *); \
434
+ static VALUE \
435
+ gl_##_name_(obj,arg1,arg2) \
436
+ VALUE obj,arg1,arg2; \
437
+ { \
438
+ GLint location; \
439
+ GLsizei count; \
440
+ _type_ *value; \
441
+ LOAD_GL_FUNC(gl##_name_,"2.0"); \
442
+ Check_Type(arg2,T_ARRAY); \
443
+ count = (GLsizei)RARRAY_LENINT(arg2); \
444
+ if (count<=0 || (count % _size_) != 0) \
445
+ rb_raise(rb_eArgError, "Parameter array size must be multiplication of %i",_size_); \
446
+ location = (GLint)NUM2INT(arg1); \
447
+ value = ALLOC_N(_type_,count); \
448
+ _conv_(arg2,value,count); \
449
+ fptr_gl##_name_(location,count / _size_,value); \
450
+ xfree(value); \
451
+ CHECK_GLERROR_FROM("gl" #_name_); \
452
+ return Qnil; \
453
+ }
454
+
455
+ UNIFORM_FUNC_V(Uniform1fv,GLfloat,ary2cflt,1)
456
+ UNIFORM_FUNC_V(Uniform1iv,GLint,ary2cint,1)
457
+ UNIFORM_FUNC_V(Uniform2fv,GLfloat,ary2cflt,2)
458
+ UNIFORM_FUNC_V(Uniform2iv,GLint,ary2cint,2)
459
+ UNIFORM_FUNC_V(Uniform3fv,GLfloat,ary2cflt,3)
460
+ UNIFORM_FUNC_V(Uniform3iv,GLint,ary2cint,3)
461
+ UNIFORM_FUNC_V(Uniform4fv,GLfloat,ary2cflt,4)
462
+ UNIFORM_FUNC_V(Uniform4iv,GLint,ary2cint,4)
463
+ #undef UNIFORM_FUNC_V
464
+
465
+ #define UNIFORMMATRIX_FUNC(_name_,_size_) \
466
+ static void (APIENTRY * fptr_gl##_name_)(GLint,GLsizei,GLboolean,GLfloat *); \
467
+ static VALUE \
468
+ gl_##_name_(obj,arg1,arg2,arg3) \
469
+ VALUE obj,arg1,arg2,arg3; \
470
+ { \
471
+ GLint location; \
472
+ GLsizei count; \
473
+ GLboolean transpose; \
474
+ GLfloat *value; \
475
+ LOAD_GL_FUNC(gl##_name_, "2.0"); \
476
+ location = (GLint)NUM2INT(arg1); \
477
+ count = (GLsizei)RARRAY_LENINT(rb_funcall(rb_Array(arg3), rb_intern("flatten"), 0)); \
478
+ transpose = (GLboolean)RUBYBOOL2GL(arg2); \
479
+ value = ALLOC_N(GLfloat, count); \
480
+ ary2cmatfloatcount(arg3,value,_size_,_size_); \
481
+ fptr_gl##_name_(location,count / (_size_*_size_),transpose,value); \
482
+ xfree(value); \
483
+ CHECK_GLERROR_FROM("gl" #_name_); \
484
+ return Qnil; \
485
+ }
486
+
487
+ UNIFORMMATRIX_FUNC(UniformMatrix2fv,2)
488
+ UNIFORMMATRIX_FUNC(UniformMatrix3fv,3)
489
+ UNIFORMMATRIX_FUNC(UniformMatrix4fv,4)
490
+ #undef UNIFORMMATRIX_FUNC
491
+
492
+ #define VERTEXATTRIB_FUNC_V(_name_,_type_,_conv_,_size_) \
493
+ static void (APIENTRY * fptr_gl##_name_)(GLuint,_type_ *); \
494
+ static VALUE \
495
+ gl_##_name_(obj,arg1,arg2) \
496
+ VALUE obj,arg1,arg2; \
497
+ { \
498
+ GLuint index; \
499
+ _type_ v[_size_]; \
500
+ LOAD_GL_FUNC(gl##_name_, "2.0"); \
501
+ index = (GLuint)NUM2UINT(arg1); \
502
+ _conv_(arg2,v,_size_); \
503
+ fptr_gl##_name_(index,v); \
504
+ CHECK_GLERROR_FROM("gl" #_name_); \
505
+ return Qnil; \
506
+ }
507
+
508
+ VERTEXATTRIB_FUNC_V(VertexAttrib4Nbv,GLbyte,ary2cbyte,4)
509
+ VERTEXATTRIB_FUNC_V(VertexAttrib4Niv,GLint,ary2cint,4)
510
+ VERTEXATTRIB_FUNC_V(VertexAttrib4Nsv,GLshort,ary2cshort,4)
511
+ VERTEXATTRIB_FUNC_V(VertexAttrib4Nubv,GLubyte,ary2cubyte,4)
512
+ VERTEXATTRIB_FUNC_V(VertexAttrib4Nuiv,GLuint,ary2cuint,4)
513
+ VERTEXATTRIB_FUNC_V(VertexAttrib4Nusv,GLushort,ary2cushort,4)
514
+ VERTEXATTRIB_FUNC_V(VertexAttrib4uiv,GLuint,ary2cuint,4)
515
+ VERTEXATTRIB_FUNC_V(VertexAttrib4ubv,GLubyte,ary2cubyte,4)
516
+ VERTEXATTRIB_FUNC_V(VertexAttrib4usv,GLushort,ary2cushort,4)
517
+ VERTEXATTRIB_FUNC_V(VertexAttrib4bv,GLbyte,ary2cbyte,4)
518
+ VERTEXATTRIB_FUNC_V(VertexAttrib4iv,GLint,ary2cint,4)
519
+ VERTEXATTRIB_FUNC_V(VertexAttrib4dv,GLdouble,ary2cdbl,4)
520
+ VERTEXATTRIB_FUNC_V(VertexAttrib4fv,GLfloat,ary2cflt,4)
521
+ VERTEXATTRIB_FUNC_V(VertexAttrib4sv,GLshort,ary2cshort,4)
522
+ VERTEXATTRIB_FUNC_V(VertexAttrib3dv,GLdouble,ary2cdbl,3)
523
+ VERTEXATTRIB_FUNC_V(VertexAttrib3fv,GLfloat,ary2cflt,3)
524
+ VERTEXATTRIB_FUNC_V(VertexAttrib3sv,GLshort,ary2cshort,3)
525
+ VERTEXATTRIB_FUNC_V(VertexAttrib2dv,GLdouble,ary2cdbl,2)
526
+ VERTEXATTRIB_FUNC_V(VertexAttrib2fv,GLfloat,ary2cflt,2)
527
+ VERTEXATTRIB_FUNC_V(VertexAttrib2sv,GLshort,ary2cshort,2)
528
+ VERTEXATTRIB_FUNC_V(VertexAttrib1dv,GLdouble,ary2cdbl,1)
529
+ VERTEXATTRIB_FUNC_V(VertexAttrib1fv,GLfloat,ary2cflt,1)
530
+ VERTEXATTRIB_FUNC_V(VertexAttrib1sv,GLshort,ary2cshort,1)
531
+ #undef VERTEXATTRIB_FUNC_V
532
+
533
+ static void (APIENTRY * fptr_glVertexAttribPointer)(GLuint,GLint,GLenum,GLboolean,GLsizei,GLvoid *);
534
+ static VALUE
535
+ gl_VertexAttribPointer(obj,arg1,arg2,arg3,arg4,arg5,arg6)
536
+ VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6;
537
+ {
538
+ GLuint index;
539
+ GLuint size;
540
+ GLenum type;
541
+ GLboolean normalized;
542
+ GLsizei stride;
543
+ LOAD_GL_FUNC(glVertexAttribPointer, "2.0");
544
+ index = (GLuint)NUM2UINT(arg1);
545
+ size = (GLuint)NUM2UINT(arg2);
546
+ type = (GLenum)NUM2INT(arg3);
547
+ normalized = (GLboolean)RUBYBOOL2GL(arg4);
548
+ stride = (GLsizei)NUM2UINT(arg5);
549
+ if (index>_MAX_VERTEX_ATTRIBS)
550
+ rb_raise(rb_eArgError, "Index too large, maximum allowed value '%i'",_MAX_VERTEX_ATTRIBS);
551
+
552
+ if (CheckBufferBinding(GL_ARRAY_BUFFER_BINDING)) {
553
+ g_VertexAttrib_ptr[index] = arg6;
554
+ fptr_glVertexAttribPointer(index,size,type,normalized,stride,(GLvoid *)NUM2SIZET(arg6));
555
+ } else {
556
+ VALUE data;
557
+ data = pack_array_or_pass_string(type,arg6);
558
+ rb_str_freeze(data);
559
+ g_VertexAttrib_ptr[index] = data;
560
+ fptr_glVertexAttribPointer(index,size,type,normalized,stride,(GLvoid *)RSTRING_PTR(data));
561
+ }
562
+ CHECK_GLERROR_FROM("glVertexAttribPointer");
563
+ return Qnil;
564
+ }
565
+
566
+ void gl_init_functions_2_0(VALUE module)
567
+ {
568
+ rb_define_module_function(module, "glBlendEquationSeparate", gl_BlendEquationSeparate, 2);
569
+ rb_define_module_function(module, "glDrawBuffers", gl_DrawBuffers, 1);
570
+ rb_define_module_function(module, "glStencilOpSeparate", gl_StencilOpSeparate, 4);
571
+ rb_define_module_function(module, "glStencilFuncSeparate", gl_StencilFuncSeparate, 4);
572
+ rb_define_module_function(module, "glStencilMaskSeparate", gl_StencilMaskSeparate, 2);
573
+ rb_define_module_function(module, "glAttachShader", gl_AttachShader, 2);
574
+ rb_define_module_function(module, "glBindAttribLocation", gl_BindAttribLocation, 3);
575
+ rb_define_module_function(module, "glCompileShader", gl_CompileShader, 1);
576
+ rb_define_module_function(module, "glCreateProgram", gl_CreateProgram, 0);
577
+ rb_define_module_function(module, "glCreateShader", gl_CreateShader, 1);
578
+ rb_define_module_function(module, "glDeleteProgram", gl_DeleteProgram, 1);
579
+ rb_define_module_function(module, "glDeleteShader", gl_DeleteShader, 1);
580
+ rb_define_module_function(module, "glDetachShader", gl_DetachShader, 2);
581
+ rb_define_module_function(module, "glDisableVertexAttribArray", gl_DisableVertexAttribArray, 1);
582
+ rb_define_module_function(module, "glEnableVertexAttribArray", gl_EnableVertexAttribArray, 1);
583
+ rb_define_module_function(module, "glGetActiveAttrib", gl_GetActiveAttrib, 2);
584
+ rb_define_module_function(module, "glGetActiveUniform", gl_GetActiveUniform, 2);
585
+ rb_define_module_function(module, "glGetAttachedShaders", gl_GetAttachedShaders, 1);
586
+ rb_define_module_function(module, "glGetAttribLocation", gl_GetAttribLocation, 2);
587
+ rb_define_module_function(module, "glGetProgramiv", gl_GetProgramiv, 2);
588
+ rb_define_module_function(module, "glGetProgramInfoLog", gl_GetProgramInfoLog, 1);
589
+ rb_define_module_function(module, "glGetShaderiv", gl_GetShaderiv, 2);
590
+ rb_define_module_function(module, "glGetShaderInfoLog", gl_GetShaderInfoLog, 1);
591
+ rb_define_module_function(module, "glGetShaderSource", gl_GetShaderSource, 1);
592
+ rb_define_module_function(module, "glGetUniformLocation", gl_GetUniformLocation, 2);
593
+ rb_define_module_function(module, "glGetUniformfv", gl_GetUniformfv, 2);
594
+ rb_define_module_function(module, "glGetUniformiv", gl_GetUniformiv, 2);
595
+ rb_define_module_function(module, "glGetVertexAttribdv", gl_GetVertexAttribdv, 2);
596
+ rb_define_module_function(module, "glGetVertexAttribfv", gl_GetVertexAttribfv, 2);
597
+ rb_define_module_function(module, "glGetVertexAttribiv", gl_GetVertexAttribiv, 2);
598
+ rb_define_module_function(module, "glGetVertexAttribPointerv", gl_GetVertexAttribPointerv, 1);
599
+ rb_define_module_function(module, "glIsProgram", gl_IsProgram, 1);
600
+ rb_define_module_function(module, "glIsShader", gl_IsShader, 1);
601
+ rb_define_module_function(module, "glLinkProgram", gl_LinkProgram, 1);
602
+ rb_define_module_function(module, "glShaderSource", gl_ShaderSource, 2);
603
+ rb_define_module_function(module, "glUseProgram", gl_UseProgram, 1);
604
+ rb_define_module_function(module, "glUniform1f", gl_Uniform1f, 2);
605
+ rb_define_module_function(module, "glUniform2f", gl_Uniform2f, 3);
606
+ rb_define_module_function(module, "glUniform3f", gl_Uniform3f, 4);
607
+ rb_define_module_function(module, "glUniform4f", gl_Uniform4f, 5);
608
+ rb_define_module_function(module, "glUniform1i", gl_Uniform1i, 2);
609
+ rb_define_module_function(module, "glUniform2i", gl_Uniform2i, 3);
610
+ rb_define_module_function(module, "glUniform3i", gl_Uniform3i, 4);
611
+ rb_define_module_function(module, "glUniform4i", gl_Uniform4i, 5);
612
+ rb_define_module_function(module, "glUniform1fv", gl_Uniform1fv, 2);
613
+ rb_define_module_function(module, "glUniform2fv", gl_Uniform2fv, 2);
614
+ rb_define_module_function(module, "glUniform3fv", gl_Uniform3fv, 2);
615
+ rb_define_module_function(module, "glUniform4fv", gl_Uniform4fv, 2);
616
+ rb_define_module_function(module, "glUniform1iv", gl_Uniform1iv, 2);
617
+ rb_define_module_function(module, "glUniform2iv", gl_Uniform2iv, 2);
618
+ rb_define_module_function(module, "glUniform3iv", gl_Uniform3iv, 2);
619
+ rb_define_module_function(module, "glUniform4iv", gl_Uniform4iv, 2);
620
+ rb_define_module_function(module, "glUniformMatrix2fv", gl_UniformMatrix2fv, 3);
621
+ rb_define_module_function(module, "glUniformMatrix3fv", gl_UniformMatrix3fv, 3);
622
+ rb_define_module_function(module, "glUniformMatrix4fv", gl_UniformMatrix4fv, 3);
623
+ rb_define_module_function(module, "glValidateProgram", gl_ValidateProgram, 1);
624
+ rb_define_module_function(module, "glVertexAttrib1d", gl_VertexAttrib1d, 2);
625
+ rb_define_module_function(module, "glVertexAttrib1f", gl_VertexAttrib1f, 2);
626
+ rb_define_module_function(module, "glVertexAttrib1s", gl_VertexAttrib1s, 2);
627
+ rb_define_module_function(module, "glVertexAttrib2d", gl_VertexAttrib2d, 3);
628
+ rb_define_module_function(module, "glVertexAttrib2f", gl_VertexAttrib2f, 3);
629
+ rb_define_module_function(module, "glVertexAttrib2s", gl_VertexAttrib2s, 3);
630
+ rb_define_module_function(module, "glVertexAttrib3d", gl_VertexAttrib3d, 4);
631
+ rb_define_module_function(module, "glVertexAttrib3f", gl_VertexAttrib3f, 4);
632
+ rb_define_module_function(module, "glVertexAttrib3s", gl_VertexAttrib3s, 4);
633
+ rb_define_module_function(module, "glVertexAttrib4Nbv", gl_VertexAttrib4Nbv, 2);
634
+ rb_define_module_function(module, "glVertexAttrib4Niv", gl_VertexAttrib4Niv, 2);
635
+ rb_define_module_function(module, "glVertexAttrib4Nsv", gl_VertexAttrib4Nsv, 2);
636
+ rb_define_module_function(module, "glVertexAttrib4Nub", gl_VertexAttrib4Nub, 5);
637
+ rb_define_module_function(module, "glVertexAttrib4Nubv", gl_VertexAttrib4Nubv, 2);
638
+ rb_define_module_function(module, "glVertexAttrib4Nuiv", gl_VertexAttrib4Nuiv, 2);
639
+ rb_define_module_function(module, "glVertexAttrib4Nusv", gl_VertexAttrib4Nusv, 2);
640
+ rb_define_module_function(module, "glVertexAttrib4bv", gl_VertexAttrib4bv, 2);
641
+ rb_define_module_function(module, "glVertexAttrib4d", gl_VertexAttrib4d, 5);
642
+ rb_define_module_function(module, "glVertexAttrib4f", gl_VertexAttrib4f, 5);
643
+ rb_define_module_function(module, "glVertexAttrib4iv", gl_VertexAttrib4iv, 2);
644
+ rb_define_module_function(module, "glVertexAttrib4s", gl_VertexAttrib4s, 5);
645
+ rb_define_module_function(module, "glVertexAttrib4ubv", gl_VertexAttrib4ubv, 2);
646
+ rb_define_module_function(module, "glVertexAttrib4uiv", gl_VertexAttrib4uiv, 2);
647
+ rb_define_module_function(module, "glVertexAttrib4usv", gl_VertexAttrib4usv, 2);
648
+ rb_define_module_function(module, "glVertexAttrib1dv", gl_VertexAttrib1dv, 2);
649
+ rb_define_module_function(module, "glVertexAttrib1fv", gl_VertexAttrib1fv, 2);
650
+ rb_define_module_function(module, "glVertexAttrib1sv", gl_VertexAttrib1sv, 2);
651
+ rb_define_module_function(module, "glVertexAttrib2dv", gl_VertexAttrib2dv, 2);
652
+ rb_define_module_function(module, "glVertexAttrib2fv", gl_VertexAttrib2fv, 2);
653
+ rb_define_module_function(module, "glVertexAttrib2sv", gl_VertexAttrib2sv, 2);
654
+ rb_define_module_function(module, "glVertexAttrib3dv", gl_VertexAttrib3dv, 2);
655
+ rb_define_module_function(module, "glVertexAttrib3fv", gl_VertexAttrib3fv, 2);
656
+ rb_define_module_function(module, "glVertexAttrib3sv", gl_VertexAttrib3sv, 2);
657
+ rb_define_module_function(module, "glVertexAttrib4dv", gl_VertexAttrib4dv, 2);
658
+ rb_define_module_function(module, "glVertexAttrib4fv", gl_VertexAttrib4fv, 2);
659
+ rb_define_module_function(module, "glVertexAttrib4sv", gl_VertexAttrib4sv, 2);
660
+ rb_define_module_function(module, "glVertexAttribPointer", gl_VertexAttribPointer, 6);
661
+
662
+ {
663
+ int i;
664
+ for (i=0;i<_MAX_VERTEX_ATTRIBS;i++)
665
+ rb_global_variable(&g_VertexAttrib_ptr[i]);
666
+ }
667
+ }