opengl 0.9.2-x64-mingw32 → 0.10.0-x64-mingw32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +8 -0
  3. data/{History.rdoc → History.md} +15 -0
  4. data/Manifest.txt +5 -1
  5. data/README.rdoc +25 -28
  6. data/Rakefile +125 -27
  7. data/examples/RedBook/font.rb +2 -2
  8. data/examples/RedBook/light.rb +2 -0
  9. data/examples/RedBook/stroke.rb +6 -6
  10. data/ext/opengl/GL/gl.h +2115 -0
  11. data/ext/opengl/GL/glext.h +11770 -0
  12. data/ext/opengl/common.h +116 -172
  13. data/ext/opengl/conv.h +2 -2
  14. data/ext/opengl/extconf.rb +3 -31
  15. data/ext/opengl/fptr_struct.h +912 -0
  16. data/ext/opengl/funcdef.h +29 -63
  17. data/ext/opengl/gl-1.0-1.1.c +918 -648
  18. data/ext/opengl/gl-1.2.c +13 -13
  19. data/ext/opengl/gl-1.3.c +68 -64
  20. data/ext/opengl/gl-1.4.c +64 -66
  21. data/ext/opengl/gl-1.5.c +32 -31
  22. data/ext/opengl/gl-2.0.c +126 -128
  23. data/ext/opengl/gl-2.1.c +8 -8
  24. data/ext/opengl/gl-3.0.c +102 -93
  25. data/ext/opengl/gl-enums.c +9 -29
  26. data/ext/opengl/gl-enums.h +31 -91
  27. data/ext/opengl/gl-error.c +15 -17
  28. data/ext/opengl/gl-error.h +4 -7
  29. data/ext/opengl/gl-ext-3dfx.c +2 -2
  30. data/ext/opengl/gl-ext-arb.c +176 -171
  31. data/ext/opengl/gl-ext-ati.c +4 -4
  32. data/ext/opengl/gl-ext-ext.c +151 -155
  33. data/ext/opengl/gl-ext-gremedy.c +4 -4
  34. data/ext/opengl/gl-ext-nv.c +141 -142
  35. data/ext/opengl/gl.c +121 -76
  36. data/ext/opengl/gl_buffer.c +44 -19
  37. data/ext/opengl/glimpl.c +187 -0
  38. data/ext/opengl/glimpl.h +47 -0
  39. data/ext/opengl/opengl.c +5 -3
  40. data/lib/opengl.rb +24 -4
  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/2.4/opengl.so +0 -0
  46. data/lib/opengl/bindings_version.rb +4 -0
  47. data/lib/opengl/implementation.rb +38 -0
  48. data/opengl.gemspec +32 -0
  49. data/test/test_gl.rb +7 -0
  50. data/test/test_gl_21.rb +21 -21
  51. data/test/test_gl_ext_arb.rb +1 -1
  52. data/test/test_glimpl.rb +23 -0
  53. data/test/test_opengl_buffer.rb +2 -0
  54. data/utils/enumgen.rb +2 -2
  55. metadata +74 -61
  56. checksums.yaml.gz.sig +0 -0
  57. data.tar.gz.sig +0 -0
  58. data/ext/opengl/gl-types.h +0 -67
  59. metadata.gz.sig +0 -2
@@ -18,9 +18,9 @@
18
18
  /* Graphic Remedy extensions */
19
19
 
20
20
  /* #311 GL_GREMEDY_string_marker */
21
- static void (APIENTRY * fptr_glStringMarkerGREMEDY)(GLsizei,const void *);
22
21
  static VALUE gl_StringMarkerGREMEDY(VALUE obj,VALUE arg1)
23
22
  {
23
+ DECL_GL_FUNC_PTR(GLvoid,glStringMarkerGREMEDY,(GLsizei,const void *));
24
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));
@@ -31,11 +31,11 @@ static VALUE gl_StringMarkerGREMEDY(VALUE obj,VALUE arg1)
31
31
  /* #345 GL_GREMEDY_frame_terminator */
32
32
  GL_FUNC_LOAD_0(FrameTerminatorGREMEDY,GLvoid, "GL_GREMEDY_frame_terminator")
33
33
 
34
- void gl_init_functions_ext_gremedy(VALUE module)
34
+ void gl_init_functions_ext_gremedy(VALUE klass)
35
35
  {
36
36
  /* #311 GL_GREMEDY_string_marker */
37
- rb_define_module_function(module, "glStringMarkerGREMEDY", gl_StringMarkerGREMEDY, 1);
37
+ rb_define_method(klass, "glStringMarkerGREMEDY", gl_StringMarkerGREMEDY, 1);
38
38
 
39
39
  /* #345 GL_GREMEDY_frame_terminator */
40
- rb_define_module_function(module, "glFrameTerminatorGREMEDY", gl_FrameTerminatorGREMEDY, 0);
40
+ rb_define_method(klass, "glFrameTerminatorGREMEDY", gl_FrameTerminatorGREMEDY, 0);
41
41
  }
@@ -25,10 +25,10 @@ GL_FUNC_LOAD_1(TestFenceNV,GLboolean, GLuint,"GL_NV_fence")
25
25
  GL_FUNC_LOAD_1(IsFenceNV,GLboolean, GLuint,"GL_NV_fence")
26
26
  GL_FUNC_LOAD_1(FinishFenceNV,GLvoid, GLuint,"GL_NV_fence")
27
27
 
28
- static void (APIENTRY * fptr_glGetFenceivNV)(GLuint,GLenum,GLint *);
29
28
  static VALUE gl_GetFenceivNV(VALUE obj,VALUE arg1,VALUE arg2)
30
29
  {
31
30
  GLint ret = 0;
31
+ DECL_GL_FUNC_PTR(GLvoid,glGetFenceivNV,(GLuint,GLenum,GLint *));
32
32
  LOAD_GL_FUNC(glGetFenceivNV, "GL_NV_fence");
33
33
  fptr_glGetFenceivNV(NUM2INT(arg1),NUM2INT(arg2),&ret);
34
34
  CHECK_GLERROR_FROM("glGetFenceivNV");
@@ -36,9 +36,9 @@ static VALUE gl_GetFenceivNV(VALUE obj,VALUE arg1,VALUE arg2)
36
36
  }
37
37
 
38
38
  /* #233 GL_NV_vertex_program */
39
- static void (APIENTRY * fptr_glLoadProgramNV)(GLenum,GLuint,GLsizei,const GLubyte *);
40
39
  static VALUE gl_LoadProgramNV(VALUE obj,VALUE arg1,VALUE arg2,VALUE arg3)
41
40
  {
41
+ DECL_GL_FUNC_PTR(GLvoid,glLoadProgramNV,(GLenum,GLuint,GLsizei,const GLubyte *));
42
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));
@@ -46,23 +46,24 @@ static VALUE gl_LoadProgramNV(VALUE obj,VALUE arg1,VALUE arg2,VALUE arg3)
46
46
  return Qnil;
47
47
  }
48
48
 
49
- static void (APIENTRY * fptr_glGetProgramivNV)(GLuint,GLenum,GLint *);
50
49
  static VALUE gl_GetProgramivNV(VALUE obj,VALUE arg1,VALUE arg2)
51
50
  {
52
51
  GLint ret = 0;
52
+ DECL_GL_FUNC_PTR(GLvoid,glGetProgramivNV,(GLuint,GLenum,GLint *));
53
53
  LOAD_GL_FUNC(glGetProgramivNV, "GL_NV_vertex_program");
54
54
  fptr_glGetProgramivNV(NUM2INT(arg1),NUM2INT(arg2),&ret);
55
55
  CHECK_GLERROR_FROM("glGetProgramivNV");
56
56
  return cond_GLBOOL2RUBY(NUM2INT(arg2),ret);
57
57
  }
58
58
 
59
- static void (APIENTRY * fptr_glGetProgramStringNV)(GLuint,GLenum,void *string);
60
59
  static VALUE gl_GetProgramStringNV(VALUE obj,VALUE arg1,VALUE arg2)
61
60
  {
62
61
  GLsizei len = 0;
63
62
  char *buffer;
64
63
  VALUE ret_buffer;
65
64
 
65
+ DECL_GL_FUNC_PTR(GLvoid,glGetProgramStringNV,(GLuint,GLenum,void *string));
66
+ DECL_GL_FUNC_PTR(GLvoid,glGetProgramivNV,(GLuint,GLenum,GLint *));
66
67
  LOAD_GL_FUNC(glGetProgramStringNV, "GL_NV_vertex_program");
67
68
  LOAD_GL_FUNC(glGetProgramivNV, "GL_NV_vertex_program");
68
69
 
@@ -86,10 +87,10 @@ GL_FUNC_LOAD_1(IsProgramNV,GLboolean, GLuint,"GL_NV_vertex_program")
86
87
  GL_FUNC_GENOBJECTS_LOAD(GenProgramsNV,"GL_NV_vertex_program")
87
88
  GL_FUNC_DELETEOBJECTS_LOAD(DeleteProgramsNV,"GL_NV_vertex_program")
88
89
 
89
- 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
+ DECL_GL_FUNC_PTR(GLvoid,glExecuteProgramNV,(GLenum,GLuint,const GLfloat *));
93
94
  LOAD_GL_FUNC(glExecuteProgramNV, "GL_NV_vertex_program");
94
95
  ary2cflt(arg3,params,4);
95
96
  fptr_glExecuteProgramNV(NUM2UINT(arg1),NUM2UINT(arg2),params);
@@ -97,9 +98,6 @@ static VALUE gl_ExecuteProgramNV(VALUE obj,VALUE arg1,VALUE arg2,VALUE arg3)
97
98
  return Qnil;
98
99
  }
99
100
 
100
- extern VALUE g_VertexAttrib_ptr[];
101
-
102
- static void (APIENTRY * fptr_glVertexAttribPointerNV)(GLuint,GLint,GLenum,GLsizei,const GLvoid *);
103
101
  static VALUE gl_VertexAttribPointerNV(VALUE obj,VALUE arg1,VALUE arg2,VALUE arg3,VALUE arg4,VALUE arg5)
104
102
  {
105
103
  GLuint index;
@@ -107,6 +105,7 @@ static VALUE gl_VertexAttribPointerNV(VALUE obj,VALUE arg1,VALUE arg2,VALUE arg3
107
105
  GLenum type;
108
106
  GLsizei stride;
109
107
 
108
+ DECL_GL_FUNC_PTR(GLvoid,glVertexAttribPointerNV,(GLuint,GLint,GLenum,GLsizei,const GLvoid *));
110
109
  LOAD_GL_FUNC(glVertexAttribPointerNV, "GL_NV_vertex_program");
111
110
 
112
111
  index = (GLuint)NUM2UINT(arg1);
@@ -116,14 +115,14 @@ static VALUE gl_VertexAttribPointerNV(VALUE obj,VALUE arg1,VALUE arg2,VALUE arg3
116
115
  if (index>_MAX_VERTEX_ATTRIBS)
117
116
  rb_raise(rb_eArgError, "Index too large, maximum allowed value '%i'",_MAX_VERTEX_ATTRIBS);
118
117
 
119
- if (CheckBufferBinding(GL_ARRAY_BUFFER_BINDING)) {
120
- g_VertexAttrib_ptr[index] = arg5;
118
+ if (CHECK_BUFFER_BINDING(GL_ARRAY_BUFFER_BINDING)) {
119
+ GET_GLIMPL_VARIABLE(VertexAttrib_ptr)[index] = arg5;
121
120
  fptr_glVertexAttribPointerNV(index,size,type,stride,(GLvoid *)NUM2SIZET(arg5));
122
121
  } else {
123
122
  VALUE data;
124
123
  data = pack_array_or_pass_string(type,arg5);
125
124
  rb_str_freeze(data);
126
- g_VertexAttrib_ptr[index] = data;
125
+ GET_GLIMPL_VARIABLE(VertexAttrib_ptr)[index] = data;
127
126
  fptr_glVertexAttribPointerNV(index,size,type,stride,(GLvoid *)RSTRING_PTR(data));
128
127
  }
129
128
 
@@ -132,30 +131,30 @@ static VALUE gl_VertexAttribPointerNV(VALUE obj,VALUE arg1,VALUE arg2,VALUE arg3
132
131
  }
133
132
 
134
133
 
135
- static void (APIENTRY * fptr_glGetVertexAttribPointervNV)(GLuint,GLenum,GLvoid **);
136
134
  static VALUE
137
135
  gl_GetVertexAttribPointervNV(obj,arg1)
138
136
  VALUE obj,arg1;
139
137
  {
140
138
  GLuint index;
139
+ DECL_GL_FUNC_PTR(GLvoid,glGetVertexAttribPointervNV,(GLuint,GLenum,GLvoid **));
141
140
  LOAD_GL_FUNC(glGetVertexAttribPointervNV, "GL_NV_vertex_program");
142
141
  index =(GLuint) NUM2INT(arg1);
143
142
  if (index>_MAX_VERTEX_ATTRIBS)
144
143
  rb_raise(rb_eArgError, "Index too large, maximum allowed value '%i'",_MAX_VERTEX_ATTRIBS);
145
144
 
146
- return g_VertexAttrib_ptr[index];
145
+ return GET_GLIMPL_VARIABLE(VertexAttrib_ptr)[index];
147
146
  }
148
147
 
149
148
  GL_FUNC_LOAD_6(ProgramParameter4dNV,GLvoid, GLenum,GLuint,GLdouble,GLdouble,GLdouble,GLdouble, "GL_NV_vertex_program")
150
149
  GL_FUNC_LOAD_6(ProgramParameter4fNV,GLvoid, GLenum,GLuint,GLfloat,GLfloat,GLfloat,GLfloat, "GL_NV_vertex_program")
151
150
 
152
151
  #define PROGRAMPARAM_FUNC_V(_name_,_type_,_conv_,_extension_) \
153
- static void (APIENTRY * fptr_gl##_name_)(GLenum,GLuint,const _type_ *); \
154
152
  static VALUE \
155
153
  gl_##_name_(obj,arg1,arg2,arg3) \
156
154
  VALUE obj,arg1,arg2,arg3; \
157
155
  { \
158
156
  _type_ cary[4]; \
157
+ DECL_GL_FUNC_PTR(GLvoid,gl##_name_,(GLenum,GLuint,const _type_ *)); \
159
158
  LOAD_GL_FUNC(gl##_name_, _extension_); \
160
159
  _conv_(arg3,cary,4); \
161
160
  fptr_gl##_name_(NUM2UINT(arg1),NUM2UINT(arg2),cary); \
@@ -167,12 +166,12 @@ PROGRAMPARAM_FUNC_V(ProgramParameter4dvNV,GLdouble,ary2cdbl,"GL_NV_vertex_progra
167
166
  PROGRAMPARAM_FUNC_V(ProgramParameter4fvNV,GLfloat,ary2cflt,"GL_NV_vertex_program")
168
167
 
169
168
  #define GETPROGRAMPARAM_FUNC(_name_,_type_,_extension_) \
170
- static void (APIENTRY * fptr_gl##_name_)(GLenum,GLuint,GLenum,_type_ *); \
171
169
  static VALUE \
172
170
  gl_##_name_(obj,arg1,arg2,arg3) \
173
171
  VALUE obj,arg1,arg2,arg3; \
174
172
  { \
175
173
  _type_ cary[4] = {(_type_)0.0, (_type_)0.0, (_type_)0.0, (_type_)0.0}; \
174
+ DECL_GL_FUNC_PTR(GLvoid,gl##_name_,(GLenum,GLuint,GLenum,_type_ *)); \
176
175
  LOAD_GL_FUNC(gl##_name_, _extension_); \
177
176
  fptr_gl##_name_(NUM2UINT(arg1),NUM2UINT(arg2),NUM2UINT(arg3),cary); \
178
177
  RET_ARRAY_OR_SINGLE("gl" #_name_, 4, RETCONV_##_type_, cary); \
@@ -183,13 +182,13 @@ GETPROGRAMPARAM_FUNC(GetProgramParameterfvNV,GLfloat,"GL_NV_vertex_program")
183
182
  #undef GETPROGRAMPARAM_FUNC
184
183
 
185
184
  #define PROGRAMPARAM_MULTI_FUNC_V(_name_,_type_,_conv_,_extension_) \
186
- static void (APIENTRY * fptr_gl##_name_)(GLenum,GLuint,GLuint,const _type_ *); \
187
185
  static VALUE \
188
186
  gl_##_name_(obj,arg1,arg2,arg3) \
189
187
  VALUE obj,arg1,arg2,arg3; \
190
188
  { \
191
189
  _type_ *cary; \
192
190
  GLuint len; \
191
+ DECL_GL_FUNC_PTR(GLvoid,gl##_name_,(GLenum,GLuint,GLuint,const _type_ *)); \
193
192
  LOAD_GL_FUNC(gl##_name_, _extension_); \
194
193
  len = (GLuint)RARRAY_LENINT(rb_Array(arg3)); \
195
194
  if (len<=0 || (len % 4) != 0) \
@@ -220,13 +219,13 @@ GL_FUNC_LOAD_5(VertexAttrib4sNV,GLvoid, GLuint,GLshort,GLshort,GLshort,GLshort,
220
219
  GL_FUNC_LOAD_5(VertexAttrib4ubNV,GLvoid, GLuint,GLubyte,GLubyte,GLubyte,GLubyte, "GL_NV_vertex_program")
221
220
 
222
221
  #define VERTEXATTRIB_FUNC_V(_name_,_type_,_conv_,_size_,_extension_) \
223
- static void (APIENTRY * fptr_gl##_name_)(GLuint,_type_ *); \
224
222
  static VALUE \
225
223
  gl_##_name_(obj,arg1,arg2) \
226
224
  VALUE obj,arg1,arg2; \
227
225
  { \
228
226
  GLuint index; \
229
227
  _type_ v[_size_]; \
228
+ DECL_GL_FUNC_PTR(GLvoid,gl##_name_,(GLuint,_type_ *)); \
230
229
  LOAD_GL_FUNC(gl##_name_, _extension_); \
231
230
  index = (GLuint)NUM2UINT(arg1); \
232
231
  _conv_(arg2,v,_size_); \
@@ -251,7 +250,6 @@ VERTEXATTRIB_FUNC_V(VertexAttrib1svNV,GLshort,ary2cshort,1,"GL_NV_vertex_program
251
250
  #undef VERTEXATTRIB_FUNC_V
252
251
 
253
252
  #define VERTEXATTRIB_MULTI_FUNC_V(_name_,_type_,_conv_,_size_,_extension_) \
254
- static void (APIENTRY * fptr_gl##_name_)(GLuint,GLsizei,_type_ *); \
255
253
  static VALUE \
256
254
  gl_##_name_(obj,arg1,arg2) \
257
255
  VALUE obj,arg1,arg2; \
@@ -259,6 +257,7 @@ VALUE obj,arg1,arg2; \
259
257
  GLuint index; \
260
258
  _type_ *cary; \
261
259
  GLsizei len; \
260
+ DECL_GL_FUNC_PTR(GLvoid,gl##_name_,(GLuint,GLsizei,_type_ *)); \
262
261
  LOAD_GL_FUNC(gl##_name_, _extension_); \
263
262
  len = (GLsizei)RARRAY_LENINT(rb_Array(arg2)); \
264
263
  if (len<=0 || (len % _size_) != 0) \
@@ -288,7 +287,6 @@ VERTEXATTRIB_MULTI_FUNC_V(VertexAttribs1svNV,GLshort,ary2cshort,1,"GL_NV_vertex_
288
287
  #undef VERTEXATTRIB_MULTI_FUNC_V
289
288
 
290
289
  #define GETVERTEXATTRIB_FUNC(_name_,_type_,_extension_) \
291
- static void (APIENTRY * fptr_gl##_name_)(GLuint,GLenum,_type_ *); \
292
290
  static VALUE \
293
291
  gl_##_name_(obj,arg1,arg2) \
294
292
  VALUE obj,arg1,arg2; \
@@ -297,6 +295,7 @@ VALUE obj,arg1,arg2; \
297
295
  GLenum pname; \
298
296
  _type_ params[4] = {0,0,0,0}; \
299
297
  GLint size; \
298
+ DECL_GL_FUNC_PTR(GLvoid,gl##_name_,(GLuint,GLenum,_type_ *)); \
300
299
  LOAD_GL_FUNC(gl##_name_, _extension_); \
301
300
  index = (GLuint)NUM2UINT(arg1); \
302
301
  pname = (GLenum)NUM2INT(arg2); \
@@ -312,7 +311,6 @@ GETVERTEXATTRIB_FUNC(GetVertexAttribdvNV,GLdouble,"GL_NV_vertex_program")
312
311
  GETVERTEXATTRIB_FUNC(GetVertexAttribfvNV,GLfloat,"GL_NV_vertex_program")
313
312
  #undef GETVERTEXATTRIB_FUNC
314
313
 
315
- static void (APIENTRY * fptr_glGetVertexAttribivNV)(GLuint,GLenum,GLint *);
316
314
  static VALUE
317
315
  gl_GetVertexAttribivNV(obj,arg1,arg2)
318
316
  VALUE obj,arg1,arg2;
@@ -321,6 +319,7 @@ VALUE obj,arg1,arg2;
321
319
  GLenum pname;
322
320
  GLint params[4] = {0,0,0,0};
323
321
  GLint size;
322
+ DECL_GL_FUNC_PTR(GLvoid,glGetVertexAttribivNV,(GLuint,GLenum,GLint *));
324
323
  LOAD_GL_FUNC(glGetVertexAttribivNV, "GL_NV_vertex_program");
325
324
  index = (GLuint)NUM2UINT(arg1);
326
325
  pname = (GLenum)NUM2INT(arg2);
@@ -336,19 +335,19 @@ VALUE obj,arg1,arg2;
336
335
 
337
336
  GL_FUNC_LOAD_4(TrackMatrixNV,GLvoid, GLenum,GLuint,GLenum,GLenum, "GL_NV_vertex_program")
338
337
 
339
- static void (APIENTRY * fptr_glGetTrackMatrixivNV)(GLenum,GLuint,GLenum,GLint *);
340
338
  static VALUE gl_GetTrackMatrixivNV(VALUE obj,VALUE arg1,VALUE arg2,VALUE arg3)
341
339
  {
342
340
  GLint ret = 0;
341
+ DECL_GL_FUNC_PTR(GLvoid,glGetTrackMatrixivNV,(GLenum,GLuint,GLenum,GLint *));
343
342
  LOAD_GL_FUNC(glGetTrackMatrixivNV, "GL_NV_vertex_program");
344
343
  fptr_glGetTrackMatrixivNV(NUM2UINT(arg1),NUM2UINT(arg2),NUM2UINT(arg3),&ret);
345
344
  CHECK_GLERROR_FROM("glGetTrackMatrixivNV");
346
345
  return INT2NUM(ret);
347
346
  }
348
347
 
349
- static void (APIENTRY * fptr_glRequestResidentProgramsNV)(GLsizei, GLuint *);
350
348
  static VALUE gl_RequestResidentProgramsNV(VALUE obj,VALUE arg1)
351
349
  {
350
+ DECL_GL_FUNC_PTR(GLvoid,glRequestResidentProgramsNV,(GLsizei, GLuint *));
352
351
  LOAD_GL_FUNC(glRequestResidentProgramsNV, "GL_NV_vertex_program");
353
352
  if (TYPE(arg1)==T_ARRAY) {
354
353
  GLsizei n;
@@ -367,7 +366,6 @@ static VALUE gl_RequestResidentProgramsNV(VALUE obj,VALUE arg1)
367
366
  return Qnil;
368
367
  }
369
368
 
370
- static GLboolean (APIENTRY * fptr_glAreProgramsResidentNV)(GLsizei, const GLuint *, GLboolean *);
371
369
  static VALUE gl_AreProgramsResidentNV(VALUE obj,VALUE arg1)
372
370
  {
373
371
  GLuint *programs;
@@ -377,6 +375,7 @@ static VALUE gl_AreProgramsResidentNV(VALUE obj,VALUE arg1)
377
375
  VALUE retary;
378
376
  VALUE ary;
379
377
  int i;
378
+ DECL_GL_FUNC_PTR(GLboolean,glAreProgramsResidentNV,(GLsizei, const GLuint *, GLboolean *));
380
379
  LOAD_GL_FUNC(glAreProgramsResidentNV, "GL_NV_vertex_program");
381
380
  ary = rb_Array(arg1);
382
381
  size = (GLsizei)RARRAY_LENINT(ary);
@@ -406,10 +405,10 @@ GL_FUNC_LOAD_1(BeginOcclusionQueryNV,GLvoid, GLuint, "GL_NV_occlusion_query")
406
405
  GL_FUNC_LOAD_0(EndOcclusionQueryNV,GLvoid, "GL_NV_occlusion_query")
407
406
 
408
407
  #define GETOCCLUSIONQUERY_FUNC(_name_,_type_,_conv_) \
409
- static void (APIENTRY * fptr_gl##_name_)(GLuint,GLenum,_type_ *); \
410
408
  static VALUE gl_##_name_(VALUE obj,VALUE arg1,VALUE arg2) \
411
409
  { \
412
410
  _type_ ret = 0; \
411
+ DECL_GL_FUNC_PTR(GLvoid,gl##_name_,(GLuint,GLenum,_type_ *)); \
413
412
  LOAD_GL_FUNC(gl##_name_, "GL_NV_occlusion_query"); \
414
413
  fptr_gl##_name_(NUM2INT(arg1),NUM2INT(arg2),&ret); \
415
414
  CHECK_GLERROR_FROM("gl" #_name_); \
@@ -423,10 +422,10 @@ GETOCCLUSIONQUERY_FUNC(GetOcclusionQueryuivNV,GLuint,cond_GLBOOL2RUBY_U)
423
422
  /* #262 GL_NV_point_sprite */
424
423
  GL_FUNC_LOAD_2(PointParameteriNV,GLvoid, GLenum,GLint, "GL_NV_point_sprite")
425
424
 
426
- static void (APIENTRY * fptr_glPointParameterivNV)(GLenum,const GLint *);
427
425
  static VALUE gl_PointParameterivNV(VALUE obj,VALUE arg1,VALUE arg2)
428
426
  {
429
427
  GLint param = 0;
428
+ DECL_GL_FUNC_PTR(GLvoid,glPointParameterivNV,(GLenum,const GLint *));
430
429
  LOAD_GL_FUNC(glPointParameterivNV, "GL_NV_point_sprite");
431
430
  ary2cint(arg2,&param,1);
432
431
  fptr_glPointParameterivNV(NUM2UINT(arg1),&param);
@@ -436,11 +435,11 @@ static VALUE gl_PointParameterivNV(VALUE obj,VALUE arg1,VALUE arg2)
436
435
 
437
436
  /* #282 GL_NV_fragment_program */
438
437
  #define PROGRAMNAMEDPARAM_FUNC(_name_,_type_,_conv_,_extension_) \
439
- static void (APIENTRY * fptr_gl##_name_)(GLuint,GLsizei,const GLubyte *,_type_,_type_,_type_,_type_); \
440
438
  static VALUE \
441
439
  gl_##_name_(obj,arg1,arg2,arg3,arg4,arg5,arg6) \
442
440
  VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6; \
443
441
  { \
442
+ DECL_GL_FUNC_PTR(GLvoid,gl##_name_,(GLuint,GLsizei,const GLubyte *,_type_,_type_,_type_,_type_)); \
444
443
  LOAD_GL_FUNC(gl##_name_, _extension_); \
445
444
  Check_Type(arg2,T_STRING); \
446
445
  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)); \
@@ -453,12 +452,12 @@ PROGRAMNAMEDPARAM_FUNC(ProgramNamedParameter4fNV,GLfloat,NUM2DBL,"GL_NV_fragment
453
452
  #undef PROGRAMNAMEDPARAM_FUNC
454
453
 
455
454
  #define PROGRAMNAMEDPARAM_FUNC_V(_name_,_type_,_conv_,_extension_) \
456
- static void (APIENTRY * fptr_gl##_name_)(GLuint,GLsizei,const GLubyte *,const _type_ *); \
457
455
  static VALUE \
458
456
  gl_##_name_(obj,arg1,arg2,arg3) \
459
457
  VALUE obj,arg1,arg2,arg3; \
460
458
  { \
461
459
  _type_ cary[4]; \
460
+ DECL_GL_FUNC_PTR(GLvoid,gl##_name_,(GLuint,GLsizei,const GLubyte *,const _type_ *)); \
462
461
  LOAD_GL_FUNC(gl##_name_, _extension_); \
463
462
  Check_Type(arg2,T_STRING); \
464
463
  _conv_(arg3,cary,4); \
@@ -472,12 +471,12 @@ PROGRAMNAMEDPARAM_FUNC_V(ProgramNamedParameter4fvNV,GLfloat,ary2cflt,"GL_NV_vert
472
471
  #undef PROGRAMNAMEDPARAM_FUNC_V
473
472
 
474
473
  #define GETPROGRAMNAMEDPARAM_FUNC(_name_,_type_,_extension_) \
475
- static void (APIENTRY * fptr_gl##_name_)(GLuint,GLsizei,const GLubyte *,_type_ *); \
476
474
  static VALUE \
477
475
  gl_##_name_(obj,arg1,arg2) \
478
476
  VALUE obj,arg1,arg2; \
479
477
  { \
480
478
  _type_ cary[4] = {(_type_)0.0, (_type_)0.0, (_type_)0.0, (_type_)0.0}; \
479
+ DECL_GL_FUNC_PTR(GLvoid,gl##_name_,(GLuint,GLsizei,const GLubyte *,_type_ *)); \
481
480
  LOAD_GL_FUNC(gl##_name_, _extension_); \
482
481
  Check_Type(arg2,T_STRING); \
483
482
  fptr_gl##_name_((GLuint)NUM2UINT(arg1),(GLsizei)RSTRING_LENINT(arg2),(GLubyte *)RSTRING_PTR(arg2),cary); \
@@ -512,12 +511,12 @@ PROGRAMPARAM_MULTI_FUNC_V(ProgramEnvParametersI4uivNV,GLuint,ary2cuint,"GL_NV_gp
512
511
  #undef PROGRAMPARAM_FUNC_V
513
512
 
514
513
  #define GETPROGRAMPARAM_FUNC_2(_name_,_type_,_extension_) \
515
- static void (APIENTRY * fptr_gl##_name_)(GLenum,GLuint,_type_ *); \
516
514
  static VALUE \
517
515
  gl_##_name_(obj,arg1,arg2) \
518
516
  VALUE obj,arg1,arg2; \
519
517
  { \
520
518
  _type_ cary[4] = {(_type_)0.0, (_type_)0.0, (_type_)0.0, (_type_)0.0}; \
519
+ DECL_GL_FUNC_PTR(GLvoid,gl##_name_,(GLenum,GLuint,_type_ *)); \
521
520
  LOAD_GL_FUNC(gl##_name_, _extension_); \
522
521
  fptr_gl##_name_(NUM2UINT(arg1),NUM2UINT(arg2),cary); \
523
522
  RET_ARRAY_OR_SINGLE("gl" #_name_, 4, RETCONV_##_type_, cary); \
@@ -543,138 +542,138 @@ GL_FUNC_LOAD_2(DepthBoundsdNV,GLvoid, GLdouble,GLdouble, "GL_NV_depth_buffer_flo
543
542
  /* #336 GL_NV_framebuffer_multisample_coverage */
544
543
  GL_FUNC_LOAD_6(RenderbufferStorageMultisampleCoverageNV,GLvoid, GLenum,GLsizei,GLsizei,GLenum,GLsizei,GLsizei, "GL_NV_framebuffer_multisample_coverage")
545
544
 
546
- void gl_init_functions_ext_nv(VALUE module)
545
+ void gl_init_functions_ext_nv(VALUE klass)
547
546
  {
548
547
  /* #222 GL_NV_fence */
549
- rb_define_module_function(module, "glGenFencesNV", gl_GenFencesNV, 1);
550
- rb_define_module_function(module, "glDeleteFencesNV", gl_DeleteFencesNV, 1);
551
- rb_define_module_function(module, "glSetFenceNV", gl_SetFenceNV, 2);
552
- rb_define_module_function(module, "glTestFenceNV", gl_TestFenceNV, 1);
553
- rb_define_module_function(module, "glFinishFenceNV", gl_FinishFenceNV, 1);
554
- rb_define_module_function(module, "glIsFenceNV", gl_IsFenceNV, 1);
555
- rb_define_module_function(module, "glGetFenceivNV", gl_GetFenceivNV, 2);
548
+ rb_define_method(klass, "glGenFencesNV", gl_GenFencesNV, 1);
549
+ rb_define_method(klass, "glDeleteFencesNV", gl_DeleteFencesNV, 1);
550
+ rb_define_method(klass, "glSetFenceNV", gl_SetFenceNV, 2);
551
+ rb_define_method(klass, "glTestFenceNV", gl_TestFenceNV, 1);
552
+ rb_define_method(klass, "glFinishFenceNV", gl_FinishFenceNV, 1);
553
+ rb_define_method(klass, "glIsFenceNV", gl_IsFenceNV, 1);
554
+ rb_define_method(klass, "glGetFenceivNV", gl_GetFenceivNV, 2);
556
555
 
557
556
  /* #233 GL_NV_vertex_program */
558
- rb_define_module_function(module, "glLoadProgramNV", gl_LoadProgramNV, 3);
559
- rb_define_module_function(module, "glGetProgramStringNV", gl_GetProgramStringNV, 2);
560
- rb_define_module_function(module, "glGetProgramivNV", gl_GetProgramivNV, 2);
561
- rb_define_module_function(module, "glBindProgramNV", gl_BindProgramNV, 2);
562
- rb_define_module_function(module, "glGenProgramsNV", gl_GenProgramsNV, 1);
563
- rb_define_module_function(module, "glDeleteProgramsNV", gl_DeleteProgramsNV, 1);
564
- rb_define_module_function(module, "glIsProgramNV", gl_IsProgramNV, 1);
565
- rb_define_module_function(module, "glExecuteProgramNV", gl_ExecuteProgramNV, 3);
566
- rb_define_module_function(module, "glVertexAttribPointerNV", gl_VertexAttribPointerNV, 5);
567
- rb_define_module_function(module, "glGetVertexAttribPointervNV", gl_GetVertexAttribPointervNV, 1);
568
- rb_define_module_function(module, "glProgramParameter4dNV", gl_ProgramParameter4dNV, 6);
569
- rb_define_module_function(module, "glProgramParameter4fNV", gl_ProgramParameter4fNV, 6);
570
- rb_define_module_function(module, "glProgramParameter4dvNV", gl_ProgramParameter4dvNV, 3);
571
- rb_define_module_function(module, "glProgramParameter4fvNV", gl_ProgramParameter4fvNV, 3);
572
- rb_define_module_function(module, "glProgramParameters4dvNV", gl_ProgramParameters4dvNV, 3);
573
- rb_define_module_function(module, "glProgramParameters4fvNV", gl_ProgramParameters4fvNV, 3);
574
- rb_define_module_function(module, "glGetProgramParameterdvNV", gl_GetProgramParameterdvNV, 3);
575
- rb_define_module_function(module, "glGetProgramParameterfvNV", gl_GetProgramParameterfvNV, 3);
576
- rb_define_module_function(module, "glVertexAttrib1dNV", gl_VertexAttrib1dNV, 2);
577
- rb_define_module_function(module, "glVertexAttrib1fNV", gl_VertexAttrib1fNV, 2);
578
- rb_define_module_function(module, "glVertexAttrib1sNV", gl_VertexAttrib1sNV, 2);
579
- rb_define_module_function(module, "glVertexAttrib2dNV", gl_VertexAttrib2dNV, 3);
580
- rb_define_module_function(module, "glVertexAttrib2fNV", gl_VertexAttrib2fNV, 3);
581
- rb_define_module_function(module, "glVertexAttrib2sNV", gl_VertexAttrib2sNV, 3);
582
- rb_define_module_function(module, "glVertexAttrib3dNV", gl_VertexAttrib3dNV, 4);
583
- rb_define_module_function(module, "glVertexAttrib3fNV", gl_VertexAttrib3fNV, 4);
584
- rb_define_module_function(module, "glVertexAttrib3sNV", gl_VertexAttrib3sNV, 4);
585
- rb_define_module_function(module, "glVertexAttrib4dNV", gl_VertexAttrib4dNV, 5);
586
- rb_define_module_function(module, "glVertexAttrib4fNV", gl_VertexAttrib4fNV, 5);
587
- rb_define_module_function(module, "glVertexAttrib4sNV", gl_VertexAttrib4sNV, 5);
588
- rb_define_module_function(module, "glVertexAttrib4ubNV", gl_VertexAttrib4ubNV, 5);
589
- rb_define_module_function(module, "glVertexAttrib1dvNV", gl_VertexAttrib1dvNV, 2);
590
- rb_define_module_function(module, "glVertexAttrib1fvNV", gl_VertexAttrib1fvNV, 2);
591
- rb_define_module_function(module, "glVertexAttrib1svNV", gl_VertexAttrib1svNV, 2);
592
- rb_define_module_function(module, "glVertexAttrib2dvNV", gl_VertexAttrib2dvNV, 2);
593
- rb_define_module_function(module, "glVertexAttrib2fvNV", gl_VertexAttrib2fvNV, 2);
594
- rb_define_module_function(module, "glVertexAttrib2svNV", gl_VertexAttrib2svNV, 2);
595
- rb_define_module_function(module, "glVertexAttrib3dvNV", gl_VertexAttrib3dvNV, 2);
596
- rb_define_module_function(module, "glVertexAttrib3fvNV", gl_VertexAttrib3fvNV, 2);
597
- rb_define_module_function(module, "glVertexAttrib3svNV", gl_VertexAttrib3svNV, 2);
598
- rb_define_module_function(module, "glVertexAttrib4dvNV", gl_VertexAttrib4dvNV, 2);
599
- rb_define_module_function(module, "glVertexAttrib4fvNV", gl_VertexAttrib4fvNV, 2);
600
- rb_define_module_function(module, "glVertexAttrib4svNV", gl_VertexAttrib4svNV, 2);
601
- rb_define_module_function(module, "glVertexAttrib4ubvNV", gl_VertexAttrib4ubvNV, 2);
602
- rb_define_module_function(module, "glVertexAttribs1dvNV", gl_VertexAttribs1dvNV, 2);
603
- rb_define_module_function(module, "glVertexAttribs1fvNV", gl_VertexAttribs1fvNV, 2);
604
- rb_define_module_function(module, "glVertexAttribs1svNV", gl_VertexAttribs1svNV, 2);
605
- rb_define_module_function(module, "glVertexAttribs2dvNV", gl_VertexAttribs2dvNV, 2);
606
- rb_define_module_function(module, "glVertexAttribs2fvNV", gl_VertexAttribs2fvNV, 2);
607
- rb_define_module_function(module, "glVertexAttribs2svNV", gl_VertexAttribs2svNV, 2);
608
- rb_define_module_function(module, "glVertexAttribs3dvNV", gl_VertexAttribs3dvNV, 2);
609
- rb_define_module_function(module, "glVertexAttribs3fvNV", gl_VertexAttribs3fvNV, 2);
610
- rb_define_module_function(module, "glVertexAttribs3svNV", gl_VertexAttribs3svNV, 2);
611
- rb_define_module_function(module, "glVertexAttribs4dvNV", gl_VertexAttribs4dvNV, 2);
612
- rb_define_module_function(module, "glVertexAttribs4fvNV", gl_VertexAttribs4fvNV, 2);
613
- rb_define_module_function(module, "glVertexAttribs4svNV", gl_VertexAttribs4svNV, 2);
614
- rb_define_module_function(module, "glVertexAttribs4ubvNV", gl_VertexAttribs4ubvNV, 2);
615
- rb_define_module_function(module, "glGetVertexAttribdvNV", gl_GetVertexAttribdvNV, 2);
616
- rb_define_module_function(module, "glGetVertexAttribfvNV", gl_GetVertexAttribfvNV, 2);
617
- rb_define_module_function(module, "glGetVertexAttribivNV", gl_GetVertexAttribivNV, 2);
618
- rb_define_module_function(module, "glTrackMatrixNV", gl_TrackMatrixNV, 4);
619
- rb_define_module_function(module, "glGetTrackMatrixivNV", gl_GetTrackMatrixivNV, 3);
620
- rb_define_module_function(module, "glRequestResidentProgramsNV", gl_RequestResidentProgramsNV, 1);
621
- rb_define_module_function(module, "glAreProgramsResidentNV", gl_AreProgramsResidentNV, 1);
557
+ rb_define_method(klass, "glLoadProgramNV", gl_LoadProgramNV, 3);
558
+ rb_define_method(klass, "glGetProgramStringNV", gl_GetProgramStringNV, 2);
559
+ rb_define_method(klass, "glGetProgramivNV", gl_GetProgramivNV, 2);
560
+ rb_define_method(klass, "glBindProgramNV", gl_BindProgramNV, 2);
561
+ rb_define_method(klass, "glGenProgramsNV", gl_GenProgramsNV, 1);
562
+ rb_define_method(klass, "glDeleteProgramsNV", gl_DeleteProgramsNV, 1);
563
+ rb_define_method(klass, "glIsProgramNV", gl_IsProgramNV, 1);
564
+ rb_define_method(klass, "glExecuteProgramNV", gl_ExecuteProgramNV, 3);
565
+ rb_define_method(klass, "glVertexAttribPointerNV", gl_VertexAttribPointerNV, 5);
566
+ rb_define_method(klass, "glGetVertexAttribPointervNV", gl_GetVertexAttribPointervNV, 1);
567
+ rb_define_method(klass, "glProgramParameter4dNV", gl_ProgramParameter4dNV, 6);
568
+ rb_define_method(klass, "glProgramParameter4fNV", gl_ProgramParameter4fNV, 6);
569
+ rb_define_method(klass, "glProgramParameter4dvNV", gl_ProgramParameter4dvNV, 3);
570
+ rb_define_method(klass, "glProgramParameter4fvNV", gl_ProgramParameter4fvNV, 3);
571
+ rb_define_method(klass, "glProgramParameters4dvNV", gl_ProgramParameters4dvNV, 3);
572
+ rb_define_method(klass, "glProgramParameters4fvNV", gl_ProgramParameters4fvNV, 3);
573
+ rb_define_method(klass, "glGetProgramParameterdvNV", gl_GetProgramParameterdvNV, 3);
574
+ rb_define_method(klass, "glGetProgramParameterfvNV", gl_GetProgramParameterfvNV, 3);
575
+ rb_define_method(klass, "glVertexAttrib1dNV", gl_VertexAttrib1dNV, 2);
576
+ rb_define_method(klass, "glVertexAttrib1fNV", gl_VertexAttrib1fNV, 2);
577
+ rb_define_method(klass, "glVertexAttrib1sNV", gl_VertexAttrib1sNV, 2);
578
+ rb_define_method(klass, "glVertexAttrib2dNV", gl_VertexAttrib2dNV, 3);
579
+ rb_define_method(klass, "glVertexAttrib2fNV", gl_VertexAttrib2fNV, 3);
580
+ rb_define_method(klass, "glVertexAttrib2sNV", gl_VertexAttrib2sNV, 3);
581
+ rb_define_method(klass, "glVertexAttrib3dNV", gl_VertexAttrib3dNV, 4);
582
+ rb_define_method(klass, "glVertexAttrib3fNV", gl_VertexAttrib3fNV, 4);
583
+ rb_define_method(klass, "glVertexAttrib3sNV", gl_VertexAttrib3sNV, 4);
584
+ rb_define_method(klass, "glVertexAttrib4dNV", gl_VertexAttrib4dNV, 5);
585
+ rb_define_method(klass, "glVertexAttrib4fNV", gl_VertexAttrib4fNV, 5);
586
+ rb_define_method(klass, "glVertexAttrib4sNV", gl_VertexAttrib4sNV, 5);
587
+ rb_define_method(klass, "glVertexAttrib4ubNV", gl_VertexAttrib4ubNV, 5);
588
+ rb_define_method(klass, "glVertexAttrib1dvNV", gl_VertexAttrib1dvNV, 2);
589
+ rb_define_method(klass, "glVertexAttrib1fvNV", gl_VertexAttrib1fvNV, 2);
590
+ rb_define_method(klass, "glVertexAttrib1svNV", gl_VertexAttrib1svNV, 2);
591
+ rb_define_method(klass, "glVertexAttrib2dvNV", gl_VertexAttrib2dvNV, 2);
592
+ rb_define_method(klass, "glVertexAttrib2fvNV", gl_VertexAttrib2fvNV, 2);
593
+ rb_define_method(klass, "glVertexAttrib2svNV", gl_VertexAttrib2svNV, 2);
594
+ rb_define_method(klass, "glVertexAttrib3dvNV", gl_VertexAttrib3dvNV, 2);
595
+ rb_define_method(klass, "glVertexAttrib3fvNV", gl_VertexAttrib3fvNV, 2);
596
+ rb_define_method(klass, "glVertexAttrib3svNV", gl_VertexAttrib3svNV, 2);
597
+ rb_define_method(klass, "glVertexAttrib4dvNV", gl_VertexAttrib4dvNV, 2);
598
+ rb_define_method(klass, "glVertexAttrib4fvNV", gl_VertexAttrib4fvNV, 2);
599
+ rb_define_method(klass, "glVertexAttrib4svNV", gl_VertexAttrib4svNV, 2);
600
+ rb_define_method(klass, "glVertexAttrib4ubvNV", gl_VertexAttrib4ubvNV, 2);
601
+ rb_define_method(klass, "glVertexAttribs1dvNV", gl_VertexAttribs1dvNV, 2);
602
+ rb_define_method(klass, "glVertexAttribs1fvNV", gl_VertexAttribs1fvNV, 2);
603
+ rb_define_method(klass, "glVertexAttribs1svNV", gl_VertexAttribs1svNV, 2);
604
+ rb_define_method(klass, "glVertexAttribs2dvNV", gl_VertexAttribs2dvNV, 2);
605
+ rb_define_method(klass, "glVertexAttribs2fvNV", gl_VertexAttribs2fvNV, 2);
606
+ rb_define_method(klass, "glVertexAttribs2svNV", gl_VertexAttribs2svNV, 2);
607
+ rb_define_method(klass, "glVertexAttribs3dvNV", gl_VertexAttribs3dvNV, 2);
608
+ rb_define_method(klass, "glVertexAttribs3fvNV", gl_VertexAttribs3fvNV, 2);
609
+ rb_define_method(klass, "glVertexAttribs3svNV", gl_VertexAttribs3svNV, 2);
610
+ rb_define_method(klass, "glVertexAttribs4dvNV", gl_VertexAttribs4dvNV, 2);
611
+ rb_define_method(klass, "glVertexAttribs4fvNV", gl_VertexAttribs4fvNV, 2);
612
+ rb_define_method(klass, "glVertexAttribs4svNV", gl_VertexAttribs4svNV, 2);
613
+ rb_define_method(klass, "glVertexAttribs4ubvNV", gl_VertexAttribs4ubvNV, 2);
614
+ rb_define_method(klass, "glGetVertexAttribdvNV", gl_GetVertexAttribdvNV, 2);
615
+ rb_define_method(klass, "glGetVertexAttribfvNV", gl_GetVertexAttribfvNV, 2);
616
+ rb_define_method(klass, "glGetVertexAttribivNV", gl_GetVertexAttribivNV, 2);
617
+ rb_define_method(klass, "glTrackMatrixNV", gl_TrackMatrixNV, 4);
618
+ rb_define_method(klass, "glGetTrackMatrixivNV", gl_GetTrackMatrixivNV, 3);
619
+ rb_define_method(klass, "glRequestResidentProgramsNV", gl_RequestResidentProgramsNV, 1);
620
+ rb_define_method(klass, "glAreProgramsResidentNV", gl_AreProgramsResidentNV, 1);
622
621
 
623
622
  /* #261 GL_NV_occlusion_query */
624
- rb_define_module_function(module, "glGenOcclusionQueriesNV", gl_GenOcclusionQueriesNV, 1);
625
- rb_define_module_function(module, "glDeleteOcclusionQueriesNV", gl_DeleteOcclusionQueriesNV, 1);
626
- rb_define_module_function(module, "glIsOcclusionQueryNV", gl_IsOcclusionQueryNV, 1);
627
- rb_define_module_function(module, "glBeginOcclusionQueryNV", gl_BeginOcclusionQueryNV, 1);
628
- rb_define_module_function(module, "glEndOcclusionQueryNV", gl_EndOcclusionQueryNV, 0);
629
- rb_define_module_function(module, "glGetOcclusionQueryivNV", gl_GetOcclusionQueryivNV, 2);
630
- rb_define_module_function(module, "glGetOcclusionQueryuivNV", gl_GetOcclusionQueryuivNV, 2);
623
+ rb_define_method(klass, "glGenOcclusionQueriesNV", gl_GenOcclusionQueriesNV, 1);
624
+ rb_define_method(klass, "glDeleteOcclusionQueriesNV", gl_DeleteOcclusionQueriesNV, 1);
625
+ rb_define_method(klass, "glIsOcclusionQueryNV", gl_IsOcclusionQueryNV, 1);
626
+ rb_define_method(klass, "glBeginOcclusionQueryNV", gl_BeginOcclusionQueryNV, 1);
627
+ rb_define_method(klass, "glEndOcclusionQueryNV", gl_EndOcclusionQueryNV, 0);
628
+ rb_define_method(klass, "glGetOcclusionQueryivNV", gl_GetOcclusionQueryivNV, 2);
629
+ rb_define_method(klass, "glGetOcclusionQueryuivNV", gl_GetOcclusionQueryuivNV, 2);
631
630
 
632
631
  /* #262 GL_NV_point_sprite */
633
- rb_define_module_function(module, "glPointParameteriNV", gl_PointParameteriNV, 2);
634
- rb_define_module_function(module, "glPointParameterivNV", gl_PointParameterivNV, 2);
632
+ rb_define_method(klass, "glPointParameteriNV", gl_PointParameteriNV, 2);
633
+ rb_define_method(klass, "glPointParameterivNV", gl_PointParameterivNV, 2);
635
634
 
636
635
  /* #282 GL_NV_fragment_program */
637
- rb_define_module_function(module, "glProgramNamedParameter4fNV", gl_ProgramNamedParameter4fNV, 6);
638
- rb_define_module_function(module, "glProgramNamedParameter4dNV", gl_ProgramNamedParameter4dNV, 6);
639
- rb_define_module_function(module, "glProgramNamedParameter4fvNV", gl_ProgramNamedParameter4fvNV, 3);
640
- rb_define_module_function(module, "glProgramNamedParameter4dvNV", gl_ProgramNamedParameter4dvNV, 3);
641
- rb_define_module_function(module, "glGetProgramNamedParameterdvNV", gl_GetProgramNamedParameterdvNV, 2);
642
- rb_define_module_function(module, "glGetProgramNamedParameterfvNV", gl_GetProgramNamedParameterfvNV, 2);
636
+ rb_define_method(klass, "glProgramNamedParameter4fNV", gl_ProgramNamedParameter4fNV, 6);
637
+ rb_define_method(klass, "glProgramNamedParameter4dNV", gl_ProgramNamedParameter4dNV, 6);
638
+ rb_define_method(klass, "glProgramNamedParameter4fvNV", gl_ProgramNamedParameter4fvNV, 3);
639
+ rb_define_method(klass, "glProgramNamedParameter4dvNV", gl_ProgramNamedParameter4dvNV, 3);
640
+ rb_define_method(klass, "glGetProgramNamedParameterdvNV", gl_GetProgramNamedParameterdvNV, 2);
641
+ rb_define_method(klass, "glGetProgramNamedParameterfvNV", gl_GetProgramNamedParameterfvNV, 2);
643
642
 
644
643
  /* #285 GL_NV_primitive_restart */
645
- rb_define_module_function(module, "glPrimitiveRestartNV", gl_PrimitiveRestartNV, 0);
646
- rb_define_module_function(module, "glPrimitiveRestartIndexNV", gl_PrimitiveRestartIndexNV, 1);
644
+ rb_define_method(klass, "glPrimitiveRestartNV", gl_PrimitiveRestartNV, 0);
645
+ rb_define_method(klass, "glPrimitiveRestartIndexNV", gl_PrimitiveRestartIndexNV, 1);
647
646
 
648
647
  /* #322 GL_NV_gpu_program4 */
649
- rb_define_module_function(module, "glProgramLocalParameterI4iNV", gl_ProgramLocalParameterI4iNV, 6);
650
- rb_define_module_function(module, "glProgramLocalParameterI4uiNV", gl_ProgramLocalParameterI4uiNV, 6);
651
- rb_define_module_function(module, "glProgramLocalParameterI4ivNV", gl_ProgramLocalParameterI4ivNV, 3);
652
- rb_define_module_function(module, "glProgramLocalParameterI4uivNV", gl_ProgramLocalParameterI4uivNV, 3);
653
- rb_define_module_function(module, "glProgramLocalParametersI4ivNV", gl_ProgramLocalParametersI4ivNV, 3);
654
- rb_define_module_function(module, "glProgramLocalParametersI4uivNV", gl_ProgramLocalParametersI4uivNV, 3);
655
- rb_define_module_function(module, "glGetProgramLocalParameterIivNV", gl_GetProgramLocalParameterIivNV, 2);
656
- rb_define_module_function(module, "glGetProgramLocalParameterIuivNV", gl_GetProgramLocalParameterIuivNV, 2);
657
- rb_define_module_function(module, "glProgramEnvParameterI4iNV", gl_ProgramEnvParameterI4iNV, 6);
658
- rb_define_module_function(module, "glProgramEnvParameterI4uiNV", gl_ProgramEnvParameterI4uiNV, 6);
659
- rb_define_module_function(module, "glProgramEnvParameterI4ivNV", gl_ProgramEnvParameterI4ivNV, 3);
660
- rb_define_module_function(module, "glProgramEnvParameterI4uivNV", gl_ProgramEnvParameterI4uivNV, 3);
661
- rb_define_module_function(module, "glProgramEnvParametersI4ivNV", gl_ProgramEnvParametersI4ivNV, 3);
662
- rb_define_module_function(module, "glProgramEnvParametersI4uivNV", gl_ProgramEnvParametersI4uivNV, 3);
663
- rb_define_module_function(module, "glGetProgramEnvParameterIivNV", gl_GetProgramEnvParameterIivNV, 2);
664
- rb_define_module_function(module, "glGetProgramEnvParameterIuivNV", gl_GetProgramEnvParameterIuivNV, 2);
648
+ rb_define_method(klass, "glProgramLocalParameterI4iNV", gl_ProgramLocalParameterI4iNV, 6);
649
+ rb_define_method(klass, "glProgramLocalParameterI4uiNV", gl_ProgramLocalParameterI4uiNV, 6);
650
+ rb_define_method(klass, "glProgramLocalParameterI4ivNV", gl_ProgramLocalParameterI4ivNV, 3);
651
+ rb_define_method(klass, "glProgramLocalParameterI4uivNV", gl_ProgramLocalParameterI4uivNV, 3);
652
+ rb_define_method(klass, "glProgramLocalParametersI4ivNV", gl_ProgramLocalParametersI4ivNV, 3);
653
+ rb_define_method(klass, "glProgramLocalParametersI4uivNV", gl_ProgramLocalParametersI4uivNV, 3);
654
+ rb_define_method(klass, "glGetProgramLocalParameterIivNV", gl_GetProgramLocalParameterIivNV, 2);
655
+ rb_define_method(klass, "glGetProgramLocalParameterIuivNV", gl_GetProgramLocalParameterIuivNV, 2);
656
+ rb_define_method(klass, "glProgramEnvParameterI4iNV", gl_ProgramEnvParameterI4iNV, 6);
657
+ rb_define_method(klass, "glProgramEnvParameterI4uiNV", gl_ProgramEnvParameterI4uiNV, 6);
658
+ rb_define_method(klass, "glProgramEnvParameterI4ivNV", gl_ProgramEnvParameterI4ivNV, 3);
659
+ rb_define_method(klass, "glProgramEnvParameterI4uivNV", gl_ProgramEnvParameterI4uivNV, 3);
660
+ rb_define_method(klass, "glProgramEnvParametersI4ivNV", gl_ProgramEnvParametersI4ivNV, 3);
661
+ rb_define_method(klass, "glProgramEnvParametersI4uivNV", gl_ProgramEnvParametersI4uivNV, 3);
662
+ rb_define_method(klass, "glGetProgramEnvParameterIivNV", gl_GetProgramEnvParameterIivNV, 2);
663
+ rb_define_method(klass, "glGetProgramEnvParameterIuivNV", gl_GetProgramEnvParameterIuivNV, 2);
665
664
 
666
665
  /* #323 GL_NV_geometry_program4 */
667
- rb_define_module_function(module, "glProgramVertexLimitNV", gl_ProgramVertexLimitNV, 2);
668
- rb_define_module_function(module, "glFramebufferTextureEXT", gl_FramebufferTextureEXT, 4);
669
- rb_define_module_function(module, "glFramebufferTextureLayerEXT", gl_FramebufferTextureLayerEXT, 5);
670
- rb_define_module_function(module, "glFramebufferTextureFaceEXT", gl_FramebufferTextureFaceEXT, 5);
666
+ rb_define_method(klass, "glProgramVertexLimitNV", gl_ProgramVertexLimitNV, 2);
667
+ rb_define_method(klass, "glFramebufferTextureEXT", gl_FramebufferTextureEXT, 4);
668
+ rb_define_method(klass, "glFramebufferTextureLayerEXT", gl_FramebufferTextureLayerEXT, 5);
669
+ rb_define_method(klass, "glFramebufferTextureFaceEXT", gl_FramebufferTextureFaceEXT, 5);
671
670
 
672
671
  /* #334 GL_NV_depth_buffer_float */
673
- rb_define_module_function(module, "glDepthRangedNV", gl_DepthRangedNV, 2);
674
- rb_define_module_function(module, "glClearDepthdNV", gl_ClearDepthdNV, 1);
675
- rb_define_module_function(module, "glDepthBoundsdNV", gl_DepthBoundsdNV, 2);
672
+ rb_define_method(klass, "glDepthRangedNV", gl_DepthRangedNV, 2);
673
+ rb_define_method(klass, "glClearDepthdNV", gl_ClearDepthdNV, 1);
674
+ rb_define_method(klass, "glDepthBoundsdNV", gl_DepthBoundsdNV, 2);
676
675
 
677
676
  /* #336 GL_NV_framebuffer_multisample_coverage */
678
- rb_define_module_function(module, "glRenderbufferStorageMultisampleCoverageNV", gl_RenderbufferStorageMultisampleCoverageNV, 6);
677
+ rb_define_method(klass, "glRenderbufferStorageMultisampleCoverageNV", gl_RenderbufferStorageMultisampleCoverageNV, 6);
679
678
 
680
679
  }