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.5.c CHANGED
@@ -27,7 +27,6 @@ GL_FUNC_DELETEOBJECTS_LOAD(DeleteQueries, "1.5");
27
27
  GL_FUNC_GENOBJECTS_LOAD(GenBuffers, "1.5");
28
28
  GL_FUNC_DELETEOBJECTS_LOAD(DeleteBuffers, "1.5");
29
29
 
30
- static void (APIENTRY * fptr_glGetQueryiv)(GLenum,GLenum,GLint *);
31
30
  static VALUE
32
31
  gl_GetQueryiv(obj,arg1,arg2)
33
32
  VALUE obj,arg1,arg2;
@@ -35,6 +34,7 @@ VALUE obj,arg1,arg2;
35
34
  GLenum target;
36
35
  GLenum pname;
37
36
  GLint params = 0;
37
+ DECL_GL_FUNC_PTR(GLvoid,glGetQueryiv,(GLenum,GLenum,GLint *));
38
38
  LOAD_GL_FUNC(glGetQueryiv, "1.5");
39
39
  target = (GLenum)NUM2INT(arg1);
40
40
  pname = (GLenum)NUM2INT(arg2);
@@ -43,7 +43,6 @@ VALUE obj,arg1,arg2;
43
43
  return RETCONV_GLint(params);
44
44
  }
45
45
 
46
- static void (APIENTRY * fptr_glGetQueryObjectiv)(GLuint,GLenum,GLint *);
47
46
  static VALUE
48
47
  gl_GetQueryObjectiv(obj,arg1,arg2)
49
48
  VALUE obj,arg1,arg2;
@@ -51,6 +50,7 @@ VALUE obj,arg1,arg2;
51
50
  GLuint id;
52
51
  GLenum pname;
53
52
  GLint params = 0;
53
+ DECL_GL_FUNC_PTR(GLvoid,glGetQueryObjectiv,(GLuint,GLenum,GLint *));
54
54
  LOAD_GL_FUNC(glGetQueryObjectiv, "1.5");
55
55
  id = (GLuint)NUM2UINT(arg1);
56
56
  pname = (GLenum)NUM2INT(arg2);
@@ -59,7 +59,6 @@ VALUE obj,arg1,arg2;
59
59
  return cond_GLBOOL2RUBY(pname,params);
60
60
  }
61
61
 
62
- static void (APIENTRY * fptr_glGetQueryObjectuiv)(GLuint,GLenum,GLuint *);
63
62
  static VALUE
64
63
  gl_GetQueryObjectuiv(obj,arg1,arg2)
65
64
  VALUE obj,arg1,arg2;
@@ -67,6 +66,7 @@ VALUE obj,arg1,arg2;
67
66
  GLuint id;
68
67
  GLenum pname;
69
68
  GLuint params = 0;
69
+ DECL_GL_FUNC_PTR(GLvoid,glGetQueryObjectuiv,(GLuint,GLenum,GLuint *));
70
70
  LOAD_GL_FUNC(glGetQueryObjectuiv, "1.5");
71
71
  id = (GLuint)NUM2UINT(arg1);
72
72
  pname = (GLenum)NUM2INT(arg2);
@@ -75,7 +75,6 @@ VALUE obj,arg1,arg2;
75
75
  return cond_GLBOOL2RUBY_U(pname,params);
76
76
  }
77
77
 
78
- static void (APIENTRY * fptr_glBufferData)(GLenum,GLsizeiptr,GLvoid *,GLenum);
79
78
  static VALUE
80
79
  gl_BufferData(obj,arg1,arg2,arg3,arg4)
81
80
  VALUE obj,arg1,arg2,arg3,arg4;
@@ -83,6 +82,7 @@ VALUE obj,arg1,arg2,arg3,arg4;
83
82
  GLenum target;
84
83
  GLsizeiptr size;
85
84
  GLenum usage;
85
+ DECL_GL_FUNC_PTR(GLvoid,glBufferData,(GLenum,GLsizeiptr,GLvoid *,GLenum));
86
86
  LOAD_GL_FUNC(glBufferData, "1.5");
87
87
  target = (GLenum)NUM2INT(arg1);
88
88
  size = (GLsizeiptr)NUM2INT(arg2);
@@ -98,7 +98,6 @@ VALUE obj,arg1,arg2,arg3,arg4;
98
98
  return Qnil;
99
99
  }
100
100
 
101
- static void (APIENTRY * fptr_glBufferSubData)(GLenum,GLintptr,GLsizeiptr,GLvoid *);
102
101
  static VALUE
103
102
  gl_BufferSubData(obj,arg1,arg2,arg3,arg4)
104
103
  VALUE obj,arg1,arg2,arg3,arg4;
@@ -106,6 +105,7 @@ VALUE obj,arg1,arg2,arg3,arg4;
106
105
  GLenum target;
107
106
  GLintptr offset;
108
107
  GLsizeiptr size;
108
+ DECL_GL_FUNC_PTR(GLvoid,glBufferSubData,(GLenum,GLintptr,GLsizeiptr,GLvoid *));
109
109
  LOAD_GL_FUNC(glBufferSubData, "1.5");
110
110
  target = (GLenum)NUM2INT(arg1);
111
111
  offset = (GLintptr)NUM2INT(arg2);
@@ -116,7 +116,6 @@ VALUE obj,arg1,arg2,arg3,arg4;
116
116
  return Qnil;
117
117
  }
118
118
 
119
- static void (APIENTRY * fptr_glGetBufferSubData)(GLenum,GLintptr,GLsizeiptr,GLvoid *);
120
119
  static VALUE
121
120
  gl_GetBufferSubData(obj,arg1,arg2,arg3)
122
121
  VALUE obj,arg1,arg2,arg3;
@@ -125,6 +124,7 @@ VALUE obj,arg1,arg2,arg3;
125
124
  GLintptr offset;
126
125
  GLsizeiptr size;
127
126
  VALUE data;
127
+ DECL_GL_FUNC_PTR(GLvoid,glGetBufferSubData,(GLenum,GLintptr,GLsizeiptr,GLvoid *));
128
128
  LOAD_GL_FUNC(glGetBufferSubData, "1.5");
129
129
  target = (GLenum)NUM2INT(arg1);
130
130
  offset = (GLintptr)NUM2INT(arg2);
@@ -135,7 +135,6 @@ VALUE obj,arg1,arg2,arg3;
135
135
  return data;
136
136
  }
137
137
 
138
- static void (APIENTRY * fptr_glGetBufferParameteriv)(GLenum,GLenum,GLint *);
139
138
  static VALUE
140
139
  gl_GetBufferParameteriv(obj,arg1,arg2)
141
140
  VALUE obj,arg1,arg2;
@@ -143,6 +142,7 @@ VALUE obj,arg1,arg2;
143
142
  GLenum target;
144
143
  GLenum value;
145
144
  GLint data = 0;
145
+ DECL_GL_FUNC_PTR(GLvoid,glGetBufferParameteriv,(GLenum,GLenum,GLint *));
146
146
  LOAD_GL_FUNC(glGetBufferParameteriv, "1.5");
147
147
  target = (GLenum)NUM2INT(arg1);
148
148
  value = (GLenum)NUM2INT(arg2);
@@ -151,14 +151,15 @@ VALUE obj,arg1,arg2;
151
151
  return cond_GLBOOL2RUBY(value,data);
152
152
  }
153
153
 
154
- static GLvoid * (APIENTRY * fptr_glMapBuffer)(GLenum,GLenum);
155
154
  static VALUE
156
- gl_MapBuffer(VALUE self, VALUE _target, VALUE _access) {
155
+ gl_MapBuffer(VALUE obj, VALUE _target, VALUE _access) {
157
156
  GLenum target = CONV_GLenum(_target);
158
157
  GLenum access = CONV_GLenum(_access);
159
158
  GLint size = 0;
160
159
  GLvoid *buffer_ptr = NULL;
161
160
 
161
+ DECL_GL_FUNC_PTR(GLvoid *,glMapBuffer,(GLenum,GLenum));
162
+ DECL_GL_FUNC_PTR(GLvoid,glGetBufferParameteriv,(GLenum,GLenum,GLint *));
162
163
  LOAD_GL_FUNC(glMapBuffer, "1.5");
163
164
  LOAD_GL_FUNC(glGetBufferParameteriv, "1.5");
164
165
 
@@ -175,13 +176,13 @@ gl_MapBuffer(VALUE self, VALUE _target, VALUE _access) {
175
176
  return rb_str_new(buffer_ptr, size);
176
177
  }
177
178
 
178
- static GLboolean (APIENTRY * fptr_glUnmapBuffer)(GLenum);
179
179
  static VALUE
180
180
  gl_UnmapBuffer(obj,arg1)
181
181
  VALUE obj,arg1;
182
182
  {
183
183
  GLenum target;
184
184
  GLboolean ret;
185
+ DECL_GL_FUNC_PTR(GLboolean,glUnmapBuffer,(GLenum));
185
186
  LOAD_GL_FUNC(glUnmapBuffer, "1.5");
186
187
  target = (GLenum)NUM2INT(arg1);
187
188
  ret = fptr_glUnmapBuffer(target);
@@ -189,36 +190,36 @@ VALUE obj,arg1;
189
190
  return GLBOOL2RUBY(ret);
190
191
  }
191
192
 
192
- static void (APIENTRY * fptr_glGetBufferPointerv)(GLenum,GLenum,GLvoid **);
193
193
  static VALUE
194
194
  gl_GetBufferPointerv(obj,arg1,arg2,arg3)
195
195
  VALUE obj,arg1,arg2,arg3;
196
196
  {
197
+ DECL_GL_FUNC_PTR(GLvoid,glGetBufferPointerv,(GLenum,GLenum,GLvoid **));
197
198
  LOAD_GL_FUNC(glGetBufferPointerv, "1.5");
198
199
  rb_raise(rb_eArgError, "glGetBufferPointerv not implemented");
199
200
  CHECK_GLERROR_FROM("glGetBufferPointerv");
200
201
  return Qnil;
201
202
  }
202
203
 
203
- void gl_init_functions_1_5(VALUE module)
204
+ void gl_init_functions_1_5(VALUE klass)
204
205
  {
205
- rb_define_module_function(module, "glGenQueries", gl_GenQueries, 1);
206
- rb_define_module_function(module, "glDeleteQueries", gl_DeleteQueries, 1);
207
- rb_define_module_function(module, "glIsQuery", gl_IsQuery, 1);
208
- rb_define_module_function(module, "glBeginQuery", gl_BeginQuery, 2);
209
- rb_define_module_function(module, "glEndQuery", gl_EndQuery, 1);
210
- rb_define_module_function(module, "glGetQueryiv", gl_GetQueryiv, 2);
211
- rb_define_module_function(module, "glGetQueryObjectiv", gl_GetQueryObjectiv, 2);
212
- rb_define_module_function(module, "glGetQueryObjectuiv", gl_GetQueryObjectuiv, 2);
213
- rb_define_module_function(module, "glBindBuffer", gl_BindBuffer, 2);
214
- rb_define_module_function(module, "glDeleteBuffers", gl_DeleteBuffers, 1);
215
- rb_define_module_function(module, "glGenBuffers", gl_GenBuffers, 1);
216
- rb_define_module_function(module, "glIsBuffer", gl_IsBuffer, 1);
217
- rb_define_module_function(module, "glBufferData", gl_BufferData, 4);
218
- rb_define_module_function(module, "glBufferSubData", gl_BufferSubData, 4);
219
- rb_define_module_function(module, "glGetBufferSubData", gl_GetBufferSubData, 3);
220
- rb_define_module_function(module, "glMapBuffer", gl_MapBuffer, 2);
221
- rb_define_module_function(module, "glUnmapBuffer", gl_UnmapBuffer, 1);
222
- rb_define_module_function(module, "glGetBufferParameteriv", gl_GetBufferParameteriv, 2);
223
- rb_define_module_function(module, "glGetBufferPointerv", gl_GetBufferPointerv, 3);
206
+ rb_define_method(klass, "glGenQueries", gl_GenQueries, 1);
207
+ rb_define_method(klass, "glDeleteQueries", gl_DeleteQueries, 1);
208
+ rb_define_method(klass, "glIsQuery", gl_IsQuery, 1);
209
+ rb_define_method(klass, "glBeginQuery", gl_BeginQuery, 2);
210
+ rb_define_method(klass, "glEndQuery", gl_EndQuery, 1);
211
+ rb_define_method(klass, "glGetQueryiv", gl_GetQueryiv, 2);
212
+ rb_define_method(klass, "glGetQueryObjectiv", gl_GetQueryObjectiv, 2);
213
+ rb_define_method(klass, "glGetQueryObjectuiv", gl_GetQueryObjectuiv, 2);
214
+ rb_define_method(klass, "glBindBuffer", gl_BindBuffer, 2);
215
+ rb_define_method(klass, "glDeleteBuffers", gl_DeleteBuffers, 1);
216
+ rb_define_method(klass, "glGenBuffers", gl_GenBuffers, 1);
217
+ rb_define_method(klass, "glIsBuffer", gl_IsBuffer, 1);
218
+ rb_define_method(klass, "glBufferData", gl_BufferData, 4);
219
+ rb_define_method(klass, "glBufferSubData", gl_BufferSubData, 4);
220
+ rb_define_method(klass, "glGetBufferSubData", gl_GetBufferSubData, 3);
221
+ rb_define_method(klass, "glMapBuffer", gl_MapBuffer, 2);
222
+ rb_define_method(klass, "glUnmapBuffer", gl_UnmapBuffer, 1);
223
+ rb_define_method(klass, "glGetBufferParameteriv", gl_GetBufferParameteriv, 2);
224
+ rb_define_method(klass, "glGetBufferPointerv", gl_GetBufferPointerv, 3);
224
225
  }
data/ext/opengl/gl-2.0.c CHANGED
@@ -55,13 +55,13 @@ GL_FUNC_LOAD_5(VertexAttrib4f,GLvoid, GLuint,GLfloat,GLfloat,GLfloat,GLfloat, "2
55
55
  GL_FUNC_LOAD_5(VertexAttrib4s,GLvoid, GLuint,GLshort,GLshort,GLshort,GLshort, "2.0")
56
56
  GL_FUNC_LOAD_5(VertexAttrib4Nub,GLvoid, GLuint,GLubyte,GLubyte,GLubyte,GLubyte, "2.0")
57
57
 
58
- static void (APIENTRY * fptr_glDrawBuffers)(GLsizei,GLenum *);
59
58
  static VALUE
60
59
  gl_DrawBuffers(obj,arg1)
61
60
  VALUE obj,arg1;
62
61
  {
63
62
  GLsizei size;
64
63
  GLenum *buffers;
64
+ DECL_GL_FUNC_PTR(GLvoid,glDrawBuffers,(GLsizei,GLenum *));
65
65
  LOAD_GL_FUNC(glDrawBuffers, "2.0");
66
66
  Check_Type(arg1,T_ARRAY);
67
67
  size = (GLsizei)RARRAY_LENINT(arg1);
@@ -73,13 +73,13 @@ VALUE obj,arg1;
73
73
  return Qnil;
74
74
  }
75
75
 
76
- static void (APIENTRY * fptr_glBindAttribLocation)(GLuint,GLuint,GLchar *);
77
76
  static VALUE
78
77
  gl_BindAttribLocation(obj,arg1,arg2,arg3)
79
78
  VALUE obj,arg1,arg2,arg3;
80
79
  {
81
80
  GLuint program;
82
81
  GLuint index;
82
+ DECL_GL_FUNC_PTR(GLvoid,glBindAttribLocation,(GLuint,GLuint,GLchar *));
83
83
  LOAD_GL_FUNC(glBindAttribLocation, "2.0");
84
84
  program = (GLuint)NUM2UINT(arg1);
85
85
  index = (GLuint)NUM2UINT(arg2);
@@ -89,7 +89,6 @@ VALUE obj,arg1,arg2,arg3;
89
89
  return Qnil;
90
90
  }
91
91
 
92
- static void (APIENTRY * fptr_glGetProgramiv)(GLuint,GLenum,GLint *);
93
92
  static VALUE
94
93
  gl_GetProgramiv(obj,arg1,arg2)
95
94
  VALUE obj,arg1,arg2;
@@ -97,6 +96,7 @@ VALUE obj,arg1,arg2;
97
96
  GLuint program;
98
97
  GLenum pname;
99
98
  GLint params = 0;
99
+ DECL_GL_FUNC_PTR(GLvoid,glGetProgramiv,(GLuint,GLenum,GLint *));
100
100
  LOAD_GL_FUNC(glGetProgramiv, "2.0");
101
101
  program = (GLuint)NUM2UINT(arg1);
102
102
  pname = (GLenum)NUM2INT(arg2);
@@ -105,7 +105,6 @@ VALUE obj,arg1,arg2;
105
105
  return cond_GLBOOL2RUBY(pname,params);
106
106
  }
107
107
 
108
- static void (APIENTRY * fptr_glGetActiveAttrib)(GLuint,GLuint,GLsizei,GLsizei *,GLint *,GLenum *,GLchar *);
109
108
  static VALUE
110
109
  gl_GetActiveAttrib(obj,arg1,arg2)
111
110
  VALUE obj,arg1,arg2;
@@ -118,6 +117,8 @@ VALUE obj,arg1,arg2;
118
117
  GLenum attrib_type = 0;
119
118
  VALUE buffer;
120
119
  VALUE retary;
120
+ DECL_GL_FUNC_PTR(GLvoid,glGetActiveAttrib,(GLuint,GLuint,GLsizei,GLsizei *,GLint *,GLenum *,GLchar *));
121
+ DECL_GL_FUNC_PTR(GLvoid,glGetProgramiv,(GLuint,GLenum,GLint *));
121
122
  LOAD_GL_FUNC(glGetActiveAttrib, "2.0");
122
123
  LOAD_GL_FUNC(glGetProgramiv, "2.0");
123
124
  program = (GLuint)NUM2UINT(arg1);
@@ -139,7 +140,6 @@ VALUE obj,arg1,arg2;
139
140
  return retary;
140
141
  }
141
142
 
142
- static void (APIENTRY * fptr_glGetActiveUniform)(GLuint,GLuint,GLsizei,GLsizei*,GLint*,GLenum*,GLchar*);
143
143
  static VALUE
144
144
  gl_GetActiveUniform(obj,arg1,arg2)
145
145
  VALUE obj,arg1,arg2;
@@ -152,6 +152,8 @@ VALUE obj,arg1,arg2;
152
152
  GLenum uniform_type = 0;
153
153
  VALUE buffer;
154
154
  VALUE retary;
155
+ DECL_GL_FUNC_PTR(GLvoid,glGetActiveUniform,(GLuint,GLuint,GLsizei,GLsizei*,GLint*,GLenum*,GLchar*));
156
+ DECL_GL_FUNC_PTR(GLvoid,glGetProgramiv,(GLuint,GLenum,GLint *));
155
157
  LOAD_GL_FUNC(glGetActiveUniform, "2.0");
156
158
  LOAD_GL_FUNC(glGetProgramiv, "2.0");
157
159
  program = (GLuint)NUM2UINT(arg1);
@@ -173,7 +175,6 @@ VALUE obj,arg1,arg2;
173
175
  return retary;
174
176
  }
175
177
 
176
- static void (APIENTRY * fptr_glGetAttachedShaders)(GLuint,GLsizei,GLsizei *,GLuint *);
177
178
  static VALUE
178
179
  gl_GetAttachedShaders(obj,arg1)
179
180
  VALUE obj,arg1;
@@ -182,6 +183,8 @@ VALUE obj,arg1;
182
183
  GLint shaders_num = 0;
183
184
  GLuint *shaders;
184
185
  GLsizei count = 0;
186
+ DECL_GL_FUNC_PTR(GLvoid,glGetAttachedShaders,(GLuint,GLsizei,GLsizei *,GLuint *));
187
+ DECL_GL_FUNC_PTR(GLvoid,glGetProgramiv,(GLuint,GLenum,GLint *));
185
188
  LOAD_GL_FUNC(glGetAttachedShaders, "2.0");
186
189
  LOAD_GL_FUNC(glGetProgramiv, "2.0");
187
190
  program = (GLuint)NUM2UINT(arg1);
@@ -195,13 +198,13 @@ VALUE obj,arg1;
195
198
  shaders);
196
199
  }
197
200
 
198
- static GLint (APIENTRY * fptr_glGetAttribLocation)(GLuint, GLchar *);
199
201
  static VALUE
200
202
  gl_GetAttribLocation(obj,arg1,arg2)
201
203
  VALUE obj,arg1,arg2;
202
204
  {
203
205
  GLuint program;
204
206
  GLint ret;
207
+ DECL_GL_FUNC_PTR(GLint,glGetAttribLocation,(GLuint, GLchar *));
205
208
  LOAD_GL_FUNC(glGetAttribLocation, "2.0");
206
209
  program=(GLuint)NUM2UINT(arg1);
207
210
  Check_Type(arg2,T_STRING);
@@ -210,7 +213,6 @@ VALUE obj,arg1,arg2;
210
213
  return INT2NUM(ret);
211
214
  }
212
215
 
213
- static void (APIENTRY * fptr_glGetProgramInfoLog)(GLuint,GLsizei,GLsizei *,GLchar *);
214
216
  static VALUE
215
217
  gl_GetProgramInfoLog(obj,arg1)
216
218
  VALUE obj,arg1;
@@ -219,6 +221,8 @@ VALUE obj,arg1;
219
221
  GLint max_size = 0;
220
222
  GLsizei ret_length = 0;
221
223
  VALUE buffer;
224
+ DECL_GL_FUNC_PTR(GLvoid,glGetProgramInfoLog,(GLuint,GLsizei,GLsizei *,GLchar *));
225
+ DECL_GL_FUNC_PTR(GLvoid,glGetProgramiv,(GLuint,GLenum,GLint *));
222
226
  LOAD_GL_FUNC(glGetProgramInfoLog, "2.0");
223
227
  LOAD_GL_FUNC(glGetProgramiv, "2.0");
224
228
  program = (GLuint)NUM2UINT(arg1);
@@ -233,7 +237,6 @@ VALUE obj,arg1;
233
237
  return buffer;
234
238
  }
235
239
 
236
- static void (APIENTRY * fptr_glGetShaderiv)(GLuint,GLenum,GLint *);
237
240
  static VALUE
238
241
  gl_GetShaderiv(obj,arg1,arg2)
239
242
  VALUE obj,arg1,arg2;
@@ -241,6 +244,7 @@ VALUE obj,arg1,arg2;
241
244
  GLuint program;
242
245
  GLenum pname;
243
246
  GLint params = 0;
247
+ DECL_GL_FUNC_PTR(GLvoid,glGetShaderiv,(GLuint,GLenum,GLint *));
244
248
  LOAD_GL_FUNC(glGetShaderiv, "2.0");
245
249
  program = (GLuint)NUM2UINT(arg1);
246
250
  pname = (GLenum)NUM2INT(arg2);
@@ -249,7 +253,6 @@ VALUE obj,arg1,arg2;
249
253
  return cond_GLBOOL2RUBY(pname,params);
250
254
  }
251
255
 
252
- static void (APIENTRY * fptr_glGetShaderInfoLog)(GLuint,GLsizei,GLsizei *,GLchar *);
253
256
  static VALUE
254
257
  gl_GetShaderInfoLog(obj,arg1)
255
258
  VALUE obj,arg1;
@@ -259,6 +262,8 @@ VALUE obj,arg1;
259
262
  GLsizei ret_length = 0;
260
263
  VALUE ret_buffer;
261
264
  GLchar *buffer;
265
+ DECL_GL_FUNC_PTR(GLvoid,glGetShaderInfoLog,(GLuint,GLsizei,GLsizei *,GLchar *));
266
+ DECL_GL_FUNC_PTR(GLvoid,glGetShaderiv,(GLuint,GLenum,GLint *));
262
267
  LOAD_GL_FUNC(glGetShaderInfoLog, "2.0");
263
268
  LOAD_GL_FUNC(glGetShaderiv, "2.0");
264
269
  program = (GLuint)NUM2UINT(arg1);
@@ -275,7 +280,6 @@ VALUE obj,arg1;
275
280
  return ret_buffer;
276
281
  }
277
282
 
278
- static void (APIENTRY * fptr_glGetShaderSource)(GLuint,GLsizei,GLsizei *,GLchar *);
279
283
  static VALUE
280
284
  gl_GetShaderSource(obj,arg1)
281
285
  VALUE obj,arg1;
@@ -284,6 +288,8 @@ VALUE obj,arg1;
284
288
  GLint max_size = 0;
285
289
  GLsizei ret_length = 0;
286
290
  VALUE buffer;
291
+ DECL_GL_FUNC_PTR(GLvoid,glGetShaderSource,(GLuint,GLsizei,GLsizei *,GLchar *));
292
+ DECL_GL_FUNC_PTR(GLvoid,glGetShaderiv,(GLuint,GLenum,GLint *));
287
293
  LOAD_GL_FUNC(glGetShaderSource, "2.0");
288
294
  LOAD_GL_FUNC(glGetShaderiv, "2.0");
289
295
  shader = (GLuint)NUM2UINT(arg1);
@@ -297,13 +303,13 @@ VALUE obj,arg1;
297
303
  return buffer;
298
304
  }
299
305
 
300
- static GLint (APIENTRY * fptr_glGetUniformLocation)(GLuint,const GLchar*);
301
306
  static VALUE
302
307
  gl_GetUniformLocation(obj,arg1,arg2)
303
308
  VALUE obj,arg1,arg2;
304
309
  {
305
310
  GLuint program;
306
311
  GLint ret;
312
+ DECL_GL_FUNC_PTR(GLint,glGetUniformLocation,(GLuint,const GLchar*));
307
313
  LOAD_GL_FUNC(glGetUniformLocation, "2.0");
308
314
  program=(GLuint)NUM2UINT(arg1);
309
315
  Check_Type(arg2,T_STRING);
@@ -314,7 +320,6 @@ VALUE obj,arg1,arg2;
314
320
  }
315
321
 
316
322
  #define GETUNIFORM_FUNC(_name_,_type_) \
317
- static void (APIENTRY * fptr_gl##_name_)(GLuint,GLint,_type_ *); \
318
323
  static VALUE \
319
324
  gl_##_name_(obj,arg1,arg2) \
320
325
  VALUE obj,arg1,arg2; \
@@ -326,6 +331,8 @@ VALUE obj,arg1,arg2; \
326
331
  GLenum uniform_type = 0; \
327
332
  GLint uniform_size = 0; \
328
333
  \
334
+ DECL_GL_FUNC_PTR(GLvoid,gl##_name_,(GLuint,GLint,_type_ *)); \
335
+ DECL_GL_FUNC_PTR(GLvoid,glGetActiveUniform,(GLuint,GLuint,GLsizei,GLsizei*,GLint*,GLenum*,GLchar*)); \
329
336
  LOAD_GL_FUNC(gl##_name_, "2.0"); \
330
337
  LOAD_GL_FUNC(glGetActiveUniform, "2.0"); \
331
338
  program = (GLuint)NUM2UINT(arg1); \
@@ -348,7 +355,6 @@ GETUNIFORM_FUNC(GetUniformiv,GLint)
348
355
  #undef GETUNIFORM_FUNC
349
356
 
350
357
  #define GETVERTEXATTRIB_FUNC(_name_,_type_) \
351
- static void (APIENTRY * fptr_gl##_name_)(GLuint,GLenum,_type_ *); \
352
358
  static VALUE \
353
359
  gl_##_name_(obj,arg1,arg2) \
354
360
  VALUE obj,arg1,arg2; \
@@ -357,6 +363,7 @@ VALUE obj,arg1,arg2; \
357
363
  GLenum pname; \
358
364
  _type_ params[4] = {0,0,0,0}; \
359
365
  GLint size; \
366
+ DECL_GL_FUNC_PTR(GLvoid,gl##_name_,(GLuint,GLenum,_type_ *)); \
360
367
  LOAD_GL_FUNC(gl##_name_, "2.0"); \
361
368
  index = (GLuint)NUM2UINT(arg1); \
362
369
  pname = (GLenum)NUM2INT(arg2); \
@@ -373,7 +380,6 @@ GETVERTEXATTRIB_FUNC(GetVertexAttribfv,GLfloat)
373
380
  //GETVERTEXATTRIB_FUNC(GetVertexAttribiv,GLint,cond_GLBOOL2RUBY)
374
381
  #undef GETVERTEXATTRIB_FUNC
375
382
 
376
- static void (APIENTRY * fptr_glGetVertexAttribiv)(GLuint,GLenum,GLint *);
377
383
  static VALUE
378
384
  gl_GetVertexAttribiv(obj,arg1,arg2)
379
385
  VALUE obj,arg1,arg2;
@@ -382,6 +388,7 @@ VALUE obj,arg1,arg2;
382
388
  GLenum pname;
383
389
  GLint params[4] = {0,0,0,0};
384
390
  GLint size;
391
+ DECL_GL_FUNC_PTR(GLvoid,glGetVertexAttribiv,(GLuint,GLenum,GLint *));
385
392
  LOAD_GL_FUNC(glGetVertexAttribiv, "2.0");
386
393
  index = (GLuint)NUM2UINT(arg1);
387
394
  pname = (GLenum)NUM2INT(arg2);
@@ -394,24 +401,20 @@ VALUE obj,arg1,arg2;
394
401
  pname, params);
395
402
  }
396
403
 
397
-
398
- VALUE g_VertexAttrib_ptr[_MAX_VERTEX_ATTRIBS];
399
-
400
- static void (APIENTRY * fptr_glGetVertexAttribPointerv)(GLuint,GLenum,GLvoid **);
401
404
  static VALUE
402
405
  gl_GetVertexAttribPointerv(obj,arg1)
403
406
  VALUE obj,arg1;
404
407
  {
405
408
  GLuint index;
409
+ DECL_GL_FUNC_PTR(GLvoid,glGetVertexAttribPointerv,(GLuint,GLenum,GLvoid **));
406
410
  LOAD_GL_FUNC(glGetVertexAttribPointerv, "2.0");
407
411
  index =(GLuint) NUM2INT(arg1);
408
412
  if (index>_MAX_VERTEX_ATTRIBS)
409
413
  rb_raise(rb_eArgError, "Index too large, maximum allowed value '%i'",_MAX_VERTEX_ATTRIBS);
410
414
 
411
- return g_VertexAttrib_ptr[index];
415
+ return GET_GLIMPL_VARIABLE(VertexAttrib_ptr)[index];
412
416
  }
413
417
 
414
- static void (APIENTRY * fptr_glShaderSource)(GLuint,GLsizei,GLchar**,GLint *);
415
418
  static VALUE
416
419
  gl_ShaderSource(obj,arg1,arg2)
417
420
  VALUE obj,arg1,arg2;
@@ -419,6 +422,7 @@ VALUE obj,arg1,arg2;
419
422
  GLuint shader;
420
423
  GLint length;
421
424
  GLchar *str;
425
+ DECL_GL_FUNC_PTR(GLvoid,glShaderSource,(GLuint,GLsizei,GLchar**,GLint *));
422
426
  LOAD_GL_FUNC(glShaderSource, "2.0");
423
427
  shader = (GLuint)NUM2UINT(arg1);
424
428
  Check_Type(arg2,T_STRING);
@@ -430,7 +434,6 @@ VALUE obj,arg1,arg2;
430
434
  }
431
435
 
432
436
  #define UNIFORM_FUNC_V(_name_,_type_,_conv_,_size_) \
433
- static void (APIENTRY * fptr_gl##_name_)(GLint,GLsizei,_type_ *); \
434
437
  static VALUE \
435
438
  gl_##_name_(obj,arg1,arg2) \
436
439
  VALUE obj,arg1,arg2; \
@@ -438,6 +441,7 @@ VALUE obj,arg1,arg2; \
438
441
  GLint location; \
439
442
  GLsizei count; \
440
443
  _type_ *value; \
444
+ DECL_GL_FUNC_PTR(GLvoid,gl##_name_,(GLint,GLsizei,_type_ *)); \
441
445
  LOAD_GL_FUNC(gl##_name_,"2.0"); \
442
446
  Check_Type(arg2,T_ARRAY); \
443
447
  count = (GLsizei)RARRAY_LENINT(arg2); \
@@ -463,7 +467,6 @@ UNIFORM_FUNC_V(Uniform4iv,GLint,ary2cint,4)
463
467
  #undef UNIFORM_FUNC_V
464
468
 
465
469
  #define UNIFORMMATRIX_FUNC(_name_,_size_) \
466
- static void (APIENTRY * fptr_gl##_name_)(GLint,GLsizei,GLboolean,GLfloat *); \
467
470
  static VALUE \
468
471
  gl_##_name_(obj,arg1,arg2,arg3) \
469
472
  VALUE obj,arg1,arg2,arg3; \
@@ -472,6 +475,7 @@ VALUE obj,arg1,arg2,arg3; \
472
475
  GLsizei count; \
473
476
  GLboolean transpose; \
474
477
  GLfloat *value; \
478
+ DECL_GL_FUNC_PTR(GLvoid,gl##_name_,(GLint,GLsizei,GLboolean,GLfloat *)); \
475
479
  LOAD_GL_FUNC(gl##_name_, "2.0"); \
476
480
  location = (GLint)NUM2INT(arg1); \
477
481
  count = (GLsizei)RARRAY_LENINT(rb_funcall(rb_Array(arg3), rb_intern("flatten"), 0)); \
@@ -490,13 +494,13 @@ UNIFORMMATRIX_FUNC(UniformMatrix4fv,4)
490
494
  #undef UNIFORMMATRIX_FUNC
491
495
 
492
496
  #define VERTEXATTRIB_FUNC_V(_name_,_type_,_conv_,_size_) \
493
- static void (APIENTRY * fptr_gl##_name_)(GLuint,_type_ *); \
494
497
  static VALUE \
495
498
  gl_##_name_(obj,arg1,arg2) \
496
499
  VALUE obj,arg1,arg2; \
497
500
  { \
498
501
  GLuint index; \
499
502
  _type_ v[_size_]; \
503
+ DECL_GL_FUNC_PTR(GLvoid,gl##_name_,(GLuint,_type_ *)); \
500
504
  LOAD_GL_FUNC(gl##_name_, "2.0"); \
501
505
  index = (GLuint)NUM2UINT(arg1); \
502
506
  _conv_(arg2,v,_size_); \
@@ -530,7 +534,6 @@ VERTEXATTRIB_FUNC_V(VertexAttrib1fv,GLfloat,ary2cflt,1)
530
534
  VERTEXATTRIB_FUNC_V(VertexAttrib1sv,GLshort,ary2cshort,1)
531
535
  #undef VERTEXATTRIB_FUNC_V
532
536
 
533
- static void (APIENTRY * fptr_glVertexAttribPointer)(GLuint,GLint,GLenum,GLboolean,GLsizei,GLvoid *);
534
537
  static VALUE
535
538
  gl_VertexAttribPointer(obj,arg1,arg2,arg3,arg4,arg5,arg6)
536
539
  VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6;
@@ -540,6 +543,7 @@ VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6;
540
543
  GLenum type;
541
544
  GLboolean normalized;
542
545
  GLsizei stride;
546
+ DECL_GL_FUNC_PTR(GLvoid,glVertexAttribPointer,(GLuint,GLint,GLenum,GLboolean,GLsizei,GLvoid *));
543
547
  LOAD_GL_FUNC(glVertexAttribPointer, "2.0");
544
548
  index = (GLuint)NUM2UINT(arg1);
545
549
  size = (GLuint)NUM2UINT(arg2);
@@ -549,119 +553,113 @@ VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6;
549
553
  if (index>_MAX_VERTEX_ATTRIBS)
550
554
  rb_raise(rb_eArgError, "Index too large, maximum allowed value '%i'",_MAX_VERTEX_ATTRIBS);
551
555
 
552
- if (CheckBufferBinding(GL_ARRAY_BUFFER_BINDING)) {
553
- g_VertexAttrib_ptr[index] = arg6;
556
+ if (CHECK_BUFFER_BINDING(GL_ARRAY_BUFFER_BINDING)) {
557
+ GET_GLIMPL_VARIABLE(VertexAttrib_ptr)[index] = arg6;
554
558
  fptr_glVertexAttribPointer(index,size,type,normalized,stride,(GLvoid *)NUM2SIZET(arg6));
555
559
  } else {
556
560
  VALUE data;
557
561
  data = pack_array_or_pass_string(type,arg6);
558
562
  rb_str_freeze(data);
559
- g_VertexAttrib_ptr[index] = data;
563
+ GET_GLIMPL_VARIABLE(VertexAttrib_ptr)[index] = data;
560
564
  fptr_glVertexAttribPointer(index,size,type,normalized,stride,(GLvoid *)RSTRING_PTR(data));
561
565
  }
562
566
  CHECK_GLERROR_FROM("glVertexAttribPointer");
563
567
  return Qnil;
564
568
  }
565
569
 
566
- void gl_init_functions_2_0(VALUE module)
570
+ void gl_init_functions_2_0(VALUE klass)
567
571
  {
568
- rb_define_module_function(module, "glBlendEquationSeparate", gl_BlendEquationSeparate, 2);
569
- rb_define_module_function(module, "glDrawBuffers", gl_DrawBuffers, 1);
570
- rb_define_module_function(module, "glStencilOpSeparate", gl_StencilOpSeparate, 4);
571
- rb_define_module_function(module, "glStencilFuncSeparate", gl_StencilFuncSeparate, 4);
572
- rb_define_module_function(module, "glStencilMaskSeparate", gl_StencilMaskSeparate, 2);
573
- rb_define_module_function(module, "glAttachShader", gl_AttachShader, 2);
574
- rb_define_module_function(module, "glBindAttribLocation", gl_BindAttribLocation, 3);
575
- rb_define_module_function(module, "glCompileShader", gl_CompileShader, 1);
576
- rb_define_module_function(module, "glCreateProgram", gl_CreateProgram, 0);
577
- rb_define_module_function(module, "glCreateShader", gl_CreateShader, 1);
578
- rb_define_module_function(module, "glDeleteProgram", gl_DeleteProgram, 1);
579
- rb_define_module_function(module, "glDeleteShader", gl_DeleteShader, 1);
580
- rb_define_module_function(module, "glDetachShader", gl_DetachShader, 2);
581
- rb_define_module_function(module, "glDisableVertexAttribArray", gl_DisableVertexAttribArray, 1);
582
- rb_define_module_function(module, "glEnableVertexAttribArray", gl_EnableVertexAttribArray, 1);
583
- rb_define_module_function(module, "glGetActiveAttrib", gl_GetActiveAttrib, 2);
584
- rb_define_module_function(module, "glGetActiveUniform", gl_GetActiveUniform, 2);
585
- rb_define_module_function(module, "glGetAttachedShaders", gl_GetAttachedShaders, 1);
586
- rb_define_module_function(module, "glGetAttribLocation", gl_GetAttribLocation, 2);
587
- rb_define_module_function(module, "glGetProgramiv", gl_GetProgramiv, 2);
588
- rb_define_module_function(module, "glGetProgramInfoLog", gl_GetProgramInfoLog, 1);
589
- rb_define_module_function(module, "glGetShaderiv", gl_GetShaderiv, 2);
590
- rb_define_module_function(module, "glGetShaderInfoLog", gl_GetShaderInfoLog, 1);
591
- rb_define_module_function(module, "glGetShaderSource", gl_GetShaderSource, 1);
592
- rb_define_module_function(module, "glGetUniformLocation", gl_GetUniformLocation, 2);
593
- rb_define_module_function(module, "glGetUniformfv", gl_GetUniformfv, 2);
594
- rb_define_module_function(module, "glGetUniformiv", gl_GetUniformiv, 2);
595
- rb_define_module_function(module, "glGetVertexAttribdv", gl_GetVertexAttribdv, 2);
596
- rb_define_module_function(module, "glGetVertexAttribfv", gl_GetVertexAttribfv, 2);
597
- rb_define_module_function(module, "glGetVertexAttribiv", gl_GetVertexAttribiv, 2);
598
- rb_define_module_function(module, "glGetVertexAttribPointerv", gl_GetVertexAttribPointerv, 1);
599
- rb_define_module_function(module, "glIsProgram", gl_IsProgram, 1);
600
- rb_define_module_function(module, "glIsShader", gl_IsShader, 1);
601
- rb_define_module_function(module, "glLinkProgram", gl_LinkProgram, 1);
602
- rb_define_module_function(module, "glShaderSource", gl_ShaderSource, 2);
603
- rb_define_module_function(module, "glUseProgram", gl_UseProgram, 1);
604
- rb_define_module_function(module, "glUniform1f", gl_Uniform1f, 2);
605
- rb_define_module_function(module, "glUniform2f", gl_Uniform2f, 3);
606
- rb_define_module_function(module, "glUniform3f", gl_Uniform3f, 4);
607
- rb_define_module_function(module, "glUniform4f", gl_Uniform4f, 5);
608
- rb_define_module_function(module, "glUniform1i", gl_Uniform1i, 2);
609
- rb_define_module_function(module, "glUniform2i", gl_Uniform2i, 3);
610
- rb_define_module_function(module, "glUniform3i", gl_Uniform3i, 4);
611
- rb_define_module_function(module, "glUniform4i", gl_Uniform4i, 5);
612
- rb_define_module_function(module, "glUniform1fv", gl_Uniform1fv, 2);
613
- rb_define_module_function(module, "glUniform2fv", gl_Uniform2fv, 2);
614
- rb_define_module_function(module, "glUniform3fv", gl_Uniform3fv, 2);
615
- rb_define_module_function(module, "glUniform4fv", gl_Uniform4fv, 2);
616
- rb_define_module_function(module, "glUniform1iv", gl_Uniform1iv, 2);
617
- rb_define_module_function(module, "glUniform2iv", gl_Uniform2iv, 2);
618
- rb_define_module_function(module, "glUniform3iv", gl_Uniform3iv, 2);
619
- rb_define_module_function(module, "glUniform4iv", gl_Uniform4iv, 2);
620
- rb_define_module_function(module, "glUniformMatrix2fv", gl_UniformMatrix2fv, 3);
621
- rb_define_module_function(module, "glUniformMatrix3fv", gl_UniformMatrix3fv, 3);
622
- rb_define_module_function(module, "glUniformMatrix4fv", gl_UniformMatrix4fv, 3);
623
- rb_define_module_function(module, "glValidateProgram", gl_ValidateProgram, 1);
624
- rb_define_module_function(module, "glVertexAttrib1d", gl_VertexAttrib1d, 2);
625
- rb_define_module_function(module, "glVertexAttrib1f", gl_VertexAttrib1f, 2);
626
- rb_define_module_function(module, "glVertexAttrib1s", gl_VertexAttrib1s, 2);
627
- rb_define_module_function(module, "glVertexAttrib2d", gl_VertexAttrib2d, 3);
628
- rb_define_module_function(module, "glVertexAttrib2f", gl_VertexAttrib2f, 3);
629
- rb_define_module_function(module, "glVertexAttrib2s", gl_VertexAttrib2s, 3);
630
- rb_define_module_function(module, "glVertexAttrib3d", gl_VertexAttrib3d, 4);
631
- rb_define_module_function(module, "glVertexAttrib3f", gl_VertexAttrib3f, 4);
632
- rb_define_module_function(module, "glVertexAttrib3s", gl_VertexAttrib3s, 4);
633
- rb_define_module_function(module, "glVertexAttrib4Nbv", gl_VertexAttrib4Nbv, 2);
634
- rb_define_module_function(module, "glVertexAttrib4Niv", gl_VertexAttrib4Niv, 2);
635
- rb_define_module_function(module, "glVertexAttrib4Nsv", gl_VertexAttrib4Nsv, 2);
636
- rb_define_module_function(module, "glVertexAttrib4Nub", gl_VertexAttrib4Nub, 5);
637
- rb_define_module_function(module, "glVertexAttrib4Nubv", gl_VertexAttrib4Nubv, 2);
638
- rb_define_module_function(module, "glVertexAttrib4Nuiv", gl_VertexAttrib4Nuiv, 2);
639
- rb_define_module_function(module, "glVertexAttrib4Nusv", gl_VertexAttrib4Nusv, 2);
640
- rb_define_module_function(module, "glVertexAttrib4bv", gl_VertexAttrib4bv, 2);
641
- rb_define_module_function(module, "glVertexAttrib4d", gl_VertexAttrib4d, 5);
642
- rb_define_module_function(module, "glVertexAttrib4f", gl_VertexAttrib4f, 5);
643
- rb_define_module_function(module, "glVertexAttrib4iv", gl_VertexAttrib4iv, 2);
644
- rb_define_module_function(module, "glVertexAttrib4s", gl_VertexAttrib4s, 5);
645
- rb_define_module_function(module, "glVertexAttrib4ubv", gl_VertexAttrib4ubv, 2);
646
- rb_define_module_function(module, "glVertexAttrib4uiv", gl_VertexAttrib4uiv, 2);
647
- rb_define_module_function(module, "glVertexAttrib4usv", gl_VertexAttrib4usv, 2);
648
- rb_define_module_function(module, "glVertexAttrib1dv", gl_VertexAttrib1dv, 2);
649
- rb_define_module_function(module, "glVertexAttrib1fv", gl_VertexAttrib1fv, 2);
650
- rb_define_module_function(module, "glVertexAttrib1sv", gl_VertexAttrib1sv, 2);
651
- rb_define_module_function(module, "glVertexAttrib2dv", gl_VertexAttrib2dv, 2);
652
- rb_define_module_function(module, "glVertexAttrib2fv", gl_VertexAttrib2fv, 2);
653
- rb_define_module_function(module, "glVertexAttrib2sv", gl_VertexAttrib2sv, 2);
654
- rb_define_module_function(module, "glVertexAttrib3dv", gl_VertexAttrib3dv, 2);
655
- rb_define_module_function(module, "glVertexAttrib3fv", gl_VertexAttrib3fv, 2);
656
- rb_define_module_function(module, "glVertexAttrib3sv", gl_VertexAttrib3sv, 2);
657
- rb_define_module_function(module, "glVertexAttrib4dv", gl_VertexAttrib4dv, 2);
658
- rb_define_module_function(module, "glVertexAttrib4fv", gl_VertexAttrib4fv, 2);
659
- rb_define_module_function(module, "glVertexAttrib4sv", gl_VertexAttrib4sv, 2);
660
- rb_define_module_function(module, "glVertexAttribPointer", gl_VertexAttribPointer, 6);
661
-
662
- {
663
- int i;
664
- for (i=0;i<_MAX_VERTEX_ATTRIBS;i++)
665
- rb_global_variable(&g_VertexAttrib_ptr[i]);
666
- }
572
+ rb_define_method(klass, "glBlendEquationSeparate", gl_BlendEquationSeparate, 2);
573
+ rb_define_method(klass, "glDrawBuffers", gl_DrawBuffers, 1);
574
+ rb_define_method(klass, "glStencilOpSeparate", gl_StencilOpSeparate, 4);
575
+ rb_define_method(klass, "glStencilFuncSeparate", gl_StencilFuncSeparate, 4);
576
+ rb_define_method(klass, "glStencilMaskSeparate", gl_StencilMaskSeparate, 2);
577
+ rb_define_method(klass, "glAttachShader", gl_AttachShader, 2);
578
+ rb_define_method(klass, "glBindAttribLocation", gl_BindAttribLocation, 3);
579
+ rb_define_method(klass, "glCompileShader", gl_CompileShader, 1);
580
+ rb_define_method(klass, "glCreateProgram", gl_CreateProgram, 0);
581
+ rb_define_method(klass, "glCreateShader", gl_CreateShader, 1);
582
+ rb_define_method(klass, "glDeleteProgram", gl_DeleteProgram, 1);
583
+ rb_define_method(klass, "glDeleteShader", gl_DeleteShader, 1);
584
+ rb_define_method(klass, "glDetachShader", gl_DetachShader, 2);
585
+ rb_define_method(klass, "glDisableVertexAttribArray", gl_DisableVertexAttribArray, 1);
586
+ rb_define_method(klass, "glEnableVertexAttribArray", gl_EnableVertexAttribArray, 1);
587
+ rb_define_method(klass, "glGetActiveAttrib", gl_GetActiveAttrib, 2);
588
+ rb_define_method(klass, "glGetActiveUniform", gl_GetActiveUniform, 2);
589
+ rb_define_method(klass, "glGetAttachedShaders", gl_GetAttachedShaders, 1);
590
+ rb_define_method(klass, "glGetAttribLocation", gl_GetAttribLocation, 2);
591
+ rb_define_method(klass, "glGetProgramiv", gl_GetProgramiv, 2);
592
+ rb_define_method(klass, "glGetProgramInfoLog", gl_GetProgramInfoLog, 1);
593
+ rb_define_method(klass, "glGetShaderiv", gl_GetShaderiv, 2);
594
+ rb_define_method(klass, "glGetShaderInfoLog", gl_GetShaderInfoLog, 1);
595
+ rb_define_method(klass, "glGetShaderSource", gl_GetShaderSource, 1);
596
+ rb_define_method(klass, "glGetUniformLocation", gl_GetUniformLocation, 2);
597
+ rb_define_method(klass, "glGetUniformfv", gl_GetUniformfv, 2);
598
+ rb_define_method(klass, "glGetUniformiv", gl_GetUniformiv, 2);
599
+ rb_define_method(klass, "glGetVertexAttribdv", gl_GetVertexAttribdv, 2);
600
+ rb_define_method(klass, "glGetVertexAttribfv", gl_GetVertexAttribfv, 2);
601
+ rb_define_method(klass, "glGetVertexAttribiv", gl_GetVertexAttribiv, 2);
602
+ rb_define_method(klass, "glGetVertexAttribPointerv", gl_GetVertexAttribPointerv, 1);
603
+ rb_define_method(klass, "glIsProgram", gl_IsProgram, 1);
604
+ rb_define_method(klass, "glIsShader", gl_IsShader, 1);
605
+ rb_define_method(klass, "glLinkProgram", gl_LinkProgram, 1);
606
+ rb_define_method(klass, "glShaderSource", gl_ShaderSource, 2);
607
+ rb_define_method(klass, "glUseProgram", gl_UseProgram, 1);
608
+ rb_define_method(klass, "glUniform1f", gl_Uniform1f, 2);
609
+ rb_define_method(klass, "glUniform2f", gl_Uniform2f, 3);
610
+ rb_define_method(klass, "glUniform3f", gl_Uniform3f, 4);
611
+ rb_define_method(klass, "glUniform4f", gl_Uniform4f, 5);
612
+ rb_define_method(klass, "glUniform1i", gl_Uniform1i, 2);
613
+ rb_define_method(klass, "glUniform2i", gl_Uniform2i, 3);
614
+ rb_define_method(klass, "glUniform3i", gl_Uniform3i, 4);
615
+ rb_define_method(klass, "glUniform4i", gl_Uniform4i, 5);
616
+ rb_define_method(klass, "glUniform1fv", gl_Uniform1fv, 2);
617
+ rb_define_method(klass, "glUniform2fv", gl_Uniform2fv, 2);
618
+ rb_define_method(klass, "glUniform3fv", gl_Uniform3fv, 2);
619
+ rb_define_method(klass, "glUniform4fv", gl_Uniform4fv, 2);
620
+ rb_define_method(klass, "glUniform1iv", gl_Uniform1iv, 2);
621
+ rb_define_method(klass, "glUniform2iv", gl_Uniform2iv, 2);
622
+ rb_define_method(klass, "glUniform3iv", gl_Uniform3iv, 2);
623
+ rb_define_method(klass, "glUniform4iv", gl_Uniform4iv, 2);
624
+ rb_define_method(klass, "glUniformMatrix2fv", gl_UniformMatrix2fv, 3);
625
+ rb_define_method(klass, "glUniformMatrix3fv", gl_UniformMatrix3fv, 3);
626
+ rb_define_method(klass, "glUniformMatrix4fv", gl_UniformMatrix4fv, 3);
627
+ rb_define_method(klass, "glValidateProgram", gl_ValidateProgram, 1);
628
+ rb_define_method(klass, "glVertexAttrib1d", gl_VertexAttrib1d, 2);
629
+ rb_define_method(klass, "glVertexAttrib1f", gl_VertexAttrib1f, 2);
630
+ rb_define_method(klass, "glVertexAttrib1s", gl_VertexAttrib1s, 2);
631
+ rb_define_method(klass, "glVertexAttrib2d", gl_VertexAttrib2d, 3);
632
+ rb_define_method(klass, "glVertexAttrib2f", gl_VertexAttrib2f, 3);
633
+ rb_define_method(klass, "glVertexAttrib2s", gl_VertexAttrib2s, 3);
634
+ rb_define_method(klass, "glVertexAttrib3d", gl_VertexAttrib3d, 4);
635
+ rb_define_method(klass, "glVertexAttrib3f", gl_VertexAttrib3f, 4);
636
+ rb_define_method(klass, "glVertexAttrib3s", gl_VertexAttrib3s, 4);
637
+ rb_define_method(klass, "glVertexAttrib4Nbv", gl_VertexAttrib4Nbv, 2);
638
+ rb_define_method(klass, "glVertexAttrib4Niv", gl_VertexAttrib4Niv, 2);
639
+ rb_define_method(klass, "glVertexAttrib4Nsv", gl_VertexAttrib4Nsv, 2);
640
+ rb_define_method(klass, "glVertexAttrib4Nub", gl_VertexAttrib4Nub, 5);
641
+ rb_define_method(klass, "glVertexAttrib4Nubv", gl_VertexAttrib4Nubv, 2);
642
+ rb_define_method(klass, "glVertexAttrib4Nuiv", gl_VertexAttrib4Nuiv, 2);
643
+ rb_define_method(klass, "glVertexAttrib4Nusv", gl_VertexAttrib4Nusv, 2);
644
+ rb_define_method(klass, "glVertexAttrib4bv", gl_VertexAttrib4bv, 2);
645
+ rb_define_method(klass, "glVertexAttrib4d", gl_VertexAttrib4d, 5);
646
+ rb_define_method(klass, "glVertexAttrib4f", gl_VertexAttrib4f, 5);
647
+ rb_define_method(klass, "glVertexAttrib4iv", gl_VertexAttrib4iv, 2);
648
+ rb_define_method(klass, "glVertexAttrib4s", gl_VertexAttrib4s, 5);
649
+ rb_define_method(klass, "glVertexAttrib4ubv", gl_VertexAttrib4ubv, 2);
650
+ rb_define_method(klass, "glVertexAttrib4uiv", gl_VertexAttrib4uiv, 2);
651
+ rb_define_method(klass, "glVertexAttrib4usv", gl_VertexAttrib4usv, 2);
652
+ rb_define_method(klass, "glVertexAttrib1dv", gl_VertexAttrib1dv, 2);
653
+ rb_define_method(klass, "glVertexAttrib1fv", gl_VertexAttrib1fv, 2);
654
+ rb_define_method(klass, "glVertexAttrib1sv", gl_VertexAttrib1sv, 2);
655
+ rb_define_method(klass, "glVertexAttrib2dv", gl_VertexAttrib2dv, 2);
656
+ rb_define_method(klass, "glVertexAttrib2fv", gl_VertexAttrib2fv, 2);
657
+ rb_define_method(klass, "glVertexAttrib2sv", gl_VertexAttrib2sv, 2);
658
+ rb_define_method(klass, "glVertexAttrib3dv", gl_VertexAttrib3dv, 2);
659
+ rb_define_method(klass, "glVertexAttrib3fv", gl_VertexAttrib3fv, 2);
660
+ rb_define_method(klass, "glVertexAttrib3sv", gl_VertexAttrib3sv, 2);
661
+ rb_define_method(klass, "glVertexAttrib4dv", gl_VertexAttrib4dv, 2);
662
+ rb_define_method(klass, "glVertexAttrib4fv", gl_VertexAttrib4fv, 2);
663
+ rb_define_method(klass, "glVertexAttrib4sv", gl_VertexAttrib4sv, 2);
664
+ rb_define_method(klass, "glVertexAttribPointer", gl_VertexAttribPointer, 6);
667
665
  }