ruby-opengl 0.60.1 → 0.61.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (127) hide show
  1. metadata +36 -186
  2. data/Rakefile +0 -168
  3. data/doc/build_install.txt +0 -122
  4. data/doc/extensions.txt +0 -556
  5. data/doc/extensions.txt.in +0 -348
  6. data/doc/history.txt +0 -66
  7. data/doc/requirements_and_design.txt +0 -117
  8. data/doc/roadmap.txt +0 -28
  9. data/doc/scientific_use.txt +0 -35
  10. data/doc/supplies/page_template.html +0 -71
  11. data/doc/thanks.txt +0 -29
  12. data/doc/tutorial.txt +0 -469
  13. data/examples/NeHe/nehe_lesson02.rb +0 -117
  14. data/examples/NeHe/nehe_lesson03.rb +0 -122
  15. data/examples/NeHe/nehe_lesson04.rb +0 -133
  16. data/examples/NeHe/nehe_lesson05.rb +0 -186
  17. data/examples/NeHe/nehe_lesson36.rb +0 -303
  18. data/examples/OrangeBook/3Dlabs-License.txt +0 -33
  19. data/examples/OrangeBook/brick.frag +0 -36
  20. data/examples/OrangeBook/brick.rb +0 -376
  21. data/examples/OrangeBook/brick.vert +0 -41
  22. data/examples/OrangeBook/particle.frag +0 -17
  23. data/examples/OrangeBook/particle.rb +0 -406
  24. data/examples/OrangeBook/particle.vert +0 -38
  25. data/examples/README +0 -16
  26. data/examples/RedBook/aapoly.rb +0 -142
  27. data/examples/RedBook/aargb.rb +0 -119
  28. data/examples/RedBook/accanti.rb +0 -162
  29. data/examples/RedBook/accpersp.rb +0 -215
  30. data/examples/RedBook/alpha.rb +0 -123
  31. data/examples/RedBook/alpha3D.rb +0 -158
  32. data/examples/RedBook/bezcurve.rb +0 -105
  33. data/examples/RedBook/bezmesh.rb +0 -137
  34. data/examples/RedBook/checker.rb +0 -124
  35. data/examples/RedBook/clip.rb +0 -95
  36. data/examples/RedBook/colormat.rb +0 -135
  37. data/examples/RedBook/cube.rb +0 -69
  38. data/examples/RedBook/depthcue.rb +0 -99
  39. data/examples/RedBook/dof.rb +0 -205
  40. data/examples/RedBook/double.rb +0 -105
  41. data/examples/RedBook/drawf.rb +0 -91
  42. data/examples/RedBook/feedback.rb +0 -145
  43. data/examples/RedBook/fog.rb +0 -167
  44. data/examples/RedBook/font.rb +0 -151
  45. data/examples/RedBook/hello.rb +0 -79
  46. data/examples/RedBook/image.rb +0 -137
  47. data/examples/RedBook/jitter.rb +0 -207
  48. data/examples/RedBook/lines.rb +0 -128
  49. data/examples/RedBook/list.rb +0 -111
  50. data/examples/RedBook/material.rb +0 -275
  51. data/examples/RedBook/mipmap.rb +0 -156
  52. data/examples/RedBook/model.rb +0 -113
  53. data/examples/RedBook/movelight.rb +0 -132
  54. data/examples/RedBook/pickdepth.rb +0 -179
  55. data/examples/RedBook/planet.rb +0 -108
  56. data/examples/RedBook/quadric.rb +0 -158
  57. data/examples/RedBook/robot.rb +0 -115
  58. data/examples/RedBook/select.rb +0 -196
  59. data/examples/RedBook/smooth.rb +0 -95
  60. data/examples/RedBook/stencil.rb +0 -163
  61. data/examples/RedBook/stroke.rb +0 -167
  62. data/examples/RedBook/surface.rb +0 -166
  63. data/examples/RedBook/teaambient.rb +0 -132
  64. data/examples/RedBook/teapots.rb +0 -182
  65. data/examples/RedBook/tess.rb +0 -183
  66. data/examples/RedBook/texbind.rb +0 -147
  67. data/examples/RedBook/texgen.rb +0 -169
  68. data/examples/RedBook/texturesurf.rb +0 -128
  69. data/examples/RedBook/varray.rb +0 -159
  70. data/examples/RedBook/wrap.rb +0 -148
  71. data/examples/misc/OGLBench.rb +0 -337
  72. data/examples/misc/anisotropic.rb +0 -194
  73. data/examples/misc/fbo_test.rb +0 -356
  74. data/examples/misc/font-glut.rb +0 -46
  75. data/examples/misc/glfwtest.rb +0 -30
  76. data/examples/misc/plane.rb +0 -161
  77. data/examples/misc/readpixel.rb +0 -65
  78. data/examples/misc/sdltest.rb +0 -34
  79. data/examples/misc/trislam.rb +0 -828
  80. data/ext/common/common.h +0 -423
  81. data/ext/common/conv.h +0 -244
  82. data/ext/common/funcdef.h +0 -280
  83. data/ext/common/gl-enums.h +0 -10031
  84. data/ext/common/gl-error.h +0 -23
  85. data/ext/common/gl-types.h +0 -61
  86. data/ext/common/glu-enums.h +0 -463
  87. data/ext/gl/gl-1.0-1.1.c +0 -2817
  88. data/ext/gl/gl-1.2.c +0 -814
  89. data/ext/gl/gl-1.3.c +0 -444
  90. data/ext/gl/gl-1.4.c +0 -349
  91. data/ext/gl/gl-1.5.c +0 -225
  92. data/ext/gl/gl-2.0.c +0 -657
  93. data/ext/gl/gl-2.1.c +0 -57
  94. data/ext/gl/gl-enums.c +0 -3354
  95. data/ext/gl/gl-error.c +0 -104
  96. data/ext/gl/gl-ext-3dfx.c +0 -27
  97. data/ext/gl/gl-ext-arb.c +0 -866
  98. data/ext/gl/gl-ext-ati.c +0 -41
  99. data/ext/gl/gl-ext-ext.c +0 -890
  100. data/ext/gl/gl-ext-gremedy.c +0 -41
  101. data/ext/gl/gl-ext-nv.c +0 -679
  102. data/ext/gl/gl.c +0 -214
  103. data/ext/gl/mkrf_conf.rb +0 -34
  104. data/ext/glu/glu-enums.c +0 -164
  105. data/ext/glu/glu.c +0 -1530
  106. data/ext/glu/mkrf_conf.rb +0 -35
  107. data/ext/glut/glut.c +0 -1623
  108. data/ext/glut/mkrf_conf.rb +0 -37
  109. data/lib/opengl.rb +0 -84
  110. data/test/README +0 -10
  111. data/test/tc_common.rb +0 -98
  112. data/test/tc_ext_arb.rb +0 -467
  113. data/test/tc_ext_ati.rb +0 -33
  114. data/test/tc_ext_ext.rb +0 -551
  115. data/test/tc_ext_gremedy.rb +0 -36
  116. data/test/tc_ext_nv.rb +0 -357
  117. data/test/tc_func_10_11.rb +0 -1281
  118. data/test/tc_func_12.rb +0 -186
  119. data/test/tc_func_13.rb +0 -229
  120. data/test/tc_func_14.rb +0 -197
  121. data/test/tc_func_15.rb +0 -270
  122. data/test/tc_func_20.rb +0 -346
  123. data/test/tc_func_21.rb +0 -541
  124. data/test/tc_glu.rb +0 -310
  125. data/test/tc_include_gl.rb +0 -35
  126. data/test/tc_misc.rb +0 -54
  127. data/test/tc_require_gl.rb +0 -34
@@ -1,41 +0,0 @@
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/common.h"
17
-
18
- /* OpenGL ATI extensions */
19
-
20
- /* #277 GL_ATI_draw_buffers */
21
- static void (APIENTRY * fptr_glDrawBuffersATI)(GLsizei,const GLenum *);
22
- static VALUE gl_DrawBuffersATI(VALUE obj,VALUE arg1)
23
- {
24
- GLsizei size;
25
- GLenum *buffers;
26
- LOAD_GL_FUNC(glDrawBuffersATI,"GL_ATI_draw_buffers")
27
- Check_Type(arg1,T_ARRAY);
28
- size = RARRAY_LEN(arg1);
29
- buffers = ALLOC_N(GLenum,size);
30
- ary2cuint(arg1,buffers,size);
31
- fptr_glDrawBuffersATI(size,buffers);
32
- xfree(buffers);
33
- CHECK_GLERROR
34
- return Qnil;
35
- }
36
-
37
- void gl_init_functions_ext_ati(VALUE module)
38
- {
39
- /* #277 GL_ATI_draw_buffers */
40
- rb_define_module_function(module, "glDrawBuffersATI", gl_DrawBuffersATI, 1);
41
- }
@@ -1,890 +0,0 @@
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/common.h"
17
-
18
- /* OpenGL EXT extensions */
19
- /* Those are extensions that are not blessed by ARB committee but were
20
- created or agreed upon by multiple vendors */
21
-
22
- /* #2 - GL_EXT_blend_color */
23
- GL_FUNC_LOAD_4(BlendColorEXT,GLvoid, GLclampf,GLclampf,GLclampf,GLclampf, "GL_EXT_blend_color")
24
-
25
- /* #3 - GL_EXT_polygon_offset */
26
- GL_FUNC_LOAD_2(PolygonOffsetEXT,GLvoid, GLfloat,GLfloat, "GL_EXT_polygon_offset")
27
-
28
- /* #20 - GL_EXT_texture_object */
29
- GL_FUNC_GENOBJECTS_LOAD(GenTexturesEXT,"GL_EXT_texture_object")
30
- GL_FUNC_DELETEOBJECTS_LOAD(DeleteTexturesEXT,"GL_EXT_texture_object")
31
- GL_FUNC_LOAD_2(BindTextureEXT,GLvoid, GLenum,GLint, "GL_EXT_texture_object")
32
-
33
- static void (APIENTRY * fptr_glPrioritizeTexturesEXT)(GLsizei,const GLuint *,const GLclampf *);
34
- static VALUE
35
- gl_PrioritizeTexturesEXT(obj,arg1,arg2)
36
- VALUE obj,arg1,arg2;
37
- {
38
- GLuint *textures;
39
- GLclampf *priorities;
40
- GLsizei size;
41
- LOAD_GL_FUNC(glPrioritizeTexturesEXT,"GL_EXT_texture_object")
42
- Check_Type(arg1,T_ARRAY);
43
- Check_Type(arg2,T_ARRAY);
44
- if ((size = RARRAY_LEN(arg1)) != RARRAY_LEN(arg2))
45
- rb_raise(rb_eArgError, "passed arrays must have the same length");
46
- textures = ALLOC_N(GLuint,size);
47
- priorities = ALLOC_N(GLclampf,size);
48
- ary2cuint(arg1,textures,size);
49
- ary2cflt(arg2,priorities,size);
50
- fptr_glPrioritizeTexturesEXT(size,textures,priorities);
51
- xfree(textures);
52
- xfree(priorities);
53
- CHECK_GLERROR
54
- return Qnil;
55
- }
56
-
57
- static GLboolean (APIENTRY * fptr_glAreTexturesResidentEXT)(GLsizei,const GLuint *,GLboolean *);
58
- static VALUE
59
- gl_AreTexturesResidentEXT(obj,arg1)
60
- VALUE obj,arg1;
61
- {
62
- GLuint *textures;
63
- GLboolean *residences;
64
- GLsizei size;
65
- GLboolean r;
66
- VALUE retary;
67
- VALUE ary;
68
- int i;
69
- LOAD_GL_FUNC(glAreTexturesResidentEXT,"GL_EXT_texture_object")
70
- ary = rb_Array(arg1);
71
- size = RARRAY_LEN(ary);
72
- textures = ALLOC_N(GLuint,size);
73
- residences = ALLOC_N(GLboolean,size);
74
- ary2cuint(ary,textures,size);
75
- r = fptr_glAreTexturesResidentEXT(size,textures,residences);
76
- retary = rb_ary_new2(size);
77
- if (r==GL_TRUE) { /* all are resident */
78
- for(i=0;i<size;i++)
79
- rb_ary_push(retary, GLBOOL2RUBY(GL_TRUE));
80
- } else {
81
- for(i=0;i<size;i++)
82
- rb_ary_push(retary, GLBOOL2RUBY(residences[i]));
83
- }
84
- xfree(textures);
85
- xfree(residences);
86
- CHECK_GLERROR
87
- return retary;
88
- }
89
-
90
- GL_FUNC_LOAD_1(IsTextureEXT,GLboolean, GLuint, "GL_EXT_texture_object")
91
-
92
- /* #37 - GL_EXT_blend_minmax */
93
- GL_FUNC_LOAD_1(BlendEquationEXT,GLvoid, GLenum, "GL_EXT_blend_minmax")
94
-
95
- /* #54 - GL_EXT_point_parameters */
96
- GL_FUNC_LOAD_2(PointParameterfEXT,GLvoid, GLenum,GLfloat, "GL_EXT_point_parameters")
97
-
98
- static void (APIENTRY * fptr_glPointParameterfvEXT)(GLenum,GLfloat *);
99
- static VALUE gl_PointParameterfvEXT(VALUE obj,VALUE arg1,VALUE arg2)
100
- {
101
- GLfloat params[3] = {0.0,0.0,0.0};
102
- GLenum pname;
103
- GLint size;
104
- LOAD_GL_FUNC(glPointParameterfvEXT,"GL_EXT_point_parameters")
105
- pname = NUM2UINT(arg1);
106
- Check_Type(arg2,T_ARRAY);
107
- if (pname==GL_POINT_DISTANCE_ATTENUATION)
108
- size = 3;
109
- else
110
- size = 1;
111
- ary2cflt(arg2,params,size);
112
- fptr_glPointParameterfvEXT(pname,params);
113
- CHECK_GLERROR
114
- return Qnil;
115
- }
116
-
117
- /* #145 - GL_EXT_secondary_color */
118
- GL_FUNC_LOAD_3(SecondaryColor3bEXT,GLvoid, GLbyte,GLbyte,GLbyte, "GL_EXT_secondary_color")
119
- GL_FUNC_LOAD_3(SecondaryColor3sEXT,GLvoid, GLshort,GLshort,GLshort, "GL_EXT_secondary_color")
120
- GL_FUNC_LOAD_3(SecondaryColor3iEXT,GLvoid, GLint,GLint,GLint, "GL_EXT_secondary_color")
121
- GL_FUNC_LOAD_3(SecondaryColor3fEXT,GLvoid, GLfloat,GLfloat,GLfloat, "GL_EXT_secondary_color")
122
- GL_FUNC_LOAD_3(SecondaryColor3dEXT,GLvoid, GLdouble,GLdouble,GLdouble, "GL_EXT_secondary_color")
123
- GL_FUNC_LOAD_3(SecondaryColor3ubEXT,GLvoid, GLubyte,GLubyte,GLubyte, "GL_EXT_secondary_color")
124
- GL_FUNC_LOAD_3(SecondaryColor3usEXT,GLvoid, GLushort,GLushort,GLushort, "GL_EXT_secondary_color")
125
- GL_FUNC_LOAD_3(SecondaryColor3uiEXT,GLvoid, GLuint,GLuint,GLuint, "GL_EXT_secondary_color")
126
-
127
- #define GLSECONDARYCOLOREXT_VFUNC(_name_,_type_,_conv_) \
128
- static void (APIENTRY * fptr_gl##_name_)(_type_ *); \
129
- VALUE gl_##_name_(VALUE obj,VALUE arg1) \
130
- { \
131
- _type_ cary[3] = {0,0,0}; \
132
- LOAD_GL_FUNC(gl##_name_,"GL_EXT_secondary_color") \
133
- Check_Type(arg1,T_ARRAY); \
134
- _conv_(arg1,cary,3); \
135
- fptr_gl##_name_(cary); \
136
- CHECK_GLERROR \
137
- return Qnil; \
138
- }
139
-
140
- GLSECONDARYCOLOREXT_VFUNC(SecondaryColor3bvEXT,GLbyte,ary2cbyte)
141
- GLSECONDARYCOLOREXT_VFUNC(SecondaryColor3dvEXT,GLdouble,ary2cdbl)
142
- GLSECONDARYCOLOREXT_VFUNC(SecondaryColor3fvEXT,GLfloat,ary2cflt)
143
- GLSECONDARYCOLOREXT_VFUNC(SecondaryColor3ivEXT,GLint,ary2cint)
144
- GLSECONDARYCOLOREXT_VFUNC(SecondaryColor3svEXT,GLshort,ary2cshort)
145
- GLSECONDARYCOLOREXT_VFUNC(SecondaryColor3uivEXT,GLuint,ary2cuint)
146
- GLSECONDARYCOLOREXT_VFUNC(SecondaryColor3ubvEXT,GLubyte,ary2cubyte)
147
- GLSECONDARYCOLOREXT_VFUNC(SecondaryColor3usvEXT,GLushort,ary2cushort)
148
- #undef GLSECONDARYCOLOREXT_VFUNC
149
-
150
- extern VALUE g_SecondaryColor_ptr;
151
- static void (APIENTRY * fptr_glSecondaryColorPointerEXT)(GLint,GLenum,GLsizei,const GLvoid *);
152
- static VALUE
153
- gl_SecondaryColorPointerEXT(obj,arg1,arg2,arg3,arg4)
154
- VALUE obj,arg1,arg2,arg3,arg4;
155
- {
156
- GLint size;
157
- GLenum type;
158
- GLsizei stride;
159
- LOAD_GL_FUNC(glSecondaryColorPointerEXT,"GL_EXT_secondary_color")
160
- size = (GLint)NUM2INT(arg1);
161
- type = (GLenum)NUM2INT(arg2);
162
- stride = (GLsizei)NUM2UINT(arg3);
163
- if (CheckBufferBinding(GL_ARRAY_BUFFER_BINDING)) {
164
- g_SecondaryColor_ptr = arg4;
165
- fptr_glSecondaryColorPointerEXT(size,type, stride, (const GLvoid*)NUM2INT(arg4));
166
- } else {
167
- VALUE data;
168
- data = pack_array_or_pass_string(type,arg4);
169
- rb_str_freeze(data);
170
- g_SecondaryColor_ptr = data;
171
- fptr_glSecondaryColorPointerEXT(size,type, stride, (const GLvoid*)RSTRING_PTR(data));
172
- }
173
- CHECK_GLERROR
174
- return Qnil;
175
- }
176
-
177
- /* #97 - GL_EXT_compiled_vertex_array */
178
- GL_FUNC_LOAD_2(LockArraysEXT,GLvoid, GLint,GLint, "GL_EXT_compiled_vertex_array")
179
- GL_FUNC_LOAD_0(UnlockArraysEXT,GLvoid, "GL_EXT_compiled_vertex_array")
180
-
181
- /* #112 - GL_EXT_draw_range_elements */
182
- static void (APIENTRY * fptr_glDrawRangeElementsEXT)(GLenum,GLuint,GLuint,GLsizei,GLenum,GLvoid*);
183
- static VALUE
184
- gl_DrawRangeElementsEXT(obj,arg1,arg2,arg3,arg4,arg5,arg6)
185
- VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6;
186
- {
187
- GLenum mode;
188
- GLuint start;
189
- GLuint end;
190
- GLsizei count;
191
- GLenum type;
192
- LOAD_GL_FUNC(glDrawRangeElementsEXT,"GL_EXT_draw_range_elements")
193
- mode = (GLenum)NUM2INT(arg1);
194
- start = (GLuint)NUM2UINT(arg2);
195
- end = (GLuint)NUM2UINT(arg3);
196
- count = (GLsizei)NUM2UINT(arg4);
197
- type = (GLenum)NUM2INT(arg5);
198
- if (CheckBufferBinding(GL_ELEMENT_ARRAY_BUFFER_BINDING)) {
199
- fptr_glDrawRangeElementsEXT(mode, start, end, count, type, (GLvoid *)NUM2INT(arg6));
200
- } else {
201
- VALUE data;
202
- data = pack_array_or_pass_string(type,arg6);
203
- fptr_glDrawRangeElementsEXT(mode, start, end, count, type, RSTRING_PTR(data));
204
- }
205
- CHECK_GLERROR
206
- return Qnil;
207
- }
208
-
209
- /* #148 - GL_EXT_multi_draw_arrays */
210
- static void (APIENTRY * fptr_glMultiDrawArraysEXT)(GLenum,GLint*,GLsizei*,GLsizei);
211
- static VALUE
212
- gl_MultiDrawArraysEXT(obj,arg1,arg2,arg3)
213
- VALUE obj,arg1,arg2,arg3;
214
- {
215
- GLenum mode;
216
- GLint *ary1;
217
- GLsizei *ary2;
218
- int len1,len2;
219
- LOAD_GL_FUNC(glMultiDrawArraysEXT,"GL_EXT_multi_draw_arrays")
220
- len1 = RARRAY_LEN(arg2);
221
- len2 = RARRAY_LEN(arg3);
222
- if (len1!=len2)
223
- rb_raise(rb_eArgError, "Passed arrays must have same length");
224
- mode = (GLenum)NUM2INT(arg1);
225
- ary1 = ALLOC_N(GLint,len1);
226
- ary2 = ALLOC_N(GLsizei,len2);
227
- ary2cint(arg2,ary1,len1);
228
- ary2cint(arg3,ary2,len2);
229
- fptr_glMultiDrawArraysEXT(mode,ary1,ary2,len1);
230
- xfree(ary1);
231
- xfree(ary2);
232
- CHECK_GLERROR
233
- return Qnil;
234
- }
235
-
236
- static void (APIENTRY * fptr_glMultiDrawElementsEXT)(GLenum,const GLsizei *,GLenum,GLvoid **,GLsizei);
237
- static VALUE
238
- gl_MultiDrawElementsEXT(argc,argv,obj)
239
- int argc;
240
- VALUE *argv;
241
- VALUE obj;
242
- {
243
- GLenum mode;
244
- GLenum type;
245
- GLsizei *counts;
246
- GLvoid **indices;
247
- GLint size;
248
- RArray *ary;
249
- int i;
250
- VALUE args[4];
251
- LOAD_GL_FUNC(glMultiDrawElementsEXT,"GL_EXT_multi_draw_arrays")
252
- switch (rb_scan_args(argc, argv, "31", &args[0], &args[1], &args[2],&args[3])) {
253
- default:
254
- case 3:
255
- if (CheckBufferBinding(GL_ELEMENT_ARRAY_BUFFER_BINDING))
256
- rb_raise(rb_eArgError, "Element array buffer bound, but offsets array missing");
257
- mode = (GLenum)NUM2INT(args[0]);
258
- type = (GLenum)NUM2INT(args[1]);
259
- Check_Type(args[2],T_ARRAY);
260
- ary = RARRAY(args[2]);
261
- size = RARRAY_LEN(ary);
262
- counts = ALLOC_N(GLsizei,size);
263
- indices = ALLOC_N(GLvoid*,size);
264
- for (i=0;i<size;i++) {
265
- VALUE data;
266
- data = pack_array_or_pass_string(type,RARRAY_PTR(ary)[i]);
267
-
268
- indices[i] = RSTRING_PTR(data);
269
- counts[i] = RSTRING_LEN(data);
270
- }
271
- fptr_glMultiDrawElementsEXT(mode,counts,type,indices,size);
272
- xfree(counts);
273
- xfree(indices);
274
- break;
275
- case 4:
276
- if (!CheckBufferBinding(GL_ELEMENT_ARRAY_BUFFER_BINDING))
277
- rb_raise(rb_eArgError, "Element array buffer not bound");
278
- mode = (GLenum)NUM2INT(args[0]);
279
- type = (GLenum)NUM2INT(args[1]);
280
- Check_Type(args[2],T_ARRAY);
281
- Check_Type(args[3],T_ARRAY);
282
- if (RARRAY_LEN(args[2]) != RARRAY_LEN(args[3]))
283
- rb_raise(rb_eArgError, "Count and indices offset array must have same length");
284
-
285
- size = RARRAY_LEN(args[2]);
286
-
287
- counts = ALLOC_N(GLsizei,size);
288
- indices = ALLOC_N(GLvoid*,size);
289
- for (i=0;i<size;i++) {
290
- counts[i] = NUM2INT(rb_ary_entry(args[2],i));
291
- indices[i] = (GLvoid *) NUM2INT(rb_ary_entry(args[3],i));
292
- }
293
- fptr_glMultiDrawElementsEXT(mode,counts,type,indices,size);
294
- xfree(counts);
295
- xfree(indices);
296
- break;
297
- }
298
- CHECK_GLERROR
299
- return Qnil;
300
- }
301
-
302
- /* #149 - GL_EXT_fog_coord */
303
- GL_FUNC_LOAD_1(FogCoordfEXT,GLvoid, GLfloat, "GL_EXT_fog_coord")
304
- GL_FUNC_LOAD_1(FogCoorddEXT,GLvoid, GLdouble, "GL_EXT_fog_coord")
305
-
306
- #define GLFOGCOORD_VFUNC(_name_,_type_,_conv_) \
307
- static void (APIENTRY * fptr_gl##_name_)(_type_ *); \
308
- VALUE gl_##_name_(VALUE obj,VALUE arg1) \
309
- { \
310
- _type_ cary = 0; \
311
- LOAD_GL_FUNC(gl##_name_,"GL_EXT_secondary_color") \
312
- Check_Type(arg1,T_ARRAY); \
313
- _conv_(arg1,&cary,1); \
314
- fptr_gl##_name_(&cary); \
315
- CHECK_GLERROR \
316
- return Qnil; \
317
- }
318
- GLFOGCOORD_VFUNC(FogCoordfvEXT,GLfloat,ary2cflt)
319
- GLFOGCOORD_VFUNC(FogCoorddvEXT,GLdouble,ary2cdbl)
320
- #undef GLFOGCOORD_VFUNC
321
-
322
- extern VALUE g_FogCoord_ptr;
323
- static void (APIENTRY * fptr_glFogCoordPointerEXT)(GLenum,GLsizei,const GLvoid *);
324
- static VALUE
325
- gl_FogCoordPointerEXT(obj,arg1,arg2,arg3)
326
- VALUE obj,arg1,arg2,arg3;
327
- {
328
- GLenum type;
329
- GLsizei stride;
330
- LOAD_GL_FUNC(glFogCoordPointerEXT,"GL_EXT_secondary_color")
331
- type = (GLenum)NUM2INT(arg1);
332
- stride = (GLsizei)NUM2UINT(arg2);
333
- if (CheckBufferBinding(GL_ARRAY_BUFFER_BINDING)) {
334
- g_FogCoord_ptr = arg3;
335
- fptr_glFogCoordPointerEXT(type, stride, (const GLvoid*)NUM2INT(arg3));
336
- } else {
337
- VALUE data;
338
- data = pack_array_or_pass_string(type,arg3);
339
- rb_str_freeze(data);
340
- g_FogCoord_ptr = data;
341
- fptr_glFogCoordPointerEXT(type, stride, (const GLvoid*)RSTRING_PTR(data));
342
- }
343
- CHECK_GLERROR
344
- return Qnil;
345
- }
346
-
347
- /* #173 - GL_EXT_blend_func_separate */
348
- GL_FUNC_LOAD_4(BlendFuncSeparateEXT,GLvoid, GLenum,GLenum,GLenum,GLenum, "GL_EXT_blend_func_separate")
349
-
350
- /* #268 - GL_EXT_stencil_two_side */
351
- GL_FUNC_LOAD_1(ActiveStencilFaceEXT,GLvoid, GLenum, "GL_EXT_stencil_two_side")
352
-
353
- /* #297 - GL_EXT_depth_bounds_test */
354
- GL_FUNC_LOAD_2(DepthBoundsEXT,GLvoid, GLclampd,GLclampd, "GL_EXT_depth_bounds_test")
355
-
356
- /* #299 - GL_EXT_blend_equation_separate */
357
- GL_FUNC_LOAD_2(BlendEquationSeparateEXT,GLvoid, GLenum,GLenum, "GL_EXT_blend_equation_separate")
358
-
359
- /* #310 - GL_EXT_framebuffer_object */
360
- GL_FUNC_LOAD_1(IsRenderbufferEXT,GLboolean, GLuint, "GL_EXT_framebuffer_object")
361
- GL_FUNC_LOAD_2(BindRenderbufferEXT,GLvoid, GLenum,GLuint, "GL_EXT_framebuffer_object")
362
- GL_FUNC_LOAD_4(RenderbufferStorageEXT,GLvoid, GLenum,GLenum,GLsizei,GLsizei, "GL_EXT_framebuffer_object")
363
- GL_FUNC_GENOBJECTS_LOAD(GenRenderbuffersEXT,"GL_EXT_framebuffer_object")
364
- GL_FUNC_DELETEOBJECTS_LOAD(DeleteRenderbuffersEXT,"GL_EXT_framebuffer_object")
365
-
366
- static void (APIENTRY * fptr_glGetRenderbufferParameterivEXT)(GLenum,GLenum,GLint *);
367
- static VALUE gl_GetRenderbufferParameterivEXT(VALUE obj,VALUE arg1,VALUE arg2)
368
- {
369
- GLint param = 0;
370
- LOAD_GL_FUNC(glGetRenderbufferParameterivEXT,"GL_EXT_framebuffer_object")
371
- fptr_glGetRenderbufferParameterivEXT(NUM2UINT(arg1),NUM2UINT(arg2),&param);
372
- CHECK_GLERROR
373
- return INT2NUM(param);
374
- }
375
-
376
- GL_FUNC_GENOBJECTS_LOAD(GenFramebuffersEXT,"GL_EXT_framebuffer_object")
377
- GL_FUNC_DELETEOBJECTS_LOAD(DeleteFramebuffersEXT,"GL_EXT_framebuffer_object")
378
- GL_FUNC_LOAD_1(IsFramebufferEXT,GLboolean, GLuint, "GL_EXT_framebuffer_object")
379
- GL_FUNC_LOAD_2(BindFramebufferEXT,GLvoid, GLenum,GLuint, "GL_EXT_framebuffer_object")
380
- GL_FUNC_LOAD_1(CheckFramebufferStatusEXT,GLenum, GLenum, "GL_EXT_framebuffer_object")
381
- GL_FUNC_LOAD_5(FramebufferTexture1DEXT,GLvoid, GLenum,GLenum,GLenum,GLuint,GLint, "GL_EXT_framebuffer_object")
382
- GL_FUNC_LOAD_5(FramebufferTexture2DEXT,GLvoid, GLenum,GLenum,GLenum,GLuint,GLint, "GL_EXT_framebuffer_object")
383
- GL_FUNC_LOAD_6(FramebufferTexture3DEXT,GLvoid, GLenum,GLenum,GLenum,GLuint,GLint,GLint, "GL_EXT_framebuffer_object")
384
-
385
- GL_FUNC_LOAD_4(FramebufferRenderbufferEXT,GLvoid, GLuint,GLuint,GLuint,GLuint, "GL_EXT_framebuffer_object")
386
-
387
- static void (APIENTRY * fptr_glGetFramebufferAttachmentParameterivEXT)(GLenum,GLenum,GLenum,GLint *);
388
- static VALUE gl_GetFramebufferAttachmentParameterivEXT(VALUE obj,VALUE arg1, VALUE arg2, VALUE arg3)
389
- {
390
- GLint ret = 0;
391
- LOAD_GL_FUNC(glGetFramebufferAttachmentParameterivEXT,"GL_EXT_framebuffer_object")
392
- fptr_glGetFramebufferAttachmentParameterivEXT(NUM2UINT(arg1),NUM2UINT(arg2),NUM2UINT(arg3),&ret);
393
- CHECK_GLERROR
394
- return cond_GLBOOL2RUBY(NUM2UINT(arg3),ret);
395
- }
396
-
397
- GL_FUNC_LOAD_1(GenerateMipmapEXT,GLvoid, GLenum, "GL_EXT_framebuffer_object")
398
-
399
- /* #314 - GL_EXT_stencil_clear_tag */
400
- GL_FUNC_LOAD_2(StencilClearTagEXT,GLvoid, GLsizei,GLuint, "GL_EXT_stencil_clear_tag")
401
-
402
- /* #316 - GL_EXT_framebuffer_blit */
403
- GL_FUNC_LOAD_10(BlitFramebufferEXT,GLvoid, GLint,GLint,GLint,GLint,GLint,GLint,GLint,GLint,GLbitfield,GLenum, "GL_EXT_framebuffer_blit")
404
-
405
- /* #317 - GL_EXT_framebuffer_multisample */
406
- GL_FUNC_LOAD_5(RenderbufferStorageMultisampleEXT,GLvoid, GLenum,GLsizei,GLenum,GLsizei,GLsizei, "GL_EXT_framebuffer_multisample")
407
-
408
- /* #319 - GL_EXT_timer_query */
409
-
410
- #define GETQUERY_FUNC(_name_,_type_,_conv_) \
411
- static void (APIENTRY * fptr_gl##_name_)(GLuint,GLenum,_type_ *); \
412
- static VALUE gl_##_name_(VALUE obj,VALUE arg1,VALUE arg2) \
413
- { \
414
- _type_ ret = 0; \
415
- LOAD_GL_FUNC(gl##_name_,"GL_EXT_timer_query") \
416
- fptr_gl##_name_(NUM2INT(arg1),NUM2INT(arg2),&ret); \
417
- CHECK_GLERROR \
418
- return _conv_(NUM2INT(arg2),ret); \
419
- }
420
-
421
- GETQUERY_FUNC(GetQueryObjecti64vEXT,GLint64EXT,cond_GLBOOL2RUBY_LL)
422
- GETQUERY_FUNC(GetQueryObjectui64vEXT,GLuint64EXT,cond_GLBOOL2RUBY_ULL)
423
- #undef GETQUERY_FUNC
424
-
425
-
426
- /* #320 - GL_EXT_gpu_program_parameters */
427
- #define PROGRAMPARAM_MULTI_FUNC_V(_name_,_type_,_conv_,_extension_) \
428
- static void (APIENTRY * fptr_gl##_name_)(GLenum,GLuint,GLsizei,const _type_ *); \
429
- static VALUE \
430
- gl_##_name_(obj,arg1,arg2,arg3) \
431
- VALUE obj,arg1,arg2,arg3; \
432
- { \
433
- _type_ *cary; \
434
- int len; \
435
- LOAD_GL_FUNC(gl##_name_,_extension_) \
436
- len = RARRAY_LEN(rb_Array(arg3)); \
437
- if (len<=0 || (len % 4) != 0) \
438
- rb_raise(rb_eArgError, "Parameter array size must be multiplication of 4"); \
439
- cary = ALLOC_N(_type_,len); \
440
- _conv_(arg3,cary,len); \
441
- fptr_gl##_name_(NUM2UINT(arg1),NUM2UINT(arg2),len / 4, cary); \
442
- xfree(cary); \
443
- CHECK_GLERROR \
444
- return Qnil; \
445
- }
446
-
447
- PROGRAMPARAM_MULTI_FUNC_V(ProgramEnvParameters4fvEXT,GLfloat,ary2cflt,"GL_EXT_gpu_program_parameters")
448
- PROGRAMPARAM_MULTI_FUNC_V(ProgramLocalParameters4fvEXT,GLfloat,ary2cflt,"GL_EXT_gpu_program_parameters")
449
- #undef PROGRAMPARAM_MULTI_FUNC_V
450
-
451
- /* #324 - GL_EXT_geometry_shader4 */
452
- GL_FUNC_LOAD_3(ProgramParameteriEXT,GLvoid, GLuint,GLenum,GLint, "GL_EXT_geometry_shader4")
453
-
454
- /* #326 - GL_EXT_gpu_shader4 */
455
- GL_FUNC_LOAD_2(VertexAttribI1iEXT,GLvoid, GLuint,GLint, "GL_ARB_shader_objects")
456
- GL_FUNC_LOAD_3(VertexAttribI2iEXT,GLvoid, GLuint,GLint,GLint, "GL_ARB_shader_objects")
457
- GL_FUNC_LOAD_4(VertexAttribI3iEXT,GLvoid, GLuint,GLint,GLint,GLint, "GL_ARB_shader_objects")
458
- GL_FUNC_LOAD_5(VertexAttribI4iEXT,GLvoid, GLuint,GLint,GLint,GLint,GLint, "GL_ARB_shader_objects")
459
- GL_FUNC_LOAD_2(VertexAttribI1uiEXT,GLvoid, GLuint,GLuint, "GL_ARB_shader_objects")
460
- GL_FUNC_LOAD_3(VertexAttribI2uiEXT,GLvoid, GLuint,GLuint,GLuint, "GL_ARB_shader_objects")
461
- GL_FUNC_LOAD_4(VertexAttribI3uiEXT,GLvoid, GLuint,GLuint,GLuint,GLuint, "GL_ARB_shader_objects")
462
- GL_FUNC_LOAD_5(VertexAttribI4uiEXT,GLvoid, GLuint,GLuint,GLuint,GLuint,GLuint, "GL_ARB_shader_objects")
463
-
464
- #define GLVERTEXATTRIB_VFUNC(_name_,_type_,_conv_,_size_) \
465
- static void (APIENTRY * fptr_gl##_name_)(GLuint,const _type_ *); \
466
- static VALUE \
467
- gl_##_name_(obj,arg1,arg2) \
468
- VALUE obj,arg1,arg2; \
469
- { \
470
- _type_ value[_size_]; \
471
- LOAD_GL_FUNC(gl##_name_,"GL_ARB_shader_objects") \
472
- _conv_(arg2,value,_size_); \
473
- fptr_gl##_name_(NUM2UINT(arg1),value); \
474
- CHECK_GLERROR \
475
- return Qnil; \
476
- }
477
-
478
- GLVERTEXATTRIB_VFUNC(VertexAttribI1ivEXT,GLint,ary2cint,1)
479
- GLVERTEXATTRIB_VFUNC(VertexAttribI2ivEXT,GLint,ary2cint,2)
480
- GLVERTEXATTRIB_VFUNC(VertexAttribI3ivEXT,GLint,ary2cint,3)
481
- GLVERTEXATTRIB_VFUNC(VertexAttribI4ivEXT,GLint,ary2cint,4)
482
- GLVERTEXATTRIB_VFUNC(VertexAttribI1uivEXT,GLuint,ary2cuint,1)
483
- GLVERTEXATTRIB_VFUNC(VertexAttribI2uivEXT,GLuint,ary2cuint,2)
484
- GLVERTEXATTRIB_VFUNC(VertexAttribI3uivEXT,GLuint,ary2cuint,3)
485
- GLVERTEXATTRIB_VFUNC(VertexAttribI4uivEXT,GLuint,ary2cuint,4)
486
- GLVERTEXATTRIB_VFUNC(VertexAttribI4bvEXT,GLbyte,ary2cbyte,4)
487
- GLVERTEXATTRIB_VFUNC(VertexAttribI4svEXT,GLshort,ary2cshort,4)
488
- GLVERTEXATTRIB_VFUNC(VertexAttribI4ubvEXT,GLubyte,ary2cubyte,4)
489
- GLVERTEXATTRIB_VFUNC(VertexAttribI4usvEXT,GLushort,ary2cushort,4)
490
- #undef GLVERTEXATTRIB_VFUNC
491
-
492
- #define GETVERTEXATTRIB_FUNC(_name_,_type_,_conv_,_extension_) \
493
- static void (APIENTRY * fptr_gl##_name_)(GLuint,GLenum,_type_ *); \
494
- static VALUE \
495
- gl_##_name_(obj,arg1,arg2) \
496
- VALUE obj,arg1,arg2; \
497
- { \
498
- GLuint index; \
499
- GLenum pname; \
500
- _type_ params[4] = {0,0,0,0}; \
501
- GLint size; \
502
- LOAD_GL_FUNC(gl##_name_,_extension_) \
503
- index = (GLuint)NUM2UINT(arg1); \
504
- pname = (GLenum)NUM2INT(arg2); \
505
- if (pname==GL_CURRENT_VERTEX_ATTRIB_ARB) \
506
- size = 4; \
507
- else \
508
- size = 1; \
509
- fptr_gl##_name_(index,pname,params); \
510
- RET_ARRAY_OR_SINGLE_BOOL(size,_conv_,pname,params) \
511
- }
512
-
513
- GETVERTEXATTRIB_FUNC(GetVertexAttribIivEXT,GLint,cond_GLBOOL2RUBY,"GL_EXT_gpu_shader4")
514
- GETVERTEXATTRIB_FUNC(GetVertexAttribIuivEXT,GLuint,cond_GLBOOL2RUBY_U,"GL_EXT_gpu_shader4")
515
- #undef GETVERTEXATTRIB_FUNC
516
-
517
- extern VALUE g_VertexAttrib_ptr[];
518
-
519
- static void (APIENTRY * fptr_glVertexAttribIPointerEXT)(GLuint,GLint,GLenum,GLsizei,const GLvoid *);
520
- static VALUE gl_VertexAttribIPointerEXT(VALUE obj,VALUE arg1,VALUE arg2,VALUE arg3,VALUE arg4,VALUE arg5)
521
- {
522
- GLuint index;
523
- GLuint size;
524
- GLenum type;
525
- GLsizei stride;
526
-
527
- LOAD_GL_FUNC(glVertexAttribIPointerEXT,"GL_EXT_gpu_shader4")
528
-
529
- index = (GLuint)NUM2UINT(arg1);
530
- size = (GLuint)NUM2UINT(arg2);
531
- type = (GLenum)NUM2INT(arg3);
532
- stride = (GLsizei)NUM2UINT(arg4);
533
- if (index>_MAX_VERTEX_ATTRIBS)
534
- rb_raise(rb_eArgError, "Index too large, maximum allowed value '%i'",_MAX_VERTEX_ATTRIBS);
535
-
536
- if (CheckBufferBinding(GL_ARRAY_BUFFER_BINDING)) {
537
- g_VertexAttrib_ptr[index] = arg5;
538
- fptr_glVertexAttribIPointerEXT(index,size,type,stride,(GLvoid *)NUM2INT(arg5));
539
- } else {
540
- VALUE data;
541
- data = pack_array_or_pass_string(type,arg5);
542
- rb_str_freeze(data);
543
- g_VertexAttrib_ptr[index] = data;
544
- fptr_glVertexAttribIPointerEXT(index,size,type,stride,(GLvoid *)RSTRING_PTR(data));
545
- }
546
-
547
- CHECK_GLERROR
548
- return Qnil;
549
- }
550
-
551
- GL_FUNC_LOAD_2(Uniform1uiEXT,GLvoid, GLint,GLuint, "GL_EXT_gpu_shader4")
552
- GL_FUNC_LOAD_3(Uniform2uiEXT,GLvoid, GLint,GLuint,GLuint, "GL_EXT_gpu_shader4")
553
- GL_FUNC_LOAD_4(Uniform3uiEXT,GLvoid, GLint,GLuint,GLuint,GLuint, "GL_EXT_gpu_shader4")
554
- GL_FUNC_LOAD_5(Uniform4uiEXT,GLvoid, GLint,GLuint,GLuint,GLuint,GLuint, "GL_EXT_gpu_shader4")
555
-
556
- #define GLUNIFORM_VFUNC(_name_,_type_,_conv_,_size_) \
557
- static void (APIENTRY * fptr_gl##_name_)(GLint,GLsizei,const _type_ *); \
558
- static VALUE \
559
- gl_##_name_(obj,arg1,arg2) \
560
- VALUE obj,arg1,arg2; \
561
- { \
562
- GLint location; \
563
- GLsizei count; \
564
- _type_ *value; \
565
- LOAD_GL_FUNC(gl##_name_,"GL_EXT_gpu_shader4") \
566
- Check_Type(arg2,T_ARRAY); \
567
- count = RARRAY_LEN(arg2); \
568
- if (count<=0 || (count % _size_) != 0) \
569
- rb_raise(rb_eArgError, "Parameter array size must be multiplication of %i",_size_); \
570
- location = (GLint)NUM2INT(arg1); \
571
- value = ALLOC_N(_type_,count); \
572
- _conv_(arg2,value,count); \
573
- fptr_gl##_name_(location,count / _size_,value); \
574
- xfree(value); \
575
- CHECK_GLERROR \
576
- return Qnil; \
577
- }
578
-
579
- GLUNIFORM_VFUNC(Uniform1uivEXT,GLuint,ary2cuint,1)
580
- GLUNIFORM_VFUNC(Uniform2uivEXT,GLuint,ary2cuint,2)
581
- GLUNIFORM_VFUNC(Uniform3uivEXT,GLuint,ary2cuint,3)
582
- GLUNIFORM_VFUNC(Uniform4uivEXT,GLuint,ary2cuint,4)
583
- #undef GLUNIFORM_VFUNC
584
-
585
- static void (APIENTRY * fptr_glGetActiveUniformARB)(GLuint,GLuint,GLsizei,GLsizei*,GLint*,GLenum*,GLchar*);
586
- #define GETUNIFORM_FUNC(_name_,_type_) \
587
- static void (APIENTRY * fptr_gl##_name_)(GLuint,GLint,_type_ *); \
588
- static VALUE \
589
- gl_##_name_(obj,arg1,arg2) \
590
- VALUE obj,arg1,arg2; \
591
- { \
592
- GLuint program; \
593
- GLint location; \
594
- _type_ params[16]; \
595
- GLint unused = 0; \
596
- GLenum uniform_type = 0; \
597
- GLint uniform_size = 0; \
598
- \
599
- LOAD_GL_FUNC(gl##_name_,"GL_EXT_gpu_shader4") \
600
- LOAD_GL_FUNC(glGetActiveUniformARB,"GL_ARB_shader_objects") \
601
- program = (GLuint)NUM2UINT(arg1); \
602
- location = (GLint)NUM2INT(arg2); \
603
- \
604
- fptr_glGetActiveUniformARB(program,location,0,NULL,&unused,&uniform_type,NULL); \
605
- CHECK_GLERROR \
606
- if (uniform_type==0) \
607
- rb_raise(rb_eTypeError, "Can't determine the uniform's type"); \
608
- \
609
- uniform_size = get_uniform_size(uniform_type); \
610
- \
611
- memset(params,0,16*sizeof(_type_)); \
612
- fptr_gl##_name_(program,location,params); \
613
- RET_ARRAY_OR_SINGLE(uniform_size,RETCONV_##_type_,params) \
614
- }
615
-
616
- GETUNIFORM_FUNC(GetUniformuivEXT,GLuint)
617
- #undef GETUNIFORM_FUNC
618
-
619
- static void (APIENTRY * fptr_glBindFragDataLocationEXT)(GLuint,GLuint,const GLchar *);
620
- static VALUE gl_BindFragDataLocationEXT(VALUE obj,VALUE arg1,VALUE arg2,VALUE arg3)
621
- {
622
- LOAD_GL_FUNC(glBindFragDataLocationEXT,"GL_EXT_gpu_shader4")
623
- Check_Type(arg3,T_STRING);
624
- fptr_glBindFragDataLocationEXT(NUM2UINT(arg1),NUM2UINT(arg2),RSTRING_PTR(arg3));
625
- CHECK_GLERROR
626
- return Qnil;
627
- }
628
-
629
- static GLint (APIENTRY * fptr_glGetFragDataLocationEXT)(GLuint,const GLchar *);
630
- static VALUE gl_GetFragDataLocationEXT(VALUE obj,VALUE arg1,VALUE arg2)
631
- {
632
- GLint ret;
633
- LOAD_GL_FUNC(glGetFragDataLocationEXT,"GL_EXT_gpu_shader4")
634
- Check_Type(arg2,T_STRING);
635
- ret = fptr_glGetFragDataLocationEXT(NUM2UINT(arg1),RSTRING_PTR(arg2));
636
- CHECK_GLERROR
637
- return INT2NUM(ret);
638
- }
639
-
640
- /* #327 - GL_EXT_draw_instanced */
641
- GL_FUNC_LOAD_4(DrawArraysInstancedEXT,GLvoid, GLenum,GLint,GLsizei,GLsizei, "GL_EXT_draw_instanced")
642
-
643
- static void (APIENTRY * fptr_glDrawElementsInstancedEXT)(GLenum,GLsizei,GLenum,const GLvoid *,GLsizei);
644
- static VALUE gl_DrawElementsInstancedEXT(obj,arg1,arg2,arg3,arg4,arg5)
645
- VALUE obj,arg1,arg2,arg3,arg4,arg5;
646
- {
647
- GLenum mode;
648
- GLsizei count;
649
- GLenum type;
650
- GLsizei primcount;
651
- LOAD_GL_FUNC(glDrawElementsInstancedEXT,"GL_EXT_draw_instanced")
652
- mode = (GLenum)NUM2INT(arg1);
653
- count = (GLsizei)NUM2UINT(arg2);
654
- type = (GLenum)NUM2INT(arg3);
655
- primcount = (GLsizei)NUM2INT(arg5);
656
- if (CheckBufferBinding(GL_ELEMENT_ARRAY_BUFFER_BINDING)) {
657
- fptr_glDrawElementsInstancedEXT(mode, count, type, (const GLvoid*)NUM2INT(arg4), primcount);
658
- } else {
659
- VALUE data;
660
- data = pack_array_or_pass_string(type,arg4);
661
- fptr_glDrawElementsInstancedEXT(mode, count, type, (const GLvoid*)RSTRING_PTR(data), primcount);
662
- }
663
- CHECK_GLERROR
664
- return Qnil;
665
- }
666
-
667
- /* #330 - GL_EXT_texture_buffer_object */
668
- GL_FUNC_LOAD_3(TexBufferEXT,GLvoid, GLenum,GLenum,GLenum, "GL_EXT_texture_buffer_object")
669
-
670
- /* #343 - GL_EXT_texture_integer */
671
- GL_FUNC_LOAD_4(ClearColorIiEXT,GLvoid, GLint,GLint,GLint,GLint, "GL_EXT_texture_integer")
672
- GL_FUNC_LOAD_4(ClearColorIuiEXT,GLvoid, GLuint,GLuint,GLuint,GLuint, "GL_EXT_texture_integer")
673
-
674
- #define TEXPARAMETER_VFUNC(_name_,_type_,_conv_) \
675
- static void (APIENTRY * fptr_gl##_name_)(GLenum,GLenum,_type_ *); \
676
- static VALUE \
677
- gl_##_name_(obj,arg1,arg2,arg3) \
678
- VALUE obj,arg1,arg2,arg3; \
679
- { \
680
- GLenum target; \
681
- GLenum pname; \
682
- _type_ params[4] = {0,0,0,0}; \
683
- LOAD_GL_FUNC(gl##_name_,"GL_EXT_texture_integer") \
684
- target = (GLenum)NUM2UINT(arg1); \
685
- pname = (GLenum)NUM2UINT(arg2); \
686
- Check_Type(arg3,T_ARRAY); \
687
- _conv_(arg3,params,4); \
688
- fptr_gl##_name_(target,pname,params); \
689
- CHECK_GLERROR \
690
- return Qnil; \
691
- }
692
-
693
- TEXPARAMETER_VFUNC(TexParameterIivEXT,GLint,ary2cint)
694
- TEXPARAMETER_VFUNC(TexParameterIuivEXT,GLuint,ary2cuint)
695
- #undef TEXPARAMETER_VFUNC
696
-
697
- #define GETTEXPARAMETER_VFUNC(_name_,_type_,_conv_) \
698
- static void (APIENTRY * fptr_gl##_name_)(GLenum,GLenum,_type_ *); \
699
- static VALUE \
700
- gl_##_name_(obj,arg1,arg2) \
701
- VALUE obj,arg1,arg2; \
702
- { \
703
- GLenum target; \
704
- GLenum pname; \
705
- _type_ params[4] = {0,0,0,0}; \
706
- int size; \
707
- LOAD_GL_FUNC(gl##_name_,"GL_EXT_texture_integer") \
708
- target = (GLenum)NUM2INT(arg1); \
709
- pname = (GLenum)NUM2INT(arg2); \
710
- switch(pname) { \
711
- case GL_TEXTURE_BORDER_COLOR: \
712
- case GL_TEXTURE_BORDER_VALUES_NV: \
713
- case GL_POST_TEXTURE_FILTER_BIAS_SGIX: \
714
- case GL_POST_TEXTURE_FILTER_SCALE_SGIX: \
715
- size = 4; \
716
- break; \
717
- default: \
718
- size = 1; \
719
- break; \
720
- } \
721
- fptr_gl##_name_(target,pname,params); \
722
- RET_ARRAY_OR_SINGLE_BOOL(size,_conv_,pname,params) \
723
- }
724
-
725
- GETTEXPARAMETER_VFUNC(GetTexParameterIivEXT,GLint,cond_GLBOOL2RUBY)
726
- GETTEXPARAMETER_VFUNC(GetTexParameterIuivEXT,GLuint,cond_GLBOOL2RUBY_U)
727
- #undef GETTEXPARAMETER_VFUNC
728
-
729
- void gl_init_functions_ext_ext(VALUE module)
730
- {
731
- /* #2 - GL_EXT_blend_color */
732
- rb_define_module_function(module, "glBlendColorEXT", gl_BlendColorEXT, 4);
733
-
734
- /* #3 - GL_EXT_polygon_offset */
735
- rb_define_module_function(module, "glPolygonOffsetEXT", gl_PolygonOffsetEXT, 2);
736
-
737
- /* #20 - GL_EXT_texture_object */
738
- rb_define_module_function(module, "glGenTexturesEXT", gl_GenTexturesEXT, 1);
739
- rb_define_module_function(module, "glDeleteTexturesEXT", gl_DeleteTexturesEXT, 1);
740
- rb_define_module_function(module, "glBindTextureEXT", gl_BindTextureEXT, 2);
741
- rb_define_module_function(module, "glPrioritizeTexturesEXT", gl_PrioritizeTexturesEXT, 2);
742
- rb_define_module_function(module, "glAreTexturesResidentEXT", gl_AreTexturesResidentEXT, 1);
743
- rb_define_module_function(module, "glIsTextureEXT", gl_IsTextureEXT, 1);
744
-
745
- /* #37 - GL_EXT_blend_minmax */
746
- rb_define_module_function(module, "glBlendEquationEXT", gl_BlendEquationEXT, 1);
747
-
748
- /* #54 - GL_EXT_point_parameters */
749
- rb_define_module_function(module, "glPointParameterfEXT", gl_PointParameterfEXT, 2);
750
- rb_define_module_function(module, "glPointParameterfvEXT", gl_PointParameterfvEXT, 2);
751
-
752
- /* #97 - GL_EXT_compiled_vertex_array */
753
- rb_define_module_function(module, "glLockArraysEXT", gl_LockArraysEXT, 2);
754
- rb_define_module_function(module, "glUnlockArraysEXT", gl_UnlockArraysEXT, 0);
755
-
756
- /* #112 - GL_EXT_draw_range_elements */
757
- rb_define_module_function(module, "glDrawRangeElementsEXT", gl_DrawRangeElementsEXT, 6);
758
-
759
- /* #145 - GL_EXT_secondary_color */
760
- rb_define_module_function(module, "glSecondaryColor3bEXT", gl_SecondaryColor3bEXT, 3);
761
- rb_define_module_function(module, "glSecondaryColor3dEXT", gl_SecondaryColor3dEXT, 3);
762
- rb_define_module_function(module, "glSecondaryColor3fEXT", gl_SecondaryColor3fEXT, 3);
763
- rb_define_module_function(module, "glSecondaryColor3iEXT", gl_SecondaryColor3iEXT, 3);
764
- rb_define_module_function(module, "glSecondaryColor3sEXT", gl_SecondaryColor3sEXT, 3);
765
- rb_define_module_function(module, "glSecondaryColor3ubEXT", gl_SecondaryColor3ubEXT, 3);
766
- rb_define_module_function(module, "glSecondaryColor3uiEXT", gl_SecondaryColor3uiEXT, 3);
767
- rb_define_module_function(module, "glSecondaryColor3usEXT", gl_SecondaryColor3usEXT, 3);
768
- rb_define_module_function(module, "glSecondaryColor3bvEXT", gl_SecondaryColor3bvEXT, 1);
769
- rb_define_module_function(module, "glSecondaryColor3dvEXT", gl_SecondaryColor3dvEXT, 1);
770
- rb_define_module_function(module, "glSecondaryColor3fvEXT", gl_SecondaryColor3fvEXT, 1);
771
- rb_define_module_function(module, "glSecondaryColor3ivEXT", gl_SecondaryColor3ivEXT, 1);
772
- rb_define_module_function(module, "glSecondaryColor3svEXT", gl_SecondaryColor3svEXT, 1);
773
- rb_define_module_function(module, "glSecondaryColor3ubvEXT", gl_SecondaryColor3ubvEXT, 1);
774
- rb_define_module_function(module, "glSecondaryColor3uivEXT", gl_SecondaryColor3uivEXT, 1);
775
- rb_define_module_function(module, "glSecondaryColor3usvEXT", gl_SecondaryColor3usvEXT, 1);
776
- rb_define_module_function(module, "glSecondaryColorPointerEXT", gl_SecondaryColorPointerEXT, 4);
777
-
778
- /* #148 - GL_EXT_multi_draw_arrays */
779
- rb_define_module_function(module, "glMultiDrawArraysEXT", gl_MultiDrawArraysEXT, 3);
780
- rb_define_module_function(module, "glMultiDrawElementsEXT", gl_MultiDrawElementsEXT, -1);
781
-
782
- /* #149 - GL_EXT_fog_coord */
783
- rb_define_module_function(module, "glFogCoordfEXT", gl_FogCoordfEXT, 1);
784
- rb_define_module_function(module, "glFogCoorddEXT", gl_FogCoorddEXT, 1);
785
- rb_define_module_function(module, "glFogCoordfvEXT", gl_FogCoordfvEXT, 1);
786
- rb_define_module_function(module, "glFogCoorddvEXT", gl_FogCoorddvEXT, 1);
787
- rb_define_module_function(module, "glFogCoordPointerEXT", gl_FogCoordPointerEXT, 3);
788
-
789
- /* #173 - GL_EXT_blend_func_separate */
790
- rb_define_module_function(module, "glBlendFuncSeparateEXT", gl_BlendFuncSeparateEXT, 4);
791
-
792
- /* #268 - GL_EXT_stencil_two_side */
793
- rb_define_module_function(module, "glActiveStencilFaceEXT", gl_ActiveStencilFaceEXT, 1);
794
-
795
- /* #297 - GL_EXT_depth_bounds_test */
796
- rb_define_module_function(module, "glDepthBoundsEXT", gl_DepthBoundsEXT, 2);
797
-
798
- /* #299 - GL_EXT_blend_equation_separate */
799
- rb_define_module_function(module, "glBlendEquationSeparateEXT", gl_BlendEquationSeparateEXT, 2);
800
-
801
- /* #310 - GL_EXT_framebuffer_object */
802
- rb_define_module_function(module, "glIsRenderbufferEXT", gl_IsRenderbufferEXT, 1);
803
- rb_define_module_function(module, "glBindRenderbufferEXT", gl_BindRenderbufferEXT, 2);
804
- rb_define_module_function(module, "glDeleteRenderbuffersEXT", gl_DeleteRenderbuffersEXT, 1);
805
- rb_define_module_function(module, "glGenRenderbuffersEXT", gl_GenRenderbuffersEXT, 1);
806
- rb_define_module_function(module, "glRenderbufferStorageEXT", gl_RenderbufferStorageEXT, 4);
807
- rb_define_module_function(module, "glGetRenderbufferParameterivEXT", gl_GetRenderbufferParameterivEXT, 2);
808
- rb_define_module_function(module, "glIsFramebufferEXT", gl_IsFramebufferEXT, 1);
809
- rb_define_module_function(module, "glBindFramebufferEXT", gl_BindFramebufferEXT, 2);
810
- rb_define_module_function(module, "glDeleteFramebuffersEXT", gl_DeleteFramebuffersEXT, 1);
811
- rb_define_module_function(module, "glGenFramebuffersEXT", gl_GenFramebuffersEXT, 1);
812
- rb_define_module_function(module, "glCheckFramebufferStatusEXT", gl_CheckFramebufferStatusEXT, 1);
813
- rb_define_module_function(module, "glFramebufferTexture1DEXT", gl_FramebufferTexture1DEXT, 5);
814
- rb_define_module_function(module, "glFramebufferTexture2DEXT", gl_FramebufferTexture2DEXT, 5);
815
- rb_define_module_function(module, "glFramebufferTexture3DEXT", gl_FramebufferTexture3DEXT, 6);
816
- rb_define_module_function(module, "glFramebufferRenderbufferEXT", gl_FramebufferRenderbufferEXT, 4);
817
- rb_define_module_function(module, "glGetFramebufferAttachmentParameterivEXT", gl_GetFramebufferAttachmentParameterivEXT, 3);
818
- rb_define_module_function(module, "glGenerateMipmapEXT", gl_GenerateMipmapEXT, 1);
819
-
820
- /* #314 - GL_EXT_stencil_clear_tag */
821
- rb_define_module_function(module, "glStencilClearTagEXT", gl_StencilClearTagEXT, 2);
822
-
823
- /* #316 - GL_EXT_framebuffer_blit */
824
- rb_define_module_function(module, "glBlitFramebufferEXT", gl_BlitFramebufferEXT, 10);
825
-
826
- /* #317 - GL_EXT_framebuffer_multisample */
827
- rb_define_module_function(module, "glRenderbufferStorageMultisampleEXT", gl_RenderbufferStorageMultisampleEXT, 5);
828
-
829
- /* #319 - GL_EXT_timer_query */
830
- rb_define_module_function(module, "glGetQueryObjecti64vEXT", gl_GetQueryObjecti64vEXT, 2);
831
- rb_define_module_function(module, "glGetQueryObjectui64vEXT", gl_GetQueryObjectui64vEXT, 2);
832
-
833
- /* #320 - GL_EXT_gpu_program_parameters */
834
- rb_define_module_function(module, "glProgramEnvParameters4fvEXT", gl_ProgramEnvParameters4fvEXT, 3);
835
- rb_define_module_function(module, "glProgramLocalParameters4fvEXT", gl_ProgramLocalParameters4fvEXT, 3);
836
-
837
- /* #324 - GL_EXT_geometry_shader4 */
838
- rb_define_module_function(module, "glProgramParameteriEXT", gl_ProgramParameteriEXT, 3);
839
-
840
- /* #326 - GL_EXT_gpu_shader4 */
841
- rb_define_module_function(module, "glVertexAttribI1iEXT", gl_VertexAttribI1iEXT, 2);
842
- rb_define_module_function(module, "glVertexAttribI2iEXT", gl_VertexAttribI2iEXT, 3);
843
- rb_define_module_function(module, "glVertexAttribI3iEXT", gl_VertexAttribI3iEXT, 4);
844
- rb_define_module_function(module, "glVertexAttribI4iEXT", gl_VertexAttribI4iEXT, 5);
845
- rb_define_module_function(module, "glVertexAttribI1uiEXT", gl_VertexAttribI1uiEXT, 2);
846
- rb_define_module_function(module, "glVertexAttribI2uiEXT", gl_VertexAttribI2uiEXT, 3);
847
- rb_define_module_function(module, "glVertexAttribI3uiEXT", gl_VertexAttribI3uiEXT, 4);
848
- rb_define_module_function(module, "glVertexAttribI4uiEXT", gl_VertexAttribI4uiEXT, 5);
849
- rb_define_module_function(module, "glVertexAttribI1ivEXT", gl_VertexAttribI1ivEXT, 2);
850
- rb_define_module_function(module, "glVertexAttribI2ivEXT", gl_VertexAttribI2ivEXT, 2);
851
- rb_define_module_function(module, "glVertexAttribI3ivEXT", gl_VertexAttribI3ivEXT, 2);
852
- rb_define_module_function(module, "glVertexAttribI4ivEXT", gl_VertexAttribI4ivEXT, 2);
853
- rb_define_module_function(module, "glVertexAttribI1uivEXT", gl_VertexAttribI1uivEXT, 2);
854
- rb_define_module_function(module, "glVertexAttribI2uivEXT", gl_VertexAttribI2uivEXT, 2);
855
- rb_define_module_function(module, "glVertexAttribI3uivEXT", gl_VertexAttribI3uivEXT, 2);
856
- rb_define_module_function(module, "glVertexAttribI4uivEXT", gl_VertexAttribI4uivEXT, 2);
857
- rb_define_module_function(module, "glVertexAttribI4bvEXT", gl_VertexAttribI4bvEXT, 2);
858
- rb_define_module_function(module, "glVertexAttribI4svEXT", gl_VertexAttribI4svEXT, 2);
859
- rb_define_module_function(module, "glVertexAttribI4ubvEXT", gl_VertexAttribI4ubvEXT, 2);
860
- rb_define_module_function(module, "glVertexAttribI4usvEXT", gl_VertexAttribI4usvEXT, 2);
861
- rb_define_module_function(module, "glVertexAttribIPointerEXT", gl_VertexAttribIPointerEXT, 5);
862
- rb_define_module_function(module, "glGetVertexAttribIivEXT", gl_GetVertexAttribIivEXT, 2);
863
- rb_define_module_function(module, "glGetVertexAttribIuivEXT", gl_GetVertexAttribIuivEXT, 2);
864
- rb_define_module_function(module, "glUniform1uiEXT", gl_Uniform1uiEXT, 2);
865
- rb_define_module_function(module, "glUniform2uiEXT", gl_Uniform2uiEXT, 3);
866
- rb_define_module_function(module, "glUniform3uiEXT", gl_Uniform3uiEXT, 4);
867
- rb_define_module_function(module, "glUniform4uiEXT", gl_Uniform4uiEXT, 5);
868
- rb_define_module_function(module, "glUniform1uivEXT", gl_Uniform1uivEXT, 2);
869
- rb_define_module_function(module, "glUniform2uivEXT", gl_Uniform2uivEXT, 2);
870
- rb_define_module_function(module, "glUniform3uivEXT", gl_Uniform3uivEXT, 2);
871
- rb_define_module_function(module, "glUniform4uivEXT", gl_Uniform4uivEXT, 2);
872
- rb_define_module_function(module, "glGetUniformuivEXT", gl_GetUniformuivEXT, 2);
873
- rb_define_module_function(module, "glBindFragDataLocationEXT", gl_BindFragDataLocationEXT, 3);
874
- rb_define_module_function(module, "glGetFragDataLocationEXT", gl_GetFragDataLocationEXT, 2);
875
-
876
- /* #327 - GL_EXT_draw_instanced */
877
- rb_define_module_function(module, "glDrawArraysInstancedEXT", gl_DrawArraysInstancedEXT, 4);
878
- rb_define_module_function(module, "glDrawElementsInstancedEXT", gl_DrawElementsInstancedEXT, 5);
879
-
880
- /* #330 - GL_EXT_texture_buffer_object */
881
- rb_define_module_function(module, "glTexBufferEXT", gl_TexBufferEXT, 3);
882
-
883
- /* #343 - GL_EXT_texture_integer */
884
- rb_define_module_function(module, "glClearColorIiEXT", gl_ClearColorIiEXT, 4);
885
- rb_define_module_function(module, "glClearColorIuiEXT", gl_ClearColorIuiEXT, 4);
886
- rb_define_module_function(module, "glTexParameterIivEXT", gl_TexParameterIivEXT, 3);
887
- rb_define_module_function(module, "glTexParameterIuivEXT", gl_TexParameterIuivEXT, 3);
888
- rb_define_module_function(module, "glGetTexParameterIivEXT", gl_GetTexParameterIivEXT, 2);
889
- rb_define_module_function(module, "glGetTexParameterIuivEXT", gl_GetTexParameterIuivEXT, 2);
890
- }