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
data/ext/opengl/gl-1.2.c CHANGED
@@ -23,7 +23,6 @@ GL_FUNC_LOAD_4(BlendColor,GLvoid, GLclampf,GLclampf,GLclampf,GLclampf, "1.2")
23
23
  GL_FUNC_LOAD_1(BlendEquation,GLvoid, GLenum, "1.2")
24
24
  GL_FUNC_LOAD_9(CopyTexSubImage3D,GLvoid, GLenum,GLint,GLint,GLint,GLint,GLint,GLint,GLsizei,GLsizei, "1.2")
25
25
 
26
- static void (APIENTRY * fptr_glDrawRangeElements)(GLenum,GLuint,GLuint,GLsizei,GLenum,GLvoid*);
27
26
  static VALUE
28
27
  gl_DrawRangeElements(obj,arg1,arg2,arg3,arg4,arg5,arg6)
29
28
  VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6;
@@ -33,13 +32,14 @@ VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6;
33
32
  GLuint end;
34
33
  GLsizei count;
35
34
  GLenum type;
35
+ DECL_GL_FUNC_PTR(GLvoid,glDrawRangeElements,(GLenum,GLuint,GLuint,GLsizei,GLenum,GLvoid*));
36
36
  LOAD_GL_FUNC(glDrawRangeElements, "1.2");
37
37
  mode = (GLenum)NUM2INT(arg1);
38
38
  start = (GLuint)NUM2UINT(arg2);
39
39
  end = (GLuint)NUM2UINT(arg3);
40
40
  count = (GLsizei)NUM2UINT(arg4);
41
41
  type = (GLenum)NUM2INT(arg5);
42
- if (CheckBufferBinding(GL_ELEMENT_ARRAY_BUFFER_BINDING)) {
42
+ if (CHECK_BUFFER_BINDING(GL_ELEMENT_ARRAY_BUFFER_BINDING)) {
43
43
  fptr_glDrawRangeElements(mode, start, end, count, type, (GLvoid *)NUM2SIZET(arg6));
44
44
  } else {
45
45
  VALUE data;
@@ -50,7 +50,6 @@ VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6;
50
50
  return Qnil;
51
51
  }
52
52
 
53
- static void (APIENTRY * fptr_glTexImage3D)(GLenum,GLint,GLint,GLsizei,GLsizei,GLsizei,GLint,GLenum,GLenum,const GLvoid*);
54
53
  static VALUE
55
54
  gl_TexImage3D(obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10)
56
55
  VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10;
@@ -65,6 +64,7 @@ VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10;
65
64
  GLenum format;
66
65
  GLenum type;
67
66
  const char *pixels;
67
+ DECL_GL_FUNC_PTR(GLvoid,glTexImage3D,(GLenum,GLint,GLint,GLsizei,GLsizei,GLsizei,GLint,GLenum,GLenum,const GLvoid*));
68
68
  LOAD_GL_FUNC(glTexImage3D, "1.2");
69
69
  target = (GLenum)NUM2INT(arg1);
70
70
  level = (GLint)NUM2INT(arg2);
@@ -76,7 +76,7 @@ VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10;
76
76
  format = (GLenum)NUM2INT(arg8);
77
77
  type = (GLenum)NUM2INT(arg9);
78
78
 
79
- if (CheckBufferBinding(GL_PIXEL_UNPACK_BUFFER_BINDING)) {
79
+ if (CHECK_BUFFER_BINDING(GL_PIXEL_UNPACK_BUFFER_BINDING)) {
80
80
  fptr_glTexImage3D( target, level, internalFormat, width, height,
81
81
  depth, border, format, type,(GLvoid *)NUM2SIZET(arg10));
82
82
  CHECK_GLERROR_FROM("glTexImage3D");
@@ -102,7 +102,6 @@ VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10;
102
102
  return Qnil;
103
103
  }
104
104
 
105
- static void (APIENTRY * fptr_glTexSubImage3D)(GLenum,GLint,GLint,GLint,GLint,GLsizei,GLsizei,GLsizei,GLenum,GLenum,const GLvoid*);
106
105
  static VALUE
107
106
  gl_TexSubImage3D(obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11)
108
107
  VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11;
@@ -117,6 +116,7 @@ VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11;
117
116
  GLsizei depth;
118
117
  GLenum format;
119
118
  GLenum type;
119
+ DECL_GL_FUNC_PTR(GLvoid,glTexSubImage3D,(GLenum,GLint,GLint,GLint,GLint,GLsizei,GLsizei,GLsizei,GLenum,GLenum,const GLvoid*));
120
120
  LOAD_GL_FUNC(glTexSubImage3D, "1.2");
121
121
  target = (GLenum)NUM2INT(arg1);
122
122
  level = (GLint)NUM2INT(arg2);
@@ -128,7 +128,7 @@ VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11;
128
128
  depth = (GLsizei)NUM2UINT(arg8);
129
129
  format = (GLenum)NUM2INT(arg9);
130
130
  type = (GLenum)NUM2INT(arg10);
131
- if (CheckBufferBinding(GL_PIXEL_UNPACK_BUFFER_BINDING)) {
131
+ if (CHECK_BUFFER_BINDING(GL_PIXEL_UNPACK_BUFFER_BINDING)) {
132
132
  fptr_glTexSubImage3D( target, level, xoffset, yoffset, zoffset,
133
133
  width, height, depth,
134
134
  format, type, (GLvoid *)NUM2SIZET(arg11));
@@ -144,12 +144,12 @@ VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11;
144
144
  return Qnil;
145
145
  }
146
146
 
147
- void gl_init_functions_1_2(VALUE module)
147
+ void gl_init_functions_1_2(VALUE klass)
148
148
  {
149
- rb_define_module_function(module, "glBlendColor", gl_BlendColor, 4);
150
- rb_define_module_function(module, "glBlendEquation", gl_BlendEquation, 1);
151
- rb_define_module_function(module, "glDrawRangeElements", gl_DrawRangeElements, 6);
152
- rb_define_module_function(module, "glTexImage3D", gl_TexImage3D, 10);
153
- rb_define_module_function(module, "glTexSubImage3D", gl_TexSubImage3D, 11);
154
- rb_define_module_function(module, "glCopyTexSubImage3D", gl_CopyTexSubImage3D, 9);
149
+ rb_define_method(klass, "glBlendColor", gl_BlendColor, 4);
150
+ rb_define_method(klass, "glBlendEquation", gl_BlendEquation, 1);
151
+ rb_define_method(klass, "glDrawRangeElements", gl_DrawRangeElements, 6);
152
+ rb_define_method(klass, "glTexImage3D", gl_TexImage3D, 10);
153
+ rb_define_method(klass, "glTexSubImage3D", gl_TexSubImage3D, 11);
154
+ rb_define_method(klass, "glCopyTexSubImage3D", gl_CopyTexSubImage3D, 9);
155
155
  }
data/ext/opengl/gl-1.3.c CHANGED
@@ -95,12 +95,12 @@ GLMULTITEXCOORD_VFUNC(s)
95
95
  #undef GLTEXCOORD_VFUNC
96
96
 
97
97
  #define TRANSPOSEMATRIX_FUNC(_name_,_type_) \
98
- static void (APIENTRY * fptr_gl##_name_)(const _type_[]); \
99
98
  static VALUE \
100
99
  gl_##_name_(obj,arg1) \
101
100
  VALUE obj,arg1; \
102
101
  { \
103
102
  _type_ m[4*4]; \
103
+ DECL_GL_FUNC_PTR(GLvoid,gl##_name_,(const _type_[])); \
104
104
  LOAD_GL_FUNC(gl##_name_, "1.3"); \
105
105
  ary2cmat##_type_(arg1, m, 4, 4); \
106
106
  fptr_gl##_name_(m); \
@@ -115,7 +115,6 @@ TRANSPOSEMATRIX_FUNC(MultTransposeMatrixd,double)
115
115
 
116
116
  #undef TRANSPOSEMATRIX_FUNC
117
117
 
118
- static void (APIENTRY * fptr_glCompressedTexImage3D)(GLenum,GLint,GLenum,GLsizei,GLsizei,GLsizei,GLint,GLsizei,GLvoid*);
119
118
  static VALUE
120
119
  gl_CompressedTexImage3D(obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9)
121
120
  VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9;
@@ -129,6 +128,7 @@ VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9;
129
128
  GLint border;
130
129
  GLsizei imagesize;
131
130
  GLvoid *pixels;
131
+ DECL_GL_FUNC_PTR(GLvoid,glCompressedTexImage3D,(GLenum,GLint,GLenum,GLsizei,GLsizei,GLsizei,GLint,GLsizei,GLvoid*));
132
132
  LOAD_GL_FUNC(glCompressedTexImage3D, "1.3");
133
133
  target = (GLenum)NUM2INT(arg1);
134
134
  level = (GLint)NUM2INT(arg2);
@@ -138,7 +138,7 @@ VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9;
138
138
  depth = (GLsizei)NUM2UINT(arg6);
139
139
  border = (GLint)NUM2INT(arg7);
140
140
  imagesize = (GLsizei)NUM2UINT(arg8);
141
- if (CheckBufferBinding(GL_PIXEL_UNPACK_BUFFER_BINDING)) {
141
+ if (CHECK_BUFFER_BINDING(GL_PIXEL_UNPACK_BUFFER_BINDING)) {
142
142
  fptr_glCompressedTexImage3D(target,level,internalformat,width,height,depth,border,imagesize,(GLvoid *)NUM2SIZET(arg9));
143
143
  } else {
144
144
  if (TYPE(arg9) == T_STRING || TYPE(arg9) == T_ARRAY) {
@@ -159,7 +159,6 @@ VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9;
159
159
  return Qnil;
160
160
  }
161
161
 
162
- static void (APIENTRY * fptr_glCompressedTexImage2D)(GLenum,GLint,GLenum,GLsizei,GLsizei,GLint,GLsizei,GLvoid*);
163
162
  static VALUE
164
163
  gl_CompressedTexImage2D(obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8)
165
164
  VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8;
@@ -172,6 +171,7 @@ VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8;
172
171
  GLint border;
173
172
  GLsizei imagesize;
174
173
  GLvoid *pixels;
174
+ DECL_GL_FUNC_PTR(GLvoid,glCompressedTexImage2D,(GLenum,GLint,GLenum,GLsizei,GLsizei,GLint,GLsizei,GLvoid*));
175
175
  LOAD_GL_FUNC(glCompressedTexImage2D, "1.3");
176
176
  target = (GLenum)NUM2INT(arg1);
177
177
  level = (GLint)NUM2INT(arg2);
@@ -180,7 +180,7 @@ VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8;
180
180
  height = (GLsizei)NUM2UINT(arg5);
181
181
  border = (GLint)NUM2INT(arg6);
182
182
  imagesize = (GLsizei)NUM2UINT(arg7);
183
- if (CheckBufferBinding(GL_PIXEL_UNPACK_BUFFER_BINDING)) {
183
+ if (CHECK_BUFFER_BINDING(GL_PIXEL_UNPACK_BUFFER_BINDING)) {
184
184
  fptr_glCompressedTexImage2D(target,level,internalformat,width,height,border,imagesize,(GLvoid *)NUM2SIZET(arg8));
185
185
  } else {
186
186
  if (TYPE(arg8) == T_STRING || TYPE(arg8) == T_ARRAY) {
@@ -201,7 +201,6 @@ VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8;
201
201
  return Qnil;
202
202
  }
203
203
 
204
- static void (APIENTRY * fptr_glCompressedTexImage1D)(GLenum,GLint,GLenum,GLsizei,GLint,GLsizei,GLvoid*);
205
204
  static VALUE
206
205
  gl_CompressedTexImage1D(obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7)
207
206
  VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7;
@@ -213,6 +212,7 @@ VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7;
213
212
  GLint border;
214
213
  GLsizei imagesize;
215
214
  GLvoid *pixels;
215
+ DECL_GL_FUNC_PTR(GLvoid,glCompressedTexImage1D,(GLenum,GLint,GLenum,GLsizei,GLint,GLsizei,GLvoid*));
216
216
  LOAD_GL_FUNC(glCompressedTexImage1D, "1.3");
217
217
  target = (GLenum)NUM2INT(arg1);
218
218
  level = (GLint)NUM2INT(arg2);
@@ -220,7 +220,7 @@ VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7;
220
220
  width = (GLsizei)NUM2UINT(arg4);
221
221
  border = (GLint)NUM2INT(arg5);
222
222
  imagesize = (GLsizei)NUM2UINT(arg6);
223
- if (CheckBufferBinding(GL_PIXEL_UNPACK_BUFFER_BINDING)) {
223
+ if (CHECK_BUFFER_BINDING(GL_PIXEL_UNPACK_BUFFER_BINDING)) {
224
224
  fptr_glCompressedTexImage1D(target,level,internalformat,width,border,imagesize,(GLvoid *)NUM2SIZET(arg7));
225
225
  } else {
226
226
  if (TYPE(arg7) == T_STRING || TYPE(arg7) == T_ARRAY) {
@@ -241,7 +241,6 @@ VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7;
241
241
  return Qnil;
242
242
  }
243
243
 
244
- static void (APIENTRY * fptr_glCompressedTexSubImage3D)(GLenum,GLint,GLint,GLint,GLint,GLsizei,GLsizei,GLsizei,GLenum,GLsizei,GLvoid*);
245
244
  static VALUE
246
245
  gl_CompressedTexSubImage3D(obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11)
247
246
  VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11;
@@ -257,6 +256,7 @@ VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11;
257
256
  GLenum format;
258
257
  GLsizei imagesize;
259
258
  GLvoid *pixels;
259
+ DECL_GL_FUNC_PTR(GLvoid,glCompressedTexSubImage3D,(GLenum,GLint,GLint,GLint,GLint,GLsizei,GLsizei,GLsizei,GLenum,GLsizei,GLvoid*));
260
260
  LOAD_GL_FUNC(glCompressedTexSubImage3D, "1.3");
261
261
  target = (GLenum)NUM2INT(arg1);
262
262
  level = (GLint)NUM2INT(arg2);
@@ -268,7 +268,7 @@ VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11;
268
268
  depth = (GLsizei)NUM2UINT(arg8);
269
269
  format = (GLenum)NUM2INT(arg9);
270
270
  imagesize = (GLsizei)NUM2UINT(arg10);
271
- if (CheckBufferBinding(GL_PIXEL_UNPACK_BUFFER_BINDING)) {
271
+ if (CHECK_BUFFER_BINDING(GL_PIXEL_UNPACK_BUFFER_BINDING)) {
272
272
  fptr_glCompressedTexSubImage3D(target,level,xoffset,yoffset,zoffset,width,height,depth,format,imagesize,(GLvoid *)NUM2SIZET(arg11));
273
273
  } else {
274
274
  VALUE data;
@@ -283,7 +283,6 @@ VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11;
283
283
  return Qnil;
284
284
  }
285
285
 
286
- static void (APIENTRY * fptr_glCompressedTexSubImage2D)(GLenum,GLint,GLint,GLint,GLsizei,GLsizei,GLenum,GLsizei,GLvoid*);
287
286
  static VALUE
288
287
  gl_CompressedTexSubImage2D(obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9)
289
288
  VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9;
@@ -297,6 +296,7 @@ VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9;
297
296
  GLenum format;
298
297
  GLsizei imagesize;
299
298
  GLvoid *pixels;
299
+ DECL_GL_FUNC_PTR(GLvoid,glCompressedTexSubImage2D,(GLenum,GLint,GLint,GLint,GLsizei,GLsizei,GLenum,GLsizei,GLvoid*));
300
300
  LOAD_GL_FUNC(glCompressedTexSubImage2D, "1.3");
301
301
  target = (GLenum)NUM2INT(arg1);
302
302
  level = (GLint)NUM2INT(arg2);
@@ -306,7 +306,7 @@ VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9;
306
306
  height = (GLsizei)NUM2UINT(arg6);
307
307
  format = (GLenum)NUM2INT(arg7);
308
308
  imagesize = (GLsizei)NUM2UINT(arg8);
309
- if (CheckBufferBinding(GL_PIXEL_UNPACK_BUFFER_BINDING)) {
309
+ if (CHECK_BUFFER_BINDING(GL_PIXEL_UNPACK_BUFFER_BINDING)) {
310
310
  fptr_glCompressedTexSubImage2D(target,level,xoffset,yoffset,width,height,format,imagesize,(GLvoid *)NUM2SIZET(arg9));
311
311
  } else {
312
312
  VALUE data;
@@ -320,7 +320,6 @@ VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9;
320
320
  return Qnil;
321
321
  }
322
322
 
323
- static void (APIENTRY * fptr_glCompressedTexSubImage1D)(GLenum,GLint,GLint,GLsizei,GLenum,GLsizei,GLvoid*);
324
323
  static VALUE
325
324
  gl_CompressedTexSubImage1D(obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7)
326
325
  VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7;
@@ -332,6 +331,7 @@ VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7;
332
331
  GLenum format;
333
332
  GLsizei imagesize;
334
333
  GLvoid *pixels;
334
+ DECL_GL_FUNC_PTR(GLvoid,glCompressedTexSubImage1D,(GLenum,GLint,GLint,GLsizei,GLenum,GLsizei,GLvoid*));
335
335
  LOAD_GL_FUNC(glCompressedTexSubImage1D, "1.3");
336
336
  target = (GLenum)NUM2INT(arg1);
337
337
  level = (GLint)NUM2INT(arg2);
@@ -339,7 +339,7 @@ VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7;
339
339
  width = (GLsizei)NUM2UINT(arg4);
340
340
  format = (GLenum)NUM2INT(arg5);
341
341
  imagesize = (GLsizei)NUM2UINT(arg6);
342
- if (CheckBufferBinding(GL_PIXEL_UNPACK_BUFFER_BINDING)) {
342
+ if (CHECK_BUFFER_BINDING(GL_PIXEL_UNPACK_BUFFER_BINDING)) {
343
343
  fptr_glCompressedTexSubImage1D(target,level,xoffset,width,format,imagesize,(GLvoid *)NUM2SIZET(arg7));
344
344
  } else {
345
345
  VALUE data;
@@ -353,7 +353,6 @@ VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7;
353
353
  return Qnil;
354
354
  }
355
355
 
356
- static void (APIENTRY * fptr_glGetCompressedTexImage)(GLenum,GLint,GLvoid*);
357
356
  static VALUE
358
357
  gl_GetCompressedTexImage(argc,argv,obj)
359
358
  int argc;
@@ -366,6 +365,7 @@ VALUE obj;
366
365
  VALUE data;
367
366
  VALUE args[3];
368
367
  int numargs;
368
+ DECL_GL_FUNC_PTR(GLvoid,glGetCompressedTexImage,(GLenum,GLint,GLvoid*));
369
369
  LOAD_GL_FUNC(glGetCompressedTexImage, "1.3");
370
370
  numargs = rb_scan_args(argc, argv, "21", &args[0], &args[1], &args[2]);
371
371
  target = (GLenum)NUM2INT(args[0]);
@@ -373,9 +373,13 @@ VALUE obj;
373
373
  switch(numargs) {
374
374
  default:
375
375
  case 2:
376
- if (CheckBufferBinding(GL_PIXEL_PACK_BUFFER_BINDING))
376
+ if (CHECK_BUFFER_BINDING(GL_PIXEL_PACK_BUFFER_BINDING))
377
377
  rb_raise(rb_eArgError, "Pixel pack buffer bound, but offset argument missing");
378
- glGetTexLevelParameteriv(target,lod,GL_TEXTURE_COMPRESSED_IMAGE_SIZE,&size); /* 1.0 function */
378
+ {
379
+ DECL_GL_FUNC_PTR(void,glGetTexLevelParameteriv,(GLenum target, GLint level, GLenum pname, GLint *params));
380
+ LOAD_GL_FUNC(glGetTexLevelParameteriv, NULL);
381
+ fptr_glGetTexLevelParameteriv(target,lod,GL_TEXTURE_COMPRESSED_IMAGE_SIZE,&size); /* 1.0 function */
382
+ }
379
383
  CHECK_GLERROR_FROM("glGetTexLevelParameteriv");
380
384
  data = allocate_buffer_with_string(size);
381
385
  fptr_glGetCompressedTexImage(target,lod,(GLvoid*)RSTRING_PTR(data));
@@ -388,56 +392,56 @@ VALUE obj;
388
392
  }
389
393
  }
390
394
 
391
- void gl_init_functions_1_3(VALUE module)
395
+ void gl_init_functions_1_3(VALUE klass)
392
396
  {
393
- rb_define_module_function(module, "glActiveTexture", gl_ActiveTexture, 1);
394
- rb_define_module_function(module, "glClientActiveTexture", gl_ClientActiveTexture, 1);
395
- rb_define_module_function(module, "glMultiTexCoord1d", gl_MultiTexCoord1d, 2);
396
- rb_define_module_function(module, "glMultiTexCoord1f", gl_MultiTexCoord1f, 2);
397
- rb_define_module_function(module, "glMultiTexCoord1i", gl_MultiTexCoord1i, 2);
398
- rb_define_module_function(module, "glMultiTexCoord1s", gl_MultiTexCoord1s, 2);
399
- rb_define_module_function(module, "glMultiTexCoord2d", gl_MultiTexCoord2d, 3);
400
- rb_define_module_function(module, "glMultiTexCoord2f", gl_MultiTexCoord2f, 3);
401
- rb_define_module_function(module, "glMultiTexCoord2i", gl_MultiTexCoord2i, 3);
402
- rb_define_module_function(module, "glMultiTexCoord2s", gl_MultiTexCoord2s, 3);
403
- rb_define_module_function(module, "glMultiTexCoord3d", gl_MultiTexCoord3d, 4);
404
- rb_define_module_function(module, "glMultiTexCoord3f", gl_MultiTexCoord3f, 4);
405
- rb_define_module_function(module, "glMultiTexCoord3i", gl_MultiTexCoord3i, 4);
406
- rb_define_module_function(module, "glMultiTexCoord3s", gl_MultiTexCoord3s, 4);
407
- rb_define_module_function(module, "glMultiTexCoord4d", gl_MultiTexCoord4d, 5);
408
- rb_define_module_function(module, "glMultiTexCoord4f", gl_MultiTexCoord4f, 5);
409
- rb_define_module_function(module, "glMultiTexCoord4i", gl_MultiTexCoord4i, 5);
410
- rb_define_module_function(module, "glMultiTexCoord4s", gl_MultiTexCoord4s, 5);
411
- rb_define_module_function(module, "glLoadTransposeMatrixf", gl_LoadTransposeMatrixf, 1);
412
- rb_define_module_function(module, "glLoadTransposeMatrixd", gl_LoadTransposeMatrixd, 1);
413
- rb_define_module_function(module, "glMultTransposeMatrixf", gl_MultTransposeMatrixf, 1);
414
- rb_define_module_function(module, "glMultTransposeMatrixd", gl_MultTransposeMatrixd, 1);
415
- rb_define_module_function(module, "glSampleCoverage", gl_SampleCoverage, 2);
416
- rb_define_module_function(module, "glCompressedTexImage3D", gl_CompressedTexImage3D, 9);
417
- rb_define_module_function(module, "glCompressedTexImage2D", gl_CompressedTexImage2D, 8);
418
- rb_define_module_function(module, "glCompressedTexImage1D", gl_CompressedTexImage1D, 7);
419
- rb_define_module_function(module, "glCompressedTexSubImage3D", gl_CompressedTexSubImage3D, 11);
420
- rb_define_module_function(module, "glCompressedTexSubImage2D", gl_CompressedTexSubImage2D, 9);
421
- rb_define_module_function(module, "glCompressedTexSubImage1D", gl_CompressedTexSubImage1D, 7);
422
- rb_define_module_function(module, "glGetCompressedTexImage", gl_GetCompressedTexImage, -1);
397
+ rb_define_method(klass, "glActiveTexture", gl_ActiveTexture, 1);
398
+ rb_define_method(klass, "glClientActiveTexture", gl_ClientActiveTexture, 1);
399
+ rb_define_method(klass, "glMultiTexCoord1d", gl_MultiTexCoord1d, 2);
400
+ rb_define_method(klass, "glMultiTexCoord1f", gl_MultiTexCoord1f, 2);
401
+ rb_define_method(klass, "glMultiTexCoord1i", gl_MultiTexCoord1i, 2);
402
+ rb_define_method(klass, "glMultiTexCoord1s", gl_MultiTexCoord1s, 2);
403
+ rb_define_method(klass, "glMultiTexCoord2d", gl_MultiTexCoord2d, 3);
404
+ rb_define_method(klass, "glMultiTexCoord2f", gl_MultiTexCoord2f, 3);
405
+ rb_define_method(klass, "glMultiTexCoord2i", gl_MultiTexCoord2i, 3);
406
+ rb_define_method(klass, "glMultiTexCoord2s", gl_MultiTexCoord2s, 3);
407
+ rb_define_method(klass, "glMultiTexCoord3d", gl_MultiTexCoord3d, 4);
408
+ rb_define_method(klass, "glMultiTexCoord3f", gl_MultiTexCoord3f, 4);
409
+ rb_define_method(klass, "glMultiTexCoord3i", gl_MultiTexCoord3i, 4);
410
+ rb_define_method(klass, "glMultiTexCoord3s", gl_MultiTexCoord3s, 4);
411
+ rb_define_method(klass, "glMultiTexCoord4d", gl_MultiTexCoord4d, 5);
412
+ rb_define_method(klass, "glMultiTexCoord4f", gl_MultiTexCoord4f, 5);
413
+ rb_define_method(klass, "glMultiTexCoord4i", gl_MultiTexCoord4i, 5);
414
+ rb_define_method(klass, "glMultiTexCoord4s", gl_MultiTexCoord4s, 5);
415
+ rb_define_method(klass, "glLoadTransposeMatrixf", gl_LoadTransposeMatrixf, 1);
416
+ rb_define_method(klass, "glLoadTransposeMatrixd", gl_LoadTransposeMatrixd, 1);
417
+ rb_define_method(klass, "glMultTransposeMatrixf", gl_MultTransposeMatrixf, 1);
418
+ rb_define_method(klass, "glMultTransposeMatrixd", gl_MultTransposeMatrixd, 1);
419
+ rb_define_method(klass, "glSampleCoverage", gl_SampleCoverage, 2);
420
+ rb_define_method(klass, "glCompressedTexImage3D", gl_CompressedTexImage3D, 9);
421
+ rb_define_method(klass, "glCompressedTexImage2D", gl_CompressedTexImage2D, 8);
422
+ rb_define_method(klass, "glCompressedTexImage1D", gl_CompressedTexImage1D, 7);
423
+ rb_define_method(klass, "glCompressedTexSubImage3D", gl_CompressedTexSubImage3D, 11);
424
+ rb_define_method(klass, "glCompressedTexSubImage2D", gl_CompressedTexSubImage2D, 9);
425
+ rb_define_method(klass, "glCompressedTexSubImage1D", gl_CompressedTexSubImage1D, 7);
426
+ rb_define_method(klass, "glGetCompressedTexImage", gl_GetCompressedTexImage, -1);
423
427
 
424
428
  /* Additional functions */
425
429
 
426
- rb_define_module_function(module, "glMultiTexCoord", gl_MultiTexCoorddv, -1);
427
- rb_define_module_function(module, "glMultiTexCoord1dv", gl_MultiTexCoorddv, -1);
428
- rb_define_module_function(module, "glMultiTexCoord1fv", gl_MultiTexCoordfv, -1);
429
- rb_define_module_function(module, "glMultiTexCoord1iv", gl_MultiTexCoordiv, -1);
430
- rb_define_module_function(module, "glMultiTexCoord1sv", gl_MultiTexCoordsv, -1);
431
- rb_define_module_function(module, "glMultiTexCoord2dv", gl_MultiTexCoorddv, -1);
432
- rb_define_module_function(module, "glMultiTexCoord2fv", gl_MultiTexCoordfv, -1);
433
- rb_define_module_function(module, "glMultiTexCoord2iv", gl_MultiTexCoordiv, -1);
434
- rb_define_module_function(module, "glMultiTexCoord2sv", gl_MultiTexCoordsv, -1);
435
- rb_define_module_function(module, "glMultiTexCoord3dv", gl_MultiTexCoorddv, -1);
436
- rb_define_module_function(module, "glMultiTexCoord3fv", gl_MultiTexCoordfv, -1);
437
- rb_define_module_function(module, "glMultiTexCoord3iv", gl_MultiTexCoordiv, -1);
438
- rb_define_module_function(module, "glMultiTexCoord3sv", gl_MultiTexCoordsv, -1);
439
- rb_define_module_function(module, "glMultiTexCoord4dv", gl_MultiTexCoorddv, -1);
440
- rb_define_module_function(module, "glMultiTexCoord4fv", gl_MultiTexCoordfv, -1);
441
- rb_define_module_function(module, "glMultiTexCoord4iv", gl_MultiTexCoordiv, -1);
442
- rb_define_module_function(module, "glMultiTexCoord4sv", gl_MultiTexCoordsv, -1);
430
+ rb_define_method(klass, "glMultiTexCoord", gl_MultiTexCoorddv, -1);
431
+ rb_define_method(klass, "glMultiTexCoord1dv", gl_MultiTexCoorddv, -1);
432
+ rb_define_method(klass, "glMultiTexCoord1fv", gl_MultiTexCoordfv, -1);
433
+ rb_define_method(klass, "glMultiTexCoord1iv", gl_MultiTexCoordiv, -1);
434
+ rb_define_method(klass, "glMultiTexCoord1sv", gl_MultiTexCoordsv, -1);
435
+ rb_define_method(klass, "glMultiTexCoord2dv", gl_MultiTexCoorddv, -1);
436
+ rb_define_method(klass, "glMultiTexCoord2fv", gl_MultiTexCoordfv, -1);
437
+ rb_define_method(klass, "glMultiTexCoord2iv", gl_MultiTexCoordiv, -1);
438
+ rb_define_method(klass, "glMultiTexCoord2sv", gl_MultiTexCoordsv, -1);
439
+ rb_define_method(klass, "glMultiTexCoord3dv", gl_MultiTexCoorddv, -1);
440
+ rb_define_method(klass, "glMultiTexCoord3fv", gl_MultiTexCoordfv, -1);
441
+ rb_define_method(klass, "glMultiTexCoord3iv", gl_MultiTexCoordiv, -1);
442
+ rb_define_method(klass, "glMultiTexCoord3sv", gl_MultiTexCoordsv, -1);
443
+ rb_define_method(klass, "glMultiTexCoord4dv", gl_MultiTexCoorddv, -1);
444
+ rb_define_method(klass, "glMultiTexCoord4fv", gl_MultiTexCoordfv, -1);
445
+ rb_define_method(klass, "glMultiTexCoord4iv", gl_MultiTexCoordiv, -1);
446
+ rb_define_method(klass, "glMultiTexCoord4sv", gl_MultiTexCoordsv, -1);
443
447
  }
data/ext/opengl/gl-1.4.c CHANGED
@@ -39,12 +39,12 @@ GL_FUNC_LOAD_3(WindowPos3f,GLvoid, GLfloat,GLfloat,GLfloat, "1.4")
39
39
  GL_FUNC_LOAD_3(WindowPos3i,GLvoid, GLint,GLint,GLint, "1.4")
40
40
  GL_FUNC_LOAD_3(WindowPos3s,GLvoid, GLshort,GLshort,GLshort, "1.4")
41
41
 
42
- static void (APIENTRY * fptr_glFogCoordfv)(GLfloat *);
43
42
  static VALUE
44
43
  gl_FogCoordfv(obj,arg1)
45
44
  VALUE obj,arg1;
46
45
  {
47
46
  GLfloat coord;
47
+ DECL_GL_FUNC_PTR(GLvoid,glFogCoordfv,(GLfloat *));
48
48
  LOAD_GL_FUNC(glFogCoordfv, "1.4");
49
49
  Check_Type(arg1,T_ARRAY);
50
50
  ary2cflt(arg1,&coord,1);
@@ -53,12 +53,12 @@ VALUE obj,arg1;
53
53
  return Qnil;
54
54
  }
55
55
 
56
- static void (APIENTRY * fptr_glFogCoorddv)(GLdouble *);
57
56
  static VALUE
58
57
  gl_FogCoorddv(obj,arg1)
59
58
  VALUE obj,arg1;
60
59
  {
61
60
  GLdouble coord;
61
+ DECL_GL_FUNC_PTR(GLvoid,glFogCoorddv,(GLdouble *));
62
62
  LOAD_GL_FUNC(glFogCoorddv, "1.4");
63
63
  Check_Type(arg1,T_ARRAY);
64
64
  ary2cdbl(arg1,&coord,1);
@@ -67,32 +67,30 @@ VALUE obj,arg1;
67
67
  return Qnil;
68
68
  }
69
69
 
70
- extern VALUE g_FogCoord_ptr;
71
- static void (APIENTRY * fptr_glFogCoordPointer)(GLenum,GLsizei,const GLvoid *);
72
70
  static VALUE
73
71
  gl_FogCoordPointer(obj,arg1,arg2,arg3)
74
72
  VALUE obj,arg1,arg2,arg3;
75
73
  {
76
74
  GLenum type;
77
75
  GLsizei stride;
76
+ DECL_GL_FUNC_PTR(GLvoid,glFogCoordPointer,(GLenum,GLsizei,const GLvoid *));
78
77
  LOAD_GL_FUNC(glFogCoordPointer, "1.4");
79
78
  type = (GLenum)NUM2INT(arg1);
80
79
  stride = (GLsizei)NUM2UINT(arg2);
81
- if (CheckBufferBinding(GL_ARRAY_BUFFER_BINDING)) {
82
- g_FogCoord_ptr = arg3;
80
+ if (CHECK_BUFFER_BINDING(GL_ARRAY_BUFFER_BINDING)) {
81
+ SET_GLIMPL_VARIABLE(FogCoord_ptr, arg3);
83
82
  fptr_glFogCoordPointer(type, stride, (const GLvoid*)NUM2SIZET(arg3));
84
83
  } else {
85
84
  VALUE data;
86
85
  data = pack_array_or_pass_string(GL_UNSIGNED_BYTE,arg3);
87
86
  rb_str_freeze(data);
88
- g_FogCoord_ptr = data;
87
+ SET_GLIMPL_VARIABLE(FogCoord_ptr, data);
89
88
  fptr_glFogCoordPointer(type, stride, (const GLvoid*)RSTRING_PTR(data));
90
89
  }
91
90
  CHECK_GLERROR_FROM("glFogCoordPointer");
92
91
  return Qnil;
93
92
  }
94
93
 
95
- static void (APIENTRY * fptr_glMultiDrawArrays)(GLenum,GLint*,GLsizei*,GLsizei);
96
94
  static VALUE
97
95
  gl_MultiDrawArrays(obj,arg1,arg2,arg3)
98
96
  VALUE obj,arg1,arg2,arg3;
@@ -101,6 +99,7 @@ VALUE obj,arg1,arg2,arg3;
101
99
  GLint *ary1;
102
100
  GLsizei *ary2;
103
101
  int len1,len2;
102
+ DECL_GL_FUNC_PTR(GLvoid,glMultiDrawArrays,(GLenum,GLint*,GLsizei*,GLsizei));
104
103
  LOAD_GL_FUNC(glMultiDrawArrays, "1.4");
105
104
  len1 = (int)RARRAY_LENINT(arg2);
106
105
  len2 = (int)RARRAY_LENINT(arg3);
@@ -118,7 +117,6 @@ VALUE obj,arg1,arg2,arg3;
118
117
  return Qnil;
119
118
  }
120
119
 
121
- static void (APIENTRY * fptr_glMultiDrawElements)(GLenum,const GLsizei *,GLenum,GLvoid **,GLsizei);
122
120
  static VALUE
123
121
  gl_MultiDrawElements(argc,argv,obj)
124
122
  int argc;
@@ -132,11 +130,12 @@ VALUE obj;
132
130
  GLint size;
133
131
  int i;
134
132
  VALUE ary, args[4];
133
+ DECL_GL_FUNC_PTR(GLvoid,glMultiDrawElements,(GLenum,const GLsizei *,GLenum,GLvoid **,GLsizei));
135
134
  LOAD_GL_FUNC(glMultiDrawElements, "1.4");
136
135
  switch (rb_scan_args(argc, argv, "31", &args[0], &args[1], &args[2],&args[3])) {
137
136
  default:
138
137
  case 3:
139
- if (CheckBufferBinding(GL_ELEMENT_ARRAY_BUFFER_BINDING))
138
+ if (CHECK_BUFFER_BINDING(GL_ELEMENT_ARRAY_BUFFER_BINDING))
140
139
  rb_raise(rb_eArgError, "Element array buffer bound, but offsets array missing");
141
140
  mode = (GLenum)NUM2INT(args[0]);
142
141
  type = (GLenum)NUM2INT(args[1]);
@@ -156,7 +155,7 @@ VALUE obj;
156
155
  xfree(indices);
157
156
  break;
158
157
  case 4:
159
- if (!CheckBufferBinding(GL_ELEMENT_ARRAY_BUFFER_BINDING))
158
+ if (!CHECK_BUFFER_BINDING(GL_ELEMENT_ARRAY_BUFFER_BINDING))
160
159
  rb_raise(rb_eArgError, "Element array buffer not bound");
161
160
  mode = (GLenum)NUM2INT(args[0]);
162
161
  type = (GLenum)NUM2INT(args[1]);
@@ -182,7 +181,6 @@ VALUE obj;
182
181
  return Qnil;
183
182
  }
184
183
 
185
- static void (APIENTRY * fptr_glPointParameterfv)(GLenum,GLfloat *);
186
184
  static VALUE
187
185
  gl_PointParameterfv(obj,arg1,arg2)
188
186
  VALUE obj,arg1,arg2;
@@ -190,6 +188,7 @@ VALUE obj,arg1,arg2;
190
188
  GLenum pname;
191
189
  GLfloat params[3] = {(GLfloat)0.0,(GLfloat)0.0,(GLfloat)0.0};
192
190
  GLint size;
191
+ DECL_GL_FUNC_PTR(GLvoid,glPointParameterfv,(GLenum,GLfloat *));
193
192
  LOAD_GL_FUNC(glPointParameterfv, "1.4");
194
193
  pname = (GLenum)NUM2INT(arg1);
195
194
  Check_Type(arg2,T_ARRAY);
@@ -203,7 +202,6 @@ VALUE obj,arg1,arg2;
203
202
  return Qnil;
204
203
  }
205
204
 
206
- static void (APIENTRY * fptr_glPointParameteriv)(GLenum,GLint *);
207
205
  static VALUE
208
206
  gl_PointParameteriv(obj,arg1,arg2)
209
207
  VALUE obj,arg1,arg2;
@@ -211,6 +209,7 @@ VALUE obj,arg1,arg2;
211
209
  GLenum pname;
212
210
  GLint params[3] = {0,0,0};
213
211
  GLint size;
212
+ DECL_GL_FUNC_PTR(GLvoid,glPointParameteriv,(GLenum,GLint *));
214
213
  LOAD_GL_FUNC(glPointParameteriv, "1.4");
215
214
  pname = (GLenum)NUM2INT(arg1);
216
215
  Check_Type(arg2,T_ARRAY);
@@ -225,10 +224,10 @@ VALUE obj,arg1,arg2;
225
224
  }
226
225
 
227
226
  #define GLSECONDARYCOLOR_VFUNC(_name_,_type_,_conv_) \
228
- static void (APIENTRY * fptr_gl##_name_)(_type_ *); \
229
227
  VALUE gl_##_name_(VALUE obj,VALUE arg1) \
230
228
  { \
231
229
  _type_ cary[3] = {0,0,0}; \
230
+ DECL_GL_FUNC_PTR(GLvoid,gl##_name_,(_type_ *)); \
232
231
  LOAD_GL_FUNC(gl##_name_, "1.4"); \
233
232
  Check_Type(arg1,T_ARRAY); \
234
233
  _conv_(arg1,cary,3); \
@@ -247,8 +246,6 @@ GLSECONDARYCOLOR_VFUNC(SecondaryColor3ubv,GLubyte,ary2cubyte)
247
246
  GLSECONDARYCOLOR_VFUNC(SecondaryColor3usv,GLushort,ary2cushort)
248
247
  #undef GLSECONDARYCOLOR_VFUNC
249
248
 
250
- extern VALUE g_SecondaryColor_ptr;
251
- static void (APIENTRY * fptr_glSecondaryColorPointer)(GLint,GLenum,GLsizei,const GLvoid *);
252
249
  static VALUE
253
250
  gl_SecondaryColorPointer(obj,arg1,arg2,arg3,arg4)
254
251
  VALUE obj,arg1,arg2,arg3,arg4;
@@ -256,18 +253,19 @@ VALUE obj,arg1,arg2,arg3,arg4;
256
253
  GLint size;
257
254
  GLenum type;
258
255
  GLsizei stride;
256
+ DECL_GL_FUNC_PTR(GLvoid,glSecondaryColorPointer,(GLint,GLenum,GLsizei,const GLvoid *));
259
257
  LOAD_GL_FUNC(glSecondaryColorPointer, "1.4");
260
258
  size = (GLint)NUM2INT(arg1);
261
259
  type = (GLenum)NUM2INT(arg2);
262
260
  stride = (GLsizei)NUM2UINT(arg3);
263
- if (CheckBufferBinding(GL_ARRAY_BUFFER_BINDING)) {
264
- g_SecondaryColor_ptr = arg4;
261
+ if (CHECK_BUFFER_BINDING(GL_ARRAY_BUFFER_BINDING)) {
262
+ SET_GLIMPL_VARIABLE(SecondaryColor_ptr, arg4);
265
263
  fptr_glSecondaryColorPointer(size,type, stride, (const GLvoid*)NUM2SIZET(arg4));
266
264
  } else {
267
265
  VALUE data;
268
266
  data = pack_array_or_pass_string(type,arg4);
269
267
  rb_str_freeze(data);
270
- g_SecondaryColor_ptr = data;
268
+ SET_GLIMPL_VARIABLE(SecondaryColor_ptr, data);
271
269
  fptr_glSecondaryColorPointer(size,type, stride, (const GLvoid*)RSTRING_PTR(data));
272
270
  }
273
271
  CHECK_GLERROR_FROM("glSecondaryColorPointer");
@@ -275,10 +273,10 @@ VALUE obj,arg1,arg2,arg3,arg4;
275
273
  }
276
274
 
277
275
  #define GLWINDOWPOS_VFUNC(_name_,_type_,_size_,_conv_) \
278
- static void (APIENTRY * fptr_gl##_name_)(_type_ *); \
279
276
  VALUE gl_##_name_(VALUE obj,VALUE arg1) \
280
277
  { \
281
278
  _type_ cary[3] = {0,0,0}; \
279
+ DECL_GL_FUNC_PTR(GLvoid,gl##_name_,(_type_ *)); \
282
280
  LOAD_GL_FUNC(gl##_name_, "1.4"); \
283
281
  Check_Type(arg1,T_ARRAY); \
284
282
  _conv_(arg1,cary,_size_); \
@@ -298,51 +296,51 @@ GLWINDOWPOS_VFUNC(WindowPos3sv,GLshort,3,ary2cshort)
298
296
  #undef GLWINDOWPOS_VFUNC
299
297
 
300
298
 
301
- void gl_init_functions_1_4(VALUE module)
299
+ void gl_init_functions_1_4(VALUE klass)
302
300
  {
303
- rb_define_module_function(module, "glBlendFuncSeparate", gl_BlendFuncSeparate, 4);
304
- rb_define_module_function(module, "glFogCoordf", gl_FogCoordf, 1);
305
- rb_define_module_function(module, "glFogCoordfv", gl_FogCoordfv, 1);
306
- rb_define_module_function(module, "glFogCoordd", gl_FogCoordd, 1);
307
- rb_define_module_function(module, "glFogCoorddv", gl_FogCoorddv, 1);
308
- rb_define_module_function(module, "glFogCoordPointer", gl_FogCoordPointer, 3);
309
- rb_define_module_function(module, "glMultiDrawArrays", gl_MultiDrawArrays, 3);
310
- rb_define_module_function(module, "glMultiDrawElements", gl_MultiDrawElements, -1);
311
- rb_define_module_function(module, "glPointParameterf", gl_PointParameterf, 2);
312
- rb_define_module_function(module, "glPointParameterfv", gl_PointParameterfv, 2);
313
- rb_define_module_function(module, "glPointParameteri", gl_PointParameteri, 2);
314
- rb_define_module_function(module, "glPointParameteriv", gl_PointParameteriv, 2);
315
- rb_define_module_function(module, "glSecondaryColor3b", gl_SecondaryColor3b, 3);
316
- rb_define_module_function(module, "glSecondaryColor3d", gl_SecondaryColor3d, 3);
317
- rb_define_module_function(module, "glSecondaryColor3f", gl_SecondaryColor3f, 3);
318
- rb_define_module_function(module, "glSecondaryColor3i", gl_SecondaryColor3i, 3);
319
- rb_define_module_function(module, "glSecondaryColor3s", gl_SecondaryColor3s, 3);
320
- rb_define_module_function(module, "glSecondaryColor3ub", gl_SecondaryColor3ub, 3);
321
- rb_define_module_function(module, "glSecondaryColor3ui", gl_SecondaryColor3ui, 3);
322
- rb_define_module_function(module, "glSecondaryColor3us", gl_SecondaryColor3us, 3);
323
- rb_define_module_function(module, "glSecondaryColor3bv", gl_SecondaryColor3bv, 1);
324
- rb_define_module_function(module, "glSecondaryColor3dv", gl_SecondaryColor3dv, 1);
325
- rb_define_module_function(module, "glSecondaryColor3fv", gl_SecondaryColor3fv, 1);
326
- rb_define_module_function(module, "glSecondaryColor3iv", gl_SecondaryColor3iv, 1);
327
- rb_define_module_function(module, "glSecondaryColor3sv", gl_SecondaryColor3sv, 1);
328
- rb_define_module_function(module, "glSecondaryColor3ubv", gl_SecondaryColor3ubv, 1);
329
- rb_define_module_function(module, "glSecondaryColor3uiv", gl_SecondaryColor3uiv, 1);
330
- rb_define_module_function(module, "glSecondaryColor3usv", gl_SecondaryColor3usv, 1);
331
- rb_define_module_function(module, "glSecondaryColorPointer", gl_SecondaryColorPointer, 4);
332
- rb_define_module_function(module, "glWindowPos2d", gl_WindowPos2d, 2);
333
- rb_define_module_function(module, "glWindowPos2f", gl_WindowPos2f, 2);
334
- rb_define_module_function(module, "glWindowPos2i", gl_WindowPos2i, 2);
335
- rb_define_module_function(module, "glWindowPos2s", gl_WindowPos2s, 2);
336
- rb_define_module_function(module, "glWindowPos3d", gl_WindowPos3d, 3);
337
- rb_define_module_function(module, "glWindowPos3f", gl_WindowPos3f, 3);
338
- rb_define_module_function(module, "glWindowPos3i", gl_WindowPos3i, 3);
339
- rb_define_module_function(module, "glWindowPos3s", gl_WindowPos3s, 3);
340
- rb_define_module_function(module, "glWindowPos2dv", gl_WindowPos2dv, 1);
341
- rb_define_module_function(module, "glWindowPos2fv", gl_WindowPos2fv, 1);
342
- rb_define_module_function(module, "glWindowPos2iv", gl_WindowPos2iv, 1);
343
- rb_define_module_function(module, "glWindowPos2sv", gl_WindowPos2sv, 1);
344
- rb_define_module_function(module, "glWindowPos3dv", gl_WindowPos3dv, 1);
345
- rb_define_module_function(module, "glWindowPos3fv", gl_WindowPos3fv, 1);
346
- rb_define_module_function(module, "glWindowPos3iv", gl_WindowPos3iv, 1);
347
- rb_define_module_function(module, "glWindowPos3sv", gl_WindowPos3sv, 1);
301
+ rb_define_method(klass, "glBlendFuncSeparate", gl_BlendFuncSeparate, 4);
302
+ rb_define_method(klass, "glFogCoordf", gl_FogCoordf, 1);
303
+ rb_define_method(klass, "glFogCoordfv", gl_FogCoordfv, 1);
304
+ rb_define_method(klass, "glFogCoordd", gl_FogCoordd, 1);
305
+ rb_define_method(klass, "glFogCoorddv", gl_FogCoorddv, 1);
306
+ rb_define_method(klass, "glFogCoordPointer", gl_FogCoordPointer, 3);
307
+ rb_define_method(klass, "glMultiDrawArrays", gl_MultiDrawArrays, 3);
308
+ rb_define_method(klass, "glMultiDrawElements", gl_MultiDrawElements, -1);
309
+ rb_define_method(klass, "glPointParameterf", gl_PointParameterf, 2);
310
+ rb_define_method(klass, "glPointParameterfv", gl_PointParameterfv, 2);
311
+ rb_define_method(klass, "glPointParameteri", gl_PointParameteri, 2);
312
+ rb_define_method(klass, "glPointParameteriv", gl_PointParameteriv, 2);
313
+ rb_define_method(klass, "glSecondaryColor3b", gl_SecondaryColor3b, 3);
314
+ rb_define_method(klass, "glSecondaryColor3d", gl_SecondaryColor3d, 3);
315
+ rb_define_method(klass, "glSecondaryColor3f", gl_SecondaryColor3f, 3);
316
+ rb_define_method(klass, "glSecondaryColor3i", gl_SecondaryColor3i, 3);
317
+ rb_define_method(klass, "glSecondaryColor3s", gl_SecondaryColor3s, 3);
318
+ rb_define_method(klass, "glSecondaryColor3ub", gl_SecondaryColor3ub, 3);
319
+ rb_define_method(klass, "glSecondaryColor3ui", gl_SecondaryColor3ui, 3);
320
+ rb_define_method(klass, "glSecondaryColor3us", gl_SecondaryColor3us, 3);
321
+ rb_define_method(klass, "glSecondaryColor3bv", gl_SecondaryColor3bv, 1);
322
+ rb_define_method(klass, "glSecondaryColor3dv", gl_SecondaryColor3dv, 1);
323
+ rb_define_method(klass, "glSecondaryColor3fv", gl_SecondaryColor3fv, 1);
324
+ rb_define_method(klass, "glSecondaryColor3iv", gl_SecondaryColor3iv, 1);
325
+ rb_define_method(klass, "glSecondaryColor3sv", gl_SecondaryColor3sv, 1);
326
+ rb_define_method(klass, "glSecondaryColor3ubv", gl_SecondaryColor3ubv, 1);
327
+ rb_define_method(klass, "glSecondaryColor3uiv", gl_SecondaryColor3uiv, 1);
328
+ rb_define_method(klass, "glSecondaryColor3usv", gl_SecondaryColor3usv, 1);
329
+ rb_define_method(klass, "glSecondaryColorPointer", gl_SecondaryColorPointer, 4);
330
+ rb_define_method(klass, "glWindowPos2d", gl_WindowPos2d, 2);
331
+ rb_define_method(klass, "glWindowPos2f", gl_WindowPos2f, 2);
332
+ rb_define_method(klass, "glWindowPos2i", gl_WindowPos2i, 2);
333
+ rb_define_method(klass, "glWindowPos2s", gl_WindowPos2s, 2);
334
+ rb_define_method(klass, "glWindowPos3d", gl_WindowPos3d, 3);
335
+ rb_define_method(klass, "glWindowPos3f", gl_WindowPos3f, 3);
336
+ rb_define_method(klass, "glWindowPos3i", gl_WindowPos3i, 3);
337
+ rb_define_method(klass, "glWindowPos3s", gl_WindowPos3s, 3);
338
+ rb_define_method(klass, "glWindowPos2dv", gl_WindowPos2dv, 1);
339
+ rb_define_method(klass, "glWindowPos2fv", gl_WindowPos2fv, 1);
340
+ rb_define_method(klass, "glWindowPos2iv", gl_WindowPos2iv, 1);
341
+ rb_define_method(klass, "glWindowPos2sv", gl_WindowPos2sv, 1);
342
+ rb_define_method(klass, "glWindowPos3dv", gl_WindowPos3dv, 1);
343
+ rb_define_method(klass, "glWindowPos3fv", gl_WindowPos3fv, 1);
344
+ rb_define_method(klass, "glWindowPos3iv", gl_WindowPos3iv, 1);
345
+ rb_define_method(klass, "glWindowPos3sv", gl_WindowPos3sv, 1);
348
346
  }