opengl 0.9.2-x86-mingw32 → 0.10.0.pre1-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +8 -0
  3. data/Manifest.txt +5 -1
  4. data/README.rdoc +25 -28
  5. data/Rakefile +56 -28
  6. data/examples/RedBook/font.rb +2 -2
  7. data/examples/RedBook/light.rb +2 -0
  8. data/examples/RedBook/stroke.rb +6 -6
  9. data/ext/opengl/GL/gl.h +2115 -0
  10. data/ext/opengl/GL/glext.h +11770 -0
  11. data/ext/opengl/common.h +116 -172
  12. data/ext/opengl/conv.h +2 -2
  13. data/ext/opengl/extconf.rb +3 -31
  14. data/ext/opengl/fptr_struct.h +912 -0
  15. data/ext/opengl/funcdef.h +29 -63
  16. data/ext/opengl/gl-1.0-1.1.c +918 -648
  17. data/ext/opengl/gl-1.2.c +13 -13
  18. data/ext/opengl/gl-1.3.c +68 -64
  19. data/ext/opengl/gl-1.4.c +64 -66
  20. data/ext/opengl/gl-1.5.c +32 -31
  21. data/ext/opengl/gl-2.0.c +126 -128
  22. data/ext/opengl/gl-2.1.c +8 -8
  23. data/ext/opengl/gl-3.0.c +102 -93
  24. data/ext/opengl/gl-enums.c +9 -29
  25. data/ext/opengl/gl-enums.h +31 -91
  26. data/ext/opengl/gl-error.c +15 -17
  27. data/ext/opengl/gl-error.h +4 -7
  28. data/ext/opengl/gl-ext-3dfx.c +2 -2
  29. data/ext/opengl/gl-ext-arb.c +176 -171
  30. data/ext/opengl/gl-ext-ati.c +4 -4
  31. data/ext/opengl/gl-ext-ext.c +151 -155
  32. data/ext/opengl/gl-ext-gremedy.c +4 -4
  33. data/ext/opengl/gl-ext-nv.c +141 -142
  34. data/ext/opengl/gl.c +121 -76
  35. data/ext/opengl/gl_buffer.c +44 -19
  36. data/ext/opengl/glimpl.c +187 -0
  37. data/ext/opengl/glimpl.h +47 -0
  38. data/ext/opengl/opengl.c +5 -3
  39. data/lib/opengl.rb +24 -4
  40. data/lib/opengl/1.9/opengl.so +0 -0
  41. data/lib/opengl/2.0/opengl.so +0 -0
  42. data/lib/opengl/2.1/opengl.so +0 -0
  43. data/lib/opengl/2.2/opengl.so +0 -0
  44. data/lib/opengl/2.3/opengl.so +0 -0
  45. data/lib/opengl/bindings_version.rb +4 -0
  46. data/lib/opengl/implementation.rb +38 -0
  47. data/opengl.gemspec +33 -0
  48. data/test/test_gl.rb +7 -0
  49. data/test/test_gl_21.rb +21 -21
  50. data/test/test_gl_ext_arb.rb +1 -1
  51. data/test/test_glimpl.rb +23 -0
  52. data/test/test_opengl_buffer.rb +2 -0
  53. data/utils/enumgen.rb +2 -2
  54. metadata +69 -60
  55. checksums.yaml.gz.sig +0 -2
  56. data.tar.gz.sig +0 -0
  57. data/ext/opengl/gl-types.h +0 -67
  58. metadata.gz.sig +0 -0
@@ -18,13 +18,13 @@
18
18
  /* OpenGL ATI extensions */
19
19
 
20
20
  /* #277 GL_ATI_draw_buffers */
21
- static void (APIENTRY * fptr_glDrawBuffersATI)(GLsizei,const GLenum *);
22
21
  static VALUE gl_DrawBuffersATI(VALUE obj,VALUE arg1)
23
22
  {
24
23
  GLsizei size;
25
24
  GLenum *buffers;
25
+ DECL_GL_FUNC_PTR(GLvoid,glDrawBuffersATI,(GLsizei,const GLenum *));
26
26
  LOAD_GL_FUNC(glDrawBuffersATI, "GL_ATI_draw_buffers");
27
- Check_Type(arg1,T_ARRAY);
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);
@@ -34,8 +34,8 @@ static VALUE gl_DrawBuffersATI(VALUE obj,VALUE arg1)
34
34
  return Qnil;
35
35
  }
36
36
 
37
- void gl_init_functions_ext_ati(VALUE module)
37
+ void gl_init_functions_ext_ati(VALUE klass)
38
38
  {
39
39
  /* #277 GL_ATI_draw_buffers */
40
- rb_define_module_function(module, "glDrawBuffersATI", gl_DrawBuffersATI, 1);
40
+ rb_define_method(klass, "glDrawBuffersATI", gl_DrawBuffersATI, 1);
41
41
  }
@@ -30,7 +30,6 @@ GL_FUNC_GENOBJECTS_LOAD(GenTexturesEXT,"GL_EXT_texture_object")
30
30
  GL_FUNC_DELETEOBJECTS_LOAD(DeleteTexturesEXT,"GL_EXT_texture_object")
31
31
  GL_FUNC_LOAD_2(BindTextureEXT,GLvoid, GLenum,GLint, "GL_EXT_texture_object")
32
32
 
33
- static void (APIENTRY * fptr_glPrioritizeTexturesEXT)(GLsizei,const GLuint *,const GLclampf *);
34
33
  static VALUE
35
34
  gl_PrioritizeTexturesEXT(obj,arg1,arg2)
36
35
  VALUE obj,arg1,arg2;
@@ -38,6 +37,7 @@ VALUE obj,arg1,arg2;
38
37
  GLuint *textures;
39
38
  GLclampf *priorities;
40
39
  GLsizei size;
40
+ DECL_GL_FUNC_PTR(GLvoid,glPrioritizeTexturesEXT,(GLsizei,const GLuint *,const GLclampf *));
41
41
  LOAD_GL_FUNC(glPrioritizeTexturesEXT, "GL_EXT_texture_object");
42
42
  Check_Type(arg1,T_ARRAY);
43
43
  Check_Type(arg2,T_ARRAY);
@@ -54,7 +54,6 @@ VALUE obj,arg1,arg2;
54
54
  return Qnil;
55
55
  }
56
56
 
57
- static GLboolean (APIENTRY * fptr_glAreTexturesResidentEXT)(GLsizei,const GLuint *,GLboolean *);
58
57
  static VALUE
59
58
  gl_AreTexturesResidentEXT(obj,arg1)
60
59
  VALUE obj,arg1;
@@ -66,6 +65,7 @@ VALUE obj,arg1;
66
65
  VALUE retary;
67
66
  VALUE ary;
68
67
  int i;
68
+ DECL_GL_FUNC_PTR(GLboolean,glAreTexturesResidentEXT,(GLsizei,const GLuint *,GLboolean *));
69
69
  LOAD_GL_FUNC(glAreTexturesResidentEXT, "GL_EXT_texture_object");
70
70
  ary = rb_Array(arg1);
71
71
  size = (GLsizei)RARRAY_LENINT(ary);
@@ -95,12 +95,12 @@ GL_FUNC_LOAD_1(BlendEquationEXT,GLvoid, GLenum, "GL_EXT_blend_minmax")
95
95
  /* #54 - GL_EXT_point_parameters */
96
96
  GL_FUNC_LOAD_2(PointParameterfEXT,GLvoid, GLenum,GLfloat, "GL_EXT_point_parameters")
97
97
 
98
- static void (APIENTRY * fptr_glPointParameterfvEXT)(GLenum,GLfloat *);
99
98
  static VALUE gl_PointParameterfvEXT(VALUE obj,VALUE arg1,VALUE arg2)
100
99
  {
101
100
  GLfloat params[3] = {(GLfloat)0.0,(GLfloat)0.0,(GLfloat)0.0};
102
101
  GLenum pname;
103
102
  GLint size;
103
+ DECL_GL_FUNC_PTR(GLvoid,glPointParameterfvEXT,(GLenum,GLfloat *));
104
104
  LOAD_GL_FUNC(glPointParameterfvEXT, "GL_EXT_point_parameters");
105
105
  pname = NUM2UINT(arg1);
106
106
  Check_Type(arg2,T_ARRAY);
@@ -125,10 +125,10 @@ GL_FUNC_LOAD_3(SecondaryColor3usEXT,GLvoid, GLushort,GLushort,GLushort, "GL_EXT_
125
125
  GL_FUNC_LOAD_3(SecondaryColor3uiEXT,GLvoid, GLuint,GLuint,GLuint, "GL_EXT_secondary_color")
126
126
 
127
127
  #define GLSECONDARYCOLOREXT_VFUNC(_name_,_type_,_conv_) \
128
- static void (APIENTRY * fptr_gl##_name_)(_type_ *); \
129
128
  VALUE gl_##_name_(VALUE obj,VALUE arg1) \
130
129
  { \
131
130
  _type_ cary[3] = {0,0,0}; \
131
+ DECL_GL_FUNC_PTR(GLvoid,gl##_name_,(_type_ *)); \
132
132
  LOAD_GL_FUNC(gl##_name_, "GL_EXT_secondary_color"); \
133
133
  Check_Type(arg1,T_ARRAY); \
134
134
  _conv_(arg1,cary,3); \
@@ -147,8 +147,6 @@ GLSECONDARYCOLOREXT_VFUNC(SecondaryColor3ubvEXT,GLubyte,ary2cubyte)
147
147
  GLSECONDARYCOLOREXT_VFUNC(SecondaryColor3usvEXT,GLushort,ary2cushort)
148
148
  #undef GLSECONDARYCOLOREXT_VFUNC
149
149
 
150
- extern VALUE g_SecondaryColor_ptr;
151
- static void (APIENTRY * fptr_glSecondaryColorPointerEXT)(GLint,GLenum,GLsizei,const GLvoid *);
152
150
  static VALUE
153
151
  gl_SecondaryColorPointerEXT(obj,arg1,arg2,arg3,arg4)
154
152
  VALUE obj,arg1,arg2,arg3,arg4;
@@ -156,18 +154,19 @@ VALUE obj,arg1,arg2,arg3,arg4;
156
154
  GLint size;
157
155
  GLenum type;
158
156
  GLsizei stride;
157
+ DECL_GL_FUNC_PTR(GLvoid,glSecondaryColorPointerEXT,(GLint,GLenum,GLsizei,const GLvoid *));
159
158
  LOAD_GL_FUNC(glSecondaryColorPointerEXT, "GL_EXT_secondary_color");
160
159
  size = (GLint)NUM2INT(arg1);
161
160
  type = (GLenum)NUM2INT(arg2);
162
161
  stride = (GLsizei)NUM2UINT(arg3);
163
- if (CheckBufferBinding(GL_ARRAY_BUFFER_BINDING)) {
164
- g_SecondaryColor_ptr = arg4;
162
+ if (CHECK_BUFFER_BINDING(GL_ARRAY_BUFFER_BINDING)) {
163
+ SET_GLIMPL_VARIABLE(SecondaryColor_ptr, arg4);
165
164
  fptr_glSecondaryColorPointerEXT(size,type, stride, (const GLvoid*)NUM2SIZET(arg4));
166
165
  } else {
167
166
  VALUE data;
168
167
  data = pack_array_or_pass_string(type,arg4);
169
168
  rb_str_freeze(data);
170
- g_SecondaryColor_ptr = data;
169
+ SET_GLIMPL_VARIABLE(SecondaryColor_ptr, data);
171
170
  fptr_glSecondaryColorPointerEXT(size,type, stride, (const GLvoid*)RSTRING_PTR(data));
172
171
  }
173
172
  CHECK_GLERROR_FROM("glSecondaryColorPointerEXT");
@@ -179,7 +178,6 @@ GL_FUNC_LOAD_2(LockArraysEXT,GLvoid, GLint,GLint, "GL_EXT_compiled_vertex_array"
179
178
  GL_FUNC_LOAD_0(UnlockArraysEXT,GLvoid, "GL_EXT_compiled_vertex_array")
180
179
 
181
180
  /* #112 - GL_EXT_draw_range_elements */
182
- static void (APIENTRY * fptr_glDrawRangeElementsEXT)(GLenum,GLuint,GLuint,GLsizei,GLenum,GLvoid*);
183
181
  static VALUE
184
182
  gl_DrawRangeElementsEXT(obj,arg1,arg2,arg3,arg4,arg5,arg6)
185
183
  VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6;
@@ -189,13 +187,14 @@ VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6;
189
187
  GLuint end;
190
188
  GLsizei count;
191
189
  GLenum type;
190
+ DECL_GL_FUNC_PTR(GLvoid,glDrawRangeElementsEXT,(GLenum,GLuint,GLuint,GLsizei,GLenum,GLvoid*));
192
191
  LOAD_GL_FUNC(glDrawRangeElementsEXT, "GL_EXT_draw_range_elements");
193
192
  mode = (GLenum)NUM2INT(arg1);
194
193
  start = (GLuint)NUM2UINT(arg2);
195
194
  end = (GLuint)NUM2UINT(arg3);
196
195
  count = (GLsizei)NUM2UINT(arg4);
197
196
  type = (GLenum)NUM2INT(arg5);
198
- if (CheckBufferBinding(GL_ELEMENT_ARRAY_BUFFER_BINDING)) {
197
+ if (CHECK_BUFFER_BINDING(GL_ELEMENT_ARRAY_BUFFER_BINDING)) {
199
198
  fptr_glDrawRangeElementsEXT(mode, start, end, count, type, (GLvoid *)NUM2SIZET(arg6));
200
199
  } else {
201
200
  VALUE data;
@@ -207,7 +206,6 @@ VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6;
207
206
  }
208
207
 
209
208
  /* #148 - GL_EXT_multi_draw_arrays */
210
- static void (APIENTRY * fptr_glMultiDrawArraysEXT)(GLenum,GLint*,GLsizei*,GLsizei);
211
209
  static VALUE
212
210
  gl_MultiDrawArraysEXT(obj,arg1,arg2,arg3)
213
211
  VALUE obj,arg1,arg2,arg3;
@@ -216,6 +214,7 @@ VALUE obj,arg1,arg2,arg3;
216
214
  GLint *ary1;
217
215
  GLsizei *ary2;
218
216
  int len1,len2;
217
+ DECL_GL_FUNC_PTR(GLvoid,glMultiDrawArraysEXT,(GLenum,GLint*,GLsizei*,GLsizei));
219
218
  LOAD_GL_FUNC(glMultiDrawArraysEXT, "GL_EXT_multi_draw_arrays");
220
219
  len1 = (int)RARRAY_LENINT(arg2);
221
220
  len2 = (int)RARRAY_LENINT(arg3);
@@ -233,7 +232,6 @@ VALUE obj,arg1,arg2,arg3;
233
232
  return Qnil;
234
233
  }
235
234
 
236
- static void (APIENTRY * fptr_glMultiDrawElementsEXT)(GLenum,const GLsizei *,GLenum,GLvoid **,GLsizei);
237
235
  static VALUE
238
236
  gl_MultiDrawElementsEXT(argc,argv,obj)
239
237
  int argc;
@@ -247,11 +245,12 @@ VALUE obj;
247
245
  GLint size;
248
246
  int i;
249
247
  VALUE ary, args[4];
248
+ DECL_GL_FUNC_PTR(GLvoid,glMultiDrawElementsEXT,(GLenum,const GLsizei *,GLenum,GLvoid **,GLsizei));
250
249
  LOAD_GL_FUNC(glMultiDrawElementsEXT, "GL_EXT_multi_draw_arrays");
251
250
  switch (rb_scan_args(argc, argv, "31", &args[0], &args[1], &args[2],&args[3])) {
252
251
  default:
253
252
  case 3:
254
- if (CheckBufferBinding(GL_ELEMENT_ARRAY_BUFFER_BINDING))
253
+ if (CHECK_BUFFER_BINDING(GL_ELEMENT_ARRAY_BUFFER_BINDING))
255
254
  rb_raise(rb_eArgError, "Element array buffer bound, but offsets array missing");
256
255
  mode = (GLenum)NUM2INT(args[0]);
257
256
  type = (GLenum)NUM2INT(args[1]);
@@ -272,7 +271,7 @@ VALUE obj;
272
271
  xfree(indices);
273
272
  break;
274
273
  case 4:
275
- if (!CheckBufferBinding(GL_ELEMENT_ARRAY_BUFFER_BINDING))
274
+ if (!CHECK_BUFFER_BINDING(GL_ELEMENT_ARRAY_BUFFER_BINDING))
276
275
  rb_raise(rb_eArgError, "Element array buffer not bound");
277
276
  mode = (GLenum)NUM2INT(args[0]);
278
277
  type = (GLenum)NUM2INT(args[1]);
@@ -303,10 +302,10 @@ GL_FUNC_LOAD_1(FogCoordfEXT,GLvoid, GLfloat, "GL_EXT_fog_coord")
303
302
  GL_FUNC_LOAD_1(FogCoorddEXT,GLvoid, GLdouble, "GL_EXT_fog_coord")
304
303
 
305
304
  #define GLFOGCOORD_VFUNC(_name_,_type_,_conv_) \
306
- static void (APIENTRY * fptr_gl##_name_)(_type_ *); \
307
305
  VALUE gl_##_name_(VALUE obj,VALUE arg1) \
308
306
  { \
309
307
  _type_ cary = 0; \
308
+ DECL_GL_FUNC_PTR(GLvoid,gl##_name_,(_type_ *)); \
310
309
  LOAD_GL_FUNC(gl##_name_, "GL_EXT_secondary_color"); \
311
310
  Check_Type(arg1,T_ARRAY); \
312
311
  _conv_(arg1,&cary,1); \
@@ -318,25 +317,24 @@ GLFOGCOORD_VFUNC(FogCoordfvEXT,GLfloat,ary2cflt)
318
317
  GLFOGCOORD_VFUNC(FogCoorddvEXT,GLdouble,ary2cdbl)
319
318
  #undef GLFOGCOORD_VFUNC
320
319
 
321
- extern VALUE g_FogCoord_ptr;
322
- static void (APIENTRY * fptr_glFogCoordPointerEXT)(GLenum,GLsizei,const GLvoid *);
323
320
  static VALUE
324
321
  gl_FogCoordPointerEXT(obj,arg1,arg2,arg3)
325
322
  VALUE obj,arg1,arg2,arg3;
326
323
  {
327
324
  GLenum type;
328
325
  GLsizei stride;
326
+ DECL_GL_FUNC_PTR(GLvoid,glFogCoordPointerEXT,(GLenum,GLsizei,const GLvoid *));
329
327
  LOAD_GL_FUNC(glFogCoordPointerEXT, "GL_EXT_secondary_color");
330
328
  type = (GLenum)NUM2INT(arg1);
331
329
  stride = (GLsizei)NUM2UINT(arg2);
332
- if (CheckBufferBinding(GL_ARRAY_BUFFER_BINDING)) {
333
- g_FogCoord_ptr = arg3;
330
+ if (CHECK_BUFFER_BINDING(GL_ARRAY_BUFFER_BINDING)) {
331
+ SET_GLIMPL_VARIABLE(FogCoord_ptr, arg3);
334
332
  fptr_glFogCoordPointerEXT(type, stride, (const GLvoid*)NUM2SIZET(arg3));
335
333
  } else {
336
334
  VALUE data;
337
335
  data = pack_array_or_pass_string(type,arg3);
338
336
  rb_str_freeze(data);
339
- g_FogCoord_ptr = data;
337
+ SET_GLIMPL_VARIABLE(FogCoord_ptr, data);
340
338
  fptr_glFogCoordPointerEXT(type, stride, (const GLvoid*)RSTRING_PTR(data));
341
339
  }
342
340
  CHECK_GLERROR_FROM("glFogCoordPointerEXT");
@@ -362,10 +360,10 @@ GL_FUNC_LOAD_4(RenderbufferStorageEXT,GLvoid, GLenum,GLenum,GLsizei,GLsizei, "GL
362
360
  GL_FUNC_GENOBJECTS_LOAD(GenRenderbuffersEXT,"GL_EXT_framebuffer_object")
363
361
  GL_FUNC_DELETEOBJECTS_LOAD(DeleteRenderbuffersEXT,"GL_EXT_framebuffer_object")
364
362
 
365
- static void (APIENTRY * fptr_glGetRenderbufferParameterivEXT)(GLenum,GLenum,GLint *);
366
363
  static VALUE gl_GetRenderbufferParameterivEXT(VALUE obj,VALUE arg1,VALUE arg2)
367
364
  {
368
365
  GLint param = 0;
366
+ DECL_GL_FUNC_PTR(GLvoid,glGetRenderbufferParameterivEXT,(GLenum,GLenum,GLint *));
369
367
  LOAD_GL_FUNC(glGetRenderbufferParameterivEXT, "GL_EXT_framebuffer_object");
370
368
  fptr_glGetRenderbufferParameterivEXT(NUM2UINT(arg1),NUM2UINT(arg2),&param);
371
369
  CHECK_GLERROR_FROM("glGetRenderbufferParameterivEXT");
@@ -383,10 +381,10 @@ GL_FUNC_LOAD_6(FramebufferTexture3DEXT,GLvoid, GLenum,GLenum,GLenum,GLuint,GLint
383
381
 
384
382
  GL_FUNC_LOAD_4(FramebufferRenderbufferEXT,GLvoid, GLuint,GLuint,GLuint,GLuint, "GL_EXT_framebuffer_object")
385
383
 
386
- static void (APIENTRY * fptr_glGetFramebufferAttachmentParameterivEXT)(GLenum,GLenum,GLenum,GLint *);
387
384
  static VALUE gl_GetFramebufferAttachmentParameterivEXT(VALUE obj,VALUE arg1, VALUE arg2, VALUE arg3)
388
385
  {
389
386
  GLint ret = 0;
387
+ DECL_GL_FUNC_PTR(GLvoid,glGetFramebufferAttachmentParameterivEXT,(GLenum,GLenum,GLenum,GLint *));
390
388
  LOAD_GL_FUNC(glGetFramebufferAttachmentParameterivEXT, "GL_EXT_framebuffer_object");
391
389
  fptr_glGetFramebufferAttachmentParameterivEXT(NUM2UINT(arg1),NUM2UINT(arg2),NUM2UINT(arg3),&ret);
392
390
  CHECK_GLERROR_FROM("glGetFramebufferAttachmentParameterivEXT");
@@ -407,30 +405,30 @@ GL_FUNC_LOAD_5(RenderbufferStorageMultisampleEXT,GLvoid, GLenum,GLsizei,GLenum,G
407
405
  /* #319 - GL_EXT_timer_query */
408
406
 
409
407
  #define GETQUERY_FUNC(_name_,_type_,_conv_) \
410
- static void (APIENTRY * fptr_gl##_name_)(GLuint,GLenum,_type_ *); \
411
408
  static VALUE gl_##_name_(VALUE obj,VALUE arg1,VALUE arg2) \
412
409
  { \
413
410
  _type_ ret = 0; \
411
+ DECL_GL_FUNC_PTR(GLvoid,gl##_name_,(GLuint,GLenum,_type_ *)); \
414
412
  LOAD_GL_FUNC(gl##_name_, "GL_EXT_timer_query"); \
415
413
  fptr_gl##_name_(NUM2INT(arg1),NUM2INT(arg2),&ret); \
416
414
  CHECK_GLERROR_FROM("gl" #_name_); \
417
415
  return _conv_(NUM2INT(arg2),ret); \
418
416
  }
419
417
 
420
- GETQUERY_FUNC(GetQueryObjecti64vEXT,GLint64EXT,cond_GLBOOL2RUBY_LL)
421
- GETQUERY_FUNC(GetQueryObjectui64vEXT,GLuint64EXT,cond_GLBOOL2RUBY_ULL)
418
+ GETQUERY_FUNC(GetQueryObjecti64vEXT,GLint64,cond_GLBOOL2RUBY_LL)
419
+ GETQUERY_FUNC(GetQueryObjectui64vEXT,GLuint64,cond_GLBOOL2RUBY_ULL)
422
420
  #undef GETQUERY_FUNC
423
421
 
424
422
 
425
423
  /* #320 - GL_EXT_gpu_program_parameters */
426
424
  #define PROGRAMPARAM_MULTI_FUNC_V(_name_,_type_,_conv_,_extension_) \
427
- static void (APIENTRY * fptr_gl##_name_)(GLenum,GLuint,GLsizei,const _type_ *); \
428
425
  static VALUE \
429
426
  gl_##_name_(obj,arg1,arg2,arg3) \
430
427
  VALUE obj,arg1,arg2,arg3; \
431
428
  { \
432
429
  _type_ *cary; \
433
430
  GLsizei len; \
431
+ DECL_GL_FUNC_PTR(GLvoid,gl##_name_,(GLenum,GLuint,GLsizei,const _type_ *)); \
434
432
  LOAD_GL_FUNC(gl##_name_, _extension_); \
435
433
  len = (GLsizei)RARRAY_LENINT(rb_Array(arg3)); \
436
434
  if (len<=0 || (len % 4) != 0) \
@@ -461,12 +459,12 @@ GL_FUNC_LOAD_4(VertexAttribI3uiEXT,GLvoid, GLuint,GLuint,GLuint,GLuint, "GL_EXT_
461
459
  GL_FUNC_LOAD_5(VertexAttribI4uiEXT,GLvoid, GLuint,GLuint,GLuint,GLuint,GLuint, "GL_EXT_gpu_shader4")
462
460
 
463
461
  #define GLVERTEXATTRIB_VFUNC(_name_,_type_,_conv_,_size_) \
464
- static void (APIENTRY * fptr_gl##_name_)(GLuint,const _type_ *); \
465
462
  static VALUE \
466
463
  gl_##_name_(obj,arg1,arg2) \
467
464
  VALUE obj,arg1,arg2; \
468
465
  { \
469
466
  _type_ value[_size_]; \
467
+ DECL_GL_FUNC_PTR(GLvoid,gl##_name_,(GLuint,const _type_ *)); \
470
468
  LOAD_GL_FUNC(gl##_name_, "GL_EXT_gpu_shader4"); \
471
469
  _conv_(arg2,value,_size_); \
472
470
  fptr_gl##_name_(NUM2UINT(arg1),value); \
@@ -489,7 +487,6 @@ GLVERTEXATTRIB_VFUNC(VertexAttribI4usvEXT,GLushort,ary2cushort,4)
489
487
  #undef GLVERTEXATTRIB_VFUNC
490
488
 
491
489
  #define GETVERTEXATTRIB_FUNC(_name_,_type_,_conv_,_extension_) \
492
- static void (APIENTRY * fptr_gl##_name_)(GLuint,GLenum,_type_ *); \
493
490
  static VALUE \
494
491
  gl_##_name_(obj,arg1,arg2) \
495
492
  VALUE obj,arg1,arg2; \
@@ -498,6 +495,7 @@ VALUE obj,arg1,arg2; \
498
495
  GLenum pname; \
499
496
  _type_ params[4] = {0,0,0,0}; \
500
497
  GLint size; \
498
+ DECL_GL_FUNC_PTR(GLvoid,gl##_name_,(GLuint,GLenum,_type_ *)); \
501
499
  LOAD_GL_FUNC(gl##_name_, _extension_); \
502
500
  index = (GLuint)NUM2UINT(arg1); \
503
501
  pname = (GLenum)NUM2INT(arg2); \
@@ -513,9 +511,6 @@ GETVERTEXATTRIB_FUNC(GetVertexAttribIivEXT,GLint,cond_GLBOOL2RUBY,"GL_EXT_gpu_sh
513
511
  GETVERTEXATTRIB_FUNC(GetVertexAttribIuivEXT,GLuint,cond_GLBOOL2RUBY_U,"GL_EXT_gpu_shader4")
514
512
  #undef GETVERTEXATTRIB_FUNC
515
513
 
516
- extern VALUE g_VertexAttrib_ptr[];
517
-
518
- static void (APIENTRY * fptr_glVertexAttribIPointerEXT)(GLuint,GLint,GLenum,GLsizei,const GLvoid *);
519
514
  static VALUE gl_VertexAttribIPointerEXT(VALUE obj,VALUE arg1,VALUE arg2,VALUE arg3,VALUE arg4,VALUE arg5)
520
515
  {
521
516
  GLuint index;
@@ -523,6 +518,7 @@ static VALUE gl_VertexAttribIPointerEXT(VALUE obj,VALUE arg1,VALUE arg2,VALUE ar
523
518
  GLenum type;
524
519
  GLsizei stride;
525
520
 
521
+ DECL_GL_FUNC_PTR(GLvoid,glVertexAttribIPointerEXT,(GLuint,GLint,GLenum,GLsizei,const GLvoid *));
526
522
  LOAD_GL_FUNC(glVertexAttribIPointerEXT, "GL_EXT_gpu_shader4");
527
523
 
528
524
  index = (GLuint)NUM2UINT(arg1);
@@ -532,14 +528,14 @@ static VALUE gl_VertexAttribIPointerEXT(VALUE obj,VALUE arg1,VALUE arg2,VALUE ar
532
528
  if (index>_MAX_VERTEX_ATTRIBS)
533
529
  rb_raise(rb_eArgError, "Index too large, maximum allowed value '%i'",_MAX_VERTEX_ATTRIBS);
534
530
 
535
- if (CheckBufferBinding(GL_ARRAY_BUFFER_BINDING)) {
536
- g_VertexAttrib_ptr[index] = arg5;
531
+ if (CHECK_BUFFER_BINDING(GL_ARRAY_BUFFER_BINDING)) {
532
+ SET_GLIMPL_VARIABLE(VertexAttrib_ptr[index], arg5);
537
533
  fptr_glVertexAttribIPointerEXT(index,size,type,stride,(GLvoid *)NUM2SIZET(arg5));
538
534
  } else {
539
535
  VALUE data;
540
536
  data = pack_array_or_pass_string(type,arg5);
541
537
  rb_str_freeze(data);
542
- g_VertexAttrib_ptr[index] = data;
538
+ SET_GLIMPL_VARIABLE(VertexAttrib_ptr[index], data);
543
539
  fptr_glVertexAttribIPointerEXT(index,size,type,stride,(GLvoid *)RSTRING_PTR(data));
544
540
  }
545
541
 
@@ -553,7 +549,6 @@ GL_FUNC_LOAD_4(Uniform3uiEXT,GLvoid, GLint,GLuint,GLuint,GLuint, "GL_EXT_gpu_sha
553
549
  GL_FUNC_LOAD_5(Uniform4uiEXT,GLvoid, GLint,GLuint,GLuint,GLuint,GLuint, "GL_EXT_gpu_shader4")
554
550
 
555
551
  #define GLUNIFORM_VFUNC(_name_,_type_,_conv_,_size_) \
556
- static void (APIENTRY * fptr_gl##_name_)(GLint,GLsizei,const _type_ *); \
557
552
  static VALUE \
558
553
  gl_##_name_(obj,arg1,arg2) \
559
554
  VALUE obj,arg1,arg2; \
@@ -561,6 +556,7 @@ VALUE obj,arg1,arg2; \
561
556
  GLint location; \
562
557
  GLsizei count; \
563
558
  _type_ *value; \
559
+ DECL_GL_FUNC_PTR(GLvoid,gl##_name_,(GLint,GLsizei,const _type_ *)); \
564
560
  LOAD_GL_FUNC(gl##_name_, "GL_EXT_gpu_shader4"); \
565
561
  Check_Type(arg2,T_ARRAY); \
566
562
  count = (GLsizei)RARRAY_LENINT(arg2); \
@@ -581,9 +577,7 @@ GLUNIFORM_VFUNC(Uniform3uivEXT,GLuint,ary2cuint,3)
581
577
  GLUNIFORM_VFUNC(Uniform4uivEXT,GLuint,ary2cuint,4)
582
578
  #undef GLUNIFORM_VFUNC
583
579
 
584
- static void (APIENTRY * fptr_glGetActiveUniformARB)(GLuint,GLuint,GLsizei,GLsizei*,GLint*,GLenum*,GLchar*);
585
580
  #define GETUNIFORM_FUNC(_name_,_type_) \
586
- static void (APIENTRY * fptr_gl##_name_)(GLuint,GLint,_type_ *); \
587
581
  static VALUE \
588
582
  gl_##_name_(obj,arg1,arg2) \
589
583
  VALUE obj,arg1,arg2; \
@@ -595,6 +589,8 @@ VALUE obj,arg1,arg2; \
595
589
  GLenum uniform_type = 0; \
596
590
  GLint uniform_size = 0; \
597
591
  \
592
+ DECL_GL_FUNC_PTR(GLvoid,gl##_name_,(GLuint,GLint,_type_ *)); \
593
+ DECL_GL_FUNC_PTR(GLvoid,glGetActiveUniformARB,(GLuint,GLuint,GLsizei,GLsizei*,GLint*,GLenum*,GLchar*)); \
598
594
  LOAD_GL_FUNC(gl##_name_, "GL_EXT_gpu_shader4"); \
599
595
  LOAD_GL_FUNC(glGetActiveUniformARB, "GL_ARB_shader_objects"); \
600
596
  program = (GLuint)NUM2UINT(arg1); \
@@ -615,9 +611,9 @@ VALUE obj,arg1,arg2; \
615
611
  GETUNIFORM_FUNC(GetUniformuivEXT,GLuint)
616
612
  #undef GETUNIFORM_FUNC
617
613
 
618
- static void (APIENTRY * fptr_glBindFragDataLocationEXT)(GLuint,GLuint,const GLchar *);
619
614
  static VALUE gl_BindFragDataLocationEXT(VALUE obj,VALUE arg1,VALUE arg2,VALUE arg3)
620
615
  {
616
+ DECL_GL_FUNC_PTR(GLvoid,glBindFragDataLocationEXT,(GLuint,GLuint,const GLchar *));
621
617
  LOAD_GL_FUNC(glBindFragDataLocationEXT, "GL_EXT_gpu_shader4");
622
618
  Check_Type(arg3,T_STRING);
623
619
  fptr_glBindFragDataLocationEXT(NUM2UINT(arg1),NUM2UINT(arg2),RSTRING_PTR(arg3));
@@ -625,10 +621,10 @@ static VALUE gl_BindFragDataLocationEXT(VALUE obj,VALUE arg1,VALUE arg2,VALUE ar
625
621
  return Qnil;
626
622
  }
627
623
 
628
- static GLint (APIENTRY * fptr_glGetFragDataLocationEXT)(GLuint,const GLchar *);
629
624
  static VALUE gl_GetFragDataLocationEXT(VALUE obj,VALUE arg1,VALUE arg2)
630
625
  {
631
626
  GLint ret;
627
+ DECL_GL_FUNC_PTR(GLint,glGetFragDataLocationEXT,(GLuint,const GLchar *));
632
628
  LOAD_GL_FUNC(glGetFragDataLocationEXT, "GL_EXT_gpu_shader4");
633
629
  Check_Type(arg2,T_STRING);
634
630
  ret = fptr_glGetFragDataLocationEXT(NUM2UINT(arg1),RSTRING_PTR(arg2));
@@ -639,7 +635,6 @@ static VALUE gl_GetFragDataLocationEXT(VALUE obj,VALUE arg1,VALUE arg2)
639
635
  /* #327 - GL_EXT_draw_instanced */
640
636
  GL_FUNC_LOAD_4(DrawArraysInstancedEXT,GLvoid, GLenum,GLint,GLsizei,GLsizei, "GL_EXT_draw_instanced")
641
637
 
642
- static void (APIENTRY * fptr_glDrawElementsInstancedEXT)(GLenum,GLsizei,GLenum,const GLvoid *,GLsizei);
643
638
  static VALUE gl_DrawElementsInstancedEXT(obj,arg1,arg2,arg3,arg4,arg5)
644
639
  VALUE obj,arg1,arg2,arg3,arg4,arg5;
645
640
  {
@@ -647,12 +642,13 @@ VALUE obj,arg1,arg2,arg3,arg4,arg5;
647
642
  GLsizei count;
648
643
  GLenum type;
649
644
  GLsizei primcount;
645
+ DECL_GL_FUNC_PTR(GLvoid,glDrawElementsInstancedEXT,(GLenum,GLsizei,GLenum,const GLvoid *,GLsizei));
650
646
  LOAD_GL_FUNC(glDrawElementsInstancedEXT, "GL_EXT_draw_instanced");
651
647
  mode = (GLenum)NUM2INT(arg1);
652
648
  count = (GLsizei)NUM2UINT(arg2);
653
649
  type = (GLenum)NUM2INT(arg3);
654
650
  primcount = (GLsizei)NUM2INT(arg5);
655
- if (CheckBufferBinding(GL_ELEMENT_ARRAY_BUFFER_BINDING)) {
651
+ if (CHECK_BUFFER_BINDING(GL_ELEMENT_ARRAY_BUFFER_BINDING)) {
656
652
  fptr_glDrawElementsInstancedEXT(mode, count, type, (const GLvoid*)NUM2SIZET(arg4), primcount);
657
653
  } else {
658
654
  VALUE data;
@@ -671,7 +667,6 @@ GL_FUNC_LOAD_4(ClearColorIiEXT,GLvoid, GLint,GLint,GLint,GLint, "GL_EXT_texture_
671
667
  GL_FUNC_LOAD_4(ClearColorIuiEXT,GLvoid, GLuint,GLuint,GLuint,GLuint, "GL_EXT_texture_integer")
672
668
 
673
669
  #define TEXPARAMETER_VFUNC(_name_,_type_,_conv_) \
674
- static void (APIENTRY * fptr_gl##_name_)(GLenum,GLenum,_type_ *); \
675
670
  static VALUE \
676
671
  gl_##_name_(obj,arg1,arg2,arg3) \
677
672
  VALUE obj,arg1,arg2,arg3; \
@@ -679,6 +674,7 @@ VALUE obj,arg1,arg2,arg3; \
679
674
  GLenum target; \
680
675
  GLenum pname; \
681
676
  _type_ params[4] = {0,0,0,0}; \
677
+ DECL_GL_FUNC_PTR(GLvoid,gl##_name_,(GLenum,GLenum,_type_ *)); \
682
678
  LOAD_GL_FUNC(gl##_name_, "GL_EXT_texture_integer"); \
683
679
  target = (GLenum)NUM2UINT(arg1); \
684
680
  pname = (GLenum)NUM2UINT(arg2); \
@@ -694,7 +690,6 @@ TEXPARAMETER_VFUNC(TexParameterIuivEXT,GLuint,ary2cuint)
694
690
  #undef TEXPARAMETER_VFUNC
695
691
 
696
692
  #define GETTEXPARAMETER_VFUNC(_name_,_type_,_conv_) \
697
- static void (APIENTRY * fptr_gl##_name_)(GLenum,GLenum,_type_ *); \
698
693
  static VALUE \
699
694
  gl_##_name_(obj,arg1,arg2) \
700
695
  VALUE obj,arg1,arg2; \
@@ -703,6 +698,7 @@ VALUE obj,arg1,arg2; \
703
698
  GLenum pname; \
704
699
  _type_ params[4] = {0,0,0,0}; \
705
700
  int size; \
701
+ DECL_GL_FUNC_PTR(GLvoid,gl##_name_,(GLenum,GLenum,_type_ *)); \
706
702
  LOAD_GL_FUNC(gl##_name_, "GL_EXT_texture_integer"); \
707
703
  target = (GLenum)NUM2INT(arg1); \
708
704
  pname = (GLenum)NUM2INT(arg2); \
@@ -725,165 +721,165 @@ GETTEXPARAMETER_VFUNC(GetTexParameterIivEXT,GLint,cond_GLBOOL2RUBY)
725
721
  GETTEXPARAMETER_VFUNC(GetTexParameterIuivEXT,GLuint,cond_GLBOOL2RUBY_U)
726
722
  #undef GETTEXPARAMETER_VFUNC
727
723
 
728
- void gl_init_functions_ext_ext(VALUE module)
724
+ void gl_init_functions_ext_ext(VALUE klass)
729
725
  {
730
726
  /* #2 - GL_EXT_blend_color */
731
- rb_define_module_function(module, "glBlendColorEXT", gl_BlendColorEXT, 4);
727
+ rb_define_method(klass, "glBlendColorEXT", gl_BlendColorEXT, 4);
732
728
 
733
729
  /* #3 - GL_EXT_polygon_offset */
734
- rb_define_module_function(module, "glPolygonOffsetEXT", gl_PolygonOffsetEXT, 2);
730
+ rb_define_method(klass, "glPolygonOffsetEXT", gl_PolygonOffsetEXT, 2);
735
731
 
736
732
  /* #20 - GL_EXT_texture_object */
737
- rb_define_module_function(module, "glGenTexturesEXT", gl_GenTexturesEXT, 1);
738
- rb_define_module_function(module, "glDeleteTexturesEXT", gl_DeleteTexturesEXT, 1);
739
- rb_define_module_function(module, "glBindTextureEXT", gl_BindTextureEXT, 2);
740
- rb_define_module_function(module, "glPrioritizeTexturesEXT", gl_PrioritizeTexturesEXT, 2);
741
- rb_define_module_function(module, "glAreTexturesResidentEXT", gl_AreTexturesResidentEXT, 1);
742
- rb_define_module_function(module, "glIsTextureEXT", gl_IsTextureEXT, 1);
733
+ rb_define_method(klass, "glGenTexturesEXT", gl_GenTexturesEXT, 1);
734
+ rb_define_method(klass, "glDeleteTexturesEXT", gl_DeleteTexturesEXT, 1);
735
+ rb_define_method(klass, "glBindTextureEXT", gl_BindTextureEXT, 2);
736
+ rb_define_method(klass, "glPrioritizeTexturesEXT", gl_PrioritizeTexturesEXT, 2);
737
+ rb_define_method(klass, "glAreTexturesResidentEXT", gl_AreTexturesResidentEXT, 1);
738
+ rb_define_method(klass, "glIsTextureEXT", gl_IsTextureEXT, 1);
743
739
 
744
740
  /* #37 - GL_EXT_blend_minmax */
745
- rb_define_module_function(module, "glBlendEquationEXT", gl_BlendEquationEXT, 1);
741
+ rb_define_method(klass, "glBlendEquationEXT", gl_BlendEquationEXT, 1);
746
742
 
747
743
  /* #54 - GL_EXT_point_parameters */
748
- rb_define_module_function(module, "glPointParameterfEXT", gl_PointParameterfEXT, 2);
749
- rb_define_module_function(module, "glPointParameterfvEXT", gl_PointParameterfvEXT, 2);
744
+ rb_define_method(klass, "glPointParameterfEXT", gl_PointParameterfEXT, 2);
745
+ rb_define_method(klass, "glPointParameterfvEXT", gl_PointParameterfvEXT, 2);
750
746
 
751
747
  /* #97 - GL_EXT_compiled_vertex_array */
752
- rb_define_module_function(module, "glLockArraysEXT", gl_LockArraysEXT, 2);
753
- rb_define_module_function(module, "glUnlockArraysEXT", gl_UnlockArraysEXT, 0);
748
+ rb_define_method(klass, "glLockArraysEXT", gl_LockArraysEXT, 2);
749
+ rb_define_method(klass, "glUnlockArraysEXT", gl_UnlockArraysEXT, 0);
754
750
 
755
751
  /* #112 - GL_EXT_draw_range_elements */
756
- rb_define_module_function(module, "glDrawRangeElementsEXT", gl_DrawRangeElementsEXT, 6);
752
+ rb_define_method(klass, "glDrawRangeElementsEXT", gl_DrawRangeElementsEXT, 6);
757
753
 
758
754
  /* #145 - GL_EXT_secondary_color */
759
- rb_define_module_function(module, "glSecondaryColor3bEXT", gl_SecondaryColor3bEXT, 3);
760
- rb_define_module_function(module, "glSecondaryColor3dEXT", gl_SecondaryColor3dEXT, 3);
761
- rb_define_module_function(module, "glSecondaryColor3fEXT", gl_SecondaryColor3fEXT, 3);
762
- rb_define_module_function(module, "glSecondaryColor3iEXT", gl_SecondaryColor3iEXT, 3);
763
- rb_define_module_function(module, "glSecondaryColor3sEXT", gl_SecondaryColor3sEXT, 3);
764
- rb_define_module_function(module, "glSecondaryColor3ubEXT", gl_SecondaryColor3ubEXT, 3);
765
- rb_define_module_function(module, "glSecondaryColor3uiEXT", gl_SecondaryColor3uiEXT, 3);
766
- rb_define_module_function(module, "glSecondaryColor3usEXT", gl_SecondaryColor3usEXT, 3);
767
- rb_define_module_function(module, "glSecondaryColor3bvEXT", gl_SecondaryColor3bvEXT, 1);
768
- rb_define_module_function(module, "glSecondaryColor3dvEXT", gl_SecondaryColor3dvEXT, 1);
769
- rb_define_module_function(module, "glSecondaryColor3fvEXT", gl_SecondaryColor3fvEXT, 1);
770
- rb_define_module_function(module, "glSecondaryColor3ivEXT", gl_SecondaryColor3ivEXT, 1);
771
- rb_define_module_function(module, "glSecondaryColor3svEXT", gl_SecondaryColor3svEXT, 1);
772
- rb_define_module_function(module, "glSecondaryColor3ubvEXT", gl_SecondaryColor3ubvEXT, 1);
773
- rb_define_module_function(module, "glSecondaryColor3uivEXT", gl_SecondaryColor3uivEXT, 1);
774
- rb_define_module_function(module, "glSecondaryColor3usvEXT", gl_SecondaryColor3usvEXT, 1);
775
- rb_define_module_function(module, "glSecondaryColorPointerEXT", gl_SecondaryColorPointerEXT, 4);
755
+ rb_define_method(klass, "glSecondaryColor3bEXT", gl_SecondaryColor3bEXT, 3);
756
+ rb_define_method(klass, "glSecondaryColor3dEXT", gl_SecondaryColor3dEXT, 3);
757
+ rb_define_method(klass, "glSecondaryColor3fEXT", gl_SecondaryColor3fEXT, 3);
758
+ rb_define_method(klass, "glSecondaryColor3iEXT", gl_SecondaryColor3iEXT, 3);
759
+ rb_define_method(klass, "glSecondaryColor3sEXT", gl_SecondaryColor3sEXT, 3);
760
+ rb_define_method(klass, "glSecondaryColor3ubEXT", gl_SecondaryColor3ubEXT, 3);
761
+ rb_define_method(klass, "glSecondaryColor3uiEXT", gl_SecondaryColor3uiEXT, 3);
762
+ rb_define_method(klass, "glSecondaryColor3usEXT", gl_SecondaryColor3usEXT, 3);
763
+ rb_define_method(klass, "glSecondaryColor3bvEXT", gl_SecondaryColor3bvEXT, 1);
764
+ rb_define_method(klass, "glSecondaryColor3dvEXT", gl_SecondaryColor3dvEXT, 1);
765
+ rb_define_method(klass, "glSecondaryColor3fvEXT", gl_SecondaryColor3fvEXT, 1);
766
+ rb_define_method(klass, "glSecondaryColor3ivEXT", gl_SecondaryColor3ivEXT, 1);
767
+ rb_define_method(klass, "glSecondaryColor3svEXT", gl_SecondaryColor3svEXT, 1);
768
+ rb_define_method(klass, "glSecondaryColor3ubvEXT", gl_SecondaryColor3ubvEXT, 1);
769
+ rb_define_method(klass, "glSecondaryColor3uivEXT", gl_SecondaryColor3uivEXT, 1);
770
+ rb_define_method(klass, "glSecondaryColor3usvEXT", gl_SecondaryColor3usvEXT, 1);
771
+ rb_define_method(klass, "glSecondaryColorPointerEXT", gl_SecondaryColorPointerEXT, 4);
776
772
 
777
773
  /* #148 - GL_EXT_multi_draw_arrays */
778
- rb_define_module_function(module, "glMultiDrawArraysEXT", gl_MultiDrawArraysEXT, 3);
779
- rb_define_module_function(module, "glMultiDrawElementsEXT", gl_MultiDrawElementsEXT, -1);
774
+ rb_define_method(klass, "glMultiDrawArraysEXT", gl_MultiDrawArraysEXT, 3);
775
+ rb_define_method(klass, "glMultiDrawElementsEXT", gl_MultiDrawElementsEXT, -1);
780
776
 
781
777
  /* #149 - GL_EXT_fog_coord */
782
- rb_define_module_function(module, "glFogCoordfEXT", gl_FogCoordfEXT, 1);
783
- rb_define_module_function(module, "glFogCoorddEXT", gl_FogCoorddEXT, 1);
784
- rb_define_module_function(module, "glFogCoordfvEXT", gl_FogCoordfvEXT, 1);
785
- rb_define_module_function(module, "glFogCoorddvEXT", gl_FogCoorddvEXT, 1);
786
- rb_define_module_function(module, "glFogCoordPointerEXT", gl_FogCoordPointerEXT, 3);
778
+ rb_define_method(klass, "glFogCoordfEXT", gl_FogCoordfEXT, 1);
779
+ rb_define_method(klass, "glFogCoorddEXT", gl_FogCoorddEXT, 1);
780
+ rb_define_method(klass, "glFogCoordfvEXT", gl_FogCoordfvEXT, 1);
781
+ rb_define_method(klass, "glFogCoorddvEXT", gl_FogCoorddvEXT, 1);
782
+ rb_define_method(klass, "glFogCoordPointerEXT", gl_FogCoordPointerEXT, 3);
787
783
 
788
784
  /* #173 - GL_EXT_blend_func_separate */
789
- rb_define_module_function(module, "glBlendFuncSeparateEXT", gl_BlendFuncSeparateEXT, 4);
785
+ rb_define_method(klass, "glBlendFuncSeparateEXT", gl_BlendFuncSeparateEXT, 4);
790
786
 
791
787
  /* #268 - GL_EXT_stencil_two_side */
792
- rb_define_module_function(module, "glActiveStencilFaceEXT", gl_ActiveStencilFaceEXT, 1);
788
+ rb_define_method(klass, "glActiveStencilFaceEXT", gl_ActiveStencilFaceEXT, 1);
793
789
 
794
790
  /* #297 - GL_EXT_depth_bounds_test */
795
- rb_define_module_function(module, "glDepthBoundsEXT", gl_DepthBoundsEXT, 2);
791
+ rb_define_method(klass, "glDepthBoundsEXT", gl_DepthBoundsEXT, 2);
796
792
 
797
793
  /* #299 - GL_EXT_blend_equation_separate */
798
- rb_define_module_function(module, "glBlendEquationSeparateEXT", gl_BlendEquationSeparateEXT, 2);
794
+ rb_define_method(klass, "glBlendEquationSeparateEXT", gl_BlendEquationSeparateEXT, 2);
799
795
 
800
796
  /* #310 - GL_EXT_framebuffer_object */
801
- rb_define_module_function(module, "glIsRenderbufferEXT", gl_IsRenderbufferEXT, 1);
802
- rb_define_module_function(module, "glBindRenderbufferEXT", gl_BindRenderbufferEXT, 2);
803
- rb_define_module_function(module, "glDeleteRenderbuffersEXT", gl_DeleteRenderbuffersEXT, 1);
804
- rb_define_module_function(module, "glGenRenderbuffersEXT", gl_GenRenderbuffersEXT, 1);
805
- rb_define_module_function(module, "glRenderbufferStorageEXT", gl_RenderbufferStorageEXT, 4);
806
- rb_define_module_function(module, "glGetRenderbufferParameterivEXT", gl_GetRenderbufferParameterivEXT, 2);
807
- rb_define_module_function(module, "glIsFramebufferEXT", gl_IsFramebufferEXT, 1);
808
- rb_define_module_function(module, "glBindFramebufferEXT", gl_BindFramebufferEXT, 2);
809
- rb_define_module_function(module, "glDeleteFramebuffersEXT", gl_DeleteFramebuffersEXT, 1);
810
- rb_define_module_function(module, "glGenFramebuffersEXT", gl_GenFramebuffersEXT, 1);
811
- rb_define_module_function(module, "glCheckFramebufferStatusEXT", gl_CheckFramebufferStatusEXT, 1);
812
- rb_define_module_function(module, "glFramebufferTexture1DEXT", gl_FramebufferTexture1DEXT, 5);
813
- rb_define_module_function(module, "glFramebufferTexture2DEXT", gl_FramebufferTexture2DEXT, 5);
814
- rb_define_module_function(module, "glFramebufferTexture3DEXT", gl_FramebufferTexture3DEXT, 6);
815
- rb_define_module_function(module, "glFramebufferRenderbufferEXT", gl_FramebufferRenderbufferEXT, 4);
816
- rb_define_module_function(module, "glGetFramebufferAttachmentParameterivEXT", gl_GetFramebufferAttachmentParameterivEXT, 3);
817
- rb_define_module_function(module, "glGenerateMipmapEXT", gl_GenerateMipmapEXT, 1);
797
+ rb_define_method(klass, "glIsRenderbufferEXT", gl_IsRenderbufferEXT, 1);
798
+ rb_define_method(klass, "glBindRenderbufferEXT", gl_BindRenderbufferEXT, 2);
799
+ rb_define_method(klass, "glDeleteRenderbuffersEXT", gl_DeleteRenderbuffersEXT, 1);
800
+ rb_define_method(klass, "glGenRenderbuffersEXT", gl_GenRenderbuffersEXT, 1);
801
+ rb_define_method(klass, "glRenderbufferStorageEXT", gl_RenderbufferStorageEXT, 4);
802
+ rb_define_method(klass, "glGetRenderbufferParameterivEXT", gl_GetRenderbufferParameterivEXT, 2);
803
+ rb_define_method(klass, "glIsFramebufferEXT", gl_IsFramebufferEXT, 1);
804
+ rb_define_method(klass, "glBindFramebufferEXT", gl_BindFramebufferEXT, 2);
805
+ rb_define_method(klass, "glDeleteFramebuffersEXT", gl_DeleteFramebuffersEXT, 1);
806
+ rb_define_method(klass, "glGenFramebuffersEXT", gl_GenFramebuffersEXT, 1);
807
+ rb_define_method(klass, "glCheckFramebufferStatusEXT", gl_CheckFramebufferStatusEXT, 1);
808
+ rb_define_method(klass, "glFramebufferTexture1DEXT", gl_FramebufferTexture1DEXT, 5);
809
+ rb_define_method(klass, "glFramebufferTexture2DEXT", gl_FramebufferTexture2DEXT, 5);
810
+ rb_define_method(klass, "glFramebufferTexture3DEXT", gl_FramebufferTexture3DEXT, 6);
811
+ rb_define_method(klass, "glFramebufferRenderbufferEXT", gl_FramebufferRenderbufferEXT, 4);
812
+ rb_define_method(klass, "glGetFramebufferAttachmentParameterivEXT", gl_GetFramebufferAttachmentParameterivEXT, 3);
813
+ rb_define_method(klass, "glGenerateMipmapEXT", gl_GenerateMipmapEXT, 1);
818
814
 
819
815
  /* #314 - GL_EXT_stencil_clear_tag */
820
- rb_define_module_function(module, "glStencilClearTagEXT", gl_StencilClearTagEXT, 2);
816
+ rb_define_method(klass, "glStencilClearTagEXT", gl_StencilClearTagEXT, 2);
821
817
 
822
818
  /* #316 - GL_EXT_framebuffer_blit */
823
- rb_define_module_function(module, "glBlitFramebufferEXT", gl_BlitFramebufferEXT, 10);
819
+ rb_define_method(klass, "glBlitFramebufferEXT", gl_BlitFramebufferEXT, 10);
824
820
 
825
821
  /* #317 - GL_EXT_framebuffer_multisample */
826
- rb_define_module_function(module, "glRenderbufferStorageMultisampleEXT", gl_RenderbufferStorageMultisampleEXT, 5);
822
+ rb_define_method(klass, "glRenderbufferStorageMultisampleEXT", gl_RenderbufferStorageMultisampleEXT, 5);
827
823
 
828
824
  /* #319 - GL_EXT_timer_query */
829
- rb_define_module_function(module, "glGetQueryObjecti64vEXT", gl_GetQueryObjecti64vEXT, 2);
830
- rb_define_module_function(module, "glGetQueryObjectui64vEXT", gl_GetQueryObjectui64vEXT, 2);
825
+ rb_define_method(klass, "glGetQueryObjecti64vEXT", gl_GetQueryObjecti64vEXT, 2);
826
+ rb_define_method(klass, "glGetQueryObjectui64vEXT", gl_GetQueryObjectui64vEXT, 2);
831
827
 
832
828
  /* #320 - GL_EXT_gpu_program_parameters */
833
- rb_define_module_function(module, "glProgramEnvParameters4fvEXT", gl_ProgramEnvParameters4fvEXT, 3);
834
- rb_define_module_function(module, "glProgramLocalParameters4fvEXT", gl_ProgramLocalParameters4fvEXT, 3);
829
+ rb_define_method(klass, "glProgramEnvParameters4fvEXT", gl_ProgramEnvParameters4fvEXT, 3);
830
+ rb_define_method(klass, "glProgramLocalParameters4fvEXT", gl_ProgramLocalParameters4fvEXT, 3);
835
831
 
836
832
  /* #324 - GL_EXT_geometry_shader4 */
837
- rb_define_module_function(module, "glProgramParameteriEXT", gl_ProgramParameteriEXT, 3);
833
+ rb_define_method(klass, "glProgramParameteriEXT", gl_ProgramParameteriEXT, 3);
838
834
 
839
835
  /* #326 - GL_EXT_gpu_shader4 */
840
- rb_define_module_function(module, "glVertexAttribI1iEXT", gl_VertexAttribI1iEXT, 2);
841
- rb_define_module_function(module, "glVertexAttribI2iEXT", gl_VertexAttribI2iEXT, 3);
842
- rb_define_module_function(module, "glVertexAttribI3iEXT", gl_VertexAttribI3iEXT, 4);
843
- rb_define_module_function(module, "glVertexAttribI4iEXT", gl_VertexAttribI4iEXT, 5);
844
- rb_define_module_function(module, "glVertexAttribI1uiEXT", gl_VertexAttribI1uiEXT, 2);
845
- rb_define_module_function(module, "glVertexAttribI2uiEXT", gl_VertexAttribI2uiEXT, 3);
846
- rb_define_module_function(module, "glVertexAttribI3uiEXT", gl_VertexAttribI3uiEXT, 4);
847
- rb_define_module_function(module, "glVertexAttribI4uiEXT", gl_VertexAttribI4uiEXT, 5);
848
- rb_define_module_function(module, "glVertexAttribI1ivEXT", gl_VertexAttribI1ivEXT, 2);
849
- rb_define_module_function(module, "glVertexAttribI2ivEXT", gl_VertexAttribI2ivEXT, 2);
850
- rb_define_module_function(module, "glVertexAttribI3ivEXT", gl_VertexAttribI3ivEXT, 2);
851
- rb_define_module_function(module, "glVertexAttribI4ivEXT", gl_VertexAttribI4ivEXT, 2);
852
- rb_define_module_function(module, "glVertexAttribI1uivEXT", gl_VertexAttribI1uivEXT, 2);
853
- rb_define_module_function(module, "glVertexAttribI2uivEXT", gl_VertexAttribI2uivEXT, 2);
854
- rb_define_module_function(module, "glVertexAttribI3uivEXT", gl_VertexAttribI3uivEXT, 2);
855
- rb_define_module_function(module, "glVertexAttribI4uivEXT", gl_VertexAttribI4uivEXT, 2);
856
- rb_define_module_function(module, "glVertexAttribI4bvEXT", gl_VertexAttribI4bvEXT, 2);
857
- rb_define_module_function(module, "glVertexAttribI4svEXT", gl_VertexAttribI4svEXT, 2);
858
- rb_define_module_function(module, "glVertexAttribI4ubvEXT", gl_VertexAttribI4ubvEXT, 2);
859
- rb_define_module_function(module, "glVertexAttribI4usvEXT", gl_VertexAttribI4usvEXT, 2);
860
- rb_define_module_function(module, "glVertexAttribIPointerEXT", gl_VertexAttribIPointerEXT, 5);
861
- rb_define_module_function(module, "glGetVertexAttribIivEXT", gl_GetVertexAttribIivEXT, 2);
862
- rb_define_module_function(module, "glGetVertexAttribIuivEXT", gl_GetVertexAttribIuivEXT, 2);
863
- rb_define_module_function(module, "glUniform1uiEXT", gl_Uniform1uiEXT, 2);
864
- rb_define_module_function(module, "glUniform2uiEXT", gl_Uniform2uiEXT, 3);
865
- rb_define_module_function(module, "glUniform3uiEXT", gl_Uniform3uiEXT, 4);
866
- rb_define_module_function(module, "glUniform4uiEXT", gl_Uniform4uiEXT, 5);
867
- rb_define_module_function(module, "glUniform1uivEXT", gl_Uniform1uivEXT, 2);
868
- rb_define_module_function(module, "glUniform2uivEXT", gl_Uniform2uivEXT, 2);
869
- rb_define_module_function(module, "glUniform3uivEXT", gl_Uniform3uivEXT, 2);
870
- rb_define_module_function(module, "glUniform4uivEXT", gl_Uniform4uivEXT, 2);
871
- rb_define_module_function(module, "glGetUniformuivEXT", gl_GetUniformuivEXT, 2);
872
- rb_define_module_function(module, "glBindFragDataLocationEXT", gl_BindFragDataLocationEXT, 3);
873
- rb_define_module_function(module, "glGetFragDataLocationEXT", gl_GetFragDataLocationEXT, 2);
836
+ rb_define_method(klass, "glVertexAttribI1iEXT", gl_VertexAttribI1iEXT, 2);
837
+ rb_define_method(klass, "glVertexAttribI2iEXT", gl_VertexAttribI2iEXT, 3);
838
+ rb_define_method(klass, "glVertexAttribI3iEXT", gl_VertexAttribI3iEXT, 4);
839
+ rb_define_method(klass, "glVertexAttribI4iEXT", gl_VertexAttribI4iEXT, 5);
840
+ rb_define_method(klass, "glVertexAttribI1uiEXT", gl_VertexAttribI1uiEXT, 2);
841
+ rb_define_method(klass, "glVertexAttribI2uiEXT", gl_VertexAttribI2uiEXT, 3);
842
+ rb_define_method(klass, "glVertexAttribI3uiEXT", gl_VertexAttribI3uiEXT, 4);
843
+ rb_define_method(klass, "glVertexAttribI4uiEXT", gl_VertexAttribI4uiEXT, 5);
844
+ rb_define_method(klass, "glVertexAttribI1ivEXT", gl_VertexAttribI1ivEXT, 2);
845
+ rb_define_method(klass, "glVertexAttribI2ivEXT", gl_VertexAttribI2ivEXT, 2);
846
+ rb_define_method(klass, "glVertexAttribI3ivEXT", gl_VertexAttribI3ivEXT, 2);
847
+ rb_define_method(klass, "glVertexAttribI4ivEXT", gl_VertexAttribI4ivEXT, 2);
848
+ rb_define_method(klass, "glVertexAttribI1uivEXT", gl_VertexAttribI1uivEXT, 2);
849
+ rb_define_method(klass, "glVertexAttribI2uivEXT", gl_VertexAttribI2uivEXT, 2);
850
+ rb_define_method(klass, "glVertexAttribI3uivEXT", gl_VertexAttribI3uivEXT, 2);
851
+ rb_define_method(klass, "glVertexAttribI4uivEXT", gl_VertexAttribI4uivEXT, 2);
852
+ rb_define_method(klass, "glVertexAttribI4bvEXT", gl_VertexAttribI4bvEXT, 2);
853
+ rb_define_method(klass, "glVertexAttribI4svEXT", gl_VertexAttribI4svEXT, 2);
854
+ rb_define_method(klass, "glVertexAttribI4ubvEXT", gl_VertexAttribI4ubvEXT, 2);
855
+ rb_define_method(klass, "glVertexAttribI4usvEXT", gl_VertexAttribI4usvEXT, 2);
856
+ rb_define_method(klass, "glVertexAttribIPointerEXT", gl_VertexAttribIPointerEXT, 5);
857
+ rb_define_method(klass, "glGetVertexAttribIivEXT", gl_GetVertexAttribIivEXT, 2);
858
+ rb_define_method(klass, "glGetVertexAttribIuivEXT", gl_GetVertexAttribIuivEXT, 2);
859
+ rb_define_method(klass, "glUniform1uiEXT", gl_Uniform1uiEXT, 2);
860
+ rb_define_method(klass, "glUniform2uiEXT", gl_Uniform2uiEXT, 3);
861
+ rb_define_method(klass, "glUniform3uiEXT", gl_Uniform3uiEXT, 4);
862
+ rb_define_method(klass, "glUniform4uiEXT", gl_Uniform4uiEXT, 5);
863
+ rb_define_method(klass, "glUniform1uivEXT", gl_Uniform1uivEXT, 2);
864
+ rb_define_method(klass, "glUniform2uivEXT", gl_Uniform2uivEXT, 2);
865
+ rb_define_method(klass, "glUniform3uivEXT", gl_Uniform3uivEXT, 2);
866
+ rb_define_method(klass, "glUniform4uivEXT", gl_Uniform4uivEXT, 2);
867
+ rb_define_method(klass, "glGetUniformuivEXT", gl_GetUniformuivEXT, 2);
868
+ rb_define_method(klass, "glBindFragDataLocationEXT", gl_BindFragDataLocationEXT, 3);
869
+ rb_define_method(klass, "glGetFragDataLocationEXT", gl_GetFragDataLocationEXT, 2);
874
870
 
875
871
  /* #327 - GL_EXT_draw_instanced */
876
- rb_define_module_function(module, "glDrawArraysInstancedEXT", gl_DrawArraysInstancedEXT, 4);
877
- rb_define_module_function(module, "glDrawElementsInstancedEXT", gl_DrawElementsInstancedEXT, 5);
872
+ rb_define_method(klass, "glDrawArraysInstancedEXT", gl_DrawArraysInstancedEXT, 4);
873
+ rb_define_method(klass, "glDrawElementsInstancedEXT", gl_DrawElementsInstancedEXT, 5);
878
874
 
879
875
  /* #330 - GL_EXT_texture_buffer_object */
880
- rb_define_module_function(module, "glTexBufferEXT", gl_TexBufferEXT, 3);
876
+ rb_define_method(klass, "glTexBufferEXT", gl_TexBufferEXT, 3);
881
877
 
882
878
  /* #343 - GL_EXT_texture_integer */
883
- rb_define_module_function(module, "glClearColorIiEXT", gl_ClearColorIiEXT, 4);
884
- rb_define_module_function(module, "glClearColorIuiEXT", gl_ClearColorIuiEXT, 4);
885
- rb_define_module_function(module, "glTexParameterIivEXT", gl_TexParameterIivEXT, 3);
886
- rb_define_module_function(module, "glTexParameterIuivEXT", gl_TexParameterIuivEXT, 3);
887
- rb_define_module_function(module, "glGetTexParameterIivEXT", gl_GetTexParameterIivEXT, 2);
888
- rb_define_module_function(module, "glGetTexParameterIuivEXT", gl_GetTexParameterIuivEXT, 2);
879
+ rb_define_method(klass, "glClearColorIiEXT", gl_ClearColorIiEXT, 4);
880
+ rb_define_method(klass, "glClearColorIuiEXT", gl_ClearColorIuiEXT, 4);
881
+ rb_define_method(klass, "glTexParameterIivEXT", gl_TexParameterIivEXT, 3);
882
+ rb_define_method(klass, "glTexParameterIuivEXT", gl_TexParameterIuivEXT, 3);
883
+ rb_define_method(klass, "glGetTexParameterIivEXT", gl_GetTexParameterIivEXT, 2);
884
+ rb_define_method(klass, "glGetTexParameterIuivEXT", gl_GetTexParameterIuivEXT, 2);
889
885
  }