opengl 0.7.0.pre1-x86-mingw32 → 0.7.0.pre2-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (103) hide show
  1. data/.autotest +29 -0
  2. data/.gitignore +5 -8
  3. data/History.rdoc +33 -0
  4. data/Manifest.txt +72 -57
  5. data/README.rdoc +72 -25
  6. data/Rakefile +60 -72
  7. data/Rakefile.cross +5 -2
  8. data/{doc → docs}/build_install.txt +0 -0
  9. data/{doc → docs}/extensions.txt.in +0 -0
  10. data/{doc → docs}/history.txt +0 -0
  11. data/{doc → docs}/requirements_and_design.txt +0 -0
  12. data/{doc → docs}/roadmap.txt +0 -0
  13. data/{doc → docs}/scientific_use.txt +0 -0
  14. data/{doc → docs}/supplies/page_template.html +0 -0
  15. data/{doc → docs}/thanks.txt +0 -0
  16. data/{doc → docs}/tutorial.txt +0 -0
  17. data/examples/NeHe/NeHe.png +0 -0
  18. data/examples/NeHe/crate.png +0 -0
  19. data/examples/NeHe/glass.png +0 -0
  20. data/examples/NeHe/nehe_lesson02.rb +82 -83
  21. data/examples/NeHe/nehe_lesson03.rb +88 -88
  22. data/examples/NeHe/nehe_lesson04.rb +93 -96
  23. data/examples/NeHe/nehe_lesson05.rb +137 -144
  24. data/examples/NeHe/nehe_lesson06.rb +183 -0
  25. data/examples/NeHe/nehe_lesson07.rb +237 -0
  26. data/examples/NeHe/nehe_lesson08.rb +252 -0
  27. data/examples/NeHe/nehe_lesson09.rb +199 -0
  28. data/examples/NeHe/nehe_lesson11.rb +173 -0
  29. data/examples/NeHe/nehe_lesson12.rb +200 -0
  30. data/examples/NeHe/nehe_lesson16.rb +208 -0
  31. data/examples/NeHe/nehe_lesson19.rb +206 -0
  32. data/examples/NeHe/particle.png +0 -0
  33. data/examples/NeHe/star.png +0 -0
  34. data/examples/NeHe/tim.png +0 -0
  35. data/examples/RedBook/light.rb +154 -0
  36. data/examples/misc/OGLBench.rb +2 -2
  37. data/examples/misc/trislam.rb +2 -2
  38. data/ext/{common → opengl}/common.h +2 -11
  39. data/ext/{common → opengl}/conv.h +43 -31
  40. data/ext/{glut → opengl}/extconf.rb +14 -7
  41. data/ext/{common → opengl}/funcdef.h +155 -125
  42. data/ext/{gl → opengl}/gl-1.0-1.1.c +426 -162
  43. data/ext/{gl → opengl}/gl-1.2.c +70 -66
  44. data/ext/{gl → opengl}/gl-1.3.c +19 -19
  45. data/ext/{gl → opengl}/gl-1.4.c +23 -23
  46. data/ext/{gl → opengl}/gl-1.5.c +46 -47
  47. data/ext/{gl → opengl}/gl-2.0.c +66 -60
  48. data/ext/{gl → opengl}/gl-2.1.c +4 -4
  49. data/ext/{gl → opengl}/gl-enums.c +2 -1
  50. data/ext/{common → opengl}/gl-enums.h +0 -0
  51. data/ext/{gl → opengl}/gl-error.c +12 -4
  52. data/ext/{common → opengl}/gl-error.h +7 -2
  53. data/ext/{gl → opengl}/gl-ext-3dfx.c +1 -1
  54. data/ext/{gl → opengl}/gl-ext-arb.c +75 -70
  55. data/ext/{gl → opengl}/gl-ext-ati.c +3 -3
  56. data/ext/{gl → opengl}/gl-ext-ext.c +54 -54
  57. data/ext/{gl → opengl}/gl-ext-gremedy.c +3 -3
  58. data/ext/{gl → opengl}/gl-ext-nv.c +49 -48
  59. data/ext/{common → opengl}/gl-types.h +0 -0
  60. data/ext/{gl → opengl}/gl.c +8 -10
  61. data/ext/{glu → opengl}/glu-enums.c +1 -1
  62. data/ext/{common → opengl}/glu-enums.h +0 -0
  63. data/ext/{glu → opengl}/glu.c +7 -3
  64. data/ext/{glut → opengl}/glut.c +98 -48
  65. data/ext/opengl/opengl.c +11 -0
  66. data/lib/gl.rb +1 -0
  67. data/lib/glu.rb +1 -0
  68. data/lib/glut.rb +1 -0
  69. data/lib/opengl.rb +13 -14
  70. data/lib/opengl/opengl.so +0 -0
  71. data/lib/opengl/test_case.rb +87 -0
  72. data/test/{tc_misc.rb → test_gl.rb} +2 -14
  73. data/test/test_gl_10_11.rb +1363 -0
  74. data/test/test_gl_12.rb +182 -0
  75. data/test/{tc_func_13.rb → test_gl_13.rb} +14 -14
  76. data/test/test_gl_14.rb +221 -0
  77. data/test/test_gl_15.rb +260 -0
  78. data/test/test_gl_20.rb +430 -0
  79. data/test/test_gl_21.rb +553 -0
  80. data/test/test_gl_ext_arb.rb +526 -0
  81. data/test/{tc_ext_ati.rb → test_gl_ext_ati.rb} +11 -14
  82. data/test/test_gl_ext_ext.rb +608 -0
  83. data/test/{tc_ext_gremedy.rb → test_gl_ext_gremedy.rb} +6 -6
  84. data/test/test_gl_ext_nv.rb +352 -0
  85. data/test/test_glu.rb +309 -0
  86. metadata +159 -102
  87. data/History.txt +0 -36
  88. data/ext/gl/extconf.rb +0 -43
  89. data/ext/glu/extconf.rb +0 -51
  90. data/test/README +0 -10
  91. data/test/tc_common.rb +0 -98
  92. data/test/tc_ext_arb.rb +0 -467
  93. data/test/tc_ext_ext.rb +0 -551
  94. data/test/tc_ext_nv.rb +0 -357
  95. data/test/tc_func_10_11.rb +0 -1281
  96. data/test/tc_func_12.rb +0 -186
  97. data/test/tc_func_14.rb +0 -197
  98. data/test/tc_func_15.rb +0 -270
  99. data/test/tc_func_20.rb +0 -346
  100. data/test/tc_func_21.rb +0 -541
  101. data/test/tc_glu.rb +0 -310
  102. data/test/tc_include_gl.rb +0 -35
  103. data/test/tc_require_gl.rb +0 -34
@@ -15,7 +15,7 @@
15
15
  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
16
16
  */
17
17
 
18
- #include "../common/common.h"
18
+ #include "common.h"
19
19
 
20
20
  /* OpenGL 1.2 functions */
21
21
 
@@ -43,7 +43,7 @@ VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6;
43
43
  GLuint end;
44
44
  GLsizei count;
45
45
  GLenum type;
46
- LOAD_GL_FUNC(glDrawRangeElements,"1.2")
46
+ LOAD_GL_FUNC(glDrawRangeElements, "1.2");
47
47
  mode = (GLenum)NUM2INT(arg1);
48
48
  start = (GLuint)NUM2UINT(arg2);
49
49
  end = (GLuint)NUM2UINT(arg3);
@@ -56,7 +56,7 @@ VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6;
56
56
  data = pack_array_or_pass_string(type,arg6);
57
57
  fptr_glDrawRangeElements(mode, start, end, count, type, RSTRING_PTR(data));
58
58
  }
59
- CHECK_GLERROR
59
+ CHECK_GLERROR_FROM("glDrawRangeElements");
60
60
  return Qnil;
61
61
  }
62
62
 
@@ -70,7 +70,7 @@ VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6;
70
70
  GLsizei width;
71
71
  GLenum format;
72
72
  GLenum type;
73
- LOAD_GL_FUNC(glColorTable,"1.2")
73
+ LOAD_GL_FUNC(glColorTable, "1.2");
74
74
  target = (GLenum)NUM2INT(arg1);
75
75
  internalformat = (GLenum)NUM2INT(arg2);
76
76
  width = (GLsizei)NUM2UINT(arg3);
@@ -84,7 +84,7 @@ VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6;
84
84
  CheckDataSize(type,format,width,data);
85
85
  fptr_glColorTable(target,internalformat,width,format,type,(GLvoid*)RSTRING_PTR(data));
86
86
  }
87
- CHECK_GLERROR
87
+ CHECK_GLERROR_FROM("glColorTable");
88
88
  return Qnil;
89
89
  }
90
90
 
@@ -96,13 +96,13 @@ VALUE obj,arg1,arg2,arg3;
96
96
  GLenum target;
97
97
  GLenum pname;
98
98
  GLfloat params[4] = {(GLfloat)0.0,(GLfloat)0.0,(GLfloat)0.0,(GLfloat)0.0};
99
- LOAD_GL_FUNC(glColorTableParameterfv,"1.2")
99
+ LOAD_GL_FUNC(glColorTableParameterfv, "1.2");
100
100
  target = (GLenum)NUM2INT(arg1);
101
101
  pname = (GLenum)NUM2INT(arg2);
102
102
  Check_Type(arg3,T_ARRAY);
103
103
  ary2cflt(arg3,params,4);
104
104
  fptr_glColorTableParameterfv(target,pname,params);
105
- CHECK_GLERROR
105
+ CHECK_GLERROR_FROM("glColorTableParameterfv");
106
106
  return Qnil;
107
107
  }
108
108
 
@@ -114,13 +114,13 @@ VALUE obj,arg1,arg2,arg3;
114
114
  GLenum target;
115
115
  GLenum pname;
116
116
  GLint params[4] = {0,0,0,0};
117
- LOAD_GL_FUNC(glColorTableParameteriv,"1.2")
117
+ LOAD_GL_FUNC(glColorTableParameteriv, "1.2");
118
118
  target = (GLenum)NUM2INT(arg1);
119
119
  pname = (GLenum)NUM2INT(arg2);
120
120
  Check_Type(arg3,T_ARRAY);
121
121
  ary2cint(arg3,params,4);
122
122
  fptr_glColorTableParameteriv(target,pname,params);
123
- CHECK_GLERROR
123
+ CHECK_GLERROR_FROM("glColorTableParameteriv");
124
124
  return Qnil;
125
125
  }
126
126
 
@@ -134,7 +134,7 @@ VALUE obj,arg1,arg2;
134
134
  GLenum pname;
135
135
  GLfloat params[4] = {(GLfloat)0.0,(GLfloat)0.0,(GLfloat)0.0,(GLfloat)0.0};
136
136
  GLsizei size;
137
- LOAD_GL_FUNC(glGetColorTableParameterfv,"1.2")
137
+ LOAD_GL_FUNC(glGetColorTableParameterfv, "1.2");
138
138
  target = (GLenum)NUM2INT(arg1);
139
139
  pname = (GLenum)NUM2INT(arg2);
140
140
  switch (pname) {
@@ -147,7 +147,8 @@ VALUE obj,arg1,arg2;
147
147
  break;
148
148
  }
149
149
  fptr_glGetColorTableParameterfv(target,pname,params);
150
- RET_ARRAY_OR_SINGLE(size,RETCONV_GLfloat,params)
150
+ RET_ARRAY_OR_SINGLE("glGetColorTableParameterfv", size, RETCONV_GLfloat,
151
+ params);
151
152
  }
152
153
 
153
154
  static void (APIENTRY * fptr_glGetColorTableParameteriv)(GLenum,GLenum,GLint *);
@@ -159,7 +160,7 @@ VALUE obj,arg1,arg2;
159
160
  GLenum pname;
160
161
  GLint params[4] = {0,0,0,0};
161
162
  GLsizei size;
162
- LOAD_GL_FUNC(glGetColorTableParameteriv,"1.2")
163
+ LOAD_GL_FUNC(glGetColorTableParameteriv, "1.2");
163
164
  target = (GLenum)NUM2INT(arg1);
164
165
  pname = (GLenum)NUM2INT(arg2);
165
166
  switch (pname) {
@@ -172,7 +173,8 @@ VALUE obj,arg1,arg2;
172
173
  break;
173
174
  }
174
175
  fptr_glGetColorTableParameteriv(target,pname,params);
175
- RET_ARRAY_OR_SINGLE(size,RETCONV_GLint,params)
176
+ RET_ARRAY_OR_SINGLE("glGetColorTableParameteriv", size, RETCONV_GLint,
177
+ params);
176
178
  }
177
179
 
178
180
  static void (APIENTRY * fptr_glGetColorTable)(GLenum,GLenum,GLenum,GLvoid *);
@@ -185,18 +187,18 @@ VALUE obj,arg1,arg2,arg3;
185
187
  GLenum type;
186
188
  GLsizei width = 0;
187
189
  VALUE data;
188
- LOAD_GL_FUNC(glGetColorTable,"1.2")
189
- LOAD_GL_FUNC(glGetColorTableParameteriv,"1.2")
190
+ LOAD_GL_FUNC(glGetColorTable, "1.2");
191
+ LOAD_GL_FUNC(glGetColorTableParameteriv, "1.2");
190
192
  target = (GLenum)NUM2INT(arg1);
191
193
  format = (GLenum)NUM2INT(arg2);
192
194
  type = (GLenum)NUM2INT(arg3);
193
195
  fptr_glGetColorTableParameteriv(target,GL_COLOR_TABLE_WIDTH,&width);
194
- CHECK_GLERROR
196
+ CHECK_GLERROR_FROM("glGetColorTableParameteriv");
195
197
  data = allocate_buffer_with_string(GetDataSize(type,format,width));
196
198
  FORCE_PIXEL_STORE_MODE
197
199
  fptr_glGetColorTable(target,format,type,(GLvoid*)RSTRING_PTR(data));
198
200
  RESTORE_PIXEL_STORE_MODE
199
- CHECK_GLERROR
201
+ CHECK_GLERROR_FROM("glGetColorTable");
200
202
  return data;
201
203
  }
202
204
 
@@ -210,7 +212,7 @@ VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6;
210
212
  GLsizei count;
211
213
  GLenum format;
212
214
  GLenum type;
213
- LOAD_GL_FUNC(glColorSubTable,"1.2")
215
+ LOAD_GL_FUNC(glColorSubTable, "1.2");
214
216
  target = (GLenum)NUM2INT(arg1);
215
217
  start = (GLsizei)NUM2UINT(arg2);
216
218
  count = (GLsizei)NUM2UINT(arg3);
@@ -224,7 +226,7 @@ VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6;
224
226
  CheckDataSize(type,format,count,data);
225
227
  fptr_glColorSubTable(target,start,count,format,type,RSTRING_PTR(data));
226
228
  }
227
- CHECK_GLERROR
229
+ CHECK_GLERROR_FROM("glColorSubTable");
228
230
  return Qnil;
229
231
  }
230
232
 
@@ -238,7 +240,7 @@ VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6;
238
240
  GLsizei width;
239
241
  GLenum format;
240
242
  GLenum type;
241
- LOAD_GL_FUNC(glConvolutionFilter1D,"1.2")
243
+ LOAD_GL_FUNC(glConvolutionFilter1D, "1.2");
242
244
  target = (GLenum)NUM2INT(arg1);
243
245
  internalformat = (GLenum)NUM2INT(arg2);
244
246
  width = (GLsizei)NUM2UINT(arg3);
@@ -252,7 +254,7 @@ VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6;
252
254
  CheckDataSize(type,format,width,data);
253
255
  fptr_glConvolutionFilter1D(target,internalformat,width,format,type,RSTRING_PTR(data));
254
256
  }
255
- CHECK_GLERROR
257
+ CHECK_GLERROR_FROM("glConvolutionFilter1D");
256
258
  return Qnil;
257
259
  }
258
260
 
@@ -267,7 +269,7 @@ VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7;
267
269
  GLsizei height;
268
270
  GLenum format;
269
271
  GLenum type;
270
- LOAD_GL_FUNC(glConvolutionFilter2D,"1.2")
272
+ LOAD_GL_FUNC(glConvolutionFilter2D, "1.2");
271
273
  target = (GLenum)NUM2INT(arg1);
272
274
  internalformat = (GLenum)NUM2INT(arg2);
273
275
  width = (GLsizei)NUM2UINT(arg3);
@@ -283,7 +285,7 @@ VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7;
283
285
  CheckDataSize(type,format,width*height,data);
284
286
  fptr_glConvolutionFilter2D(target,internalformat,width,height,format,type,RSTRING_PTR(data));
285
287
  }
286
- CHECK_GLERROR
288
+ CHECK_GLERROR_FROM("glConvolutionFilter2D");
287
289
  return Qnil;
288
290
  }
289
291
 
@@ -295,13 +297,13 @@ VALUE obj,arg1,arg2,arg3;
295
297
  GLenum target;
296
298
  GLenum pname;
297
299
  GLfloat params[4] = {(GLfloat)0.0,(GLfloat)0.0,(GLfloat)0.0,(GLfloat)0.0};
298
- LOAD_GL_FUNC(glConvolutionParameterfv,"1.2")
300
+ LOAD_GL_FUNC(glConvolutionParameterfv, "1.2");
299
301
  target = (GLenum)NUM2INT(arg1);
300
302
  pname = (GLenum)NUM2INT(arg2);
301
303
  Check_Type(arg3,T_ARRAY);
302
304
  ary2cflt(arg3,params,4);
303
305
  fptr_glConvolutionParameterfv(target,pname,params);
304
- CHECK_GLERROR
306
+ CHECK_GLERROR_FROM("glConvolutionParameterfv");
305
307
  return Qnil;
306
308
  }
307
309
 
@@ -313,13 +315,13 @@ VALUE obj,arg1,arg2,arg3;
313
315
  GLenum target;
314
316
  GLenum pname;
315
317
  GLint params[4] = {0,0,0,0};
316
- LOAD_GL_FUNC(glConvolutionParameteriv,"1.2")
318
+ LOAD_GL_FUNC(glConvolutionParameteriv, "1.2");
317
319
  target = (GLenum)NUM2INT(arg1);
318
320
  pname = (GLenum)NUM2INT(arg2);
319
321
  Check_Type(arg3,T_ARRAY);
320
322
  ary2cint(arg3,params,4);
321
323
  fptr_glConvolutionParameteriv(target,pname,params);
322
- CHECK_GLERROR
324
+ CHECK_GLERROR_FROM("glConvolutionParameteriv");
323
325
  return Qnil;
324
326
  }
325
327
 
@@ -332,7 +334,7 @@ VALUE obj,arg1,arg2;
332
334
  GLenum pname;
333
335
  GLfloat params[4] = {(GLfloat)0.0,(GLfloat)0.0,(GLfloat)0.0,(GLfloat)0.0};
334
336
  GLsizei size;
335
- LOAD_GL_FUNC(glGetConvolutionParameterfv,"1.2")
337
+ LOAD_GL_FUNC(glGetConvolutionParameterfv, "1.2");
336
338
  target = (GLenum)NUM2INT(arg1);
337
339
  pname = (GLenum)NUM2INT(arg2);
338
340
  switch(pname) {
@@ -346,7 +348,8 @@ VALUE obj,arg1,arg2;
346
348
  break;
347
349
  }
348
350
  fptr_glGetConvolutionParameterfv(target,pname,params);
349
- RET_ARRAY_OR_SINGLE(size,RETCONV_GLfloat,params)
351
+ RET_ARRAY_OR_SINGLE("glGetConvolutionParamaterfv", size, RETCONV_GLfloat,
352
+ params);
350
353
  }
351
354
 
352
355
  static void (APIENTRY * fptr_glGetConvolutionParameteriv)(GLenum,GLenum,GLint *);
@@ -358,7 +361,7 @@ VALUE obj,arg1,arg2;
358
361
  GLenum pname;
359
362
  GLint params[4] = {0,0,0,0};
360
363
  GLsizei size;
361
- LOAD_GL_FUNC(glGetConvolutionParameteriv,"1.2")
364
+ LOAD_GL_FUNC(glGetConvolutionParameteriv, "1.2");
362
365
  target = (GLenum)NUM2INT(arg1);
363
366
  pname = (GLenum)NUM2INT(arg2);
364
367
  switch(pname) {
@@ -372,7 +375,8 @@ VALUE obj,arg1,arg2;
372
375
  break;
373
376
  }
374
377
  fptr_glGetConvolutionParameteriv(target,pname,params);
375
- RET_ARRAY_OR_SINGLE(size,RETCONV_GLint,params)
378
+ RET_ARRAY_OR_SINGLE("glGetConvolutionParameteriv", size, RETCONV_GLint,
379
+ params);
376
380
  }
377
381
 
378
382
  static void (APIENTRY * fptr_glGetConvolutionFilter)(GLenum,GLenum,GLenum,GLvoid *);
@@ -389,8 +393,8 @@ VALUE obj;
389
393
  VALUE data;
390
394
  VALUE args[4];
391
395
  int numargs;
392
- LOAD_GL_FUNC(glGetConvolutionFilter,"1.2")
393
- LOAD_GL_FUNC(glGetConvolutionParameteriv,"1.2")
396
+ LOAD_GL_FUNC(glGetConvolutionFilter, "1.2");
397
+ LOAD_GL_FUNC(glGetConvolutionParameteriv, "1.2");
394
398
  numargs = rb_scan_args(argc, argv, "31", &args[0], &args[1], &args[2], &args[3]);
395
399
  target = (GLenum)NUM2INT(args[0]);
396
400
  format = (GLenum)NUM2INT(args[1]);
@@ -410,12 +414,12 @@ VALUE obj;
410
414
  fptr_glGetConvolutionParameteriv(target,GL_CONVOLUTION_HEIGHT,&size);
411
415
  size *=tmp;
412
416
  }
413
- CHECK_GLERROR
417
+ CHECK_GLERROR_FROM("glGetConvolutionParameteriv");
414
418
  data = allocate_buffer_with_string(GetDataSize(type,format,size));
415
419
  FORCE_PIXEL_STORE_MODE
416
420
  fptr_glGetConvolutionFilter(target,format,type,(GLvoid*)RSTRING_PTR(data));
417
421
  RESTORE_PIXEL_STORE_MODE
418
- CHECK_GLERROR
422
+ CHECK_GLERROR_FROM("glGetConvolutionFilter");
419
423
  return data;
420
424
  case 4:
421
425
  if (!CheckBufferBinding(GL_PIXEL_PACK_BUFFER_BINDING))
@@ -424,7 +428,7 @@ VALUE obj;
424
428
  FORCE_PIXEL_STORE_MODE
425
429
  fptr_glGetConvolutionFilter(target,format,type,(GLvoid*)NUM2LONG(args[3]));
426
430
  RESTORE_PIXEL_STORE_MODE
427
- CHECK_GLERROR
431
+ CHECK_GLERROR_FROM("glGetConvolutionFilter");
428
432
  return Qnil;
429
433
  }
430
434
  }
@@ -446,8 +450,8 @@ VALUE obj;
446
450
  VALUE retary;
447
451
  VALUE args[6];
448
452
  int numargs;
449
- LOAD_GL_FUNC(glGetSeparableFilter,"1.2")
450
- LOAD_GL_FUNC(glGetConvolutionParameteriv,"1.2")
453
+ LOAD_GL_FUNC(glGetSeparableFilter, "1.2");
454
+ LOAD_GL_FUNC(glGetConvolutionParameteriv, "1.2");
451
455
  numargs = rb_scan_args(argc, argv, "33", &args[0], &args[1], &args[2], &args[3], &args[4], &args[5]);
452
456
  target = (GLenum)NUM2INT(args[0]);
453
457
  format = (GLenum)NUM2INT(args[1]);
@@ -461,7 +465,7 @@ VALUE obj;
461
465
 
462
466
  fptr_glGetConvolutionParameteriv(target,GL_CONVOLUTION_WIDTH,&size_row);
463
467
  fptr_glGetConvolutionParameteriv(target,GL_CONVOLUTION_HEIGHT,&size_column);
464
- CHECK_GLERROR
468
+ CHECK_GLERROR_FROM("glGetConvolutionParameteriv");
465
469
  data_row = allocate_buffer_with_string(GetDataSize(type,format,size_row));
466
470
  data_column = allocate_buffer_with_string(GetDataSize(type,format,size_column));
467
471
  FORCE_PIXEL_STORE_MODE
@@ -470,7 +474,7 @@ VALUE obj;
470
474
  retary = rb_ary_new2(2);
471
475
  rb_ary_push(retary, data_row);
472
476
  rb_ary_push(retary, data_column);
473
- CHECK_GLERROR
477
+ CHECK_GLERROR_FROM("glGetSeparableFilter");
474
478
  return retary;
475
479
  break;
476
480
  case 6:
@@ -479,7 +483,7 @@ VALUE obj;
479
483
  FORCE_PIXEL_STORE_MODE
480
484
  fptr_glGetSeparableFilter(target,format,type,(GLvoid*)NUM2LONG(args[3]),(GLvoid*)NUM2LONG(args[4]),(GLvoid*)NUM2LONG(args[5]));
481
485
  RESTORE_PIXEL_STORE_MODE
482
- CHECK_GLERROR
486
+ CHECK_GLERROR_FROM("glGetSeparableFilter");
483
487
  return Qnil;
484
488
  }
485
489
  }
@@ -495,7 +499,7 @@ VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8;
495
499
  GLsizei height;
496
500
  GLenum format;
497
501
  GLenum type;
498
- LOAD_GL_FUNC(glSeparableFilter2D,"1.2")
502
+ LOAD_GL_FUNC(glSeparableFilter2D, "1.2");
499
503
  target = (GLenum)NUM2INT(arg1);
500
504
  internalformat = (GLenum)NUM2INT(arg2);
501
505
  width = (GLsizei)NUM2UINT(arg3);
@@ -513,7 +517,7 @@ VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8;
513
517
  CheckDataSize(type,format,height,data_2);
514
518
  fptr_glSeparableFilter2D(target,internalformat,width,height,format,type,RSTRING_PTR(data_1),RSTRING_PTR(data_2));
515
519
  }
516
- CHECK_GLERROR
520
+ CHECK_GLERROR_FROM("glSeparableFilter2D");
517
521
  return Qnil;
518
522
  }
519
523
 
@@ -525,11 +529,11 @@ VALUE obj,arg1,arg2,arg3;
525
529
  GLenum target;
526
530
  GLenum pname;
527
531
  GLfloat params = (GLfloat)0.0;
528
- LOAD_GL_FUNC(glGetHistogramParameterfv,"1.2")
532
+ LOAD_GL_FUNC(glGetHistogramParameterfv, "1.2");
529
533
  target = (GLenum)NUM2INT(arg1);
530
534
  pname = (GLenum)NUM2INT(arg2);
531
535
  fptr_glGetHistogramParameterfv(target,pname,&params);
532
- CHECK_GLERROR
536
+ CHECK_GLERROR_FROM("glGetHistogramParameterfv");
533
537
  return RETCONV_GLfloat(params);
534
538
  }
535
539
 
@@ -541,11 +545,11 @@ VALUE obj,arg1,arg2,arg3;
541
545
  GLenum target;
542
546
  GLenum pname;
543
547
  GLint params = 0;
544
- LOAD_GL_FUNC(glGetHistogramParameteriv,"1.2")
548
+ LOAD_GL_FUNC(glGetHistogramParameteriv, "1.2");
545
549
  target = (GLenum)NUM2INT(arg1);
546
550
  pname = (GLenum)NUM2INT(arg2);
547
551
  fptr_glGetHistogramParameteriv(target,pname,&params);
548
- CHECK_GLERROR
552
+ CHECK_GLERROR_FROM("glGetHistogramParameteriv");
549
553
  return cond_GLBOOL2RUBY(pname,params);
550
554
  }
551
555
 
@@ -564,11 +568,11 @@ VALUE obj;
564
568
  VALUE data;
565
569
  VALUE args[5];
566
570
  int numargs;
567
- LOAD_GL_FUNC(glGetHistogram,"1.2")
568
- LOAD_GL_FUNC(glGetHistogramParameteriv,"1.2")
571
+ LOAD_GL_FUNC(glGetHistogram, "1.2");
572
+ LOAD_GL_FUNC(glGetHistogramParameteriv, "1.2");
569
573
  numargs = rb_scan_args(argc, argv, "41", &args[0], &args[1], &args[2], &args[3], &args[4]);
570
574
  target = (GLenum)NUM2INT(args[0]);
571
- reset = (GLboolean)NUM2INT(args[1]);
575
+ reset = (GLboolean)RUBYBOOL2GL(args[1]);
572
576
  format = (GLenum)NUM2INT(args[2]);
573
577
  type = (GLenum)NUM2INT(args[3]);
574
578
 
@@ -579,12 +583,12 @@ VALUE obj;
579
583
  rb_raise(rb_eArgError, "Pixel pack buffer bound, but offset argument missing");
580
584
 
581
585
  fptr_glGetHistogramParameteriv(target,GL_HISTOGRAM_WIDTH,&size);
582
- CHECK_GLERROR
586
+ CHECK_GLERROR_FROM("glGetHistogramParameteriv");
583
587
  data = allocate_buffer_with_string(GetDataSize(type,format,size));
584
588
  FORCE_PIXEL_STORE_MODE
585
589
  fptr_glGetHistogram(target,reset,format,type,(GLvoid*)RSTRING_PTR(data));
586
590
  RESTORE_PIXEL_STORE_MODE
587
- CHECK_GLERROR
591
+ CHECK_GLERROR_FROM("glGetHistogram");
588
592
  return data;
589
593
  break;
590
594
  case 5:
@@ -594,7 +598,7 @@ VALUE obj;
594
598
  FORCE_PIXEL_STORE_MODE
595
599
  fptr_glGetHistogram(target,reset,format,type,(GLvoid*)NUM2LONG(args[4]));
596
600
  RESTORE_PIXEL_STORE_MODE
597
- CHECK_GLERROR
601
+ CHECK_GLERROR_FROM("glGetHistogram");
598
602
  return Qnil;
599
603
  }
600
604
  }
@@ -613,10 +617,10 @@ VALUE obj;
613
617
  VALUE data;
614
618
  VALUE args[5];
615
619
  int numargs;
616
- LOAD_GL_FUNC(glGetMinmax,"1.2")
620
+ LOAD_GL_FUNC(glGetMinmax, "1.2");
617
621
  numargs = rb_scan_args(argc, argv, "41", &args[0], &args[1], &args[2], &args[3], &args[4]);
618
622
  target = (GLenum)NUM2INT(args[0]);
619
- reset = (GLboolean)NUM2INT(args[1]);
623
+ reset = (GLboolean)RUBYBOOL2GL(args[1]);
620
624
  format = (GLenum)NUM2INT(args[2]);
621
625
  type = (GLenum)NUM2INT(args[3]);
622
626
 
@@ -630,7 +634,7 @@ VALUE obj;
630
634
  FORCE_PIXEL_STORE_MODE
631
635
  fptr_glGetMinmax(target,reset,format,type,(GLvoid*)RSTRING_PTR(data));
632
636
  RESTORE_PIXEL_STORE_MODE
633
- CHECK_GLERROR
637
+ CHECK_GLERROR_FROM("glGetMinmax");
634
638
  return data;
635
639
  break;
636
640
  case 5:
@@ -640,7 +644,7 @@ VALUE obj;
640
644
  FORCE_PIXEL_STORE_MODE
641
645
  fptr_glGetMinmax(target,reset,format,type,(GLvoid*)NUM2LONG(args[4]));
642
646
  RESTORE_PIXEL_STORE_MODE
643
- CHECK_GLERROR
647
+ CHECK_GLERROR_FROM("glGetMinmax");
644
648
  return Qnil;
645
649
  }
646
650
  }
@@ -653,11 +657,11 @@ VALUE obj,arg1,arg2;
653
657
  GLenum target;
654
658
  GLenum pname;
655
659
  GLfloat params = (GLfloat)0.0;
656
- LOAD_GL_FUNC(glGetMinmaxParameterfv,"1.2")
660
+ LOAD_GL_FUNC(glGetMinmaxParameterfv, "1.2");
657
661
  target = (GLenum)NUM2INT(arg1);
658
662
  pname = (GLenum)NUM2INT(arg2);
659
663
  fptr_glGetMinmaxParameterfv(target,pname,&params);
660
- CHECK_GLERROR
664
+ CHECK_GLERROR_FROM("glGetMinmaxParameterfv");
661
665
  return RETCONV_GLfloat(params);
662
666
  }
663
667
 
@@ -669,11 +673,11 @@ VALUE obj,arg1,arg2;
669
673
  GLenum target;
670
674
  GLenum pname;
671
675
  GLint params = 0;
672
- LOAD_GL_FUNC(glGetMinmaxParameteriv,"1.2")
676
+ LOAD_GL_FUNC(glGetMinmaxParameteriv, "1.2");
673
677
  target = (GLenum)NUM2INT(arg1);
674
678
  pname = (GLenum)NUM2INT(arg2);
675
679
  fptr_glGetMinmaxParameteriv(target,pname,&params);
676
- CHECK_GLERROR
680
+ CHECK_GLERROR_FROM("glGetMinmaxParameteriv");
677
681
  return cond_GLBOOL2RUBY(pname,params);
678
682
  }
679
683
 
@@ -692,7 +696,7 @@ VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10;
692
696
  GLenum format;
693
697
  GLenum type;
694
698
  const char *pixels;
695
- LOAD_GL_FUNC(glTexImage3D,"1.2")
699
+ LOAD_GL_FUNC(glTexImage3D, "1.2");
696
700
  target = (GLenum)NUM2INT(arg1);
697
701
  level = (GLint)NUM2INT(arg2);
698
702
  internalFormat = (GLint)NUM2INT(arg3);
@@ -706,7 +710,7 @@ VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10;
706
710
  if (CheckBufferBinding(GL_PIXEL_UNPACK_BUFFER_BINDING)) {
707
711
  fptr_glTexImage3D( target, level, internalFormat, width, height,
708
712
  depth, border, format, type,(GLvoid *)NUM2LONG(arg10));
709
- CHECK_GLERROR
713
+ CHECK_GLERROR_FROM("glTexImage3D");
710
714
  return Qnil;
711
715
  }
712
716
 
@@ -725,7 +729,7 @@ VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10;
725
729
  }
726
730
  fptr_glTexImage3D( target, level, internalFormat, width, height,
727
731
  depth, border, format, type,pixels);
728
- CHECK_GLERROR
732
+ CHECK_GLERROR_FROM("glTexImage3D");
729
733
  return Qnil;
730
734
  }
731
735
 
@@ -744,7 +748,7 @@ VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11;
744
748
  GLsizei depth;
745
749
  GLenum format;
746
750
  GLenum type;
747
- LOAD_GL_FUNC(glTexSubImage3D,"1.2")
751
+ LOAD_GL_FUNC(glTexSubImage3D, "1.2");
748
752
  target = (GLenum)NUM2INT(arg1);
749
753
  level = (GLint)NUM2INT(arg2);
750
754
  xoffset = (GLint)NUM2INT(arg3);
@@ -767,7 +771,7 @@ VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11;
767
771
  width, height, depth,
768
772
  format, type, RSTRING_PTR(data));
769
773
  }
770
- CHECK_GLERROR
774
+ CHECK_GLERROR_FROM("glTexSubImage3D");
771
775
  return Qnil;
772
776
  }
773
777