opengl 0.8.0 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (145) hide show
  1. checksums.yaml +7 -0
  2. checksums.yaml.gz.sig +1 -0
  3. data.tar.gz.sig +0 -0
  4. data/.gitignore +2 -1
  5. data/.travis.yml +19 -0
  6. data/History.rdoc +26 -0
  7. data/Manifest.txt +3 -23
  8. data/README.rdoc +43 -37
  9. data/Rakefile +6 -62
  10. data/examples/NeHe/nehe_lesson02.rb +3 -2
  11. data/examples/NeHe/nehe_lesson03.rb +3 -2
  12. data/examples/NeHe/nehe_lesson04.rb +3 -1
  13. data/examples/NeHe/nehe_lesson05.rb +4 -1
  14. data/examples/NeHe/nehe_lesson06.rb +9 -6
  15. data/examples/NeHe/nehe_lesson07.rb +9 -6
  16. data/examples/NeHe/nehe_lesson08.rb +9 -6
  17. data/examples/NeHe/nehe_lesson09.rb +10 -6
  18. data/examples/NeHe/nehe_lesson11.rb +9 -6
  19. data/examples/NeHe/nehe_lesson12.rb +9 -6
  20. data/examples/NeHe/nehe_lesson16.rb +50 -47
  21. data/examples/NeHe/nehe_lesson19.rb +10 -7
  22. data/examples/NeHe/nehe_lesson36.rb +234 -229
  23. data/examples/OrangeBook/brick.rb +227 -225
  24. data/examples/OrangeBook/particle.rb +233 -231
  25. data/examples/RedBook/aapoly.rb +71 -70
  26. data/examples/RedBook/aargb.rb +54 -52
  27. data/examples/RedBook/accanti.rb +96 -94
  28. data/examples/RedBook/accpersp.rb +106 -104
  29. data/examples/RedBook/alpha.rb +54 -52
  30. data/examples/RedBook/alpha3D.rb +90 -88
  31. data/examples/RedBook/bezcurve.rb +48 -46
  32. data/examples/RedBook/bezmesh.rb +71 -69
  33. data/examples/RedBook/checker.rb +57 -55
  34. data/examples/RedBook/clip.rb +41 -39
  35. data/examples/RedBook/colormat.rb +72 -70
  36. data/examples/RedBook/cube.rb +39 -37
  37. data/examples/RedBook/depthcue.rb +37 -35
  38. data/examples/RedBook/dof.rb +110 -109
  39. data/examples/RedBook/double.rb +40 -38
  40. data/examples/RedBook/drawf.rb +30 -28
  41. data/examples/RedBook/feedback.rb +79 -77
  42. data/examples/RedBook/fog.rb +90 -89
  43. data/examples/RedBook/font.rb +78 -76
  44. data/examples/RedBook/hello.rb +29 -27
  45. data/examples/RedBook/image.rb +57 -55
  46. data/examples/RedBook/jitter.rb +131 -131
  47. data/examples/RedBook/light.rb +2 -1
  48. data/examples/RedBook/lines.rb +70 -68
  49. data/examples/RedBook/list.rb +48 -46
  50. data/examples/RedBook/material.rb +200 -199
  51. data/examples/RedBook/mipmap.rb +84 -82
  52. data/examples/RedBook/model.rb +55 -53
  53. data/examples/RedBook/movelight.rb +52 -50
  54. data/examples/RedBook/pickdepth.rb +103 -101
  55. data/examples/RedBook/planet.rb +46 -44
  56. data/examples/RedBook/quadric.rb +97 -95
  57. data/examples/RedBook/robot.rb +55 -53
  58. data/examples/RedBook/select.rb +118 -116
  59. data/examples/RedBook/smooth.rb +35 -33
  60. data/examples/RedBook/stencil.rb +96 -94
  61. data/examples/RedBook/stroke.rb +75 -73
  62. data/examples/RedBook/surface.rb +93 -91
  63. data/examples/RedBook/teaambient.rb +71 -69
  64. data/examples/RedBook/teapots.rb +105 -103
  65. data/examples/RedBook/tess.rb +96 -94
  66. data/examples/RedBook/texbind.rb +79 -77
  67. data/examples/RedBook/texgen.rb +88 -86
  68. data/examples/RedBook/texturesurf.rb +57 -55
  69. data/examples/RedBook/varray.rb +85 -83
  70. data/examples/RedBook/wrap.rb +76 -74
  71. data/examples/misc/OGLBench.rb +114 -113
  72. data/examples/misc/anisotropic.rb +154 -152
  73. data/examples/misc/fbo_test.rb +37 -36
  74. data/examples/misc/font-glut.rb +47 -46
  75. data/examples/misc/glfwtest.rb +16 -16
  76. data/examples/misc/plane.rb +13 -13
  77. data/examples/misc/readpixel.rb +66 -65
  78. data/examples/misc/sdltest.rb +21 -19
  79. data/examples/misc/trislam.rb +548 -547
  80. data/ext/opengl/common.h +16 -38
  81. data/ext/opengl/conv.h +39 -41
  82. data/ext/opengl/extconf.rb +4 -31
  83. data/ext/opengl/funcdef.h +126 -124
  84. data/ext/opengl/gl-1.0-1.1.c +1917 -1917
  85. data/ext/opengl/gl-1.2.c +4 -667
  86. data/ext/opengl/gl-1.3.c +9 -9
  87. data/ext/opengl/gl-1.4.c +8 -8
  88. data/ext/opengl/gl-1.5.c +1 -1
  89. data/ext/opengl/gl-2.0.c +392 -388
  90. data/ext/opengl/gl-3.0.c +493 -0
  91. data/ext/opengl/gl-enums.c +1523 -5
  92. data/ext/opengl/gl-enums.h +4679 -122
  93. data/ext/opengl/gl-error.c +7 -7
  94. data/ext/opengl/gl-error.h +4 -4
  95. data/ext/opengl/gl-ext-arb.c +468 -464
  96. data/ext/opengl/gl-ext-ext.c +18 -18
  97. data/ext/opengl/gl-ext-nv.c +15 -15
  98. data/ext/opengl/gl.c +2 -0
  99. data/ext/opengl/gl_buffer.c +92 -92
  100. data/ext/opengl/opengl.c +1 -7
  101. data/lib/opengl.rb +23 -59
  102. data/lib/opengl/test_case.rb +1 -2
  103. data/test/dummy.xorg.conf +140 -0
  104. data/test/test_gl.rb +18 -22
  105. data/test/test_gl_10_11.rb +220 -220
  106. data/test/test_gl_12.rb +11 -122
  107. data/test/test_gl_13.rb +202 -210
  108. data/test/test_gl_14.rb +16 -19
  109. data/test/test_gl_15.rb +2 -4
  110. data/test/test_gl_20.rb +45 -58
  111. data/test/test_gl_21.rb +46 -163
  112. data/test/test_gl_ext_arb.rb +54 -72
  113. data/test/test_gl_ext_ati.rb +0 -2
  114. data/test/test_gl_ext_ext.rb +66 -66
  115. data/test/test_gl_ext_gremedy.rb +8 -15
  116. data/test/test_gl_ext_nv.rb +109 -112
  117. data/test/test_opengl_buffer.rb +8 -25
  118. data/utils/README +0 -5
  119. data/utils/enumgen.rb +72 -76
  120. data/utils/extlistgen.rb +55 -55
  121. metadata +87 -66
  122. metadata.gz.sig +2 -0
  123. data/Rakefile.cross +0 -107
  124. data/docs/build_install.txt +0 -119
  125. data/docs/extensions.txt.in +0 -348
  126. data/docs/history.txt +0 -66
  127. data/docs/requirements_and_design.txt +0 -117
  128. data/docs/roadmap.txt +0 -28
  129. data/docs/scientific_use.txt +0 -35
  130. data/docs/supplies/page_template.html +0 -71
  131. data/docs/thanks.txt +0 -29
  132. data/docs/tutorial.txt +0 -469
  133. data/ext/opengl/glu-enums.c +0 -164
  134. data/ext/opengl/glu-enums.h +0 -463
  135. data/ext/opengl/glu.c +0 -1534
  136. data/ext/opengl/glut.c +0 -1145
  137. data/ext/opengl/glut_callbacks.c +0 -845
  138. data/lib/glu.rb +0 -1
  139. data/lib/glut.rb +0 -1
  140. data/test/test_glu.rb +0 -309
  141. data/utils/mkdn2html.rb +0 -59
  142. data/utils/post-mkdn2html.rb +0 -91
  143. data/website/images/ogl.jpg +0 -0
  144. data/website/images/tab_bottom.gif +0 -0
  145. data/website/style.css +0 -198
@@ -46,7 +46,7 @@ VALUE obj; \
46
46
  { \
47
47
  int num; \
48
48
  VALUE ary, args[5]; \
49
- switch (num = rb_scan_args(argc, argv, "23", &args[0], &args[1], &args[2], &args[3],&args[4])) { \
49
+ switch (num = rb_scan_args(argc, argv, "23", &args[0], &args[1], &args[2], &args[3], &args[4])) { \
50
50
  case 2: \
51
51
  if (TYPE(args[1]) == T_ARRAY) { \
52
52
  ary = args[1]; \
@@ -139,7 +139,7 @@ VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9;
139
139
  border = (GLint)NUM2INT(arg7);
140
140
  imagesize = (GLsizei)NUM2UINT(arg8);
141
141
  if (CheckBufferBinding(GL_PIXEL_UNPACK_BUFFER_BINDING)) {
142
- fptr_glCompressedTexImage3D(target,level,internalformat,width,height,depth,border,imagesize,(GLvoid *)NUM2LONG(arg9));
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) {
145
145
  VALUE data;
@@ -181,7 +181,7 @@ VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8;
181
181
  border = (GLint)NUM2INT(arg6);
182
182
  imagesize = (GLsizei)NUM2UINT(arg7);
183
183
  if (CheckBufferBinding(GL_PIXEL_UNPACK_BUFFER_BINDING)) {
184
- fptr_glCompressedTexImage2D(target,level,internalformat,width,height,border,imagesize,(GLvoid *)NUM2LONG(arg8));
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) {
187
187
  VALUE data;
@@ -221,7 +221,7 @@ VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7;
221
221
  border = (GLint)NUM2INT(arg5);
222
222
  imagesize = (GLsizei)NUM2UINT(arg6);
223
223
  if (CheckBufferBinding(GL_PIXEL_UNPACK_BUFFER_BINDING)) {
224
- fptr_glCompressedTexImage1D(target,level,internalformat,width,border,imagesize,(GLvoid *)NUM2LONG(arg7));
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) {
227
227
  VALUE data;
@@ -269,7 +269,7 @@ VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11;
269
269
  format = (GLenum)NUM2INT(arg9);
270
270
  imagesize = (GLsizei)NUM2UINT(arg10);
271
271
  if (CheckBufferBinding(GL_PIXEL_UNPACK_BUFFER_BINDING)) {
272
- fptr_glCompressedTexSubImage3D(target,level,xoffset,yoffset,zoffset,width,height,depth,format,imagesize,(GLvoid *)NUM2LONG(arg11));
272
+ fptr_glCompressedTexSubImage3D(target,level,xoffset,yoffset,zoffset,width,height,depth,format,imagesize,(GLvoid *)NUM2SIZET(arg11));
273
273
  } else {
274
274
  VALUE data;
275
275
  data = pack_array_or_pass_string(GL_UNSIGNED_BYTE,arg11);
@@ -307,7 +307,7 @@ VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9;
307
307
  format = (GLenum)NUM2INT(arg7);
308
308
  imagesize = (GLsizei)NUM2UINT(arg8);
309
309
  if (CheckBufferBinding(GL_PIXEL_UNPACK_BUFFER_BINDING)) {
310
- fptr_glCompressedTexSubImage2D(target,level,xoffset,yoffset,width,height,format,imagesize,(GLvoid *)NUM2LONG(arg9));
310
+ fptr_glCompressedTexSubImage2D(target,level,xoffset,yoffset,width,height,format,imagesize,(GLvoid *)NUM2SIZET(arg9));
311
311
  } else {
312
312
  VALUE data;
313
313
  data = pack_array_or_pass_string(GL_UNSIGNED_BYTE,arg9);
@@ -340,7 +340,7 @@ VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7;
340
340
  format = (GLenum)NUM2INT(arg5);
341
341
  imagesize = (GLsizei)NUM2UINT(arg6);
342
342
  if (CheckBufferBinding(GL_PIXEL_UNPACK_BUFFER_BINDING)) {
343
- fptr_glCompressedTexSubImage1D(target,level,xoffset,width,format,imagesize,(GLvoid *)NUM2LONG(arg7));
343
+ fptr_glCompressedTexSubImage1D(target,level,xoffset,width,format,imagesize,(GLvoid *)NUM2SIZET(arg7));
344
344
  } else {
345
345
  VALUE data;
346
346
  data = pack_array_or_pass_string(GL_UNSIGNED_BYTE,arg7);
@@ -382,9 +382,9 @@ VALUE obj;
382
382
  CHECK_GLERROR_FROM("glGetCompressedTexImage");
383
383
  return data;
384
384
  case 3:
385
- fptr_glGetCompressedTexImage(target,lod,(GLvoid*)NUM2LONG(args[2]));
385
+ fptr_glGetCompressedTexImage(target,lod,(GLvoid*)NUM2SIZET(args[2]));
386
386
  CHECK_GLERROR_FROM("glGetCompressedTexImage");
387
- return Qnil;
387
+ return Qnil;
388
388
  }
389
389
  }
390
390
 
@@ -80,7 +80,7 @@ VALUE obj,arg1,arg2,arg3;
80
80
  stride = (GLsizei)NUM2UINT(arg2);
81
81
  if (CheckBufferBinding(GL_ARRAY_BUFFER_BINDING)) {
82
82
  g_FogCoord_ptr = arg3;
83
- fptr_glFogCoordPointer(type, stride, (const GLvoid*)NUM2LONG(arg3));
83
+ fptr_glFogCoordPointer(type, stride, (const GLvoid*)NUM2SIZET(arg3));
84
84
  } else {
85
85
  VALUE data;
86
86
  data = pack_array_or_pass_string(GL_UNSIGNED_BYTE,arg3);
@@ -100,10 +100,10 @@ VALUE obj,arg1,arg2,arg3;
100
100
  GLenum mode;
101
101
  GLint *ary1;
102
102
  GLsizei *ary2;
103
- int len1,len2;
103
+ int len1,len2;
104
104
  LOAD_GL_FUNC(glMultiDrawArrays, "1.4");
105
- len1 = (int)RARRAY_LENINT(arg2);
106
- len2 = (int)RARRAY_LENINT(arg3);
105
+ len1 = (int)RARRAY_LENINT(arg2);
106
+ len2 = (int)RARRAY_LENINT(arg3);
107
107
  if (len1!=len2)
108
108
  rb_raise(rb_eArgError, "Passed arrays must have same length");
109
109
  mode = (GLenum)NUM2INT(arg1);
@@ -171,7 +171,7 @@ VALUE obj;
171
171
  indices = ALLOC_N(GLvoid*,size);
172
172
  for (i=0;i<size;i++) {
173
173
  counts[i] = (GLsizei)NUM2INT(rb_ary_entry(args[2],i));
174
- indices[i] = (GLvoid *)NUM2LONG(rb_ary_entry(args[3],i));
174
+ indices[i] = (GLvoid *)NUM2SIZET(rb_ary_entry(args[3],i));
175
175
  }
176
176
  fptr_glMultiDrawElements(mode,counts,type,indices,size);
177
177
  xfree(counts);
@@ -198,7 +198,7 @@ VALUE obj,arg1,arg2;
198
198
  else
199
199
  size = 1;
200
200
  ary2cflt(arg2,params,size);
201
- fptr_glPointParameterfv(pname,params);
201
+ fptr_glPointParameterfv(pname,params);
202
202
  CHECK_GLERROR_FROM("glPointParameterfv");
203
203
  return Qnil;
204
204
  }
@@ -219,7 +219,7 @@ VALUE obj,arg1,arg2;
219
219
  else
220
220
  size = 1;
221
221
  ary2cint(arg2,params,size);
222
- fptr_glPointParameteriv(pname,params);
222
+ fptr_glPointParameteriv(pname,params);
223
223
  CHECK_GLERROR_FROM("glPointParameteriv");
224
224
  return Qnil;
225
225
  }
@@ -262,7 +262,7 @@ VALUE obj,arg1,arg2,arg3,arg4;
262
262
  stride = (GLsizei)NUM2UINT(arg3);
263
263
  if (CheckBufferBinding(GL_ARRAY_BUFFER_BINDING)) {
264
264
  g_SecondaryColor_ptr = arg4;
265
- fptr_glSecondaryColorPointer(size,type, stride, (const GLvoid*)NUM2LONG(arg4));
265
+ fptr_glSecondaryColorPointer(size,type, stride, (const GLvoid*)NUM2SIZET(arg4));
266
266
  } else {
267
267
  VALUE data;
268
268
  data = pack_array_or_pass_string(type,arg4);
@@ -172,7 +172,7 @@ gl_MapBuffer(VALUE self, VALUE _target, VALUE _access) {
172
172
  if (buffer_ptr == NULL || size <= 0)
173
173
  return Qnil;
174
174
 
175
- return rb_str_new(buffer_ptr, size);
175
+ return rb_str_new(buffer_ptr, size);
176
176
  }
177
177
 
178
178
  static GLboolean (APIENTRY * fptr_glUnmapBuffer)(GLenum);
@@ -60,17 +60,17 @@ static VALUE
60
60
  gl_DrawBuffers(obj,arg1)
61
61
  VALUE obj,arg1;
62
62
  {
63
- GLsizei size;
64
- GLenum *buffers;
65
- LOAD_GL_FUNC(glDrawBuffers, "2.0");
66
- Check_Type(arg1,T_ARRAY);
67
- size = (GLsizei)RARRAY_LENINT(arg1);
68
- buffers = ALLOC_N(GLenum,size);
69
- ary2cuint(arg1,buffers,size);
70
- fptr_glDrawBuffers(size,buffers);
71
- xfree(buffers);
72
- CHECK_GLERROR_FROM("glDrawBuffers");
73
- return Qnil;
63
+ GLsizei size;
64
+ GLenum *buffers;
65
+ LOAD_GL_FUNC(glDrawBuffers, "2.0");
66
+ Check_Type(arg1,T_ARRAY);
67
+ size = (GLsizei)RARRAY_LENINT(arg1);
68
+ buffers = ALLOC_N(GLenum,size);
69
+ ary2cuint(arg1,buffers,size);
70
+ fptr_glDrawBuffers(size,buffers);
71
+ xfree(buffers);
72
+ CHECK_GLERROR_FROM("glDrawBuffers");
73
+ return Qnil;
74
74
  }
75
75
 
76
76
  static void (APIENTRY * fptr_glBindAttribLocation)(GLuint,GLuint,GLchar *);
@@ -78,15 +78,15 @@ static VALUE
78
78
  gl_BindAttribLocation(obj,arg1,arg2,arg3)
79
79
  VALUE obj,arg1,arg2,arg3;
80
80
  {
81
- GLuint program;
82
- GLuint index;
83
- LOAD_GL_FUNC(glBindAttribLocation, "2.0");
84
- program = (GLuint)NUM2UINT(arg1);
85
- index = (GLuint)NUM2UINT(arg2);
86
- Check_Type(arg3, T_STRING);
87
- fptr_glBindAttribLocation(program,index,RSTRING_PTR(arg3));
88
- CHECK_GLERROR_FROM("glBindAttribLocation");
89
- return Qnil;
81
+ GLuint program;
82
+ GLuint index;
83
+ LOAD_GL_FUNC(glBindAttribLocation, "2.0");
84
+ program = (GLuint)NUM2UINT(arg1);
85
+ index = (GLuint)NUM2UINT(arg2);
86
+ Check_Type(arg3, T_STRING);
87
+ fptr_glBindAttribLocation(program,index,RSTRING_PTR(arg3));
88
+ CHECK_GLERROR_FROM("glBindAttribLocation");
89
+ return Qnil;
90
90
  }
91
91
 
92
92
  static void (APIENTRY * fptr_glGetProgramiv)(GLuint,GLenum,GLint *);
@@ -94,15 +94,15 @@ static VALUE
94
94
  gl_GetProgramiv(obj,arg1,arg2)
95
95
  VALUE obj,arg1,arg2;
96
96
  {
97
- GLuint program;
98
- GLenum pname;
99
- GLint params = 0;
100
- LOAD_GL_FUNC(glGetProgramiv, "2.0");
101
- program = (GLuint)NUM2UINT(arg1);
102
- pname = (GLenum)NUM2INT(arg2);
103
- fptr_glGetProgramiv(program,pname,&params);
104
- CHECK_GLERROR_FROM("glGetProgramiv");
105
- return cond_GLBOOL2RUBY(pname,params);
97
+ GLuint program;
98
+ GLenum pname;
99
+ GLint params = 0;
100
+ LOAD_GL_FUNC(glGetProgramiv, "2.0");
101
+ program = (GLuint)NUM2UINT(arg1);
102
+ pname = (GLenum)NUM2INT(arg2);
103
+ fptr_glGetProgramiv(program,pname,&params);
104
+ CHECK_GLERROR_FROM("glGetProgramiv");
105
+ return cond_GLBOOL2RUBY(pname,params);
106
106
  }
107
107
 
108
108
  static void (APIENTRY * fptr_glGetActiveAttrib)(GLuint,GLuint,GLsizei,GLsizei *,GLint *,GLenum *,GLchar *);
@@ -110,30 +110,33 @@ static VALUE
110
110
  gl_GetActiveAttrib(obj,arg1,arg2)
111
111
  VALUE obj,arg1,arg2;
112
112
  {
113
- GLuint program;
114
- GLuint index;
115
- GLsizei max_size = 0;
116
- GLsizei written = 0;
117
- GLint attrib_size = 0;
118
- GLenum attrib_type = 0;
119
- VALUE buffer;
120
- VALUE retary;
121
- LOAD_GL_FUNC(glGetActiveAttrib, "2.0");
122
- LOAD_GL_FUNC(glGetProgramiv, "2.0");
123
- program = (GLuint)NUM2UINT(arg1);
124
- index = (GLuint)NUM2UINT(arg2);
125
- fptr_glGetProgramiv(program,GL_ACTIVE_ATTRIBUTE_MAX_LENGTH,&max_size);
126
- CHECK_GLERROR_FROM("glGetProgramiv");
127
- if (max_size==0)
128
- rb_raise(rb_eTypeError, "Can't determine maximum attribute name length");
129
- buffer = allocate_buffer_with_string(max_size-1);
130
- fptr_glGetActiveAttrib(program,index,max_size,&written,&attrib_size,&attrib_type,RSTRING_PTR(buffer));
131
- retary = rb_ary_new2(3);
132
- rb_ary_push(retary, INT2NUM(attrib_size));
133
- rb_ary_push(retary, INT2NUM(attrib_type));
134
- rb_ary_push(retary, buffer);
135
- CHECK_GLERROR_FROM("glGetActiveAttrib");
136
- return retary;
113
+ GLuint program;
114
+ GLuint index;
115
+ GLsizei max_size = 0;
116
+ GLsizei written = 0;
117
+ GLint attrib_size = 0;
118
+ GLenum attrib_type = 0;
119
+ VALUE buffer;
120
+ VALUE retary;
121
+ LOAD_GL_FUNC(glGetActiveAttrib, "2.0");
122
+ LOAD_GL_FUNC(glGetProgramiv, "2.0");
123
+ program = (GLuint)NUM2UINT(arg1);
124
+ index = (GLuint)NUM2UINT(arg2);
125
+ fptr_glGetProgramiv(program,GL_ACTIVE_ATTRIBUTE_MAX_LENGTH,&max_size);
126
+ CHECK_GLERROR_FROM("glGetProgramiv");
127
+ /* Can't determine maximum attribute name length, so presume it */
128
+ if (max_size==0) max_size = 256;
129
+ buffer = allocate_buffer_with_string(max_size-1);
130
+
131
+ fptr_glGetActiveAttrib(program,index,max_size,&written,&attrib_size,&attrib_type,RSTRING_PTR(buffer));
132
+
133
+ rb_str_set_len(buffer, written);
134
+ retary = rb_ary_new2(3);
135
+ rb_ary_push(retary, INT2NUM(attrib_size));
136
+ rb_ary_push(retary, INT2NUM(attrib_type));
137
+ rb_ary_push(retary, buffer);
138
+ CHECK_GLERROR_FROM("glGetActiveAttrib");
139
+ return retary;
137
140
  }
138
141
 
139
142
  static void (APIENTRY * fptr_glGetActiveUniform)(GLuint,GLuint,GLsizei,GLsizei*,GLint*,GLenum*,GLchar*);
@@ -141,33 +144,33 @@ static VALUE
141
144
  gl_GetActiveUniform(obj,arg1,arg2)
142
145
  VALUE obj,arg1,arg2;
143
146
  {
144
- GLuint program;
145
- GLuint index;
146
- GLsizei max_size = 0;
147
- GLsizei written = 0;
148
- GLint uniform_size = 0;
149
- GLenum uniform_type = 0;
150
- VALUE buffer;
151
- VALUE retary;
152
- LOAD_GL_FUNC(glGetActiveUniform, "2.0");
153
- LOAD_GL_FUNC(glGetProgramiv, "2.0");
154
- program = (GLuint)NUM2UINT(arg1);
155
- index = (GLuint)NUM2UINT(arg2);
156
- fptr_glGetProgramiv(program,GL_ACTIVE_UNIFORM_MAX_LENGTH,&max_size);
157
- CHECK_GLERROR_FROM("glGetProgramiv");
158
- if (max_size==0)
159
- rb_raise(rb_eTypeError, "Can't determine maximum uniform name length");
160
- buffer = allocate_buffer_with_string(max_size-1);
161
-
162
- fptr_glGetActiveUniform(program,index,max_size,&written,&uniform_size,&uniform_type,RSTRING_PTR(buffer));
163
-
164
- rb_str_set_len(buffer, strnlen(RSTRING_PTR(buffer), max_size));
165
- retary = rb_ary_new2(3);
166
- rb_ary_push(retary, INT2NUM(uniform_size));
167
- rb_ary_push(retary, INT2NUM(uniform_type));
168
- rb_ary_push(retary, buffer);
169
- CHECK_GLERROR_FROM("glGetActiveUniform");
170
- return retary;
147
+ GLuint program;
148
+ GLuint index;
149
+ GLsizei max_size = 0;
150
+ GLsizei written = 0;
151
+ GLint uniform_size = 0;
152
+ GLenum uniform_type = 0;
153
+ VALUE buffer;
154
+ VALUE retary;
155
+ LOAD_GL_FUNC(glGetActiveUniform, "2.0");
156
+ LOAD_GL_FUNC(glGetProgramiv, "2.0");
157
+ program = (GLuint)NUM2UINT(arg1);
158
+ index = (GLuint)NUM2UINT(arg2);
159
+ fptr_glGetProgramiv(program,GL_ACTIVE_UNIFORM_MAX_LENGTH,&max_size);
160
+ CHECK_GLERROR_FROM("glGetProgramiv");
161
+ /* Can't determine maximum uniform name length, so presume it */
162
+ if (max_size==0) max_size = 256;
163
+ buffer = allocate_buffer_with_string(max_size-1);
164
+
165
+ fptr_glGetActiveUniform(program,index,max_size,&written,&uniform_size,&uniform_type,RSTRING_PTR(buffer));
166
+
167
+ rb_str_set_len(buffer, written);
168
+ retary = rb_ary_new2(3);
169
+ rb_ary_push(retary, INT2NUM(uniform_size));
170
+ rb_ary_push(retary, INT2NUM(uniform_type));
171
+ rb_ary_push(retary, buffer);
172
+ CHECK_GLERROR_FROM("glGetActiveUniform");
173
+ return retary;
171
174
  }
172
175
 
173
176
  static void (APIENTRY * fptr_glGetAttachedShaders)(GLuint,GLsizei,GLsizei *,GLuint *);
@@ -175,19 +178,19 @@ static VALUE
175
178
  gl_GetAttachedShaders(obj,arg1)
176
179
  VALUE obj,arg1;
177
180
  {
178
- GLuint program;
179
- GLint shaders_num = 0;
180
- GLuint *shaders;
181
- GLsizei count = 0;
182
- LOAD_GL_FUNC(glGetAttachedShaders, "2.0");
183
- LOAD_GL_FUNC(glGetProgramiv, "2.0");
184
- program = (GLuint)NUM2UINT(arg1);
185
- fptr_glGetProgramiv(program,GL_ATTACHED_SHADERS,&shaders_num);
186
- CHECK_GLERROR_FROM("glGetProgramiv");
187
- if (shaders_num<=0)
188
- return Qnil;
189
- shaders = ALLOC_N(GLuint,shaders_num);
190
- fptr_glGetAttachedShaders(program,shaders_num,&count,shaders);
181
+ GLuint program;
182
+ GLint shaders_num = 0;
183
+ GLuint *shaders;
184
+ GLsizei count = 0;
185
+ LOAD_GL_FUNC(glGetAttachedShaders, "2.0");
186
+ LOAD_GL_FUNC(glGetProgramiv, "2.0");
187
+ program = (GLuint)NUM2UINT(arg1);
188
+ fptr_glGetProgramiv(program,GL_ATTACHED_SHADERS,&shaders_num);
189
+ CHECK_GLERROR_FROM("glGetProgramiv");
190
+ if (shaders_num<=0)
191
+ return Qnil;
192
+ shaders = ALLOC_N(GLuint,shaders_num);
193
+ fptr_glGetAttachedShaders(program,shaders_num,&count,shaders);
191
194
  RET_ARRAY_OR_SINGLE_FREE("glGetAttachedShaders", count, RETCONV_GLuint,
192
195
  shaders);
193
196
  }
@@ -197,14 +200,14 @@ static VALUE
197
200
  gl_GetAttribLocation(obj,arg1,arg2)
198
201
  VALUE obj,arg1,arg2;
199
202
  {
200
- GLuint program;
201
- GLint ret;
202
- LOAD_GL_FUNC(glGetAttribLocation, "2.0");
203
- program=(GLuint)NUM2UINT(arg1);
204
- Check_Type(arg2,T_STRING);
205
- ret = fptr_glGetAttribLocation(program,RSTRING_PTR(arg2));
206
- CHECK_GLERROR_FROM("glGetAttribLocation");
207
- return INT2NUM(ret);
203
+ GLuint program;
204
+ GLint ret;
205
+ LOAD_GL_FUNC(glGetAttribLocation, "2.0");
206
+ program=(GLuint)NUM2UINT(arg1);
207
+ Check_Type(arg2,T_STRING);
208
+ ret = fptr_glGetAttribLocation(program,RSTRING_PTR(arg2));
209
+ CHECK_GLERROR_FROM("glGetAttribLocation");
210
+ return INT2NUM(ret);
208
211
  }
209
212
 
210
213
  static void (APIENTRY * fptr_glGetProgramInfoLog)(GLuint,GLsizei,GLsizei *,GLchar *);
@@ -212,21 +215,22 @@ static VALUE
212
215
  gl_GetProgramInfoLog(obj,arg1)
213
216
  VALUE obj,arg1;
214
217
  {
215
- GLuint program;
216
- GLint max_size = 0;
217
- GLsizei ret_length = 0;
218
- VALUE buffer;
219
- LOAD_GL_FUNC(glGetProgramInfoLog, "2.0");
220
- LOAD_GL_FUNC(glGetProgramiv, "2.0");
221
- program = (GLuint)NUM2UINT(arg1);
222
- fptr_glGetProgramiv(program,GL_INFO_LOG_LENGTH,&max_size);
223
- CHECK_GLERROR_FROM("glGetProgramiv");
224
- if (max_size<=0)
225
- return rb_str_new2("");
226
- buffer = allocate_buffer_with_string(max_size);
227
- fptr_glGetProgramInfoLog(program,max_size,&ret_length,RSTRING_PTR(buffer));
228
- CHECK_GLERROR_FROM("glGetProgramInfoLog");
229
- return buffer;
218
+ GLuint program;
219
+ GLint max_size = 0;
220
+ GLsizei ret_length = 0;
221
+ VALUE buffer;
222
+ LOAD_GL_FUNC(glGetProgramInfoLog, "2.0");
223
+ LOAD_GL_FUNC(glGetProgramiv, "2.0");
224
+ program = (GLuint)NUM2UINT(arg1);
225
+ fptr_glGetProgramiv(program,GL_INFO_LOG_LENGTH,&max_size);
226
+ CHECK_GLERROR_FROM("glGetProgramiv");
227
+ if (max_size<=0)
228
+ return rb_str_new2("");
229
+ buffer = allocate_buffer_with_string(max_size);
230
+ fptr_glGetProgramInfoLog(program,max_size,&ret_length,RSTRING_PTR(buffer));
231
+ rb_str_set_len(buffer, ret_length);
232
+ CHECK_GLERROR_FROM("glGetProgramInfoLog");
233
+ return buffer;
230
234
  }
231
235
 
232
236
  static void (APIENTRY * fptr_glGetShaderiv)(GLuint,GLenum,GLint *);
@@ -234,15 +238,15 @@ static VALUE
234
238
  gl_GetShaderiv(obj,arg1,arg2)
235
239
  VALUE obj,arg1,arg2;
236
240
  {
237
- GLuint program;
238
- GLenum pname;
239
- GLint params = 0;
240
- LOAD_GL_FUNC(glGetShaderiv, "2.0");
241
- program = (GLuint)NUM2UINT(arg1);
242
- pname = (GLenum)NUM2INT(arg2);
243
- fptr_glGetShaderiv(program,pname,&params);
244
- CHECK_GLERROR_FROM("glGetShaderiv");
245
- return cond_GLBOOL2RUBY(pname,params);
241
+ GLuint program;
242
+ GLenum pname;
243
+ GLint params = 0;
244
+ LOAD_GL_FUNC(glGetShaderiv, "2.0");
245
+ program = (GLuint)NUM2UINT(arg1);
246
+ pname = (GLenum)NUM2INT(arg2);
247
+ fptr_glGetShaderiv(program,pname,&params);
248
+ CHECK_GLERROR_FROM("glGetShaderiv");
249
+ return cond_GLBOOL2RUBY(pname,params);
246
250
  }
247
251
 
248
252
  static void (APIENTRY * fptr_glGetShaderInfoLog)(GLuint,GLsizei,GLsizei *,GLchar *);
@@ -250,25 +254,25 @@ static VALUE
250
254
  gl_GetShaderInfoLog(obj,arg1)
251
255
  VALUE obj,arg1;
252
256
  {
253
- GLuint program;
254
- GLint max_size = 0;
255
- GLsizei ret_length = 0;
256
- VALUE ret_buffer;
257
- GLchar *buffer;
258
- LOAD_GL_FUNC(glGetShaderInfoLog, "2.0");
259
- LOAD_GL_FUNC(glGetShaderiv, "2.0");
260
- program = (GLuint)NUM2UINT(arg1);
261
- fptr_glGetShaderiv(program,GL_INFO_LOG_LENGTH,&max_size);
262
- CHECK_GLERROR_FROM("glGetShaderiv");
263
- if (max_size<=0)
264
- return rb_str_new2("");
265
- buffer = ALLOC_N(GLchar,max_size+1);
266
- memset(buffer,0,sizeof(GLchar) * (max_size+1));
267
- fptr_glGetShaderInfoLog(program,max_size,&ret_length,buffer);
268
- ret_buffer = rb_str_new(buffer, ret_length);
269
- xfree(buffer);
270
- CHECK_GLERROR_FROM("glGetShaderInfoLog");
271
- return ret_buffer;
257
+ GLuint program;
258
+ GLint max_size = 0;
259
+ GLsizei ret_length = 0;
260
+ VALUE ret_buffer;
261
+ GLchar *buffer;
262
+ LOAD_GL_FUNC(glGetShaderInfoLog, "2.0");
263
+ LOAD_GL_FUNC(glGetShaderiv, "2.0");
264
+ program = (GLuint)NUM2UINT(arg1);
265
+ fptr_glGetShaderiv(program,GL_INFO_LOG_LENGTH,&max_size);
266
+ CHECK_GLERROR_FROM("glGetShaderiv");
267
+ if (max_size<=0)
268
+ return rb_str_new2("");
269
+ buffer = ALLOC_N(GLchar,max_size+1);
270
+ memset(buffer,0,sizeof(GLchar) * (max_size+1));
271
+ fptr_glGetShaderInfoLog(program,max_size,&ret_length,buffer);
272
+ ret_buffer = rb_str_new(buffer, ret_length);
273
+ xfree(buffer);
274
+ CHECK_GLERROR_FROM("glGetShaderInfoLog");
275
+ return ret_buffer;
272
276
  }
273
277
 
274
278
  static void (APIENTRY * fptr_glGetShaderSource)(GLuint,GLsizei,GLsizei *,GLchar *);
@@ -276,21 +280,21 @@ static VALUE
276
280
  gl_GetShaderSource(obj,arg1)
277
281
  VALUE obj,arg1;
278
282
  {
279
- GLuint shader;
280
- GLint max_size = 0;
281
- GLsizei ret_length = 0;
282
- VALUE buffer;
283
- LOAD_GL_FUNC(glGetShaderSource, "2.0");
284
- LOAD_GL_FUNC(glGetShaderiv, "2.0");
285
- shader = (GLuint)NUM2UINT(arg1);
286
- fptr_glGetShaderiv(shader,GL_SHADER_SOURCE_LENGTH,&max_size);
287
- CHECK_GLERROR_FROM("glGetShaderiv");
288
- if (max_size==0)
289
- rb_raise(rb_eTypeError, "Can't determine maximum shader source length");
290
- buffer = allocate_buffer_with_string(max_size-1);
291
- fptr_glGetShaderSource(shader,max_size,&ret_length,RSTRING_PTR(buffer));
292
- CHECK_GLERROR_FROM("glGetShaderSource");
293
- return buffer;
283
+ GLuint shader;
284
+ GLint max_size = 0;
285
+ GLsizei ret_length = 0;
286
+ VALUE buffer;
287
+ LOAD_GL_FUNC(glGetShaderSource, "2.0");
288
+ LOAD_GL_FUNC(glGetShaderiv, "2.0");
289
+ shader = (GLuint)NUM2UINT(arg1);
290
+ fptr_glGetShaderiv(shader,GL_SHADER_SOURCE_LENGTH,&max_size);
291
+ CHECK_GLERROR_FROM("glGetShaderiv");
292
+ if (max_size==0)
293
+ rb_raise(rb_eTypeError, "Can't determine maximum shader source length");
294
+ buffer = allocate_buffer_with_string(max_size-1);
295
+ fptr_glGetShaderSource(shader,max_size,&ret_length,RSTRING_PTR(buffer));
296
+ CHECK_GLERROR_FROM("glGetShaderSource");
297
+ return buffer;
294
298
  }
295
299
 
296
300
  static GLint (APIENTRY * fptr_glGetUniformLocation)(GLuint,const GLchar*);
@@ -298,15 +302,15 @@ static VALUE
298
302
  gl_GetUniformLocation(obj,arg1,arg2)
299
303
  VALUE obj,arg1,arg2;
300
304
  {
301
- GLuint program;
302
- GLint ret;
303
- LOAD_GL_FUNC(glGetUniformLocation, "2.0");
304
- program=(GLuint)NUM2UINT(arg1);
305
- Check_Type(arg2,T_STRING);
306
- ret = fptr_glGetUniformLocation(program, RSTRING_PTR(arg2));
305
+ GLuint program;
306
+ GLint ret;
307
+ LOAD_GL_FUNC(glGetUniformLocation, "2.0");
308
+ program=(GLuint)NUM2UINT(arg1);
309
+ Check_Type(arg2,T_STRING);
310
+ ret = fptr_glGetUniformLocation(program, RSTRING_PTR(arg2));
307
311
 
308
312
  CHECK_GLERROR_FROM("glGetUniformLocation");
309
- return INT2NUM(ret);
313
+ return INT2NUM(ret);
310
314
  }
311
315
 
312
316
  #define GETUNIFORM_FUNC(_name_,_type_) \
@@ -315,28 +319,28 @@ static VALUE \
315
319
  gl_##_name_(obj,arg1,arg2) \
316
320
  VALUE obj,arg1,arg2; \
317
321
  { \
318
- GLuint program; \
319
- GLint location; \
320
- _type_ params[16]; \
321
- GLint unused = 0; \
322
- GLenum uniform_type = 0; \
323
- GLint uniform_size = 0; \
322
+ GLuint program; \
323
+ GLint location; \
324
+ _type_ params[16]; \
325
+ GLint unused = 0; \
326
+ GLenum uniform_type = 0; \
327
+ GLint uniform_size = 0; \
324
328
  \
325
- LOAD_GL_FUNC(gl##_name_, "2.0"); \
326
- LOAD_GL_FUNC(glGetActiveUniform, "2.0"); \
327
- program = (GLuint)NUM2UINT(arg1); \
328
- location = (GLint)NUM2INT(arg2); \
329
+ LOAD_GL_FUNC(gl##_name_, "2.0"); \
330
+ LOAD_GL_FUNC(glGetActiveUniform, "2.0"); \
331
+ program = (GLuint)NUM2UINT(arg1); \
332
+ location = (GLint)NUM2INT(arg2); \
329
333
  \
330
- fptr_glGetActiveUniform(program,location,0,NULL,&unused,&uniform_type,NULL); \
331
- CHECK_GLERROR_FROM("glGetActiveUniform"); \
332
- if (uniform_type==0) \
333
- rb_raise(rb_eTypeError, "Can't determine the uniform's type"); \
334
+ fptr_glGetActiveUniform(program,location,0,NULL,&unused,&uniform_type,NULL); \
335
+ CHECK_GLERROR_FROM("glGetActiveUniform"); \
336
+ if (uniform_type==0) \
337
+ rb_raise(rb_eTypeError, "Can't determine the uniform's type"); \
334
338
  \
335
- uniform_size = get_uniform_size(uniform_type); \
339
+ uniform_size = get_uniform_size(uniform_type); \
336
340
  \
337
- memset(params,0,16*sizeof(_type_)); \
338
- fptr_gl##_name_(program,location,params); \
339
- RET_ARRAY_OR_SINGLE("gl" #_name_, uniform_size, RETCONV_##_type_, params); \
341
+ memset(params,0,16*sizeof(_type_)); \
342
+ fptr_gl##_name_(program,location,params); \
343
+ RET_ARRAY_OR_SINGLE("gl" #_name_, uniform_size, RETCONV_##_type_, params); \
340
344
  }
341
345
 
342
346
  GETUNIFORM_FUNC(GetUniformfv,GLfloat)
@@ -349,19 +353,19 @@ static VALUE \
349
353
  gl_##_name_(obj,arg1,arg2) \
350
354
  VALUE obj,arg1,arg2; \
351
355
  { \
352
- GLuint index; \
353
- GLenum pname; \
354
- _type_ params[4] = {0,0,0,0}; \
355
- GLint size; \
356
- LOAD_GL_FUNC(gl##_name_, "2.0"); \
357
- index = (GLuint)NUM2UINT(arg1); \
358
- pname = (GLenum)NUM2INT(arg2); \
359
- if (pname==GL_CURRENT_VERTEX_ATTRIB) \
360
- size = 4; \
361
- else \
362
- size = 1; \
363
- fptr_gl##_name_(index,pname,params); \
364
- RET_ARRAY_OR_SINGLE("gl" #_name_, size, RETCONV_##_type_, params); \
356
+ GLuint index; \
357
+ GLenum pname; \
358
+ _type_ params[4] = {0,0,0,0}; \
359
+ GLint size; \
360
+ LOAD_GL_FUNC(gl##_name_, "2.0"); \
361
+ index = (GLuint)NUM2UINT(arg1); \
362
+ pname = (GLenum)NUM2INT(arg2); \
363
+ if (pname==GL_CURRENT_VERTEX_ATTRIB) \
364
+ size = 4; \
365
+ else \
366
+ size = 1; \
367
+ fptr_gl##_name_(index,pname,params); \
368
+ RET_ARRAY_OR_SINGLE("gl" #_name_, size, RETCONV_##_type_, params); \
365
369
  }
366
370
 
367
371
  GETVERTEXATTRIB_FUNC(GetVertexAttribdv,GLdouble)
@@ -374,18 +378,18 @@ static VALUE
374
378
  gl_GetVertexAttribiv(obj,arg1,arg2)
375
379
  VALUE obj,arg1,arg2;
376
380
  {
377
- GLuint index;
378
- GLenum pname;
379
- GLint params[4] = {0,0,0,0};
380
- GLint size;
381
- LOAD_GL_FUNC(glGetVertexAttribiv, "2.0");
382
- index = (GLuint)NUM2UINT(arg1);
383
- pname = (GLenum)NUM2INT(arg2);
384
- if (pname==GL_CURRENT_VERTEX_ATTRIB)
385
- size = 4;
386
- else
387
- size = 1;
388
- fptr_glGetVertexAttribiv(index,pname,params);
381
+ GLuint index;
382
+ GLenum pname;
383
+ GLint params[4] = {0,0,0,0};
384
+ GLint size;
385
+ LOAD_GL_FUNC(glGetVertexAttribiv, "2.0");
386
+ index = (GLuint)NUM2UINT(arg1);
387
+ pname = (GLenum)NUM2INT(arg2);
388
+ if (pname==GL_CURRENT_VERTEX_ATTRIB)
389
+ size = 4;
390
+ else
391
+ size = 1;
392
+ fptr_glGetVertexAttribiv(index,pname,params);
389
393
  RET_ARRAY_OR_SINGLE_BOOL("glGetVertexAttribiv", size, cond_GLBOOL2RUBY,
390
394
  pname, params);
391
395
  }
@@ -398,13 +402,13 @@ static VALUE
398
402
  gl_GetVertexAttribPointerv(obj,arg1)
399
403
  VALUE obj,arg1;
400
404
  {
401
- GLuint index;
402
- LOAD_GL_FUNC(glGetVertexAttribPointerv, "2.0");
403
- index =(GLuint) NUM2INT(arg1);
404
- if (index>_MAX_VERTEX_ATTRIBS)
405
- rb_raise(rb_eArgError, "Index too large, maximum allowed value '%i'",_MAX_VERTEX_ATTRIBS);
405
+ GLuint index;
406
+ LOAD_GL_FUNC(glGetVertexAttribPointerv, "2.0");
407
+ index =(GLuint) NUM2INT(arg1);
408
+ if (index>_MAX_VERTEX_ATTRIBS)
409
+ rb_raise(rb_eArgError, "Index too large, maximum allowed value '%i'",_MAX_VERTEX_ATTRIBS);
406
410
 
407
- return g_VertexAttrib_ptr[index];
411
+ return g_VertexAttrib_ptr[index];
408
412
  }
409
413
 
410
414
  static void (APIENTRY * fptr_glShaderSource)(GLuint,GLsizei,GLchar**,GLint *);
@@ -412,17 +416,17 @@ static VALUE
412
416
  gl_ShaderSource(obj,arg1,arg2)
413
417
  VALUE obj,arg1,arg2;
414
418
  {
415
- GLuint shader;
416
- GLint length;
417
- GLchar *str;
418
- LOAD_GL_FUNC(glShaderSource, "2.0");
419
- shader = (GLuint)NUM2UINT(arg1);
420
- Check_Type(arg2,T_STRING);
421
- str = RSTRING_PTR(arg2);
422
- length = (GLint)RSTRING_LENINT(arg2);
423
- fptr_glShaderSource(shader,1,&str,&length);
424
- CHECK_GLERROR_FROM("glShaderSource");
425
- return Qnil;
419
+ GLuint shader;
420
+ GLint length;
421
+ GLchar *str;
422
+ LOAD_GL_FUNC(glShaderSource, "2.0");
423
+ shader = (GLuint)NUM2UINT(arg1);
424
+ Check_Type(arg2,T_STRING);
425
+ str = RSTRING_PTR(arg2);
426
+ length = (GLint)RSTRING_LENINT(arg2);
427
+ fptr_glShaderSource(shader,1,&str,&length);
428
+ CHECK_GLERROR_FROM("glShaderSource");
429
+ return Qnil;
426
430
  }
427
431
 
428
432
  #define UNIFORM_FUNC_V(_name_,_type_,_conv_,_size_) \
@@ -431,21 +435,21 @@ static VALUE \
431
435
  gl_##_name_(obj,arg1,arg2) \
432
436
  VALUE obj,arg1,arg2; \
433
437
  { \
434
- GLint location; \
435
- GLsizei count; \
436
- _type_ *value; \
437
- LOAD_GL_FUNC(gl##_name_,"2.0"); \
438
- Check_Type(arg2,T_ARRAY); \
439
- count = (GLsizei)RARRAY_LENINT(arg2); \
440
- if (count<=0 || (count % _size_) != 0) \
441
- rb_raise(rb_eArgError, "Parameter array size must be multiplication of %i",_size_); \
442
- location = (GLint)NUM2INT(arg1); \
443
- value = ALLOC_N(_type_,count); \
444
- _conv_(arg2,value,count); \
445
- fptr_gl##_name_(location,count / _size_,value); \
446
- xfree(value); \
447
- CHECK_GLERROR_FROM("gl" #_name_); \
448
- return Qnil; \
438
+ GLint location; \
439
+ GLsizei count; \
440
+ _type_ *value; \
441
+ LOAD_GL_FUNC(gl##_name_,"2.0"); \
442
+ Check_Type(arg2,T_ARRAY); \
443
+ count = (GLsizei)RARRAY_LENINT(arg2); \
444
+ if (count<=0 || (count % _size_) != 0) \
445
+ rb_raise(rb_eArgError, "Parameter array size must be multiplication of %i",_size_); \
446
+ location = (GLint)NUM2INT(arg1); \
447
+ value = ALLOC_N(_type_,count); \
448
+ _conv_(arg2,value,count); \
449
+ fptr_gl##_name_(location,count / _size_,value); \
450
+ xfree(value); \
451
+ CHECK_GLERROR_FROM("gl" #_name_); \
452
+ return Qnil; \
449
453
  }
450
454
 
451
455
  UNIFORM_FUNC_V(Uniform1fv,GLfloat,ary2cflt,1)
@@ -464,20 +468,20 @@ static VALUE \
464
468
  gl_##_name_(obj,arg1,arg2,arg3) \
465
469
  VALUE obj,arg1,arg2,arg3; \
466
470
  { \
467
- GLint location; \
468
- GLsizei count; \
469
- GLboolean transpose; \
470
- GLfloat *value; \
471
- LOAD_GL_FUNC(gl##_name_, "2.0"); \
472
- location = (GLint)NUM2INT(arg1); \
473
- count = (GLsizei)RARRAY_LENINT(rb_funcall(rb_Array(arg3), rb_intern("flatten"), 0)); \
474
- transpose = (GLboolean)RUBYBOOL2GL(arg2); \
475
- value = ALLOC_N(GLfloat, count); \
476
- ary2cmatfloatcount(arg3,value,_size_,_size_); \
477
- fptr_gl##_name_(location,count / (_size_*_size_),transpose,value); \
478
- xfree(value); \
479
- CHECK_GLERROR_FROM("gl" #_name_); \
480
- return Qnil; \
471
+ GLint location; \
472
+ GLsizei count; \
473
+ GLboolean transpose; \
474
+ GLfloat *value; \
475
+ LOAD_GL_FUNC(gl##_name_, "2.0"); \
476
+ location = (GLint)NUM2INT(arg1); \
477
+ count = (GLsizei)RARRAY_LENINT(rb_funcall(rb_Array(arg3), rb_intern("flatten"), 0)); \
478
+ transpose = (GLboolean)RUBYBOOL2GL(arg2); \
479
+ value = ALLOC_N(GLfloat, count); \
480
+ ary2cmatfloatcount(arg3,value,_size_,_size_); \
481
+ fptr_gl##_name_(location,count / (_size_*_size_),transpose,value); \
482
+ xfree(value); \
483
+ CHECK_GLERROR_FROM("gl" #_name_); \
484
+ return Qnil; \
481
485
  }
482
486
 
483
487
  UNIFORMMATRIX_FUNC(UniformMatrix2fv,2)
@@ -491,14 +495,14 @@ static VALUE \
491
495
  gl_##_name_(obj,arg1,arg2) \
492
496
  VALUE obj,arg1,arg2; \
493
497
  { \
494
- GLuint index; \
495
- _type_ v[_size_]; \
496
- LOAD_GL_FUNC(gl##_name_, "2.0"); \
497
- index = (GLuint)NUM2UINT(arg1); \
498
- _conv_(arg2,v,_size_); \
499
- fptr_gl##_name_(index,v); \
500
- CHECK_GLERROR_FROM("gl" #_name_); \
501
- return Qnil; \
498
+ GLuint index; \
499
+ _type_ v[_size_]; \
500
+ LOAD_GL_FUNC(gl##_name_, "2.0"); \
501
+ index = (GLuint)NUM2UINT(arg1); \
502
+ _conv_(arg2,v,_size_); \
503
+ fptr_gl##_name_(index,v); \
504
+ CHECK_GLERROR_FROM("gl" #_name_); \
505
+ return Qnil; \
502
506
  }
503
507
 
504
508
  VERTEXATTRIB_FUNC_V(VertexAttrib4Nbv,GLbyte,ary2cbyte,4)
@@ -531,133 +535,133 @@ static VALUE
531
535
  gl_VertexAttribPointer(obj,arg1,arg2,arg3,arg4,arg5,arg6)
532
536
  VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6;
533
537
  {
534
- GLuint index;
535
- GLuint size;
536
- GLenum type;
537
- GLboolean normalized;
538
- GLsizei stride;
539
- LOAD_GL_FUNC(glVertexAttribPointer, "2.0");
540
- index = (GLuint)NUM2UINT(arg1);
541
- size = (GLuint)NUM2UINT(arg2);
542
- type = (GLenum)NUM2INT(arg3);
543
- normalized = (GLboolean)RUBYBOOL2GL(arg4);
544
- stride = (GLsizei)NUM2UINT(arg5);
545
- if (index>_MAX_VERTEX_ATTRIBS)
546
- rb_raise(rb_eArgError, "Index too large, maximum allowed value '%i'",_MAX_VERTEX_ATTRIBS);
547
-
548
- if (CheckBufferBinding(GL_ARRAY_BUFFER_BINDING)) {
549
- g_VertexAttrib_ptr[index] = arg6;
550
- fptr_glVertexAttribPointer(index,size,type,normalized,stride,(GLvoid *)NUM2LONG(arg6));
551
- } else {
552
- VALUE data;
553
- data = pack_array_or_pass_string(type,arg6);
554
- rb_str_freeze(data);
555
- g_VertexAttrib_ptr[index] = data;
556
- fptr_glVertexAttribPointer(index,size,type,normalized,stride,(GLvoid *)RSTRING_PTR(data));
557
- }
558
- CHECK_GLERROR_FROM("glVertexAttribPointer");
559
- return Qnil;
538
+ GLuint index;
539
+ GLuint size;
540
+ GLenum type;
541
+ GLboolean normalized;
542
+ GLsizei stride;
543
+ LOAD_GL_FUNC(glVertexAttribPointer, "2.0");
544
+ index = (GLuint)NUM2UINT(arg1);
545
+ size = (GLuint)NUM2UINT(arg2);
546
+ type = (GLenum)NUM2INT(arg3);
547
+ normalized = (GLboolean)RUBYBOOL2GL(arg4);
548
+ stride = (GLsizei)NUM2UINT(arg5);
549
+ if (index>_MAX_VERTEX_ATTRIBS)
550
+ rb_raise(rb_eArgError, "Index too large, maximum allowed value '%i'",_MAX_VERTEX_ATTRIBS);
551
+
552
+ if (CheckBufferBinding(GL_ARRAY_BUFFER_BINDING)) {
553
+ g_VertexAttrib_ptr[index] = arg6;
554
+ fptr_glVertexAttribPointer(index,size,type,normalized,stride,(GLvoid *)NUM2SIZET(arg6));
555
+ } else {
556
+ VALUE data;
557
+ data = pack_array_or_pass_string(type,arg6);
558
+ rb_str_freeze(data);
559
+ g_VertexAttrib_ptr[index] = data;
560
+ fptr_glVertexAttribPointer(index,size,type,normalized,stride,(GLvoid *)RSTRING_PTR(data));
561
+ }
562
+ CHECK_GLERROR_FROM("glVertexAttribPointer");
563
+ return Qnil;
560
564
  }
561
565
 
562
566
  void gl_init_functions_2_0(VALUE module)
563
567
  {
564
- rb_define_module_function(module, "glBlendEquationSeparate", gl_BlendEquationSeparate, 2);
565
- rb_define_module_function(module, "glDrawBuffers", gl_DrawBuffers, 1);
566
- rb_define_module_function(module, "glStencilOpSeparate", gl_StencilOpSeparate, 4);
567
- rb_define_module_function(module, "glStencilFuncSeparate", gl_StencilFuncSeparate, 4);
568
- rb_define_module_function(module, "glStencilMaskSeparate", gl_StencilMaskSeparate, 2);
569
- rb_define_module_function(module, "glAttachShader", gl_AttachShader, 2);
570
- rb_define_module_function(module, "glBindAttribLocation", gl_BindAttribLocation, 3);
571
- rb_define_module_function(module, "glCompileShader", gl_CompileShader, 1);
572
- rb_define_module_function(module, "glCreateProgram", gl_CreateProgram, 0);
573
- rb_define_module_function(module, "glCreateShader", gl_CreateShader, 1);
574
- rb_define_module_function(module, "glDeleteProgram", gl_DeleteProgram, 1);
575
- rb_define_module_function(module, "glDeleteShader", gl_DeleteShader, 1);
576
- rb_define_module_function(module, "glDetachShader", gl_DetachShader, 2);
577
- rb_define_module_function(module, "glDisableVertexAttribArray", gl_DisableVertexAttribArray, 1);
578
- rb_define_module_function(module, "glEnableVertexAttribArray", gl_EnableVertexAttribArray, 1);
579
- rb_define_module_function(module, "glGetActiveAttrib", gl_GetActiveAttrib, 2);
580
- rb_define_module_function(module, "glGetActiveUniform", gl_GetActiveUniform, 2);
581
- rb_define_module_function(module, "glGetAttachedShaders", gl_GetAttachedShaders, 1);
582
- rb_define_module_function(module, "glGetAttribLocation", gl_GetAttribLocation, 2);
583
- rb_define_module_function(module, "glGetProgramiv", gl_GetProgramiv, 2);
584
- rb_define_module_function(module, "glGetProgramInfoLog", gl_GetProgramInfoLog, 1);
585
- rb_define_module_function(module, "glGetShaderiv", gl_GetShaderiv, 2);
586
- rb_define_module_function(module, "glGetShaderInfoLog", gl_GetShaderInfoLog, 1);
587
- rb_define_module_function(module, "glGetShaderSource", gl_GetShaderSource, 1);
588
- rb_define_module_function(module, "glGetUniformLocation", gl_GetUniformLocation, 2);
589
- rb_define_module_function(module, "glGetUniformfv", gl_GetUniformfv, 2);
590
- rb_define_module_function(module, "glGetUniformiv", gl_GetUniformiv, 2);
591
- rb_define_module_function(module, "glGetVertexAttribdv", gl_GetVertexAttribdv, 2);
592
- rb_define_module_function(module, "glGetVertexAttribfv", gl_GetVertexAttribfv, 2);
593
- rb_define_module_function(module, "glGetVertexAttribiv", gl_GetVertexAttribiv, 2);
594
- rb_define_module_function(module, "glGetVertexAttribPointerv", gl_GetVertexAttribPointerv, 1);
595
- rb_define_module_function(module, "glIsProgram", gl_IsProgram, 1);
596
- rb_define_module_function(module, "glIsShader", gl_IsShader, 1);
597
- rb_define_module_function(module, "glLinkProgram", gl_LinkProgram, 1);
598
- rb_define_module_function(module, "glShaderSource", gl_ShaderSource, 2);
599
- rb_define_module_function(module, "glUseProgram", gl_UseProgram, 1);
600
- rb_define_module_function(module, "glUniform1f", gl_Uniform1f, 2);
601
- rb_define_module_function(module, "glUniform2f", gl_Uniform2f, 3);
602
- rb_define_module_function(module, "glUniform3f", gl_Uniform3f, 4);
603
- rb_define_module_function(module, "glUniform4f", gl_Uniform4f, 5);
604
- rb_define_module_function(module, "glUniform1i", gl_Uniform1i, 2);
605
- rb_define_module_function(module, "glUniform2i", gl_Uniform2i, 3);
606
- rb_define_module_function(module, "glUniform3i", gl_Uniform3i, 4);
607
- rb_define_module_function(module, "glUniform4i", gl_Uniform4i, 5);
608
- rb_define_module_function(module, "glUniform1fv", gl_Uniform1fv, 2);
609
- rb_define_module_function(module, "glUniform2fv", gl_Uniform2fv, 2);
610
- rb_define_module_function(module, "glUniform3fv", gl_Uniform3fv, 2);
611
- rb_define_module_function(module, "glUniform4fv", gl_Uniform4fv, 2);
612
- rb_define_module_function(module, "glUniform1iv", gl_Uniform1iv, 2);
613
- rb_define_module_function(module, "glUniform2iv", gl_Uniform2iv, 2);
614
- rb_define_module_function(module, "glUniform3iv", gl_Uniform3iv, 2);
615
- rb_define_module_function(module, "glUniform4iv", gl_Uniform4iv, 2);
616
- rb_define_module_function(module, "glUniformMatrix2fv", gl_UniformMatrix2fv, 3);
617
- rb_define_module_function(module, "glUniformMatrix3fv", gl_UniformMatrix3fv, 3);
618
- rb_define_module_function(module, "glUniformMatrix4fv", gl_UniformMatrix4fv, 3);
619
- rb_define_module_function(module, "glValidateProgram", gl_ValidateProgram, 1);
620
- rb_define_module_function(module, "glVertexAttrib1d", gl_VertexAttrib1d, 2);
621
- rb_define_module_function(module, "glVertexAttrib1f", gl_VertexAttrib1f, 2);
622
- rb_define_module_function(module, "glVertexAttrib1s", gl_VertexAttrib1s, 2);
623
- rb_define_module_function(module, "glVertexAttrib2d", gl_VertexAttrib2d, 3);
624
- rb_define_module_function(module, "glVertexAttrib2f", gl_VertexAttrib2f, 3);
625
- rb_define_module_function(module, "glVertexAttrib2s", gl_VertexAttrib2s, 3);
626
- rb_define_module_function(module, "glVertexAttrib3d", gl_VertexAttrib3d, 4);
627
- rb_define_module_function(module, "glVertexAttrib3f", gl_VertexAttrib3f, 4);
628
- rb_define_module_function(module, "glVertexAttrib3s", gl_VertexAttrib3s, 4);
629
- rb_define_module_function(module, "glVertexAttrib4Nbv", gl_VertexAttrib4Nbv, 2);
630
- rb_define_module_function(module, "glVertexAttrib4Niv", gl_VertexAttrib4Niv, 2);
631
- rb_define_module_function(module, "glVertexAttrib4Nsv", gl_VertexAttrib4Nsv, 2);
632
- rb_define_module_function(module, "glVertexAttrib4Nub", gl_VertexAttrib4Nub, 5);
633
- rb_define_module_function(module, "glVertexAttrib4Nubv", gl_VertexAttrib4Nubv, 2);
634
- rb_define_module_function(module, "glVertexAttrib4Nuiv", gl_VertexAttrib4Nuiv, 2);
635
- rb_define_module_function(module, "glVertexAttrib4Nusv", gl_VertexAttrib4Nusv, 2);
636
- rb_define_module_function(module, "glVertexAttrib4bv", gl_VertexAttrib4bv, 2);
637
- rb_define_module_function(module, "glVertexAttrib4d", gl_VertexAttrib4d, 5);
638
- rb_define_module_function(module, "glVertexAttrib4f", gl_VertexAttrib4f, 5);
639
- rb_define_module_function(module, "glVertexAttrib4iv", gl_VertexAttrib4iv, 2);
640
- rb_define_module_function(module, "glVertexAttrib4s", gl_VertexAttrib4s, 5);
641
- rb_define_module_function(module, "glVertexAttrib4ubv", gl_VertexAttrib4ubv, 2);
642
- rb_define_module_function(module, "glVertexAttrib4uiv", gl_VertexAttrib4uiv, 2);
643
- rb_define_module_function(module, "glVertexAttrib4usv", gl_VertexAttrib4usv, 2);
644
- rb_define_module_function(module, "glVertexAttrib1dv", gl_VertexAttrib1dv, 2);
645
- rb_define_module_function(module, "glVertexAttrib1fv", gl_VertexAttrib1fv, 2);
646
- rb_define_module_function(module, "glVertexAttrib1sv", gl_VertexAttrib1sv, 2);
647
- rb_define_module_function(module, "glVertexAttrib2dv", gl_VertexAttrib2dv, 2);
648
- rb_define_module_function(module, "glVertexAttrib2fv", gl_VertexAttrib2fv, 2);
649
- rb_define_module_function(module, "glVertexAttrib2sv", gl_VertexAttrib2sv, 2);
650
- rb_define_module_function(module, "glVertexAttrib3dv", gl_VertexAttrib3dv, 2);
651
- rb_define_module_function(module, "glVertexAttrib3fv", gl_VertexAttrib3fv, 2);
652
- rb_define_module_function(module, "glVertexAttrib3sv", gl_VertexAttrib3sv, 2);
653
- rb_define_module_function(module, "glVertexAttrib4dv", gl_VertexAttrib4dv, 2);
654
- rb_define_module_function(module, "glVertexAttrib4fv", gl_VertexAttrib4fv, 2);
655
- rb_define_module_function(module, "glVertexAttrib4sv", gl_VertexAttrib4sv, 2);
656
- rb_define_module_function(module, "glVertexAttribPointer", gl_VertexAttribPointer, 6);
657
-
658
- {
659
- int i;
660
- for (i=0;i<_MAX_VERTEX_ATTRIBS;i++)
661
- rb_global_variable(&g_VertexAttrib_ptr[i]);
662
- }
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
+ }
663
667
  }