ruby-opengl 0.60.1 → 0.61.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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,444 +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 1.3 functions */
19
-
20
- GL_FUNC_LOAD_1(ActiveTexture,GLvoid, GLenum, "1.3")
21
- GL_FUNC_LOAD_1(ClientActiveTexture,GLvoid, GLenum, "1.3")
22
- GL_FUNC_LOAD_2(MultiTexCoord1d,GLvoid, GLenum,GLdouble, "1.3")
23
- GL_FUNC_LOAD_2(MultiTexCoord1f,GLvoid, GLenum,GLfloat, "1.3")
24
- GL_FUNC_LOAD_2(MultiTexCoord1i,GLvoid, GLenum,GLint, "1.3")
25
- GL_FUNC_LOAD_2(MultiTexCoord1s,GLvoid, GLenum,GLshort, "1.3")
26
- GL_FUNC_LOAD_3(MultiTexCoord2d,GLvoid, GLenum,GLdouble,GLdouble, "1.3")
27
- GL_FUNC_LOAD_3(MultiTexCoord2f,GLvoid, GLenum,GLfloat,GLfloat, "1.3")
28
- GL_FUNC_LOAD_3(MultiTexCoord2i,GLvoid, GLenum,GLint,GLint, "1.3")
29
- GL_FUNC_LOAD_3(MultiTexCoord2s,GLvoid, GLenum,GLshort,GLshort, "1.3")
30
- GL_FUNC_LOAD_4(MultiTexCoord3d,GLvoid, GLenum,GLdouble,GLdouble,GLdouble, "1.3")
31
- GL_FUNC_LOAD_4(MultiTexCoord3f,GLvoid, GLenum,GLfloat,GLfloat,GLfloat, "1.3")
32
- GL_FUNC_LOAD_4(MultiTexCoord3i,GLvoid, GLenum,GLint,GLint,GLint, "1.3")
33
- GL_FUNC_LOAD_4(MultiTexCoord3s,GLvoid, GLenum,GLshort,GLshort,GLshort, "1.3")
34
- GL_FUNC_LOAD_5(MultiTexCoord4d,GLvoid, GLenum,GLdouble,GLdouble,GLdouble,GLdouble, "1.3")
35
- GL_FUNC_LOAD_5(MultiTexCoord4f,GLvoid, GLenum,GLfloat,GLfloat,GLfloat,GLfloat, "1.3")
36
- GL_FUNC_LOAD_5(MultiTexCoord4i,GLvoid, GLenum,GLint,GLint,GLint,GLint, "1.3")
37
- GL_FUNC_LOAD_5(MultiTexCoord4s,GLvoid, GLenum,GLshort,GLshort,GLshort,GLshort, "1.3")
38
- GL_FUNC_LOAD_2(SampleCoverage,GLvoid, GLclampf,GLboolean, "1.3")
39
-
40
- #define GLMULTITEXCOORD_VFUNC(_type_) \
41
- static VALUE \
42
- gl_MultiTexCoord##_type_##v(argc,argv,obj) \
43
- int argc; \
44
- VALUE *argv; \
45
- VALUE obj; \
46
- { \
47
- int num; \
48
- VALUE args[5]; \
49
- RArray *ary; \
50
- switch (num = rb_scan_args(argc, argv, "23", &args[0], &args[1], &args[2], &args[3],&args[4])) { \
51
- case 2: \
52
- if (TYPE(args[1]) == T_ARRAY) { \
53
- ary = RARRAY(args[1]); \
54
- switch (RARRAY_LEN(ary)) { \
55
- case 1: \
56
- gl_MultiTexCoord1##_type_(obj,args[0],RARRAY_PTR(ary)[0]); \
57
- break; \
58
- case 2: \
59
- gl_MultiTexCoord2##_type_(obj,args[0],RARRAY_PTR(ary)[0],RARRAY_PTR(ary)[1]); \
60
- break; \
61
- case 3: \
62
- gl_MultiTexCoord3##_type_(obj,args[0],RARRAY_PTR(ary)[0],RARRAY_PTR(ary)[1],RARRAY_PTR(ary)[2]); \
63
- break; \
64
- case 4: \
65
- gl_MultiTexCoord4##_type_(obj,args[0],RARRAY_PTR(ary)[0],RARRAY_PTR(ary)[1],RARRAY_PTR(ary)[2],RARRAY_PTR(ary)[3]); \
66
- break; \
67
- default: \
68
- rb_raise(rb_eArgError, "array length:%d", num); \
69
- } \
70
- } \
71
- else { \
72
- gl_MultiTexCoord1##_type_(obj,args[0], args[1]); \
73
- break; \
74
- } \
75
- break; \
76
- case 3: \
77
- gl_MultiTexCoord2##_type_(obj,args[0], args[1], args[2]); \
78
- break; \
79
- case 4: \
80
- gl_MultiTexCoord3##_type_(obj,args[0], args[1], args[2], args[3]); \
81
- break; \
82
- case 5: \
83
- gl_MultiTexCoord4##_type_(obj,args[0], args[1], args[2], args[3], args[4]); \
84
- break; \
85
- default: \
86
- rb_raise(rb_eArgError, "too many arguments"); \
87
- break; \
88
- } \
89
- return Qnil; \
90
- }
91
-
92
- GLMULTITEXCOORD_VFUNC(d)
93
- GLMULTITEXCOORD_VFUNC(f)
94
- GLMULTITEXCOORD_VFUNC(i)
95
- GLMULTITEXCOORD_VFUNC(s)
96
- #undef GLTEXCOORD_VFUNC
97
-
98
- #define TRANSPOSEMATRIX_FUNC(_name_,_type_) \
99
- static void (APIENTRY * fptr_gl##_name_)(const _type_[]); \
100
- static VALUE \
101
- gl_##_name_(obj,arg1) \
102
- VALUE obj,arg1; \
103
- { \
104
- _type_ m[4*4]; \
105
- LOAD_GL_FUNC(gl##_name_,"1.3") \
106
- ary2cmat##_type_(arg1, m, 4, 4); \
107
- fptr_gl##_name_(m); \
108
- CHECK_GLERROR \
109
- return Qnil; \
110
- }
111
-
112
- TRANSPOSEMATRIX_FUNC(LoadTransposeMatrixf,float)
113
- TRANSPOSEMATRIX_FUNC(LoadTransposeMatrixd,double)
114
- TRANSPOSEMATRIX_FUNC(MultTransposeMatrixf,float)
115
- TRANSPOSEMATRIX_FUNC(MultTransposeMatrixd,double)
116
-
117
- #undef TRANSPOSEMATRIX_FUNC
118
-
119
- static void (APIENTRY * fptr_glCompressedTexImage3D)(GLenum,GLint,GLenum,GLsizei,GLsizei,GLsizei,GLint,GLsizei,GLvoid*);
120
- static VALUE
121
- gl_CompressedTexImage3D(obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9)
122
- VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9;
123
- {
124
- GLenum target;
125
- GLint level;
126
- GLenum internalformat;
127
- GLsizei width;
128
- GLsizei height;
129
- GLsizei depth;
130
- GLint border;
131
- GLsizei imagesize;
132
- GLvoid *pixels;
133
- LOAD_GL_FUNC(glCompressedTexImage3D,"1.3")
134
- target = (GLenum)NUM2INT(arg1);
135
- level = (GLint)NUM2INT(arg2);
136
- internalformat = (GLenum)NUM2INT(arg3);
137
- width = (GLsizei)NUM2UINT(arg4);
138
- height = (GLsizei)NUM2UINT(arg5);
139
- depth = (GLsizei)NUM2UINT(arg6);
140
- border = (GLint)NUM2INT(arg7);
141
- imagesize = (GLsizei)NUM2UINT(arg8);
142
- if (CheckBufferBinding(GL_PIXEL_UNPACK_BUFFER_BINDING)) {
143
- fptr_glCompressedTexImage3D(target,level,internalformat,width,height,depth,border,imagesize,(GLvoid *)NUM2INT(arg9));
144
- } else {
145
- if (TYPE(arg9) == T_STRING || TYPE(arg9) == T_ARRAY) {
146
- VALUE data;
147
- data = pack_array_or_pass_string(GL_UNSIGNED_BYTE,arg9);
148
- if (RSTRING_LEN(data) < imagesize)
149
- rb_raise(rb_eArgError, "string length:%li",RSTRING_LEN(data));
150
- pixels = RSTRING_PTR(data);
151
- } else if (NIL_P(arg9)) {
152
- pixels = NULL;
153
- } else {
154
- Check_Type(arg9,T_STRING); /* force exception */
155
- return Qnil;
156
- }
157
- fptr_glCompressedTexImage3D(target,level,internalformat,width,height,depth,border,imagesize,pixels);
158
- }
159
- CHECK_GLERROR
160
- return Qnil;
161
- }
162
-
163
- static void (APIENTRY * fptr_glCompressedTexImage2D)(GLenum,GLint,GLenum,GLsizei,GLsizei,GLint,GLsizei,GLvoid*);
164
- static VALUE
165
- gl_CompressedTexImage2D(obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8)
166
- VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8;
167
- {
168
- GLenum target;
169
- GLint level;
170
- GLenum internalformat;
171
- GLsizei width;
172
- GLsizei height;
173
- GLint border;
174
- GLsizei imagesize;
175
- GLvoid *pixels;
176
- LOAD_GL_FUNC(glCompressedTexImage2D,"1.3")
177
- target = (GLenum)NUM2INT(arg1);
178
- level = (GLint)NUM2INT(arg2);
179
- internalformat = (GLenum)NUM2INT(arg3);
180
- width = (GLsizei)NUM2UINT(arg4);
181
- height = (GLsizei)NUM2UINT(arg5);
182
- border = (GLint)NUM2INT(arg6);
183
- imagesize = (GLsizei)NUM2UINT(arg7);
184
- if (CheckBufferBinding(GL_PIXEL_UNPACK_BUFFER_BINDING)) {
185
- fptr_glCompressedTexImage2D(target,level,internalformat,width,height,border,imagesize,(GLvoid *)NUM2INT(arg8));
186
- } else {
187
- if (TYPE(arg8) == T_STRING || TYPE(arg8) == T_ARRAY) {
188
- VALUE data;
189
- data = pack_array_or_pass_string(GL_UNSIGNED_BYTE,arg8);
190
- if (RSTRING_LEN(data) < imagesize)
191
- rb_raise(rb_eArgError, "string length:%li",RSTRING_LEN(data));
192
- pixels = RSTRING_PTR(data);
193
- } else if (NIL_P(arg8)) {
194
- pixels = NULL;
195
- } else {
196
- Check_Type(arg8,T_STRING); /* force exception */
197
- return Qnil;
198
- }
199
- fptr_glCompressedTexImage2D(target,level,internalformat,width,height,border,imagesize,pixels);
200
- }
201
- CHECK_GLERROR
202
- return Qnil;
203
- }
204
-
205
- static void (APIENTRY * fptr_glCompressedTexImage1D)(GLenum,GLint,GLenum,GLsizei,GLint,GLsizei,GLvoid*);
206
- static VALUE
207
- gl_CompressedTexImage1D(obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7)
208
- VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7;
209
- {
210
- GLenum target;
211
- GLint level;
212
- GLenum internalformat;
213
- GLsizei width;
214
- GLint border;
215
- GLsizei imagesize;
216
- GLvoid *pixels;
217
- LOAD_GL_FUNC(glCompressedTexImage1D,"1.3")
218
- target = (GLenum)NUM2INT(arg1);
219
- level = (GLint)NUM2INT(arg2);
220
- internalformat = (GLenum)NUM2INT(arg3);
221
- width = (GLsizei)NUM2UINT(arg4);
222
- border = (GLint)NUM2INT(arg5);
223
- imagesize = (GLsizei)NUM2UINT(arg6);
224
- if (CheckBufferBinding(GL_PIXEL_UNPACK_BUFFER_BINDING)) {
225
- fptr_glCompressedTexImage1D(target,level,internalformat,width,border,imagesize,(GLvoid *)NUM2INT(arg7));
226
- } else {
227
- if (TYPE(arg7) == T_STRING || TYPE(arg7) == T_ARRAY) {
228
- VALUE data;
229
- data = pack_array_or_pass_string(GL_UNSIGNED_BYTE,arg7);
230
- if (RSTRING_LEN(data) < imagesize)
231
- rb_raise(rb_eArgError, "string length:%li",RSTRING_LEN(data));
232
- pixels = RSTRING_PTR(data);
233
- } else if (NIL_P(arg7)) {
234
- pixels = NULL;
235
- } else {
236
- Check_Type(arg7,T_STRING); /* force exception */
237
- return Qnil;
238
- }
239
- fptr_glCompressedTexImage1D(target,level,internalformat,width,border,imagesize,pixels);
240
- }
241
- CHECK_GLERROR
242
- return Qnil;
243
- }
244
-
245
- static void (APIENTRY * fptr_glCompressedTexSubImage3D)(GLenum,GLint,GLint,GLint,GLint,GLsizei,GLsizei,GLsizei,GLenum,GLsizei,GLvoid*);
246
- static VALUE
247
- gl_CompressedTexSubImage3D(obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11)
248
- VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11;
249
- {
250
- GLenum target;
251
- GLint level;
252
- GLint xoffset;
253
- GLint yoffset;
254
- GLint zoffset;
255
- GLsizei width;
256
- GLsizei height;
257
- GLsizei depth;
258
- GLenum format;
259
- GLsizei imagesize;
260
- GLvoid *pixels;
261
- LOAD_GL_FUNC(glCompressedTexSubImage3D,"1.3")
262
- target = (GLenum)NUM2INT(arg1);
263
- level = (GLint)NUM2INT(arg2);
264
- xoffset = (GLint)NUM2INT(arg3);
265
- yoffset = (GLint)NUM2INT(arg4);
266
- zoffset = (GLint)NUM2INT(arg5);
267
- width = (GLsizei)NUM2UINT(arg6);
268
- height = (GLsizei)NUM2UINT(arg7);
269
- depth = (GLsizei)NUM2UINT(arg8);
270
- format = (GLenum)NUM2INT(arg9);
271
- imagesize = (GLsizei)NUM2UINT(arg10);
272
- if (CheckBufferBinding(GL_PIXEL_UNPACK_BUFFER_BINDING)) {
273
- fptr_glCompressedTexSubImage3D(target,level,xoffset,yoffset,zoffset,width,height,depth,format,imagesize,(GLvoid *)NUM2INT(arg11));
274
- } else {
275
- VALUE data;
276
- data = pack_array_or_pass_string(GL_UNSIGNED_BYTE,arg11);
277
- if (RSTRING_LEN(data) < imagesize)
278
- rb_raise(rb_eArgError, "string length:%li",RSTRING_LEN(data));
279
- pixels = RSTRING_PTR(data);
280
-
281
- fptr_glCompressedTexSubImage3D(target,level,xoffset,yoffset,zoffset,width,height,depth,format,imagesize,pixels);
282
- }
283
- CHECK_GLERROR
284
- return Qnil;
285
- }
286
-
287
- static void (APIENTRY * fptr_glCompressedTexSubImage2D)(GLenum,GLint,GLint,GLint,GLsizei,GLsizei,GLenum,GLsizei,GLvoid*);
288
- static VALUE
289
- gl_CompressedTexSubImage2D(obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9)
290
- VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9;
291
- {
292
- GLenum target;
293
- GLint level;
294
- GLint xoffset;
295
- GLint yoffset;
296
- GLsizei width;
297
- GLsizei height;
298
- GLenum format;
299
- GLsizei imagesize;
300
- GLvoid *pixels;
301
- LOAD_GL_FUNC(glCompressedTexSubImage2D,"1.3")
302
- target = (GLenum)NUM2INT(arg1);
303
- level = (GLint)NUM2INT(arg2);
304
- xoffset = (GLint)NUM2INT(arg3);
305
- yoffset = (GLint)NUM2INT(arg4);
306
- width = (GLsizei)NUM2UINT(arg5);
307
- height = (GLsizei)NUM2UINT(arg6);
308
- format = (GLenum)NUM2INT(arg7);
309
- imagesize = (GLsizei)NUM2UINT(arg8);
310
- if (CheckBufferBinding(GL_PIXEL_UNPACK_BUFFER_BINDING)) {
311
- fptr_glCompressedTexSubImage2D(target,level,xoffset,yoffset,width,height,format,imagesize,(GLvoid *)NUM2INT(arg9));
312
- } else {
313
- VALUE data;
314
- data = pack_array_or_pass_string(GL_UNSIGNED_BYTE,arg9);
315
- if (RSTRING_LEN(data) < imagesize)
316
- rb_raise(rb_eArgError, "string length:%li",RSTRING_LEN(data));
317
- pixels = RSTRING_PTR(data);
318
- fptr_glCompressedTexSubImage2D(target,level,xoffset,yoffset,width,height,format,imagesize,pixels);
319
- }
320
- CHECK_GLERROR
321
- return Qnil;
322
- }
323
-
324
- static void (APIENTRY * fptr_glCompressedTexSubImage1D)(GLenum,GLint,GLint,GLsizei,GLenum,GLsizei,GLvoid*);
325
- static VALUE
326
- gl_CompressedTexSubImage1D(obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7)
327
- VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7;
328
- {
329
- GLenum target;
330
- GLint level;
331
- GLint xoffset;
332
- GLsizei width;
333
- GLenum format;
334
- GLsizei imagesize;
335
- GLvoid *pixels;
336
- LOAD_GL_FUNC(glCompressedTexSubImage1D,"1.3")
337
- target = (GLenum)NUM2INT(arg1);
338
- level = (GLint)NUM2INT(arg2);
339
- xoffset = (GLint)NUM2INT(arg3);
340
- width = (GLsizei)NUM2UINT(arg4);
341
- format = (GLenum)NUM2INT(arg5);
342
- imagesize = (GLsizei)NUM2UINT(arg6);
343
- if (CheckBufferBinding(GL_PIXEL_UNPACK_BUFFER_BINDING)) {
344
- fptr_glCompressedTexSubImage1D(target,level,xoffset,width,format,imagesize,(GLvoid *)NUM2INT(arg7));
345
- } else {
346
- VALUE data;
347
- data = pack_array_or_pass_string(GL_UNSIGNED_BYTE,arg7);
348
- if (RSTRING_LEN(data) < imagesize)
349
- rb_raise(rb_eArgError, "string length:%li",RSTRING_LEN(data));
350
- pixels = RSTRING_PTR(data);
351
- fptr_glCompressedTexSubImage1D(target,level,xoffset,width,format,imagesize,pixels);
352
- }
353
- CHECK_GLERROR
354
- return Qnil;
355
- }
356
-
357
- static void (APIENTRY * fptr_glGetCompressedTexImage)(GLenum,GLint,GLvoid*);
358
- static VALUE
359
- gl_GetCompressedTexImage(argc,argv,obj)
360
- int argc;
361
- VALUE *argv;
362
- VALUE obj;
363
- {
364
- GLenum target;
365
- GLint lod;
366
- GLsizei size = 0;
367
- VALUE data;
368
- VALUE args[3];
369
- int numargs;
370
- LOAD_GL_FUNC(glGetCompressedTexImage,"1.3")
371
- numargs = rb_scan_args(argc, argv, "21", &args[0], &args[1], &args[2]);
372
- target = (GLenum)NUM2INT(args[0]);
373
- lod = (GLenum)NUM2INT(args[1]);
374
- switch(numargs) {
375
- default:
376
- case 2:
377
- if (CheckBufferBinding(GL_PIXEL_PACK_BUFFER_BINDING))
378
- rb_raise(rb_eArgError, "Pixel pack buffer bound, but offset argument missing");
379
- glGetTexLevelParameteriv(target,lod,GL_TEXTURE_COMPRESSED_IMAGE_SIZE,&size); /* 1.0 function */
380
- CHECK_GLERROR
381
- data = allocate_buffer_with_string(size);
382
- fptr_glGetCompressedTexImage(target,lod,(GLvoid*)RSTRING_PTR(data));
383
- CHECK_GLERROR
384
- return data;
385
- case 3:
386
- fptr_glGetCompressedTexImage(target,lod,(GLvoid*)NUM2INT(args[2]));
387
- CHECK_GLERROR
388
- return Qnil;
389
- }
390
- }
391
-
392
- void gl_init_functions_1_3(VALUE module)
393
- {
394
- rb_define_module_function(module, "glActiveTexture", gl_ActiveTexture, 1);
395
- rb_define_module_function(module, "glClientActiveTexture", gl_ClientActiveTexture, 1);
396
- rb_define_module_function(module, "glMultiTexCoord1d", gl_MultiTexCoord1d, 2);
397
- rb_define_module_function(module, "glMultiTexCoord1f", gl_MultiTexCoord1f, 2);
398
- rb_define_module_function(module, "glMultiTexCoord1i", gl_MultiTexCoord1i, 2);
399
- rb_define_module_function(module, "glMultiTexCoord1s", gl_MultiTexCoord1s, 2);
400
- rb_define_module_function(module, "glMultiTexCoord2d", gl_MultiTexCoord2d, 3);
401
- rb_define_module_function(module, "glMultiTexCoord2f", gl_MultiTexCoord2f, 3);
402
- rb_define_module_function(module, "glMultiTexCoord2i", gl_MultiTexCoord2i, 3);
403
- rb_define_module_function(module, "glMultiTexCoord2s", gl_MultiTexCoord2s, 3);
404
- rb_define_module_function(module, "glMultiTexCoord3d", gl_MultiTexCoord3d, 4);
405
- rb_define_module_function(module, "glMultiTexCoord3f", gl_MultiTexCoord3f, 4);
406
- rb_define_module_function(module, "glMultiTexCoord3i", gl_MultiTexCoord3i, 4);
407
- rb_define_module_function(module, "glMultiTexCoord3s", gl_MultiTexCoord3s, 4);
408
- rb_define_module_function(module, "glMultiTexCoord4d", gl_MultiTexCoord4d, 5);
409
- rb_define_module_function(module, "glMultiTexCoord4f", gl_MultiTexCoord4f, 5);
410
- rb_define_module_function(module, "glMultiTexCoord4i", gl_MultiTexCoord4i, 5);
411
- rb_define_module_function(module, "glMultiTexCoord4s", gl_MultiTexCoord4s, 5);
412
- rb_define_module_function(module, "glLoadTransposeMatrixf", gl_LoadTransposeMatrixf, 1);
413
- rb_define_module_function(module, "glLoadTransposeMatrixd", gl_LoadTransposeMatrixd, 1);
414
- rb_define_module_function(module, "glMultTransposeMatrixf", gl_MultTransposeMatrixf, 1);
415
- rb_define_module_function(module, "glMultTransposeMatrixd", gl_MultTransposeMatrixd, 1);
416
- rb_define_module_function(module, "glSampleCoverage", gl_SampleCoverage, 2);
417
- rb_define_module_function(module, "glCompressedTexImage3D", gl_CompressedTexImage3D, 9);
418
- rb_define_module_function(module, "glCompressedTexImage2D", gl_CompressedTexImage2D, 8);
419
- rb_define_module_function(module, "glCompressedTexImage1D", gl_CompressedTexImage1D, 7);
420
- rb_define_module_function(module, "glCompressedTexSubImage3D", gl_CompressedTexSubImage3D, 11);
421
- rb_define_module_function(module, "glCompressedTexSubImage2D", gl_CompressedTexSubImage2D, 9);
422
- rb_define_module_function(module, "glCompressedTexSubImage1D", gl_CompressedTexSubImage1D, 7);
423
- rb_define_module_function(module, "glGetCompressedTexImage", gl_GetCompressedTexImage, -1);
424
-
425
- /* Additional functions */
426
-
427
- rb_define_module_function(module, "glMultiTexCoord", gl_MultiTexCoorddv, -1);
428
- rb_define_module_function(module, "glMultiTexCoord1dv", gl_MultiTexCoorddv, -1);
429
- rb_define_module_function(module, "glMultiTexCoord1fv", gl_MultiTexCoordfv, -1);
430
- rb_define_module_function(module, "glMultiTexCoord1iv", gl_MultiTexCoordiv, -1);
431
- rb_define_module_function(module, "glMultiTexCoord1sv", gl_MultiTexCoordsv, -1);
432
- rb_define_module_function(module, "glMultiTexCoord2dv", gl_MultiTexCoorddv, -1);
433
- rb_define_module_function(module, "glMultiTexCoord2fv", gl_MultiTexCoordfv, -1);
434
- rb_define_module_function(module, "glMultiTexCoord2iv", gl_MultiTexCoordiv, -1);
435
- rb_define_module_function(module, "glMultiTexCoord2sv", gl_MultiTexCoordsv, -1);
436
- rb_define_module_function(module, "glMultiTexCoord3dv", gl_MultiTexCoorddv, -1);
437
- rb_define_module_function(module, "glMultiTexCoord3fv", gl_MultiTexCoordfv, -1);
438
- rb_define_module_function(module, "glMultiTexCoord3iv", gl_MultiTexCoordiv, -1);
439
- rb_define_module_function(module, "glMultiTexCoord3sv", gl_MultiTexCoordsv, -1);
440
- rb_define_module_function(module, "glMultiTexCoord4dv", gl_MultiTexCoorddv, -1);
441
- rb_define_module_function(module, "glMultiTexCoord4fv", gl_MultiTexCoordfv, -1);
442
- rb_define_module_function(module, "glMultiTexCoord4iv", gl_MultiTexCoordiv, -1);
443
- rb_define_module_function(module, "glMultiTexCoord4sv", gl_MultiTexCoordsv, -1);
444
- }
@@ -1,349 +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 1.4 functions */
19
-
20
- GL_FUNC_LOAD_4(BlendFuncSeparate,GLvoid, GLenum,GLenum,GLenum,GLenum, "1.4")
21
- GL_FUNC_LOAD_1(FogCoordf,GLvoid, GLfloat, "1.4")
22
- GL_FUNC_LOAD_1(FogCoordd,GLvoid, GLdouble, "1.4")
23
- GL_FUNC_LOAD_2(PointParameteri,GLvoid, GLenum,GLint, "1.4")
24
- GL_FUNC_LOAD_2(PointParameterf,GLvoid, GLenum,GLfloat, "1.4")
25
- GL_FUNC_LOAD_3(SecondaryColor3b,GLvoid, GLbyte,GLbyte,GLbyte, "1.4")
26
- GL_FUNC_LOAD_3(SecondaryColor3d,GLvoid, GLdouble,GLdouble,GLdouble, "1.4")
27
- GL_FUNC_LOAD_3(SecondaryColor3f,GLvoid, GLfloat,GLfloat,GLfloat, "1.4")
28
- GL_FUNC_LOAD_3(SecondaryColor3i,GLvoid, GLint,GLint,GLint, "1.4")
29
- GL_FUNC_LOAD_3(SecondaryColor3s,GLvoid, GLshort,GLshort,GLshort, "1.4")
30
- GL_FUNC_LOAD_3(SecondaryColor3ub,GLvoid, GLubyte,GLubyte,GLubyte, "1.4")
31
- GL_FUNC_LOAD_3(SecondaryColor3ui,GLvoid, GLuint,GLuint,GLuint, "1.4")
32
- GL_FUNC_LOAD_3(SecondaryColor3us,GLvoid, GLushort,GLushort,GLushort, "1.4")
33
- GL_FUNC_LOAD_2(WindowPos2d,GLvoid, GLdouble,GLdouble, "1.4")
34
- GL_FUNC_LOAD_2(WindowPos2f,GLvoid, GLfloat,GLfloat, "1.4")
35
- GL_FUNC_LOAD_2(WindowPos2i,GLvoid, GLint,GLint, "1.4")
36
- GL_FUNC_LOAD_2(WindowPos2s,GLvoid, GLshort,GLshort, "1.4")
37
- GL_FUNC_LOAD_3(WindowPos3d,GLvoid, GLdouble,GLdouble,GLdouble, "1.4")
38
- GL_FUNC_LOAD_3(WindowPos3f,GLvoid, GLfloat,GLfloat,GLfloat, "1.4")
39
- GL_FUNC_LOAD_3(WindowPos3i,GLvoid, GLint,GLint,GLint, "1.4")
40
- GL_FUNC_LOAD_3(WindowPos3s,GLvoid, GLshort,GLshort,GLshort, "1.4")
41
-
42
- static void (APIENTRY * fptr_glFogCoordfv)(GLfloat *);
43
- static VALUE
44
- gl_FogCoordfv(obj,arg1)
45
- VALUE obj,arg1;
46
- {
47
- GLfloat coord;
48
- LOAD_GL_FUNC(glFogCoordfv,"1.4")
49
- Check_Type(arg1,T_ARRAY);
50
- ary2cflt(arg1,&coord,1);
51
- fptr_glFogCoordfv(&coord);
52
- CHECK_GLERROR
53
- return Qnil;
54
- }
55
-
56
- static void (APIENTRY * fptr_glFogCoorddv)(GLdouble *);
57
- static VALUE
58
- gl_FogCoorddv(obj,arg1)
59
- VALUE obj,arg1;
60
- {
61
- GLdouble coord;
62
- LOAD_GL_FUNC(glFogCoorddv,"1.4")
63
- Check_Type(arg1,T_ARRAY);
64
- ary2cdbl(arg1,&coord,1);
65
- fptr_glFogCoorddv(&coord);
66
- CHECK_GLERROR
67
- return Qnil;
68
- }
69
-
70
- extern VALUE g_FogCoord_ptr;
71
- static void (APIENTRY * fptr_glFogCoordPointer)(GLenum,GLsizei,const GLvoid *);
72
- static VALUE
73
- gl_FogCoordPointer(obj,arg1,arg2,arg3)
74
- VALUE obj,arg1,arg2,arg3;
75
- {
76
- GLenum type;
77
- GLsizei stride;
78
- LOAD_GL_FUNC(glFogCoordPointer,"1.4")
79
- type = (GLenum)NUM2INT(arg1);
80
- stride = (GLsizei)NUM2UINT(arg2);
81
- if (CheckBufferBinding(GL_ARRAY_BUFFER_BINDING)) {
82
- g_FogCoord_ptr = arg3;
83
- fptr_glFogCoordPointer(type, stride, (const GLvoid*)NUM2INT(arg3));
84
- } else {
85
- VALUE data;
86
- data = pack_array_or_pass_string(GL_UNSIGNED_BYTE,arg3);
87
- rb_str_freeze(data);
88
- g_FogCoord_ptr = data;
89
- fptr_glFogCoordPointer(type, stride, (const GLvoid*)RSTRING_PTR(data));
90
- }
91
- CHECK_GLERROR
92
- return Qnil;
93
- }
94
-
95
- static void (APIENTRY * fptr_glMultiDrawArrays)(GLenum,GLint*,GLsizei*,GLsizei);
96
- static VALUE
97
- gl_MultiDrawArrays(obj,arg1,arg2,arg3)
98
- VALUE obj,arg1,arg2,arg3;
99
- {
100
- GLenum mode;
101
- GLint *ary1;
102
- GLsizei *ary2;
103
- int len1,len2;
104
- LOAD_GL_FUNC(glMultiDrawArrays,"1.4")
105
- len1 = RARRAY_LEN(arg2);
106
- len2 = RARRAY_LEN(arg3);
107
- if (len1!=len2)
108
- rb_raise(rb_eArgError, "Passed arrays must have same length");
109
- mode = (GLenum)NUM2INT(arg1);
110
- ary1 = ALLOC_N(GLint,len1);
111
- ary2 = ALLOC_N(GLsizei,len2);
112
- ary2cint(arg2,ary1,len1);
113
- ary2cint(arg3,ary2,len2);
114
- fptr_glMultiDrawArrays(mode,ary1,ary2,len1);
115
- xfree(ary1);
116
- xfree(ary2);
117
- CHECK_GLERROR
118
- return Qnil;
119
- }
120
-
121
- static void (APIENTRY * fptr_glMultiDrawElements)(GLenum,const GLsizei *,GLenum,GLvoid **,GLsizei);
122
- static VALUE
123
- gl_MultiDrawElements(argc,argv,obj)
124
- int argc;
125
- VALUE *argv;
126
- VALUE obj;
127
- {
128
- GLenum mode;
129
- GLenum type;
130
- GLsizei *counts;
131
- GLvoid **indices;
132
- GLint size;
133
- RArray *ary;
134
- int i;
135
- VALUE args[4];
136
- LOAD_GL_FUNC(glMultiDrawElements,"1.4")
137
- switch (rb_scan_args(argc, argv, "31", &args[0], &args[1], &args[2],&args[3])) {
138
- default:
139
- case 3:
140
- if (CheckBufferBinding(GL_ELEMENT_ARRAY_BUFFER_BINDING))
141
- rb_raise(rb_eArgError, "Element array buffer bound, but offsets array missing");
142
- mode = (GLenum)NUM2INT(args[0]);
143
- type = (GLenum)NUM2INT(args[1]);
144
- Check_Type(args[2],T_ARRAY);
145
- ary = RARRAY(args[2]);
146
- size = RARRAY_LEN(ary);
147
- counts = ALLOC_N(GLsizei,size);
148
- indices = ALLOC_N(GLvoid*,size);
149
- for (i=0;i<size;i++) {
150
- VALUE data;
151
- data = pack_array_or_pass_string(type,RARRAY_PTR(ary)[i]);
152
- indices[i] = RSTRING_PTR(data);
153
- counts[i] = RSTRING_LEN(data);
154
- }
155
- fptr_glMultiDrawElements(mode,counts,type,indices,size);
156
- xfree(counts);
157
- xfree(indices);
158
- break;
159
- case 4:
160
- if (!CheckBufferBinding(GL_ELEMENT_ARRAY_BUFFER_BINDING))
161
- rb_raise(rb_eArgError, "Element array buffer not bound");
162
- mode = (GLenum)NUM2INT(args[0]);
163
- type = (GLenum)NUM2INT(args[1]);
164
- Check_Type(args[2],T_ARRAY);
165
- Check_Type(args[3],T_ARRAY);
166
- if (RARRAY_LEN(args[2]) != RARRAY_LEN(args[3]))
167
- rb_raise(rb_eArgError, "Count and indices offset array must have same length");
168
-
169
- size = RARRAY_LEN(args[2]);
170
-
171
- counts = ALLOC_N(GLsizei,size);
172
- indices = ALLOC_N(GLvoid*,size);
173
- for (i=0;i<size;i++) {
174
- counts[i] = NUM2INT(rb_ary_entry(args[2],i));
175
- indices[i] = (GLvoid *) NUM2INT(rb_ary_entry(args[3],i));
176
- }
177
- fptr_glMultiDrawElements(mode,counts,type,indices,size);
178
- xfree(counts);
179
- xfree(indices);
180
- break;
181
- }
182
- CHECK_GLERROR
183
- return Qnil;
184
- }
185
-
186
- static void (APIENTRY * fptr_glPointParameterfv)(GLenum,GLfloat *);
187
- static VALUE
188
- gl_PointParameterfv(obj,arg1,arg2)
189
- VALUE obj,arg1,arg2;
190
- {
191
- GLenum pname;
192
- GLfloat params[3] = {0.0,0.0,0.0};
193
- GLint size;
194
- LOAD_GL_FUNC(glPointParameterfv,"1.4")
195
- pname = (GLenum)NUM2INT(arg1);
196
- Check_Type(arg2,T_ARRAY);
197
- if (pname==GL_POINT_DISTANCE_ATTENUATION)
198
- size = 3;
199
- else
200
- size = 1;
201
- ary2cflt(arg2,params,size);
202
- fptr_glPointParameterfv(pname,params);
203
- CHECK_GLERROR
204
- return Qnil;
205
- }
206
-
207
- static void (APIENTRY * fptr_glPointParameteriv)(GLenum,GLint *);
208
- static VALUE
209
- gl_PointParameteriv(obj,arg1,arg2)
210
- VALUE obj,arg1,arg2;
211
- {
212
- GLenum pname;
213
- GLint params[3] = {0.0,0.0,0.0};
214
- GLint size;
215
- LOAD_GL_FUNC(glPointParameteriv,"1.4")
216
- pname = (GLenum)NUM2INT(arg1);
217
- Check_Type(arg2,T_ARRAY);
218
- if (pname==GL_POINT_DISTANCE_ATTENUATION)
219
- size = 3;
220
- else
221
- size = 1;
222
- ary2cint(arg2,params,size);
223
- fptr_glPointParameteriv(pname,params);
224
- CHECK_GLERROR
225
- return Qnil;
226
- }
227
-
228
- #define GLSECONDARYCOLOR_VFUNC(_name_,_type_,_conv_) \
229
- static void (APIENTRY * fptr_gl##_name_)(_type_ *); \
230
- VALUE gl_##_name_(VALUE obj,VALUE arg1) \
231
- { \
232
- _type_ cary[3] = {0,0,0}; \
233
- LOAD_GL_FUNC(gl##_name_,"1.4") \
234
- Check_Type(arg1,T_ARRAY); \
235
- _conv_(arg1,cary,3); \
236
- fptr_gl##_name_(cary); \
237
- CHECK_GLERROR \
238
- return Qnil; \
239
- }
240
-
241
- GLSECONDARYCOLOR_VFUNC(SecondaryColor3bv,GLbyte,ary2cbyte)
242
- GLSECONDARYCOLOR_VFUNC(SecondaryColor3dv,GLdouble,ary2cdbl)
243
- GLSECONDARYCOLOR_VFUNC(SecondaryColor3fv,GLfloat,ary2cflt)
244
- GLSECONDARYCOLOR_VFUNC(SecondaryColor3iv,GLint,ary2cint)
245
- GLSECONDARYCOLOR_VFUNC(SecondaryColor3sv,GLshort,ary2cshort)
246
- GLSECONDARYCOLOR_VFUNC(SecondaryColor3uiv,GLuint,ary2cuint)
247
- GLSECONDARYCOLOR_VFUNC(SecondaryColor3ubv,GLubyte,ary2cubyte)
248
- GLSECONDARYCOLOR_VFUNC(SecondaryColor3usv,GLushort,ary2cushort)
249
- #undef GLSECONDARYCOLOR_VFUNC
250
-
251
- extern VALUE g_SecondaryColor_ptr;
252
- static void (APIENTRY * fptr_glSecondaryColorPointer)(GLint,GLenum,GLsizei,const GLvoid *);
253
- static VALUE
254
- gl_SecondaryColorPointer(obj,arg1,arg2,arg3,arg4)
255
- VALUE obj,arg1,arg2,arg3,arg4;
256
- {
257
- GLint size;
258
- GLenum type;
259
- GLsizei stride;
260
- LOAD_GL_FUNC(glSecondaryColorPointer,"1.4")
261
- size = (GLint)NUM2INT(arg1);
262
- type = (GLenum)NUM2INT(arg2);
263
- stride = (GLsizei)NUM2UINT(arg3);
264
- if (CheckBufferBinding(GL_ARRAY_BUFFER_BINDING)) {
265
- g_SecondaryColor_ptr = arg4;
266
- fptr_glSecondaryColorPointer(size,type, stride, (const GLvoid*)NUM2INT(arg4));
267
- } else {
268
- VALUE data;
269
- data = pack_array_or_pass_string(type,arg4);
270
- rb_str_freeze(data);
271
- g_SecondaryColor_ptr = data;
272
- fptr_glSecondaryColorPointer(size,type, stride, (const GLvoid*)RSTRING_PTR(data));
273
- }
274
- CHECK_GLERROR
275
- return Qnil;
276
- }
277
-
278
- #define GLWINDOWPOS_VFUNC(_name_,_type_,_size_,_conv_) \
279
- static void (APIENTRY * fptr_gl##_name_)(_type_ *); \
280
- VALUE gl_##_name_(VALUE obj,VALUE arg1) \
281
- { \
282
- _type_ cary[3] = {0,0,0}; \
283
- LOAD_GL_FUNC(gl##_name_,"1.4") \
284
- Check_Type(arg1,T_ARRAY); \
285
- _conv_(arg1,cary,_size_); \
286
- fptr_gl##_name_(cary); \
287
- CHECK_GLERROR \
288
- return Qnil; \
289
- }
290
-
291
- GLWINDOWPOS_VFUNC(WindowPos2dv,GLdouble,2,ary2cdbl)
292
- GLWINDOWPOS_VFUNC(WindowPos2fv,GLfloat,2,ary2cflt)
293
- GLWINDOWPOS_VFUNC(WindowPos2iv,GLint,2,ary2cint)
294
- GLWINDOWPOS_VFUNC(WindowPos2sv,GLshort,2,ary2cshort)
295
- GLWINDOWPOS_VFUNC(WindowPos3dv,GLdouble,3,ary2cdbl)
296
- GLWINDOWPOS_VFUNC(WindowPos3fv,GLfloat,3,ary2cflt)
297
- GLWINDOWPOS_VFUNC(WindowPos3iv,GLint,3,ary2cint)
298
- GLWINDOWPOS_VFUNC(WindowPos3sv,GLshort,3,ary2cshort)
299
- #undef GLWINDOWPOS_VFUNC
300
-
301
-
302
- void gl_init_functions_1_4(VALUE module)
303
- {
304
- rb_define_module_function(module, "glBlendFuncSeparate", gl_BlendFuncSeparate, 4);
305
- rb_define_module_function(module, "glFogCoordf", gl_FogCoordf, 1);
306
- rb_define_module_function(module, "glFogCoordfv", gl_FogCoordfv, 1);
307
- rb_define_module_function(module, "glFogCoordd", gl_FogCoordd, 1);
308
- rb_define_module_function(module, "glFogCoorddv", gl_FogCoorddv, 1);
309
- rb_define_module_function(module, "glFogCoordPointer", gl_FogCoordPointer, 3);
310
- rb_define_module_function(module, "glMultiDrawArrays", gl_MultiDrawArrays, 3);
311
- rb_define_module_function(module, "glMultiDrawElements", gl_MultiDrawElements, -1);
312
- rb_define_module_function(module, "glPointParameterf", gl_PointParameterf, 2);
313
- rb_define_module_function(module, "glPointParameterfv", gl_PointParameterfv, 2);
314
- rb_define_module_function(module, "glPointParameteri", gl_PointParameteri, 2);
315
- rb_define_module_function(module, "glPointParameteriv", gl_PointParameteriv, 2);
316
- rb_define_module_function(module, "glSecondaryColor3b", gl_SecondaryColor3b, 3);
317
- rb_define_module_function(module, "glSecondaryColor3d", gl_SecondaryColor3d, 3);
318
- rb_define_module_function(module, "glSecondaryColor3f", gl_SecondaryColor3f, 3);
319
- rb_define_module_function(module, "glSecondaryColor3i", gl_SecondaryColor3i, 3);
320
- rb_define_module_function(module, "glSecondaryColor3s", gl_SecondaryColor3s, 3);
321
- rb_define_module_function(module, "glSecondaryColor3ub", gl_SecondaryColor3ub, 3);
322
- rb_define_module_function(module, "glSecondaryColor3ui", gl_SecondaryColor3ui, 3);
323
- rb_define_module_function(module, "glSecondaryColor3us", gl_SecondaryColor3us, 3);
324
- rb_define_module_function(module, "glSecondaryColor3bv", gl_SecondaryColor3bv, 1);
325
- rb_define_module_function(module, "glSecondaryColor3dv", gl_SecondaryColor3dv, 1);
326
- rb_define_module_function(module, "glSecondaryColor3fv", gl_SecondaryColor3fv, 1);
327
- rb_define_module_function(module, "glSecondaryColor3iv", gl_SecondaryColor3iv, 1);
328
- rb_define_module_function(module, "glSecondaryColor3sv", gl_SecondaryColor3sv, 1);
329
- rb_define_module_function(module, "glSecondaryColor3ubv", gl_SecondaryColor3ubv, 1);
330
- rb_define_module_function(module, "glSecondaryColor3uiv", gl_SecondaryColor3uiv, 1);
331
- rb_define_module_function(module, "glSecondaryColor3usv", gl_SecondaryColor3usv, 1);
332
- rb_define_module_function(module, "glSecondaryColorPointer", gl_SecondaryColorPointer, 4);
333
- rb_define_module_function(module, "glWindowPos2d", gl_WindowPos2d, 2);
334
- rb_define_module_function(module, "glWindowPos2f", gl_WindowPos2f, 2);
335
- rb_define_module_function(module, "glWindowPos2i", gl_WindowPos2i, 2);
336
- rb_define_module_function(module, "glWindowPos2s", gl_WindowPos2s, 2);
337
- rb_define_module_function(module, "glWindowPos3d", gl_WindowPos3d, 3);
338
- rb_define_module_function(module, "glWindowPos3f", gl_WindowPos3f, 3);
339
- rb_define_module_function(module, "glWindowPos3i", gl_WindowPos3i, 3);
340
- rb_define_module_function(module, "glWindowPos3s", gl_WindowPos3s, 3);
341
- rb_define_module_function(module, "glWindowPos2dv", gl_WindowPos2dv, 1);
342
- rb_define_module_function(module, "glWindowPos2fv", gl_WindowPos2fv, 1);
343
- rb_define_module_function(module, "glWindowPos2iv", gl_WindowPos2iv, 1);
344
- rb_define_module_function(module, "glWindowPos2sv", gl_WindowPos2sv, 1);
345
- rb_define_module_function(module, "glWindowPos3dv", gl_WindowPos3dv, 1);
346
- rb_define_module_function(module, "glWindowPos3fv", gl_WindowPos3fv, 1);
347
- rb_define_module_function(module, "glWindowPos3iv", gl_WindowPos3iv, 1);
348
- rb_define_module_function(module, "glWindowPos3sv", gl_WindowPos3sv, 1);
349
- }