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
@@ -13,7 +13,7 @@
13
13
  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
14
14
  */
15
15
 
16
- #include "../common/common.h"
16
+ #include "common.h"
17
17
 
18
18
  /* OpenGL ATI extensions */
19
19
 
@@ -23,14 +23,14 @@ static VALUE gl_DrawBuffersATI(VALUE obj,VALUE arg1)
23
23
  {
24
24
  GLsizei size;
25
25
  GLenum *buffers;
26
- LOAD_GL_FUNC(glDrawBuffersATI,"GL_ATI_draw_buffers")
26
+ LOAD_GL_FUNC(glDrawBuffersATI, "GL_ATI_draw_buffers");
27
27
  Check_Type(arg1,T_ARRAY);
28
28
  size = (GLsizei)RARRAY_LENINT(arg1);
29
29
  buffers = ALLOC_N(GLenum,size);
30
30
  ary2cuint(arg1,buffers,size);
31
31
  fptr_glDrawBuffersATI(size,buffers);
32
32
  xfree(buffers);
33
- CHECK_GLERROR
33
+ CHECK_GLERROR_FROM("glDrawBuffersATI");
34
34
  return Qnil;
35
35
  }
36
36
 
@@ -13,7 +13,7 @@
13
13
  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
14
14
  */
15
15
 
16
- #include "../common/common.h"
16
+ #include "common.h"
17
17
 
18
18
  /* OpenGL EXT extensions */
19
19
  /* Those are extensions that are not blessed by ARB committee but were
@@ -38,19 +38,19 @@ VALUE obj,arg1,arg2;
38
38
  GLuint *textures;
39
39
  GLclampf *priorities;
40
40
  GLsizei size;
41
- LOAD_GL_FUNC(glPrioritizeTexturesEXT,"GL_EXT_texture_object")
41
+ LOAD_GL_FUNC(glPrioritizeTexturesEXT, "GL_EXT_texture_object");
42
42
  Check_Type(arg1,T_ARRAY);
43
43
  Check_Type(arg2,T_ARRAY);
44
44
  if ((size = (GLsizei)RARRAY_LENINT(arg1)) != (GLsizei)RARRAY_LENINT(arg2))
45
45
  rb_raise(rb_eArgError, "passed arrays must have the same length");
46
46
  textures = ALLOC_N(GLuint,size);
47
47
  priorities = ALLOC_N(GLclampf,size);
48
- ary2cuint(arg1,textures,size);
49
- ary2cflt(arg2,priorities,size);
48
+ ary2cuint(arg1,textures,size);
49
+ ary2cflt(arg2,priorities,size);
50
50
  fptr_glPrioritizeTexturesEXT(size,textures,priorities);
51
51
  xfree(textures);
52
52
  xfree(priorities);
53
- CHECK_GLERROR
53
+ CHECK_GLERROR_FROM("glPrioritizeTexturesEXT");
54
54
  return Qnil;
55
55
  }
56
56
 
@@ -66,12 +66,12 @@ VALUE obj,arg1;
66
66
  VALUE retary;
67
67
  VALUE ary;
68
68
  int i;
69
- LOAD_GL_FUNC(glAreTexturesResidentEXT,"GL_EXT_texture_object")
69
+ LOAD_GL_FUNC(glAreTexturesResidentEXT, "GL_EXT_texture_object");
70
70
  ary = rb_Array(arg1);
71
71
  size = (GLsizei)RARRAY_LENINT(ary);
72
72
  textures = ALLOC_N(GLuint,size);
73
73
  residences = ALLOC_N(GLboolean,size);
74
- ary2cuint(ary,textures,size);
74
+ ary2cuint(ary,textures,size);
75
75
  r = fptr_glAreTexturesResidentEXT(size,textures,residences);
76
76
  retary = rb_ary_new2(size);
77
77
  if (r==GL_TRUE) { /* all are resident */
@@ -83,7 +83,7 @@ VALUE obj,arg1;
83
83
  }
84
84
  xfree(textures);
85
85
  xfree(residences);
86
- CHECK_GLERROR
86
+ CHECK_GLERROR_FROM("glAreTexturesResidentEXT");
87
87
  return retary;
88
88
  }
89
89
 
@@ -101,7 +101,7 @@ static VALUE gl_PointParameterfvEXT(VALUE obj,VALUE arg1,VALUE arg2)
101
101
  GLfloat params[3] = {(GLfloat)0.0,(GLfloat)0.0,(GLfloat)0.0};
102
102
  GLenum pname;
103
103
  GLint size;
104
- LOAD_GL_FUNC(glPointParameterfvEXT,"GL_EXT_point_parameters")
104
+ LOAD_GL_FUNC(glPointParameterfvEXT, "GL_EXT_point_parameters");
105
105
  pname = NUM2UINT(arg1);
106
106
  Check_Type(arg2,T_ARRAY);
107
107
  if (pname==GL_POINT_DISTANCE_ATTENUATION)
@@ -110,7 +110,7 @@ static VALUE gl_PointParameterfvEXT(VALUE obj,VALUE arg1,VALUE arg2)
110
110
  size = 1;
111
111
  ary2cflt(arg2,params,size);
112
112
  fptr_glPointParameterfvEXT(pname,params);
113
- CHECK_GLERROR
113
+ CHECK_GLERROR_FROM("glPointParameterfvEXT");
114
114
  return Qnil;
115
115
  }
116
116
 
@@ -129,11 +129,11 @@ static void (APIENTRY * fptr_gl##_name_)(_type_ *); \
129
129
  VALUE gl_##_name_(VALUE obj,VALUE arg1) \
130
130
  { \
131
131
  _type_ cary[3] = {0,0,0}; \
132
- LOAD_GL_FUNC(gl##_name_,"GL_EXT_secondary_color") \
132
+ LOAD_GL_FUNC(gl##_name_, "GL_EXT_secondary_color"); \
133
133
  Check_Type(arg1,T_ARRAY); \
134
134
  _conv_(arg1,cary,3); \
135
135
  fptr_gl##_name_(cary); \
136
- CHECK_GLERROR \
136
+ CHECK_GLERROR_FROM("gl" #_name_); \
137
137
  return Qnil; \
138
138
  }
139
139
 
@@ -156,7 +156,7 @@ VALUE obj,arg1,arg2,arg3,arg4;
156
156
  GLint size;
157
157
  GLenum type;
158
158
  GLsizei stride;
159
- LOAD_GL_FUNC(glSecondaryColorPointerEXT,"GL_EXT_secondary_color")
159
+ LOAD_GL_FUNC(glSecondaryColorPointerEXT, "GL_EXT_secondary_color");
160
160
  size = (GLint)NUM2INT(arg1);
161
161
  type = (GLenum)NUM2INT(arg2);
162
162
  stride = (GLsizei)NUM2UINT(arg3);
@@ -170,7 +170,7 @@ VALUE obj,arg1,arg2,arg3,arg4;
170
170
  g_SecondaryColor_ptr = data;
171
171
  fptr_glSecondaryColorPointerEXT(size,type, stride, (const GLvoid*)RSTRING_PTR(data));
172
172
  }
173
- CHECK_GLERROR
173
+ CHECK_GLERROR_FROM("glSecondaryColorPointerEXT");
174
174
  return Qnil;
175
175
  }
176
176
 
@@ -189,7 +189,7 @@ VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6;
189
189
  GLuint end;
190
190
  GLsizei count;
191
191
  GLenum type;
192
- LOAD_GL_FUNC(glDrawRangeElementsEXT,"GL_EXT_draw_range_elements")
192
+ LOAD_GL_FUNC(glDrawRangeElementsEXT, "GL_EXT_draw_range_elements");
193
193
  mode = (GLenum)NUM2INT(arg1);
194
194
  start = (GLuint)NUM2UINT(arg2);
195
195
  end = (GLuint)NUM2UINT(arg3);
@@ -202,7 +202,7 @@ VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6;
202
202
  data = pack_array_or_pass_string(type,arg6);
203
203
  fptr_glDrawRangeElementsEXT(mode, start, end, count, type, RSTRING_PTR(data));
204
204
  }
205
- CHECK_GLERROR
205
+ CHECK_GLERROR_FROM("glDrawRangeElementsEXT");
206
206
  return Qnil;
207
207
  }
208
208
 
@@ -216,7 +216,7 @@ VALUE obj,arg1,arg2,arg3;
216
216
  GLint *ary1;
217
217
  GLsizei *ary2;
218
218
  int len1,len2;
219
- LOAD_GL_FUNC(glMultiDrawArraysEXT,"GL_EXT_multi_draw_arrays")
219
+ LOAD_GL_FUNC(glMultiDrawArraysEXT, "GL_EXT_multi_draw_arrays");
220
220
  len1 = (int)RARRAY_LENINT(arg2);
221
221
  len2 = (int)RARRAY_LENINT(arg3);
222
222
  if (len1!=len2)
@@ -229,7 +229,7 @@ VALUE obj,arg1,arg2,arg3;
229
229
  fptr_glMultiDrawArraysEXT(mode,ary1,ary2,len1);
230
230
  xfree(ary1);
231
231
  xfree(ary2);
232
- CHECK_GLERROR
232
+ CHECK_GLERROR_FROM("glMultiDrawArraysEXT");
233
233
  return Qnil;
234
234
  }
235
235
 
@@ -247,7 +247,7 @@ VALUE obj;
247
247
  GLint size;
248
248
  int i;
249
249
  VALUE ary, args[4];
250
- LOAD_GL_FUNC(glMultiDrawElementsEXT,"GL_EXT_multi_draw_arrays")
250
+ LOAD_GL_FUNC(glMultiDrawElementsEXT, "GL_EXT_multi_draw_arrays");
251
251
  switch (rb_scan_args(argc, argv, "31", &args[0], &args[1], &args[2],&args[3])) {
252
252
  default:
253
253
  case 3:
@@ -294,7 +294,7 @@ VALUE obj;
294
294
  xfree(indices);
295
295
  break;
296
296
  }
297
- CHECK_GLERROR
297
+ CHECK_GLERROR_FROM("glMultiDrawElementsEXT");
298
298
  return Qnil;
299
299
  }
300
300
 
@@ -307,11 +307,11 @@ static void (APIENTRY * fptr_gl##_name_)(_type_ *); \
307
307
  VALUE gl_##_name_(VALUE obj,VALUE arg1) \
308
308
  { \
309
309
  _type_ cary = 0; \
310
- LOAD_GL_FUNC(gl##_name_,"GL_EXT_secondary_color") \
310
+ LOAD_GL_FUNC(gl##_name_, "GL_EXT_secondary_color"); \
311
311
  Check_Type(arg1,T_ARRAY); \
312
312
  _conv_(arg1,&cary,1); \
313
313
  fptr_gl##_name_(&cary); \
314
- CHECK_GLERROR \
314
+ CHECK_GLERROR_FROM("gl" #_name_); \
315
315
  return Qnil; \
316
316
  }
317
317
  GLFOGCOORD_VFUNC(FogCoordfvEXT,GLfloat,ary2cflt)
@@ -326,7 +326,7 @@ VALUE obj,arg1,arg2,arg3;
326
326
  {
327
327
  GLenum type;
328
328
  GLsizei stride;
329
- LOAD_GL_FUNC(glFogCoordPointerEXT,"GL_EXT_secondary_color")
329
+ LOAD_GL_FUNC(glFogCoordPointerEXT, "GL_EXT_secondary_color");
330
330
  type = (GLenum)NUM2INT(arg1);
331
331
  stride = (GLsizei)NUM2UINT(arg2);
332
332
  if (CheckBufferBinding(GL_ARRAY_BUFFER_BINDING)) {
@@ -339,7 +339,7 @@ VALUE obj,arg1,arg2,arg3;
339
339
  g_FogCoord_ptr = data;
340
340
  fptr_glFogCoordPointerEXT(type, stride, (const GLvoid*)RSTRING_PTR(data));
341
341
  }
342
- CHECK_GLERROR
342
+ CHECK_GLERROR_FROM("glFogCoordPointerEXT");
343
343
  return Qnil;
344
344
  }
345
345
 
@@ -366,9 +366,9 @@ static void (APIENTRY * fptr_glGetRenderbufferParameterivEXT)(GLenum,GLenum,GLin
366
366
  static VALUE gl_GetRenderbufferParameterivEXT(VALUE obj,VALUE arg1,VALUE arg2)
367
367
  {
368
368
  GLint param = 0;
369
- LOAD_GL_FUNC(glGetRenderbufferParameterivEXT,"GL_EXT_framebuffer_object")
369
+ LOAD_GL_FUNC(glGetRenderbufferParameterivEXT, "GL_EXT_framebuffer_object");
370
370
  fptr_glGetRenderbufferParameterivEXT(NUM2UINT(arg1),NUM2UINT(arg2),&param);
371
- CHECK_GLERROR
371
+ CHECK_GLERROR_FROM("glGetRenderbufferParameterivEXT");
372
372
  return INT2NUM(param);
373
373
  }
374
374
 
@@ -387,9 +387,9 @@ static void (APIENTRY * fptr_glGetFramebufferAttachmentParameterivEXT)(GLenum,GL
387
387
  static VALUE gl_GetFramebufferAttachmentParameterivEXT(VALUE obj,VALUE arg1, VALUE arg2, VALUE arg3)
388
388
  {
389
389
  GLint ret = 0;
390
- LOAD_GL_FUNC(glGetFramebufferAttachmentParameterivEXT,"GL_EXT_framebuffer_object")
390
+ LOAD_GL_FUNC(glGetFramebufferAttachmentParameterivEXT, "GL_EXT_framebuffer_object");
391
391
  fptr_glGetFramebufferAttachmentParameterivEXT(NUM2UINT(arg1),NUM2UINT(arg2),NUM2UINT(arg3),&ret);
392
- CHECK_GLERROR
392
+ CHECK_GLERROR_FROM("glGetFramebufferAttachmentParameterivEXT");
393
393
  return cond_GLBOOL2RUBY(NUM2UINT(arg3),ret);
394
394
  }
395
395
 
@@ -411,9 +411,9 @@ static void (APIENTRY * fptr_gl##_name_)(GLuint,GLenum,_type_ *); \
411
411
  static VALUE gl_##_name_(VALUE obj,VALUE arg1,VALUE arg2) \
412
412
  { \
413
413
  _type_ ret = 0; \
414
- LOAD_GL_FUNC(gl##_name_,"GL_EXT_timer_query") \
414
+ LOAD_GL_FUNC(gl##_name_, "GL_EXT_timer_query"); \
415
415
  fptr_gl##_name_(NUM2INT(arg1),NUM2INT(arg2),&ret); \
416
- CHECK_GLERROR \
416
+ CHECK_GLERROR_FROM("gl" #_name_); \
417
417
  return _conv_(NUM2INT(arg2),ret); \
418
418
  }
419
419
 
@@ -431,7 +431,7 @@ VALUE obj,arg1,arg2,arg3; \
431
431
  { \
432
432
  _type_ *cary; \
433
433
  GLsizei len; \
434
- LOAD_GL_FUNC(gl##_name_,_extension_) \
434
+ LOAD_GL_FUNC(gl##_name_, _extension_); \
435
435
  len = (GLsizei)RARRAY_LENINT(rb_Array(arg3)); \
436
436
  if (len<=0 || (len % 4) != 0) \
437
437
  rb_raise(rb_eArgError, "Parameter array size must be multiplication of 4"); \
@@ -439,7 +439,7 @@ VALUE obj,arg1,arg2,arg3; \
439
439
  _conv_(arg3,cary,len); \
440
440
  fptr_gl##_name_((GLenum)NUM2UINT(arg1),(GLuint)NUM2UINT(arg2),len / 4, cary); \
441
441
  xfree(cary); \
442
- CHECK_GLERROR \
442
+ CHECK_GLERROR_FROM("gl" #_name_); \
443
443
  return Qnil; \
444
444
  }
445
445
 
@@ -467,10 +467,10 @@ gl_##_name_(obj,arg1,arg2) \
467
467
  VALUE obj,arg1,arg2; \
468
468
  { \
469
469
  _type_ value[_size_]; \
470
- LOAD_GL_FUNC(gl##_name_,"GL_ARB_shader_objects") \
470
+ LOAD_GL_FUNC(gl##_name_, "GL_ARB_shader_objects"); \
471
471
  _conv_(arg2,value,_size_); \
472
472
  fptr_gl##_name_(NUM2UINT(arg1),value); \
473
- CHECK_GLERROR \
473
+ CHECK_GLERROR_FROM("gl" #_name_); \
474
474
  return Qnil; \
475
475
  }
476
476
 
@@ -498,7 +498,7 @@ VALUE obj,arg1,arg2; \
498
498
  GLenum pname; \
499
499
  _type_ params[4] = {0,0,0,0}; \
500
500
  GLint size; \
501
- LOAD_GL_FUNC(gl##_name_,_extension_) \
501
+ LOAD_GL_FUNC(gl##_name_, _extension_); \
502
502
  index = (GLuint)NUM2UINT(arg1); \
503
503
  pname = (GLenum)NUM2INT(arg2); \
504
504
  if (pname==GL_CURRENT_VERTEX_ATTRIB_ARB) \
@@ -506,7 +506,7 @@ VALUE obj,arg1,arg2; \
506
506
  else \
507
507
  size = 1; \
508
508
  fptr_gl##_name_(index,pname,params); \
509
- RET_ARRAY_OR_SINGLE_BOOL(size,_conv_,pname,params) \
509
+ RET_ARRAY_OR_SINGLE_BOOL("gl" #_name_, size, _conv_, pname, params); \
510
510
  }
511
511
 
512
512
  GETVERTEXATTRIB_FUNC(GetVertexAttribIivEXT,GLint,cond_GLBOOL2RUBY,"GL_EXT_gpu_shader4")
@@ -523,7 +523,7 @@ static VALUE gl_VertexAttribIPointerEXT(VALUE obj,VALUE arg1,VALUE arg2,VALUE ar
523
523
  GLenum type;
524
524
  GLsizei stride;
525
525
 
526
- LOAD_GL_FUNC(glVertexAttribIPointerEXT,"GL_EXT_gpu_shader4")
526
+ LOAD_GL_FUNC(glVertexAttribIPointerEXT, "GL_EXT_gpu_shader4");
527
527
 
528
528
  index = (GLuint)NUM2UINT(arg1);
529
529
  size = (GLuint)NUM2UINT(arg2);
@@ -543,7 +543,7 @@ static VALUE gl_VertexAttribIPointerEXT(VALUE obj,VALUE arg1,VALUE arg2,VALUE ar
543
543
  fptr_glVertexAttribIPointerEXT(index,size,type,stride,(GLvoid *)RSTRING_PTR(data));
544
544
  }
545
545
 
546
- CHECK_GLERROR
546
+ CHECK_GLERROR_FROM("glVertexAttribIPointerEXT");
547
547
  return Qnil;
548
548
  }
549
549
 
@@ -561,7 +561,7 @@ VALUE obj,arg1,arg2; \
561
561
  GLint location; \
562
562
  GLsizei count; \
563
563
  _type_ *value; \
564
- LOAD_GL_FUNC(gl##_name_,"GL_EXT_gpu_shader4") \
564
+ LOAD_GL_FUNC(gl##_name_, "GL_EXT_gpu_shader4"); \
565
565
  Check_Type(arg2,T_ARRAY); \
566
566
  count = (GLsizei)RARRAY_LENINT(arg2); \
567
567
  if (count<=0 || (count % _size_) != 0) \
@@ -571,7 +571,7 @@ VALUE obj,arg1,arg2; \
571
571
  _conv_(arg2,value,count); \
572
572
  fptr_gl##_name_(location,count / _size_,value); \
573
573
  xfree(value); \
574
- CHECK_GLERROR \
574
+ CHECK_GLERROR_FROM("gl" #_name_); \
575
575
  return Qnil; \
576
576
  }
577
577
 
@@ -595,13 +595,13 @@ VALUE obj,arg1,arg2; \
595
595
  GLenum uniform_type = 0; \
596
596
  GLint uniform_size = 0; \
597
597
  \
598
- LOAD_GL_FUNC(gl##_name_,"GL_EXT_gpu_shader4") \
599
- LOAD_GL_FUNC(glGetActiveUniformARB,"GL_ARB_shader_objects") \
598
+ LOAD_GL_FUNC(gl##_name_, "GL_EXT_gpu_shader4"); \
599
+ LOAD_GL_FUNC(glGetActiveUniformARB, "GL_ARB_shader_objects"); \
600
600
  program = (GLuint)NUM2UINT(arg1); \
601
601
  location = (GLint)NUM2INT(arg2); \
602
602
  \
603
603
  fptr_glGetActiveUniformARB(program,location,0,NULL,&unused,&uniform_type,NULL); \
604
- CHECK_GLERROR \
604
+ CHECK_GLERROR_FROM("glGetActiveUniformARB"); \
605
605
  if (uniform_type==0) \
606
606
  rb_raise(rb_eTypeError, "Can't determine the uniform's type"); \
607
607
  \
@@ -609,7 +609,7 @@ VALUE obj,arg1,arg2; \
609
609
  \
610
610
  memset(params,0,16*sizeof(_type_)); \
611
611
  fptr_gl##_name_(program,location,params); \
612
- RET_ARRAY_OR_SINGLE(uniform_size,RETCONV_##_type_,params) \
612
+ RET_ARRAY_OR_SINGLE("gl" #_name_, uniform_size, RETCONV_##_type_, params); \
613
613
  }
614
614
 
615
615
  GETUNIFORM_FUNC(GetUniformuivEXT,GLuint)
@@ -618,10 +618,10 @@ GETUNIFORM_FUNC(GetUniformuivEXT,GLuint)
618
618
  static void (APIENTRY * fptr_glBindFragDataLocationEXT)(GLuint,GLuint,const GLchar *);
619
619
  static VALUE gl_BindFragDataLocationEXT(VALUE obj,VALUE arg1,VALUE arg2,VALUE arg3)
620
620
  {
621
- LOAD_GL_FUNC(glBindFragDataLocationEXT,"GL_EXT_gpu_shader4")
621
+ LOAD_GL_FUNC(glBindFragDataLocationEXT, "GL_EXT_gpu_shader4");
622
622
  Check_Type(arg3,T_STRING);
623
623
  fptr_glBindFragDataLocationEXT(NUM2UINT(arg1),NUM2UINT(arg2),RSTRING_PTR(arg3));
624
- CHECK_GLERROR
624
+ CHECK_GLERROR_FROM("glBindFragDataLocationEXT");
625
625
  return Qnil;
626
626
  }
627
627
 
@@ -629,10 +629,10 @@ static GLint (APIENTRY * fptr_glGetFragDataLocationEXT)(GLuint,const GLchar *);
629
629
  static VALUE gl_GetFragDataLocationEXT(VALUE obj,VALUE arg1,VALUE arg2)
630
630
  {
631
631
  GLint ret;
632
- LOAD_GL_FUNC(glGetFragDataLocationEXT,"GL_EXT_gpu_shader4")
632
+ LOAD_GL_FUNC(glGetFragDataLocationEXT, "GL_EXT_gpu_shader4");
633
633
  Check_Type(arg2,T_STRING);
634
634
  ret = fptr_glGetFragDataLocationEXT(NUM2UINT(arg1),RSTRING_PTR(arg2));
635
- CHECK_GLERROR
635
+ CHECK_GLERROR_FROM("glGetFragDataLocationEXT");
636
636
  return INT2NUM(ret);
637
637
  }
638
638
 
@@ -647,7 +647,7 @@ VALUE obj,arg1,arg2,arg3,arg4,arg5;
647
647
  GLsizei count;
648
648
  GLenum type;
649
649
  GLsizei primcount;
650
- LOAD_GL_FUNC(glDrawElementsInstancedEXT,"GL_EXT_draw_instanced")
650
+ LOAD_GL_FUNC(glDrawElementsInstancedEXT, "GL_EXT_draw_instanced");
651
651
  mode = (GLenum)NUM2INT(arg1);
652
652
  count = (GLsizei)NUM2UINT(arg2);
653
653
  type = (GLenum)NUM2INT(arg3);
@@ -659,7 +659,7 @@ VALUE obj,arg1,arg2,arg3,arg4,arg5;
659
659
  data = pack_array_or_pass_string(type,arg4);
660
660
  fptr_glDrawElementsInstancedEXT(mode, count, type, (const GLvoid*)RSTRING_PTR(data), primcount);
661
661
  }
662
- CHECK_GLERROR
662
+ CHECK_GLERROR_FROM("glDrawArraysInstancedEXT");
663
663
  return Qnil;
664
664
  }
665
665
 
@@ -679,13 +679,13 @@ VALUE obj,arg1,arg2,arg3; \
679
679
  GLenum target; \
680
680
  GLenum pname; \
681
681
  _type_ params[4] = {0,0,0,0}; \
682
- LOAD_GL_FUNC(gl##_name_,"GL_EXT_texture_integer") \
682
+ LOAD_GL_FUNC(gl##_name_, "GL_EXT_texture_integer"); \
683
683
  target = (GLenum)NUM2UINT(arg1); \
684
684
  pname = (GLenum)NUM2UINT(arg2); \
685
685
  Check_Type(arg3,T_ARRAY); \
686
686
  _conv_(arg3,params,4); \
687
687
  fptr_gl##_name_(target,pname,params); \
688
- CHECK_GLERROR \
688
+ CHECK_GLERROR_FROM("gl" #_name_); \
689
689
  return Qnil; \
690
690
  }
691
691
 
@@ -703,7 +703,7 @@ VALUE obj,arg1,arg2; \
703
703
  GLenum pname; \
704
704
  _type_ params[4] = {0,0,0,0}; \
705
705
  int size; \
706
- LOAD_GL_FUNC(gl##_name_,"GL_EXT_texture_integer") \
706
+ LOAD_GL_FUNC(gl##_name_, "GL_EXT_texture_integer"); \
707
707
  target = (GLenum)NUM2INT(arg1); \
708
708
  pname = (GLenum)NUM2INT(arg2); \
709
709
  switch(pname) { \
@@ -718,7 +718,7 @@ VALUE obj,arg1,arg2; \
718
718
  break; \
719
719
  } \
720
720
  fptr_gl##_name_(target,pname,params); \
721
- RET_ARRAY_OR_SINGLE_BOOL(size,_conv_,pname,params) \
721
+ RET_ARRAY_OR_SINGLE_BOOL("gl" #_name_, size, _conv_, pname, params); \
722
722
  }
723
723
 
724
724
  GETTEXPARAMETER_VFUNC(GetTexParameterIivEXT,GLint,cond_GLBOOL2RUBY)
@@ -13,7 +13,7 @@
13
13
  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
14
14
  */
15
15
 
16
- #include "../common/common.h"
16
+ #include "common.h"
17
17
 
18
18
  /* Graphic Remedy extensions */
19
19
 
@@ -21,10 +21,10 @@
21
21
  static void (APIENTRY * fptr_glStringMarkerGREMEDY)(GLsizei,const void *);
22
22
  static VALUE gl_StringMarkerGREMEDY(VALUE obj,VALUE arg1)
23
23
  {
24
- LOAD_GL_FUNC(glStringMarkerGREMEDY,"GL_GREMEDY_string_marker")
24
+ LOAD_GL_FUNC(glStringMarkerGREMEDY, "GL_GREMEDY_string_marker");
25
25
  Check_Type(arg1,T_STRING);
26
26
  fptr_glStringMarkerGREMEDY((GLsizei)RSTRING_LENINT(arg1),RSTRING_PTR(arg1));
27
- CHECK_GLERROR
27
+ CHECK_GLERROR_FROM("glStringMarkerGREMEDY");
28
28
  return Qnil;
29
29
  }
30
30
 
@@ -13,7 +13,7 @@
13
13
  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
14
14
  */
15
15
 
16
- #include "../common/common.h"
16
+ #include "common.h"
17
17
 
18
18
  /* OpenGL NVIDIA extensions */
19
19
 
@@ -29,9 +29,9 @@ static void (APIENTRY * fptr_glGetFenceivNV)(GLuint,GLenum,GLint *);
29
29
  static VALUE gl_GetFenceivNV(VALUE obj,VALUE arg1,VALUE arg2)
30
30
  {
31
31
  GLint ret = 0;
32
- LOAD_GL_FUNC(glGetFenceivNV,"GL_NV_fence")
32
+ LOAD_GL_FUNC(glGetFenceivNV, "GL_NV_fence");
33
33
  fptr_glGetFenceivNV(NUM2INT(arg1),NUM2INT(arg2),&ret);
34
- CHECK_GLERROR
34
+ CHECK_GLERROR_FROM("glGetFenceivNV");
35
35
  return cond_GLBOOL2RUBY(NUM2INT(arg2),ret);
36
36
  }
37
37
 
@@ -39,10 +39,10 @@ static VALUE gl_GetFenceivNV(VALUE obj,VALUE arg1,VALUE arg2)
39
39
  static void (APIENTRY * fptr_glLoadProgramNV)(GLenum,GLuint,GLsizei,const GLubyte *);
40
40
  static VALUE gl_LoadProgramNV(VALUE obj,VALUE arg1,VALUE arg2,VALUE arg3)
41
41
  {
42
- LOAD_GL_FUNC(glLoadProgramNV,"GL_NV_vertex_program")
42
+ LOAD_GL_FUNC(glLoadProgramNV, "GL_NV_vertex_program");
43
43
  Check_Type(arg3,T_STRING);
44
44
  fptr_glLoadProgramNV((GLenum)NUM2INT(arg1),(GLuint)NUM2UINT(arg2),(GLsizei)RSTRING_LENINT(arg3),(GLubyte *)RSTRING_PTR(arg3));
45
- CHECK_GLERROR
45
+ CHECK_GLERROR_FROM("glLoadProgramNV");
46
46
  return Qnil;
47
47
  }
48
48
 
@@ -50,9 +50,9 @@ static void (APIENTRY * fptr_glGetProgramivNV)(GLuint,GLenum,GLint *);
50
50
  static VALUE gl_GetProgramivNV(VALUE obj,VALUE arg1,VALUE arg2)
51
51
  {
52
52
  GLint ret = 0;
53
- LOAD_GL_FUNC(glGetProgramivNV,"GL_NV_vertex_program")
53
+ LOAD_GL_FUNC(glGetProgramivNV, "GL_NV_vertex_program");
54
54
  fptr_glGetProgramivNV(NUM2INT(arg1),NUM2INT(arg2),&ret);
55
- CHECK_GLERROR
55
+ CHECK_GLERROR_FROM("glGetProgramivNV");
56
56
  return cond_GLBOOL2RUBY(NUM2INT(arg2),ret);
57
57
  }
58
58
 
@@ -63,11 +63,11 @@ static VALUE gl_GetProgramStringNV(VALUE obj,VALUE arg1,VALUE arg2)
63
63
  char *buffer;
64
64
  VALUE ret_buffer;
65
65
 
66
- LOAD_GL_FUNC(glGetProgramStringNV,"GL_NV_vertex_program")
67
- LOAD_GL_FUNC(glGetProgramivNV,"GL_NV_vertex_program")
66
+ LOAD_GL_FUNC(glGetProgramStringNV, "GL_NV_vertex_program");
67
+ LOAD_GL_FUNC(glGetProgramivNV, "GL_NV_vertex_program");
68
68
 
69
69
  fptr_glGetProgramivNV(NUM2INT(arg1),GL_PROGRAM_LENGTH_NV,&len);
70
- CHECK_GLERROR
70
+ CHECK_GLERROR_FROM("glGetProgramivNV");
71
71
  if (len<=0)
72
72
  return rb_str_new2("");
73
73
 
@@ -77,7 +77,7 @@ static VALUE gl_GetProgramStringNV(VALUE obj,VALUE arg1,VALUE arg2)
77
77
  ret_buffer = rb_str_new2(buffer);
78
78
  xfree(buffer);
79
79
 
80
- CHECK_GLERROR
80
+ CHECK_GLERROR_FROM("glGetProgramStringNV");
81
81
  return ret_buffer;
82
82
  }
83
83
 
@@ -90,10 +90,10 @@ static void (APIENTRY * fptr_glExecuteProgramNV)(GLenum,GLuint,const GLfloat *);
90
90
  static VALUE gl_ExecuteProgramNV(VALUE obj,VALUE arg1,VALUE arg2,VALUE arg3)
91
91
  {
92
92
  GLfloat params[4] = {0,0,0,0};
93
- LOAD_GL_FUNC(glExecuteProgramNV,"GL_NV_vertex_program")
93
+ LOAD_GL_FUNC(glExecuteProgramNV, "GL_NV_vertex_program");
94
94
  ary2cflt(arg3,params,4);
95
95
  fptr_glExecuteProgramNV(NUM2UINT(arg1),NUM2UINT(arg2),params);
96
- CHECK_GLERROR
96
+ CHECK_GLERROR_FROM("glExecuteProgramNV");
97
97
  return Qnil;
98
98
  }
99
99
 
@@ -107,7 +107,7 @@ static VALUE gl_VertexAttribPointerNV(VALUE obj,VALUE arg1,VALUE arg2,VALUE arg3
107
107
  GLenum type;
108
108
  GLsizei stride;
109
109
 
110
- LOAD_GL_FUNC(glVertexAttribPointerNV,"GL_NV_vertex_program")
110
+ LOAD_GL_FUNC(glVertexAttribPointerNV, "GL_NV_vertex_program");
111
111
 
112
112
  index = (GLuint)NUM2UINT(arg1);
113
113
  size = (GLuint)NUM2UINT(arg2);
@@ -127,7 +127,7 @@ static VALUE gl_VertexAttribPointerNV(VALUE obj,VALUE arg1,VALUE arg2,VALUE arg3
127
127
  fptr_glVertexAttribPointerNV(index,size,type,stride,(GLvoid *)RSTRING_PTR(data));
128
128
  }
129
129
 
130
- CHECK_GLERROR
130
+ CHECK_GLERROR_FROM("glVertexAttribPointerNV");
131
131
  return Qnil;
132
132
  }
133
133
 
@@ -138,7 +138,7 @@ gl_GetVertexAttribPointervNV(obj,arg1)
138
138
  VALUE obj,arg1;
139
139
  {
140
140
  GLuint index;
141
- LOAD_GL_FUNC(glGetVertexAttribPointervNV,"GL_NV_vertex_program")
141
+ LOAD_GL_FUNC(glGetVertexAttribPointervNV, "GL_NV_vertex_program");
142
142
  index =(GLuint) NUM2INT(arg1);
143
143
  if (index>_MAX_VERTEX_ATTRIBS)
144
144
  rb_raise(rb_eArgError, "Index too large, maximum allowed value '%i'",_MAX_VERTEX_ATTRIBS);
@@ -156,10 +156,10 @@ gl_##_name_(obj,arg1,arg2,arg3) \
156
156
  VALUE obj,arg1,arg2,arg3; \
157
157
  { \
158
158
  _type_ cary[4]; \
159
- LOAD_GL_FUNC(gl##_name_,_extension_) \
159
+ LOAD_GL_FUNC(gl##_name_, _extension_); \
160
160
  _conv_(arg3,cary,4); \
161
161
  fptr_gl##_name_(NUM2UINT(arg1),NUM2UINT(arg2),cary); \
162
- CHECK_GLERROR \
162
+ CHECK_GLERROR_FROM("gl" #_name_); \
163
163
  return Qnil; \
164
164
  }
165
165
 
@@ -173,9 +173,9 @@ gl_##_name_(obj,arg1,arg2,arg3) \
173
173
  VALUE obj,arg1,arg2,arg3; \
174
174
  { \
175
175
  _type_ cary[4] = {(_type_)0.0, (_type_)0.0, (_type_)0.0, (_type_)0.0}; \
176
- LOAD_GL_FUNC(gl##_name_,_extension_) \
176
+ LOAD_GL_FUNC(gl##_name_, _extension_); \
177
177
  fptr_gl##_name_(NUM2UINT(arg1),NUM2UINT(arg2),NUM2UINT(arg3),cary); \
178
- RET_ARRAY_OR_SINGLE(4,RETCONV_##_type_,cary) \
178
+ RET_ARRAY_OR_SINGLE("gl" #_name_, 4, RETCONV_##_type_, cary); \
179
179
  }
180
180
 
181
181
  GETPROGRAMPARAM_FUNC(GetProgramParameterdvNV,GLdouble,"GL_NV_vertex_program")
@@ -190,7 +190,7 @@ VALUE obj,arg1,arg2,arg3; \
190
190
  { \
191
191
  _type_ *cary; \
192
192
  GLuint len; \
193
- LOAD_GL_FUNC(gl##_name_,_extension_) \
193
+ LOAD_GL_FUNC(gl##_name_, _extension_); \
194
194
  len = (GLuint)RARRAY_LENINT(rb_Array(arg3)); \
195
195
  if (len<=0 || (len % 4) != 0) \
196
196
  rb_raise(rb_eArgError, "Parameter array size must be multiplication of 4"); \
@@ -198,7 +198,7 @@ VALUE obj,arg1,arg2,arg3; \
198
198
  _conv_(arg3,cary,len); \
199
199
  fptr_gl##_name_((GLenum)NUM2UINT(arg1),(GLuint)NUM2UINT(arg2),len / 4, cary); \
200
200
  xfree(cary); \
201
- CHECK_GLERROR \
201
+ CHECK_GLERROR_FROM("gl" #_name_); \
202
202
  return Qnil; \
203
203
  }
204
204
 
@@ -227,11 +227,11 @@ VALUE obj,arg1,arg2; \
227
227
  { \
228
228
  GLuint index; \
229
229
  _type_ v[_size_]; \
230
- LOAD_GL_FUNC(gl##_name_,_extension_) \
230
+ LOAD_GL_FUNC(gl##_name_, _extension_); \
231
231
  index = (GLuint)NUM2UINT(arg1); \
232
232
  _conv_(arg2,v,_size_); \
233
233
  fptr_gl##_name_(index,v); \
234
- CHECK_GLERROR \
234
+ CHECK_GLERROR_FROM("gl" #_name_); \
235
235
  return Qnil; \
236
236
  }
237
237
 
@@ -259,7 +259,7 @@ VALUE obj,arg1,arg2; \
259
259
  GLuint index; \
260
260
  _type_ *cary; \
261
261
  GLsizei len; \
262
- LOAD_GL_FUNC(gl##_name_,_extension_) \
262
+ LOAD_GL_FUNC(gl##_name_, _extension_); \
263
263
  len = (GLsizei)RARRAY_LENINT(rb_Array(arg2)); \
264
264
  if (len<=0 || (len % _size_) != 0) \
265
265
  rb_raise(rb_eArgError, "Parameter array size must be multiplication of %i",_size_); \
@@ -268,7 +268,7 @@ VALUE obj,arg1,arg2; \
268
268
  _conv_(arg2,cary,len); \
269
269
  fptr_gl##_name_(index,len / _size_,cary); \
270
270
  xfree(cary); \
271
- CHECK_GLERROR \
271
+ CHECK_GLERROR_FROM("gl" #_name_); \
272
272
  return Qnil; \
273
273
  }
274
274
 
@@ -297,7 +297,7 @@ VALUE obj,arg1,arg2; \
297
297
  GLenum pname; \
298
298
  _type_ params[4] = {0,0,0,0}; \
299
299
  GLint size; \
300
- LOAD_GL_FUNC(gl##_name_,_extension_) \
300
+ LOAD_GL_FUNC(gl##_name_, _extension_); \
301
301
  index = (GLuint)NUM2UINT(arg1); \
302
302
  pname = (GLenum)NUM2INT(arg2); \
303
303
  if (pname==GL_CURRENT_ATTRIB_NV) \
@@ -305,7 +305,7 @@ VALUE obj,arg1,arg2; \
305
305
  else \
306
306
  size = 1; \
307
307
  fptr_gl##_name_(index,pname,params); \
308
- RET_ARRAY_OR_SINGLE(size,RETCONV_##_type_,params) \
308
+ RET_ARRAY_OR_SINGLE("gl" #_name_, size, RETCONV_##_type_, params); \
309
309
  }
310
310
 
311
311
  GETVERTEXATTRIB_FUNC(GetVertexAttribdvNV,GLdouble,"GL_NV_vertex_program")
@@ -321,7 +321,7 @@ VALUE obj,arg1,arg2;
321
321
  GLenum pname;
322
322
  GLint params[4] = {0,0,0,0};
323
323
  GLint size;
324
- LOAD_GL_FUNC(glGetVertexAttribivNV,"GL_NV_vertex_program")
324
+ LOAD_GL_FUNC(glGetVertexAttribivNV, "GL_NV_vertex_program");
325
325
  index = (GLuint)NUM2UINT(arg1);
326
326
  pname = (GLenum)NUM2INT(arg2);
327
327
  if (pname==GL_CURRENT_VERTEX_ATTRIB)
@@ -329,7 +329,8 @@ VALUE obj,arg1,arg2;
329
329
  else
330
330
  size = 1;
331
331
  fptr_glGetVertexAttribivNV(index,pname,params);
332
- RET_ARRAY_OR_SINGLE_BOOL(size,cond_GLBOOL2RUBY,pname,params) \
332
+ RET_ARRAY_OR_SINGLE_BOOL("glGetVertexAttribivNV", size, cond_GLBOOL2RUBY,
333
+ pname, params); \
333
334
  }
334
335
 
335
336
 
@@ -339,16 +340,16 @@ static void (APIENTRY * fptr_glGetTrackMatrixivNV)(GLenum,GLuint,GLenum,GLint *)
339
340
  static VALUE gl_GetTrackMatrixivNV(VALUE obj,VALUE arg1,VALUE arg2,VALUE arg3)
340
341
  {
341
342
  GLint ret = 0;
342
- LOAD_GL_FUNC(glGetTrackMatrixivNV,"GL_NV_vertex_program")
343
+ LOAD_GL_FUNC(glGetTrackMatrixivNV, "GL_NV_vertex_program");
343
344
  fptr_glGetTrackMatrixivNV(NUM2UINT(arg1),NUM2UINT(arg2),NUM2UINT(arg3),&ret);
344
- CHECK_GLERROR
345
+ CHECK_GLERROR_FROM("glGetTrackMatrixivNV");
345
346
  return INT2NUM(ret);
346
347
  }
347
348
 
348
349
  static void (APIENTRY * fptr_glRequestResidentProgramsNV)(GLsizei, GLuint *);
349
350
  static VALUE gl_RequestResidentProgramsNV(VALUE obj,VALUE arg1)
350
351
  {
351
- LOAD_GL_FUNC(glRequestResidentProgramsNV,"GL_NV_vertex_program")
352
+ LOAD_GL_FUNC(glRequestResidentProgramsNV, "GL_NV_vertex_program");
352
353
  if (TYPE(arg1)==T_ARRAY) {
353
354
  GLsizei n;
354
355
  GLuint *programs;
@@ -362,7 +363,7 @@ static VALUE gl_RequestResidentProgramsNV(VALUE obj,VALUE arg1)
362
363
  program = NUM2INT(arg1);
363
364
  fptr_glRequestResidentProgramsNV( 1, &program);
364
365
  }
365
- CHECK_GLERROR
366
+ CHECK_GLERROR_FROM("glRequestResidentProgramsNV");
366
367
  return Qnil;
367
368
  }
368
369
 
@@ -376,7 +377,7 @@ static VALUE gl_AreProgramsResidentNV(VALUE obj,VALUE arg1)
376
377
  VALUE retary;
377
378
  VALUE ary;
378
379
  int i;
379
- LOAD_GL_FUNC(glAreProgramsResidentNV,"GL_NV_vertex_program")
380
+ LOAD_GL_FUNC(glAreProgramsResidentNV, "GL_NV_vertex_program");
380
381
  ary = rb_Array(arg1);
381
382
  size = (GLsizei)RARRAY_LENINT(ary);
382
383
  programs = ALLOC_N(GLuint,size);
@@ -393,7 +394,7 @@ static VALUE gl_AreProgramsResidentNV(VALUE obj,VALUE arg1)
393
394
  }
394
395
  xfree(programs);
395
396
  xfree(residences);
396
- CHECK_GLERROR
397
+ CHECK_GLERROR_FROM("glAreProgramsResidentNV");
397
398
  return retary;
398
399
  }
399
400
 
@@ -409,9 +410,9 @@ static void (APIENTRY * fptr_gl##_name_)(GLuint,GLenum,_type_ *); \
409
410
  static VALUE gl_##_name_(VALUE obj,VALUE arg1,VALUE arg2) \
410
411
  { \
411
412
  _type_ ret = 0; \
412
- LOAD_GL_FUNC(gl##_name_,"GL_NV_occlusion_query") \
413
+ LOAD_GL_FUNC(gl##_name_, "GL_NV_occlusion_query"); \
413
414
  fptr_gl##_name_(NUM2INT(arg1),NUM2INT(arg2),&ret); \
414
- CHECK_GLERROR \
415
+ CHECK_GLERROR_FROM("gl" #_name_); \
415
416
  return _conv_(NUM2INT(arg2),ret); \
416
417
  }
417
418
 
@@ -426,10 +427,10 @@ static void (APIENTRY * fptr_glPointParameterivNV)(GLenum,const GLint *);
426
427
  static VALUE gl_PointParameterivNV(VALUE obj,VALUE arg1,VALUE arg2)
427
428
  {
428
429
  GLint param = 0;
429
- LOAD_GL_FUNC(glPointParameterivNV,"GL_NV_point_sprite")
430
+ LOAD_GL_FUNC(glPointParameterivNV, "GL_NV_point_sprite");
430
431
  ary2cint(arg2,&param,1);
431
432
  fptr_glPointParameterivNV(NUM2UINT(arg1),&param);
432
- CHECK_GLERROR
433
+ CHECK_GLERROR_FROM("glPointParameterivNV");
433
434
  return Qnil;
434
435
  }
435
436
 
@@ -440,10 +441,10 @@ static VALUE \
440
441
  gl_##_name_(obj,arg1,arg2,arg3,arg4,arg5,arg6) \
441
442
  VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6; \
442
443
  { \
443
- LOAD_GL_FUNC(gl##_name_,_extension_) \
444
+ LOAD_GL_FUNC(gl##_name_, _extension_); \
444
445
  Check_Type(arg2,T_STRING); \
445
446
  fptr_gl##_name_((GLuint)NUM2UINT(arg1),(GLsizei)RSTRING_LENINT(arg2),(GLubyte *)RSTRING_PTR(arg2),(_type_)_conv_(arg3),(_type_)_conv_(arg4),(_type_)_conv_(arg5),(_type_)_conv_(arg6)); \
446
- CHECK_GLERROR \
447
+ CHECK_GLERROR_FROM("gl" #_name_); \
447
448
  return Qnil; \
448
449
  }
449
450
 
@@ -458,11 +459,11 @@ gl_##_name_(obj,arg1,arg2,arg3) \
458
459
  VALUE obj,arg1,arg2,arg3; \
459
460
  { \
460
461
  _type_ cary[4]; \
461
- LOAD_GL_FUNC(gl##_name_,_extension_) \
462
+ LOAD_GL_FUNC(gl##_name_, _extension_); \
462
463
  Check_Type(arg2,T_STRING); \
463
464
  _conv_(arg3,cary,4); \
464
465
  fptr_gl##_name_(NUM2UINT(arg1),(GLsizei)RSTRING_LENINT(arg2),(GLubyte *)RSTRING_PTR(arg2),cary); \
465
- CHECK_GLERROR \
466
+ CHECK_GLERROR_FROM("gl" #_name_); \
466
467
  return Qnil; \
467
468
  }
468
469
 
@@ -477,10 +478,10 @@ gl_##_name_(obj,arg1,arg2) \
477
478
  VALUE obj,arg1,arg2; \
478
479
  { \
479
480
  _type_ cary[4] = {(_type_)0.0, (_type_)0.0, (_type_)0.0, (_type_)0.0}; \
480
- LOAD_GL_FUNC(gl##_name_,_extension_) \
481
+ LOAD_GL_FUNC(gl##_name_, _extension_); \
481
482
  Check_Type(arg2,T_STRING); \
482
483
  fptr_gl##_name_((GLuint)NUM2UINT(arg1),(GLsizei)RSTRING_LENINT(arg2),(GLubyte *)RSTRING_PTR(arg2),cary); \
483
- RET_ARRAY_OR_SINGLE(4,RETCONV_##_type_,cary) \
484
+ RET_ARRAY_OR_SINGLE("gl" #_name_, 4, RETCONV_##_type_, cary); \
484
485
  }
485
486
 
486
487
  GETPROGRAMNAMEDPARAM_FUNC(GetProgramNamedParameterdvNV,GLdouble,"GL_NV_vertex_program")
@@ -517,9 +518,9 @@ gl_##_name_(obj,arg1,arg2) \
517
518
  VALUE obj,arg1,arg2; \
518
519
  { \
519
520
  _type_ cary[4] = {(_type_)0.0, (_type_)0.0, (_type_)0.0, (_type_)0.0}; \
520
- LOAD_GL_FUNC(gl##_name_,_extension_) \
521
+ LOAD_GL_FUNC(gl##_name_, _extension_); \
521
522
  fptr_gl##_name_(NUM2UINT(arg1),NUM2UINT(arg2),cary); \
522
- RET_ARRAY_OR_SINGLE(4,RETCONV_##_type_,cary) \
523
+ RET_ARRAY_OR_SINGLE("gl" #_name_, 4, RETCONV_##_type_, cary); \
523
524
  }
524
525
 
525
526
  GETPROGRAMPARAM_FUNC_2(GetProgramLocalParameterIivNV,GLint,"GL_NV_gpu_program4")