opengl 0.9.0-x64-mingw32

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 +3 -0
  3. data.tar.gz.sig +0 -0
  4. data/.autotest +29 -0
  5. data/.gemtest +0 -0
  6. data/.gitignore +6 -0
  7. data/.travis.yml +19 -0
  8. data/History.rdoc +77 -0
  9. data/MIT-LICENSE +18 -0
  10. data/Manifest.txt +138 -0
  11. data/README.rdoc +102 -0
  12. data/Rakefile +60 -0
  13. data/examples/NeHe/NeHe.png +0 -0
  14. data/examples/NeHe/crate.png +0 -0
  15. data/examples/NeHe/glass.png +0 -0
  16. data/examples/NeHe/nehe_lesson02.rb +117 -0
  17. data/examples/NeHe/nehe_lesson03.rb +123 -0
  18. data/examples/NeHe/nehe_lesson04.rb +132 -0
  19. data/examples/NeHe/nehe_lesson05.rb +182 -0
  20. data/examples/NeHe/nehe_lesson06.rb +186 -0
  21. data/examples/NeHe/nehe_lesson07.rb +240 -0
  22. data/examples/NeHe/nehe_lesson08.rb +255 -0
  23. data/examples/NeHe/nehe_lesson09.rb +203 -0
  24. data/examples/NeHe/nehe_lesson11.rb +176 -0
  25. data/examples/NeHe/nehe_lesson12.rb +203 -0
  26. data/examples/NeHe/nehe_lesson16.rb +211 -0
  27. data/examples/NeHe/nehe_lesson19.rb +209 -0
  28. data/examples/NeHe/nehe_lesson36.rb +308 -0
  29. data/examples/NeHe/particle.png +0 -0
  30. data/examples/NeHe/star.png +0 -0
  31. data/examples/NeHe/tim.png +0 -0
  32. data/examples/OrangeBook/3Dlabs-License.txt +33 -0
  33. data/examples/OrangeBook/brick.frag +36 -0
  34. data/examples/OrangeBook/brick.rb +378 -0
  35. data/examples/OrangeBook/brick.vert +41 -0
  36. data/examples/OrangeBook/particle.frag +17 -0
  37. data/examples/OrangeBook/particle.rb +408 -0
  38. data/examples/OrangeBook/particle.vert +38 -0
  39. data/examples/README +16 -0
  40. data/examples/RedBook/aapoly.rb +143 -0
  41. data/examples/RedBook/aargb.rb +121 -0
  42. data/examples/RedBook/accanti.rb +164 -0
  43. data/examples/RedBook/accpersp.rb +217 -0
  44. data/examples/RedBook/alpha.rb +125 -0
  45. data/examples/RedBook/alpha3D.rb +160 -0
  46. data/examples/RedBook/bezcurve.rb +107 -0
  47. data/examples/RedBook/bezmesh.rb +139 -0
  48. data/examples/RedBook/checker.rb +126 -0
  49. data/examples/RedBook/clip.rb +97 -0
  50. data/examples/RedBook/colormat.rb +137 -0
  51. data/examples/RedBook/cube.rb +71 -0
  52. data/examples/RedBook/depthcue.rb +101 -0
  53. data/examples/RedBook/dof.rb +206 -0
  54. data/examples/RedBook/double.rb +107 -0
  55. data/examples/RedBook/drawf.rb +93 -0
  56. data/examples/RedBook/feedback.rb +147 -0
  57. data/examples/RedBook/fog.rb +168 -0
  58. data/examples/RedBook/font.rb +153 -0
  59. data/examples/RedBook/hello.rb +81 -0
  60. data/examples/RedBook/image.rb +139 -0
  61. data/examples/RedBook/jitter.rb +207 -0
  62. data/examples/RedBook/light.rb +155 -0
  63. data/examples/RedBook/lines.rb +130 -0
  64. data/examples/RedBook/list.rb +113 -0
  65. data/examples/RedBook/material.rb +276 -0
  66. data/examples/RedBook/mipmap.rb +158 -0
  67. data/examples/RedBook/model.rb +115 -0
  68. data/examples/RedBook/movelight.rb +134 -0
  69. data/examples/RedBook/pickdepth.rb +181 -0
  70. data/examples/RedBook/planet.rb +110 -0
  71. data/examples/RedBook/quadric.rb +160 -0
  72. data/examples/RedBook/robot.rb +117 -0
  73. data/examples/RedBook/select.rb +198 -0
  74. data/examples/RedBook/smooth.rb +97 -0
  75. data/examples/RedBook/stencil.rb +165 -0
  76. data/examples/RedBook/stroke.rb +169 -0
  77. data/examples/RedBook/surface.rb +168 -0
  78. data/examples/RedBook/teaambient.rb +134 -0
  79. data/examples/RedBook/teapots.rb +184 -0
  80. data/examples/RedBook/tess.rb +185 -0
  81. data/examples/RedBook/texbind.rb +149 -0
  82. data/examples/RedBook/texgen.rb +171 -0
  83. data/examples/RedBook/texturesurf.rb +130 -0
  84. data/examples/RedBook/varray.rb +161 -0
  85. data/examples/RedBook/wrap.rb +150 -0
  86. data/examples/misc/OGLBench.rb +338 -0
  87. data/examples/misc/anisotropic.rb +196 -0
  88. data/examples/misc/fbo_test.rb +357 -0
  89. data/examples/misc/font-glut.rb +47 -0
  90. data/examples/misc/glfwtest.rb +30 -0
  91. data/examples/misc/plane.rb +161 -0
  92. data/examples/misc/readpixel.rb +66 -0
  93. data/examples/misc/sdltest.rb +36 -0
  94. data/examples/misc/trislam.rb +829 -0
  95. data/ext/opengl/common.h +428 -0
  96. data/ext/opengl/conv.h +244 -0
  97. data/ext/opengl/extconf.rb +47 -0
  98. data/ext/opengl/funcdef.h +313 -0
  99. data/ext/opengl/gl-1.0-1.1.c +3075 -0
  100. data/ext/opengl/gl-1.2.c +155 -0
  101. data/ext/opengl/gl-1.3.c +443 -0
  102. data/ext/opengl/gl-1.4.c +348 -0
  103. data/ext/opengl/gl-1.5.c +224 -0
  104. data/ext/opengl/gl-2.0.c +667 -0
  105. data/ext/opengl/gl-2.1.c +57 -0
  106. data/ext/opengl/gl-3.0.c +493 -0
  107. data/ext/opengl/gl-enums.c +4873 -0
  108. data/ext/opengl/gl-enums.h +14588 -0
  109. data/ext/opengl/gl-error.c +112 -0
  110. data/ext/opengl/gl-error.h +28 -0
  111. data/ext/opengl/gl-ext-3dfx.c +27 -0
  112. data/ext/opengl/gl-ext-arb.c +875 -0
  113. data/ext/opengl/gl-ext-ati.c +41 -0
  114. data/ext/opengl/gl-ext-ext.c +889 -0
  115. data/ext/opengl/gl-ext-gremedy.c +41 -0
  116. data/ext/opengl/gl-ext-nv.c +680 -0
  117. data/ext/opengl/gl-types.h +67 -0
  118. data/ext/opengl/gl.c +220 -0
  119. data/ext/opengl/gl_buffer.c +177 -0
  120. data/ext/opengl/opengl.c +7 -0
  121. data/lib/gl.rb +1 -0
  122. data/lib/opengl.rb +53 -0
  123. data/lib/opengl/2.0/opengl.so +0 -0
  124. data/lib/opengl/2.1/opengl.so +0 -0
  125. data/lib/opengl/test_case.rb +86 -0
  126. data/test/dummy.xorg.conf +140 -0
  127. data/test/test_gl.rb +38 -0
  128. data/test/test_gl_10_11.rb +1363 -0
  129. data/test/test_gl_12.rb +71 -0
  130. data/test/test_gl_13.rb +221 -0
  131. data/test/test_gl_14.rb +218 -0
  132. data/test/test_gl_15.rb +258 -0
  133. data/test/test_gl_20.rb +417 -0
  134. data/test/test_gl_21.rb +436 -0
  135. data/test/test_gl_ext_arb.rb +508 -0
  136. data/test/test_gl_ext_ati.rb +28 -0
  137. data/test/test_gl_ext_ext.rb +608 -0
  138. data/test/test_gl_ext_gremedy.rb +29 -0
  139. data/test/test_gl_ext_nv.rb +349 -0
  140. data/test/test_opengl_buffer.rb +120 -0
  141. data/utils/README +6 -0
  142. data/utils/enumgen.rb +108 -0
  143. data/utils/extlistgen.rb +90 -0
  144. metadata +319 -0
  145. metadata.gz.sig +1 -0
@@ -0,0 +1,112 @@
1
+ /*
2
+ * Copyright (C) 2007 Jan Dvorak <jan.dvorak@kraxnet.cz>
3
+ *
4
+ * This program is distributed under the terms of the MIT license.
5
+ * See the included MIT-LICENSE file for the terms of this license.
6
+ *
7
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
8
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
9
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
10
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
11
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
12
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
13
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
14
+ */
15
+
16
+ #include "common.h"
17
+
18
+ VALUE error_checking = Qtrue;
19
+
20
+ VALUE Class_GLError;
21
+
22
+ #define BUFSIZE 256
23
+
24
+ void check_for_glerror(const char *caller)
25
+ {
26
+ GLenum error;
27
+
28
+ error = glGetError();
29
+
30
+ if (error==GL_NO_ERROR) { /* no errors == instant return */
31
+ return;
32
+ } else { /* process errors */
33
+ const char *error_string;
34
+ const char *from = "";
35
+ int queued_errors = 0;
36
+ char message[BUFSIZE];
37
+ VALUE exc;
38
+
39
+ if (caller) {
40
+ from = " for ";
41
+ } else {
42
+ caller = "";
43
+ }
44
+
45
+ /* check for queued errors */
46
+ for(queued_errors = 0;
47
+ glGetError()!=GL_NO_ERROR;
48
+ queued_errors++)
49
+ ;
50
+
51
+ switch(error) {
52
+ case GL_INVALID_ENUM: error_string = "invalid enumerant"; break;
53
+ case GL_INVALID_VALUE: error_string = "invalid value"; break;
54
+ case GL_INVALID_OPERATION: error_string = "invalid operation"; break;
55
+ case GL_STACK_OVERFLOW: error_string = "stack overflow"; break;
56
+ case GL_STACK_UNDERFLOW: error_string = "stack underflow"; break;
57
+ case GL_OUT_OF_MEMORY: error_string = "out of memory"; break;
58
+ case GL_TABLE_TOO_LARGE: error_string = "table too large"; break;
59
+ case GL_INVALID_FRAMEBUFFER_OPERATION_EXT: error_string = "invalid framebuffer operation"; break;
60
+ default: error_string = "unknown error"; break;
61
+ }
62
+
63
+ if (queued_errors==0) {
64
+ snprintf(message, BUFSIZE, "%s%s%s", error_string, from, caller);
65
+ } else {
66
+ snprintf(message, BUFSIZE, "%s%s%s [%i queued error(s) cleaned]",
67
+ error_string, from, caller, queued_errors);
68
+ }
69
+
70
+ exc = rb_funcall(Class_GLError, rb_intern("new"), 2, rb_str_new2(message), INT2NUM(error));
71
+ rb_funcall(rb_cObject, rb_intern("raise"), 1, exc);
72
+ }
73
+ }
74
+
75
+ VALUE GLError_initialize(VALUE obj,VALUE message, VALUE error_id)
76
+ {
77
+ rb_call_super(1, &message);
78
+ rb_iv_set(obj, "@id", error_id);
79
+
80
+ return obj;
81
+ }
82
+
83
+ static VALUE enable_error_checking(VALUE obj)
84
+ {
85
+ error_checking = Qtrue;
86
+ return Qnil;
87
+ }
88
+
89
+ static VALUE disable_error_checking(VALUE obj)
90
+ {
91
+ error_checking = Qfalse;
92
+ return Qnil;
93
+ }
94
+
95
+ static VALUE is_error_checking_enabled(VALUE obj)
96
+ {
97
+ return error_checking;
98
+ }
99
+
100
+ void gl_init_error(VALUE module)
101
+ {
102
+ Class_GLError = rb_define_class_under(module, "Error", rb_eStandardError);
103
+
104
+ rb_define_method(Class_GLError, "initialize", GLError_initialize, 2);
105
+ rb_define_attr(Class_GLError, "id", 1, 0);
106
+
107
+ rb_define_module_function(module, "enable_error_checking", enable_error_checking, 0);
108
+ rb_define_module_function(module, "disable_error_checking", disable_error_checking, 0);
109
+ rb_define_module_function(module, "is_error_checking_enabled?", is_error_checking_enabled, 0);
110
+
111
+ rb_global_variable(&error_checking);
112
+ }
@@ -0,0 +1,28 @@
1
+ /*
2
+ * Copyright (C) 2007 Jan Dvorak <jan.dvorak@kraxnet.cz>
3
+ *
4
+ * This program is distributed under the terms of the MIT license.
5
+ * See the included MIT-LICENSE file for the terms of this license.
6
+ *
7
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
8
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
9
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
10
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
11
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
12
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
13
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
14
+ */
15
+
16
+ void gl_init_error(VALUE);
17
+
18
+ extern VALUE error_checking;
19
+ extern VALUE inside_begin_end;
20
+
21
+ void check_for_glerror(const char *);
22
+
23
+ #define CHECK_GLERROR_FROM(caller) \
24
+ do { \
25
+ if (error_checking == Qtrue && inside_begin_end == Qfalse) \
26
+ check_for_glerror(caller); \
27
+ } while (0)
28
+
@@ -0,0 +1,27 @@
1
+ /*
2
+ * Copyright (C) 2007 Jan Dvorak <jan.dvorak@kraxnet.cz>
3
+ *
4
+ * This program is distributed under the terms of the MIT license.
5
+ * See the included MIT-LICENSE file for the terms of this license.
6
+ *
7
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
8
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
9
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
10
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
11
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
12
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
13
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
14
+ */
15
+
16
+ #include "common.h"
17
+
18
+ /* OpenGL 3DFX extensions */
19
+
20
+ /* #208 - GL_3DFX_tbuffer */
21
+ GL_FUNC_LOAD_1(TbufferMask3DFX,GLvoid, GLuint, "GL_3DFX_tbuffer")
22
+
23
+ void gl_init_functions_ext_3dfx(VALUE module)
24
+ {
25
+ /* #208 - GL_3DFX_tbuffer */
26
+ rb_define_module_function(module, "glTbufferMask3DFX", gl_TbufferMask3DFX, 1);
27
+ }
@@ -0,0 +1,875 @@
1
+ /*
2
+ * Copyright (C) 2007 Jan Dvorak <jan.dvorak@kraxnet.cz>
3
+ *
4
+ * This program is distributed under the terms of the MIT license.
5
+ * See the included MIT-LICENSE file for the terms of this license.
6
+ *
7
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
8
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
9
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
10
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
11
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
12
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
13
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
14
+ */
15
+
16
+ #include "common.h"
17
+
18
+ /* OpenGL ARB extensions */
19
+
20
+ /* #3 GL_ARB_transpose_matrix */
21
+ #define TRANSPOSEMATRIX_FUNC(_name_,_type_,_conv_) \
22
+ static void (APIENTRY * fptr_gl##_name_)(const _type_[]); \
23
+ static VALUE \
24
+ gl_##_name_(obj,arg1) \
25
+ VALUE obj,arg1; \
26
+ { \
27
+ _type_ m[4*4]; \
28
+ LOAD_GL_FUNC(gl##_name_, "GL_ARB_transpose_matrix"); \
29
+ _conv_(arg1, m, 4, 4); \
30
+ fptr_gl##_name_(m); \
31
+ CHECK_GLERROR_FROM("gl" #_name_); \
32
+ return Qnil; \
33
+ }
34
+
35
+ TRANSPOSEMATRIX_FUNC(LoadTransposeMatrixfARB,GLfloat,ary2cmatfloat)
36
+ TRANSPOSEMATRIX_FUNC(LoadTransposeMatrixdARB,GLdouble,ary2cmatdouble)
37
+ TRANSPOSEMATRIX_FUNC(MultTransposeMatrixfARB,GLfloat,ary2cmatfloat)
38
+ TRANSPOSEMATRIX_FUNC(MultTransposeMatrixdARB,GLdouble,ary2cmatdouble)
39
+
40
+ #undef TRANSPOSEMATRIX_FUNC
41
+
42
+ /* #5 GL_ARB_multisample */
43
+ GL_FUNC_LOAD_2(SampleCoverageARB,GLvoid, GLclampf,GLboolean, "GL_ARB_multisample")
44
+
45
+ /* #14 GL_ARB_point_parameters */
46
+ GL_FUNC_LOAD_2(PointParameterfARB,GLvoid, GLenum,GLfloat, "GL_ARB_point_parameters")
47
+
48
+ static void (APIENTRY * fptr_glPointParameterfvARB)(GLenum,GLfloat *);
49
+ static VALUE gl_PointParameterfvARB(VALUE obj,VALUE arg1,VALUE arg2)
50
+ {
51
+ GLfloat params[3] = {(GLfloat)0.0,(GLfloat)0.0,(GLfloat)0.0};
52
+ GLenum pname;
53
+ GLint size;
54
+ LOAD_GL_FUNC(glPointParameterfvARB, "GL_ARB_point_parameters");
55
+ pname = NUM2UINT(arg1);
56
+ Check_Type(arg2,T_ARRAY);
57
+ if (pname==GL_POINT_DISTANCE_ATTENUATION)
58
+ size = 3;
59
+ else
60
+ size = 1;
61
+ ary2cflt(arg2,params,size);
62
+ fptr_glPointParameterfvARB(pname,params);
63
+ CHECK_GLERROR_FROM("glPointParameterfvARB");
64
+ return Qnil;
65
+ }
66
+
67
+ /* #25 GL_ARB_window_pos */
68
+ GL_FUNC_LOAD_2(WindowPos2dARB,GLvoid, GLdouble,GLdouble, "GL_ARB_window_pos")
69
+ GL_FUNC_LOAD_2(WindowPos2fARB,GLvoid, GLfloat,GLfloat, "GL_ARB_window_pos")
70
+ GL_FUNC_LOAD_2(WindowPos2iARB,GLvoid, GLint,GLint, "GL_ARB_window_pos")
71
+ GL_FUNC_LOAD_2(WindowPos2sARB,GLvoid, GLshort,GLshort, "GL_ARB_window_pos")
72
+ GL_FUNC_LOAD_3(WindowPos3dARB,GLvoid, GLdouble,GLdouble,GLdouble, "GL_ARB_window_pos")
73
+ GL_FUNC_LOAD_3(WindowPos3fARB,GLvoid, GLfloat,GLfloat,GLfloat, "GL_ARB_window_pos")
74
+ GL_FUNC_LOAD_3(WindowPos3iARB,GLvoid, GLint,GLint,GLint, "GL_ARB_window_pos")
75
+ GL_FUNC_LOAD_3(WindowPos3sARB,GLvoid, GLshort,GLshort,GLshort, "GL_ARB_window_pos")
76
+
77
+ #define WINDOWPOSFUNCV(_name_,_type_,_conv_,_size_,_ext_) \
78
+ static void (APIENTRY * fptr_gl##_name_)(const _type_ *); \
79
+ static VALUE gl_##_name_(VALUE obj,VALUE arg1) \
80
+ { \
81
+ _type_ cary[_size_]; \
82
+ LOAD_GL_FUNC(gl##_name_, _ext_); \
83
+ Check_Type(arg1,T_ARRAY); \
84
+ if (RARRAY_LEN(arg1) != _size_) \
85
+ rb_raise(rb_eArgError, "Incorrect array length - must have '%i' elements.",_size_); \
86
+ _conv_(arg1,cary,_size_); \
87
+ fptr_gl##_name_(cary); \
88
+ CHECK_GLERROR_FROM("gl" #_name_); \
89
+ return Qnil; \
90
+ }
91
+
92
+ WINDOWPOSFUNCV(WindowPos2dvARB,GLdouble,ary2cdbl,2,"GL_ARB_window_pos")
93
+ WINDOWPOSFUNCV(WindowPos2fvARB,GLfloat,ary2cflt,2,"GL_ARB_window_pos")
94
+ WINDOWPOSFUNCV(WindowPos2ivARB,GLint,ary2cint,2,"GL_ARB_window_pos")
95
+ WINDOWPOSFUNCV(WindowPos2svARB,GLshort,ary2cshort,2,"GL_ARB_window_pos")
96
+ WINDOWPOSFUNCV(WindowPos3dvARB,GLdouble,ary2cdbl,3,"GL_ARB_window_pos")
97
+ WINDOWPOSFUNCV(WindowPos3fvARB,GLfloat,ary2cflt,3,"GL_ARB_window_pos")
98
+ WINDOWPOSFUNCV(WindowPos3ivARB,GLint,ary2cint,3,"GL_ARB_window_pos")
99
+ WINDOWPOSFUNCV(WindowPos3svARB,GLshort,ary2cshort,3,"GL_ARB_window_pos")
100
+ #undef WINDOWPOSFUNCV
101
+
102
+
103
+ /* #26 GL_ARB_vertex_program */
104
+ static void (APIENTRY * fptr_glProgramStringARB)(GLenum,GLenum,GLsizei,const void *);
105
+ static VALUE gl_ProgramStringARB(VALUE obj,VALUE arg1,VALUE arg2,VALUE arg3)
106
+ {
107
+ LOAD_GL_FUNC(glProgramStringARB, "GL_ARB_vertex_program");
108
+ Check_Type(arg3,T_STRING);
109
+ fptr_glProgramStringARB((GLenum)NUM2INT(arg1),(GLenum)NUM2INT(arg2),(GLsizei)RSTRING_LENINT(arg3),RSTRING_PTR(arg3));
110
+ CHECK_GLERROR_FROM("glProgramStringARB");
111
+ return Qnil;
112
+ }
113
+
114
+ static void (APIENTRY * fptr_glGetProgramivARB)(GLenum,GLenum,GLint *);
115
+ static VALUE gl_GetProgramivARB(VALUE obj,VALUE arg1,VALUE arg2)
116
+ {
117
+ GLint ret = 0;
118
+ LOAD_GL_FUNC(glGetProgramivARB, "GL_ARB_vertex_program");
119
+ fptr_glGetProgramivARB(NUM2INT(arg1),NUM2INT(arg2),&ret);
120
+ CHECK_GLERROR_FROM("glGetProgramivARB");
121
+ return cond_GLBOOL2RUBY(NUM2INT(arg2),ret);
122
+ }
123
+
124
+ static void (APIENTRY * fptr_glGetProgramStringARB)(GLenum,GLenum,void *string);
125
+ static VALUE gl_GetProgramStringARB(VALUE obj,VALUE arg1,VALUE arg2)
126
+ {
127
+ GLsizei len = 0;
128
+ char *buffer;
129
+ VALUE ret_buffer;
130
+
131
+ LOAD_GL_FUNC(glGetProgramStringARB, "GL_ARB_vertex_program");
132
+ LOAD_GL_FUNC(glGetProgramivARB, "GL_ARB_vertex_program");
133
+
134
+ fptr_glGetProgramivARB(NUM2INT(arg1),GL_PROGRAM_LENGTH_ARB,&len);
135
+ CHECK_GLERROR_FROM("glGetProgramivARB");
136
+ if (len<=0)
137
+ return rb_str_new2("");
138
+
139
+ buffer = ALLOC_N(GLchar,len+1);
140
+ memset(buffer,0,sizeof(GLchar) * (len+1));
141
+ fptr_glGetProgramStringARB(NUM2INT(arg1),NUM2INT(arg2),buffer);
142
+ ret_buffer = rb_str_new2(buffer);
143
+ xfree(buffer);
144
+
145
+ CHECK_GLERROR_FROM("glGetProgramStringARB");
146
+ return ret_buffer;
147
+ }
148
+
149
+ GL_FUNC_GENOBJECTS_LOAD(GenProgramsARB,"GL_ARB_vertex_program")
150
+ GL_FUNC_DELETEOBJECTS_LOAD(DeleteProgramsARB,"GL_ARB_vertex_program")
151
+ GL_FUNC_LOAD_2(BindProgramARB,GLvoid, GLenum,GLuint, "GL_ARB_vertex_program")
152
+ GL_FUNC_LOAD_1(IsProgramARB,GLboolean, GLuint, "GL_ARB_vertex_program")
153
+ GL_FUNC_LOAD_1(EnableVertexAttribArrayARB,GLvoid, GLuint, "GL_ARB_vertex_program")
154
+ GL_FUNC_LOAD_1(DisableVertexAttribArrayARB,GLvoid, GLuint, "GL_ARB_vertex_program")
155
+
156
+ extern VALUE g_VertexAttrib_ptr[];
157
+
158
+ static void (APIENTRY * fptr_glVertexAttribPointerARB)(GLuint,GLint,GLenum,GLboolean,GLsizei,const GLvoid *);
159
+ static VALUE gl_VertexAttribPointerARB(VALUE obj,VALUE arg1,VALUE arg2,VALUE arg3,VALUE arg4,VALUE arg5,VALUE arg6)
160
+ {
161
+ GLuint index;
162
+ GLuint size;
163
+ GLenum type;
164
+ GLboolean normalized;
165
+ GLsizei stride;
166
+
167
+ LOAD_GL_FUNC(glVertexAttribPointerARB, "GL_ARB_vertex_program");
168
+
169
+ index = (GLuint)NUM2UINT(arg1);
170
+ size = (GLuint)NUM2UINT(arg2);
171
+ type = (GLenum)NUM2INT(arg3);
172
+ normalized = (GLboolean)RUBYBOOL2GL(arg4);
173
+ stride = (GLsizei)NUM2UINT(arg5);
174
+ if (index>_MAX_VERTEX_ATTRIBS)
175
+ rb_raise(rb_eArgError, "Index too large, maximum allowed value '%i'",_MAX_VERTEX_ATTRIBS);
176
+
177
+ if (CheckBufferBinding(GL_ARRAY_BUFFER_BINDING)) {
178
+ g_VertexAttrib_ptr[index] = arg6;
179
+ fptr_glVertexAttribPointerARB(index,size,type,normalized,stride,(GLvoid *)NUM2SIZET(arg6));
180
+ } else {
181
+ VALUE data;
182
+ data = pack_array_or_pass_string(type,arg6);
183
+ rb_str_freeze(data);
184
+ g_VertexAttrib_ptr[index] = data;
185
+ fptr_glVertexAttribPointerARB(index,size,type,normalized,stride,(GLvoid *)RSTRING_PTR(data));
186
+ }
187
+
188
+ CHECK_GLERROR_FROM("glVertexAttribPointerARB");
189
+ return Qnil;
190
+ }
191
+
192
+
193
+ static void (APIENTRY * fptr_glGetVertexAttribPointervARB)(GLuint,GLenum,GLvoid **);
194
+ static VALUE
195
+ gl_GetVertexAttribPointervARB(obj,arg1)
196
+ VALUE obj,arg1;
197
+ {
198
+ GLuint index;
199
+ LOAD_GL_FUNC(glGetVertexAttribPointervARB, "GL_ARB_vertex_program");
200
+ index =(GLuint) NUM2INT(arg1);
201
+ if (index>_MAX_VERTEX_ATTRIBS)
202
+ rb_raise(rb_eArgError, "Index too large, maximum allowed value '%i'",_MAX_VERTEX_ATTRIBS);
203
+
204
+ return g_VertexAttrib_ptr[index];
205
+ }
206
+
207
+ GL_FUNC_LOAD_6(ProgramEnvParameter4dARB,GLvoid, GLenum,GLuint,GLdouble,GLdouble,GLdouble,GLdouble, "GL_ARB_vertex_program")
208
+ GL_FUNC_LOAD_6(ProgramEnvParameter4fARB,GLvoid, GLenum,GLuint,GLfloat,GLfloat,GLfloat,GLfloat, "GL_ARB_vertex_program")
209
+ GL_FUNC_LOAD_6(ProgramLocalParameter4dARB,GLvoid, GLenum,GLuint,GLdouble,GLdouble,GLdouble,GLdouble, "GL_ARB_vertex_program")
210
+ GL_FUNC_LOAD_6(ProgramLocalParameter4fARB,GLvoid, GLenum,GLuint,GLfloat,GLfloat,GLfloat,GLfloat, "GL_ARB_vertex_program")
211
+
212
+ #define PROGRAMPARAM_FUNC_V(_name_,_type_,_conv_,_extension_) \
213
+ static void (APIENTRY * fptr_gl##_name_)(GLenum,GLuint,const _type_ *); \
214
+ static VALUE \
215
+ gl_##_name_(obj,arg1,arg2,arg3) \
216
+ VALUE obj,arg1,arg2,arg3; \
217
+ { \
218
+ _type_ cary[4]; \
219
+ LOAD_GL_FUNC(gl##_name_, _extension_); \
220
+ _conv_(arg3,cary,4); \
221
+ fptr_gl##_name_(NUM2UINT(arg1),NUM2UINT(arg2),cary); \
222
+ CHECK_GLERROR_FROM("gl" #_name_); \
223
+ return Qnil; \
224
+ }
225
+
226
+ PROGRAMPARAM_FUNC_V(ProgramEnvParameter4dvARB,GLdouble,ary2cdbl,"GL_ARB_vertex_program")
227
+ PROGRAMPARAM_FUNC_V(ProgramEnvParameter4fvARB,GLfloat,ary2cflt,"GL_ARB_vertex_program")
228
+ PROGRAMPARAM_FUNC_V(ProgramLocalParameter4dvARB,GLdouble,ary2cdbl,"GL_ARB_vertex_program")
229
+ PROGRAMPARAM_FUNC_V(ProgramLocalParameter4fvARB,GLfloat,ary2cflt,"GL_ARB_vertex_program")
230
+ #undef PROGRAMPARAM_FUNC_V
231
+
232
+ #define GETPROGRAMPARAM_FUNC(_name_,_type_,_extension_) \
233
+ static void (APIENTRY * fptr_gl##_name_)(GLenum,GLuint,_type_ *); \
234
+ static VALUE \
235
+ gl_##_name_(obj,arg1,arg2) \
236
+ VALUE obj,arg1,arg2; \
237
+ { \
238
+ _type_ cary[4] = {(_type_)0.0,(_type_)0.0,(_type_)0.0,(_type_)0.0}; \
239
+ LOAD_GL_FUNC(gl##_name_, _extension_); \
240
+ fptr_gl##_name_(NUM2UINT(arg1),NUM2UINT(arg2),cary); \
241
+ RET_ARRAY_OR_SINGLE("gl" #_name_, 4, RETCONV_##_type_, cary); \
242
+ }
243
+
244
+ GETPROGRAMPARAM_FUNC(GetProgramEnvParameterdvARB,GLdouble,"GL_ARB_vertex_program")
245
+ GETPROGRAMPARAM_FUNC(GetProgramEnvParameterfvARB,GLfloat,"GL_ARB_vertex_program")
246
+ GETPROGRAMPARAM_FUNC(GetProgramLocalParameterdvARB,GLdouble,"GL_ARB_vertex_program")
247
+ GETPROGRAMPARAM_FUNC(GetProgramLocalParameterfvARB,GLfloat,"GL_ARB_vertex_program")
248
+
249
+ #undef GETPROGRAMPARAM_FUNC
250
+
251
+ GL_FUNC_LOAD_2(VertexAttrib1dARB,GLvoid, GLuint,GLdouble, "GL_ARB_vertex_program")
252
+ GL_FUNC_LOAD_2(VertexAttrib1fARB,GLvoid, GLuint,GLfloat, "GL_ARB_vertex_program")
253
+ GL_FUNC_LOAD_2(VertexAttrib1sARB,GLvoid, GLuint,GLshort, "GL_ARB_vertex_program")
254
+ GL_FUNC_LOAD_3(VertexAttrib2dARB,GLvoid, GLuint,GLdouble,GLdouble, "GL_ARB_vertex_program")
255
+ GL_FUNC_LOAD_3(VertexAttrib2fARB,GLvoid, GLuint,GLfloat,GLfloat, "GL_ARB_vertex_program")
256
+ GL_FUNC_LOAD_3(VertexAttrib2sARB,GLvoid, GLuint,GLshort,GLshort, "GL_ARB_vertex_program")
257
+ GL_FUNC_LOAD_4(VertexAttrib3dARB,GLvoid, GLuint,GLdouble,GLdouble,GLdouble, "GL_ARB_vertex_program")
258
+ GL_FUNC_LOAD_4(VertexAttrib3fARB,GLvoid, GLuint,GLfloat,GLfloat,GLfloat, "GL_ARB_vertex_program")
259
+ GL_FUNC_LOAD_4(VertexAttrib3sARB,GLvoid, GLuint,GLshort,GLshort,GLshort, "GL_ARB_vertex_program")
260
+ GL_FUNC_LOAD_5(VertexAttrib4dARB,GLvoid, GLuint,GLdouble,GLdouble,GLdouble,GLdouble, "GL_ARB_vertex_program")
261
+ GL_FUNC_LOAD_5(VertexAttrib4fARB,GLvoid, GLuint,GLfloat,GLfloat,GLfloat,GLfloat, "GL_ARB_vertex_program")
262
+ GL_FUNC_LOAD_5(VertexAttrib4sARB,GLvoid, GLuint,GLshort,GLshort,GLshort,GLshort, "GL_ARB_vertex_program")
263
+ GL_FUNC_LOAD_5(VertexAttrib4NubARB,GLvoid, GLuint,GLubyte,GLubyte,GLubyte,GLubyte, "GL_ARB_vertex_program")
264
+
265
+ #define VERTEXATTRIB_FUNC_V(_name_,_type_,_conv_,_size_,_extension_) \
266
+ static void (APIENTRY * fptr_gl##_name_)(GLuint,_type_ *); \
267
+ static VALUE \
268
+ gl_##_name_(obj,arg1,arg2) \
269
+ VALUE obj,arg1,arg2; \
270
+ { \
271
+ GLuint index; \
272
+ _type_ v[_size_]; \
273
+ LOAD_GL_FUNC(gl##_name_, _extension_); \
274
+ index = (GLuint)NUM2UINT(arg1); \
275
+ _conv_(arg2,v,_size_); \
276
+ fptr_gl##_name_(index,v); \
277
+ CHECK_GLERROR_FROM("gl" #_name_); \
278
+ return Qnil; \
279
+ }
280
+
281
+ VERTEXATTRIB_FUNC_V(VertexAttrib4NbvARB,GLbyte,ary2cbyte,4,"GL_ARB_vertex_program")
282
+ VERTEXATTRIB_FUNC_V(VertexAttrib4NivARB,GLint,ary2cint,4,"GL_ARB_vertex_program")
283
+ VERTEXATTRIB_FUNC_V(VertexAttrib4NsvARB,GLshort,ary2cshort,4,"GL_ARB_vertex_program")
284
+ VERTEXATTRIB_FUNC_V(VertexAttrib4NubvARB,GLubyte,ary2cubyte,4,"GL_ARB_vertex_program")
285
+ VERTEXATTRIB_FUNC_V(VertexAttrib4NuivARB,GLuint,ary2cuint,4,"GL_ARB_vertex_program")
286
+ VERTEXATTRIB_FUNC_V(VertexAttrib4NusvARB,GLushort,ary2cushort,4,"GL_ARB_vertex_program")
287
+ VERTEXATTRIB_FUNC_V(VertexAttrib4uivARB,GLuint,ary2cuint,4,"GL_ARB_vertex_program")
288
+ VERTEXATTRIB_FUNC_V(VertexAttrib4ubvARB,GLubyte,ary2cubyte,4,"GL_ARB_vertex_program")
289
+ VERTEXATTRIB_FUNC_V(VertexAttrib4usvARB,GLushort,ary2cushort,4,"GL_ARB_vertex_program")
290
+ VERTEXATTRIB_FUNC_V(VertexAttrib4bvARB,GLbyte,ary2cbyte,4,"GL_ARB_vertex_program")
291
+ VERTEXATTRIB_FUNC_V(VertexAttrib4ivARB,GLint,ary2cint,4,"GL_ARB_vertex_program")
292
+ VERTEXATTRIB_FUNC_V(VertexAttrib4dvARB,GLdouble,ary2cdbl,4,"GL_ARB_vertex_program")
293
+ VERTEXATTRIB_FUNC_V(VertexAttrib4fvARB,GLfloat,ary2cflt,4,"GL_ARB_vertex_program")
294
+ VERTEXATTRIB_FUNC_V(VertexAttrib4svARB,GLshort,ary2cshort,4,"GL_ARB_vertex_program")
295
+ VERTEXATTRIB_FUNC_V(VertexAttrib3dvARB,GLdouble,ary2cdbl,3,"GL_ARB_vertex_program")
296
+ VERTEXATTRIB_FUNC_V(VertexAttrib3fvARB,GLfloat,ary2cflt,3,"GL_ARB_vertex_program")
297
+ VERTEXATTRIB_FUNC_V(VertexAttrib3svARB,GLshort,ary2cshort,3,"GL_ARB_vertex_program")
298
+ VERTEXATTRIB_FUNC_V(VertexAttrib2dvARB,GLdouble,ary2cdbl,2,"GL_ARB_vertex_program")
299
+ VERTEXATTRIB_FUNC_V(VertexAttrib2fvARB,GLfloat,ary2cflt,2,"GL_ARB_vertex_program")
300
+ VERTEXATTRIB_FUNC_V(VertexAttrib2svARB,GLshort,ary2cshort,2,"GL_ARB_vertex_program")
301
+ VERTEXATTRIB_FUNC_V(VertexAttrib1dvARB,GLdouble,ary2cdbl,1,"GL_ARB_vertex_program")
302
+ VERTEXATTRIB_FUNC_V(VertexAttrib1fvARB,GLfloat,ary2cflt,1,"GL_ARB_vertex_program")
303
+ VERTEXATTRIB_FUNC_V(VertexAttrib1svARB,GLshort,ary2cshort,1,"GL_ARB_vertex_program")
304
+ #undef VERTEXATTRIB_FUNC_V
305
+
306
+ #define GETVERTEXATTRIB_FUNC(_name_,_type_,_extension_) \
307
+ static void (APIENTRY * fptr_gl##_name_)(GLuint,GLenum,_type_ *); \
308
+ static VALUE \
309
+ gl_##_name_(obj,arg1,arg2) \
310
+ VALUE obj,arg1,arg2; \
311
+ { \
312
+ GLuint index; \
313
+ GLenum pname; \
314
+ _type_ params[4] = {0,0,0,0}; \
315
+ GLint size; \
316
+ LOAD_GL_FUNC(gl##_name_, _extension_); \
317
+ index = (GLuint)NUM2UINT(arg1); \
318
+ pname = (GLenum)NUM2INT(arg2); \
319
+ if (pname==GL_CURRENT_VERTEX_ATTRIB_ARB) \
320
+ size = 4; \
321
+ else \
322
+ size = 1; \
323
+ fptr_gl##_name_(index,pname,params); \
324
+ RET_ARRAY_OR_SINGLE("gl" #_name_, size, RETCONV_##_type_, params); \
325
+ }
326
+
327
+ GETVERTEXATTRIB_FUNC(GetVertexAttribdvARB,GLdouble,"GL_ARB_vertex_program")
328
+ GETVERTEXATTRIB_FUNC(GetVertexAttribfvARB,GLfloat,"GL_ARB_vertex_program")
329
+ //GETVERTEXATTRIB_FUNC(GetVertexAttribivARB,GLint,INT2NUM,"GL_ARB_vertex_program")
330
+ #undef GETVERTEXATTRIB_FUNC
331
+
332
+ static void (APIENTRY * fptr_glGetVertexAttribivARB)(GLuint,GLenum,GLint *);
333
+ static VALUE
334
+ gl_GetVertexAttribivARB(obj,arg1,arg2)
335
+ VALUE obj,arg1,arg2;
336
+ {
337
+ GLuint index;
338
+ GLenum pname;
339
+ GLint params[4] = {0,0,0,0};
340
+ GLint size;
341
+ LOAD_GL_FUNC(glGetVertexAttribivARB, "GL_ARB_vertex_program");
342
+ index = (GLuint)NUM2UINT(arg1);
343
+ pname = (GLenum)NUM2INT(arg2);
344
+ if (pname==GL_CURRENT_VERTEX_ATTRIB)
345
+ size = 4;
346
+ else
347
+ size = 1;
348
+ fptr_glGetVertexAttribivARB(index,pname,params);
349
+ RET_ARRAY_OR_SINGLE_BOOL("glGetVertexAttribivARB", size, cond_GLBOOL2RUBY,
350
+ pname, params);
351
+ }
352
+
353
+
354
+ /* #29 GL_ARB_occlusion_query */
355
+ GL_FUNC_GENOBJECTS_LOAD(GenQueriesARB,"GL_ARB_occlusion_query")
356
+ GL_FUNC_DELETEOBJECTS_LOAD(DeleteQueriesARB,"GL_ARB_occlusion_query")
357
+ GL_FUNC_LOAD_1(IsQueryARB,GLboolean, GLuint, "GL_ARB_occlusion_query")
358
+ GL_FUNC_LOAD_2(BeginQueryARB,GLvoid, GLuint,GLuint, "GL_ARB_occlusion_query")
359
+ GL_FUNC_LOAD_1(EndQueryARB,GLvoid, GLenum, "GL_ARB_occlusion_query")
360
+
361
+ #define GETQUERY_FUNC(_name_,_type_,_conv_) \
362
+ static void (APIENTRY * fptr_gl##_name_)(GLuint,GLenum,_type_ *); \
363
+ static VALUE gl_##_name_(VALUE obj,VALUE arg1,VALUE arg2) \
364
+ { \
365
+ _type_ ret = 0; \
366
+ LOAD_GL_FUNC(gl##_name_, "GL_ARB_occlusion_query"); \
367
+ fptr_gl##_name_(NUM2INT(arg1),NUM2INT(arg2),&ret); \
368
+ CHECK_GLERROR_FROM("gl" #_name_); \
369
+ return _conv_(NUM2INT(arg2),ret); \
370
+ }
371
+
372
+ GETQUERY_FUNC(GetQueryivARB,GLint,cond_GLBOOL2RUBY)
373
+ GETQUERY_FUNC(GetQueryObjectivARB,GLint,cond_GLBOOL2RUBY)
374
+ GETQUERY_FUNC(GetQueryObjectuivARB,GLuint,cond_GLBOOL2RUBY_U)
375
+ #undef GETQUERY_FUNC
376
+
377
+ /* #30 GL_ARB_shader_objects */
378
+ GL_FUNC_LOAD_1(DeleteObjectARB,GLvoid, GLuint, "GL_ARB_shader_objects")
379
+ GL_FUNC_LOAD_2(DetachObjectARB,GLvoid, GLuint,GLuint, "GL_ARB_shader_objects")
380
+ GL_FUNC_LOAD_1(CompileShaderARB,GLvoid, GLuint, "GL_ARB_shader_objects")
381
+ GL_FUNC_LOAD_2(AttachObjectARB,GLvoid, GLuint,GLuint, "GL_ARB_shader_objects")
382
+ GL_FUNC_LOAD_1(LinkProgramARB,GLvoid, GLuint, "GL_ARB_shader_objects")
383
+ GL_FUNC_LOAD_1(UseProgramObjectARB,GLvoid, GLuint, "GL_ARB_shader_objects")
384
+ GL_FUNC_LOAD_1(ValidateProgramARB,GLvoid, GLuint, "GL_ARB_shader_objects")
385
+ GL_FUNC_LOAD_1(GetHandleARB,GLuint, GLenum, "GL_ARB_shader_objects")
386
+ GL_FUNC_LOAD_1(CreateShaderObjectARB,GLuint, GLenum, "GL_ARB_shader_objects")
387
+ GL_FUNC_LOAD_0(CreateProgramObjectARB,GLuint, "GL_ARB_shader_objects")
388
+
389
+ static void (APIENTRY * fptr_glShaderSourceARB)(GLuint,GLsizei,GLchar**,GLint *);
390
+ static VALUE
391
+ gl_ShaderSourceARB(obj,arg1,arg2)
392
+ VALUE obj,arg1,arg2;
393
+ {
394
+ GLuint shader;
395
+ GLint length;
396
+ GLchar *str;
397
+ LOAD_GL_FUNC(glShaderSourceARB, "GL_ARB_shader_objects");
398
+ shader = (GLuint)NUM2UINT(arg1);
399
+ Check_Type(arg2,T_STRING);
400
+ str = RSTRING_PTR(arg2);
401
+ length = (GLint)RSTRING_LENINT(arg2);
402
+ fptr_glShaderSourceARB(shader,1,&str,&length);
403
+ CHECK_GLERROR_FROM("glShaderSourceARB");
404
+ return Qnil;
405
+ }
406
+
407
+ GL_FUNC_LOAD_2(Uniform1fARB,GLvoid, GLint,GLfloat, "GL_ARB_shader_objects")
408
+ GL_FUNC_LOAD_3(Uniform2fARB,GLvoid, GLint,GLfloat,GLfloat, "GL_ARB_shader_objects")
409
+ GL_FUNC_LOAD_4(Uniform3fARB,GLvoid, GLint,GLfloat,GLfloat,GLfloat, "GL_ARB_shader_objects")
410
+ GL_FUNC_LOAD_5(Uniform4fARB,GLvoid, GLint,GLfloat,GLfloat,GLfloat,GLfloat, "GL_ARB_shader_objects")
411
+ GL_FUNC_LOAD_2(Uniform1iARB,GLvoid, GLint,GLint, "GL_ARB_shader_objects")
412
+ GL_FUNC_LOAD_3(Uniform2iARB,GLvoid, GLint,GLint,GLint, "GL_ARB_shader_objects")
413
+ GL_FUNC_LOAD_4(Uniform3iARB,GLvoid, GLint,GLint,GLint,GLint, "GL_ARB_shader_objects")
414
+ GL_FUNC_LOAD_5(Uniform4iARB,GLvoid, GLint,GLint,GLint,GLint,GLint, "GL_ARB_shader_objects")
415
+
416
+ #define GLUNIFORM_VFUNC(_name_,_type_,_conv_,_size_) \
417
+ static void (APIENTRY * fptr_gl##_name_)(GLint,GLsizei,const _type_ *); \
418
+ static VALUE \
419
+ gl_##_name_(obj,arg1,arg2) \
420
+ VALUE obj,arg1,arg2; \
421
+ { \
422
+ GLint location; \
423
+ GLsizei count; \
424
+ _type_ *value; \
425
+ LOAD_GL_FUNC(gl##_name_, "GL_ARB_shader_objects"); \
426
+ Check_Type(arg2,T_ARRAY); \
427
+ count = (GLsizei)RARRAY_LENINT(arg2); \
428
+ if (count<=0 || (count % _size_) != 0) \
429
+ rb_raise(rb_eArgError, "Parameter array size must be multiplication of %i",_size_); \
430
+ location = (GLint)NUM2INT(arg1); \
431
+ value = ALLOC_N(_type_,count); \
432
+ _conv_(arg2,value,count); \
433
+ fptr_gl##_name_(location,count / _size_,value); \
434
+ xfree(value); \
435
+ CHECK_GLERROR_FROM("gl" #_name_); \
436
+ return Qnil; \
437
+ }
438
+
439
+ GLUNIFORM_VFUNC(Uniform1fvARB,GLfloat,ary2cflt,1)
440
+ GLUNIFORM_VFUNC(Uniform2fvARB,GLfloat,ary2cflt,2)
441
+ GLUNIFORM_VFUNC(Uniform3fvARB,GLfloat,ary2cflt,3)
442
+ GLUNIFORM_VFUNC(Uniform4fvARB,GLfloat,ary2cflt,4)
443
+ GLUNIFORM_VFUNC(Uniform1ivARB,GLint,ary2cint,1)
444
+ GLUNIFORM_VFUNC(Uniform2ivARB,GLint,ary2cint,2)
445
+ GLUNIFORM_VFUNC(Uniform3ivARB,GLint,ary2cint,3)
446
+ GLUNIFORM_VFUNC(Uniform4ivARB,GLint,ary2cint,4)
447
+ #undef GLUNIFORM_VFUNC
448
+
449
+ #define UNIFORMMATRIX_FUNC(_name_,_size_) \
450
+ static void (APIENTRY * fptr_gl##_name_)(GLint,GLsizei,GLboolean,GLfloat *); \
451
+ static VALUE \
452
+ gl_##_name_(obj,arg1,arg2,arg3) \
453
+ VALUE obj,arg1,arg2,arg3; \
454
+ { \
455
+ GLint location; \
456
+ GLsizei count; \
457
+ GLboolean transpose; \
458
+ GLfloat *value; \
459
+ LOAD_GL_FUNC(gl##_name_, "GL_ARB_shader_objects"); \
460
+ location = (GLint)NUM2INT(arg1); \
461
+ count = (GLsizei)RARRAY_LENINT(rb_funcall(rb_Array(arg3),rb_intern("flatten"),0)); \
462
+ transpose = (GLboolean)RUBYBOOL2GL(arg2); \
463
+ value = ALLOC_N(GLfloat, count); \
464
+ ary2cmatfloatcount(arg3,value,_size_,_size_); \
465
+ fptr_gl##_name_(location,count / (_size_*_size_),transpose,value); \
466
+ xfree(value); \
467
+ CHECK_GLERROR_FROM("gl" #_name_); \
468
+ return Qnil; \
469
+ }
470
+
471
+ UNIFORMMATRIX_FUNC(UniformMatrix2fvARB,2)
472
+ UNIFORMMATRIX_FUNC(UniformMatrix3fvARB,3)
473
+ UNIFORMMATRIX_FUNC(UniformMatrix4fvARB,4)
474
+ #undef UNIFORMMATRIX_FUNC
475
+
476
+ #define GETOBJECTPARAMETER_FUNC(_name_,_type_,_conv_) \
477
+ static void (APIENTRY * fptr_gl##_name_)(GLuint,GLenum,_type_ *); \
478
+ static VALUE \
479
+ gl_##_name_(obj,arg1,arg2) \
480
+ VALUE obj,arg1,arg2; \
481
+ { \
482
+ GLuint program; \
483
+ GLenum pname; \
484
+ _type_ params = 0; \
485
+ LOAD_GL_FUNC(gl##_name_, "GL_ARB_shader_objects"); \
486
+ program = (GLuint)NUM2UINT(arg1); \
487
+ pname = (GLenum)NUM2INT(arg2); \
488
+ fptr_gl##_name_(program,pname,&params); \
489
+ CHECK_GLERROR_FROM("gl" #_name_); \
490
+ return _conv_(pname,params); \
491
+ }
492
+
493
+ GETOBJECTPARAMETER_FUNC(GetObjectParameterivARB,GLint,cond_GLBOOL2RUBY)
494
+ GETOBJECTPARAMETER_FUNC(GetObjectParameterfvARB,GLfloat,cond_GLBOOL2RUBY_F)
495
+
496
+ #undef GETOBJECTPARAMETER_FUNC
497
+
498
+ static void (APIENTRY * fptr_glGetInfoLogARB)(GLuint,GLsizei,GLsizei *,GLchar *);
499
+ static VALUE
500
+ gl_GetInfoLogARB(obj,arg1)
501
+ VALUE obj,arg1;
502
+ {
503
+ GLuint program;
504
+ GLint max_size = 0;
505
+ GLsizei ret_length = 0;
506
+ VALUE buffer;
507
+ LOAD_GL_FUNC(glGetInfoLogARB, "GL_ARB_shader_objects");
508
+ LOAD_GL_FUNC(glGetObjectParameterivARB, "GL_ARB_shader_objects");
509
+ program = (GLuint)NUM2UINT(arg1);
510
+ fptr_glGetObjectParameterivARB(program,GL_OBJECT_INFO_LOG_LENGTH_ARB,&max_size);
511
+ CHECK_GLERROR_FROM("glGetObjectParameterivARB");
512
+ if (max_size<=0)
513
+ return rb_str_new2("");
514
+ buffer = allocate_buffer_with_string(max_size);
515
+ fptr_glGetInfoLogARB(program,max_size,&ret_length,RSTRING_PTR(buffer));
516
+ CHECK_GLERROR_FROM("glGetInfoLogARB");
517
+ return buffer;
518
+ }
519
+
520
+ static void (APIENTRY * fptr_glGetShaderSourceARB)(GLuint,GLsizei,GLsizei *,GLchar *);
521
+ static VALUE
522
+ gl_GetShaderSourceARB(obj,arg1)
523
+ VALUE obj,arg1;
524
+ {
525
+ GLuint shader;
526
+ GLint max_size = 0;
527
+ GLsizei ret_length = 0;
528
+ VALUE buffer;
529
+ LOAD_GL_FUNC(glGetShaderSourceARB, "GL_ARB_shader_objects");
530
+ LOAD_GL_FUNC(glGetObjectParameterivARB, "GL_ARB_shader_objects");
531
+ shader = (GLuint)NUM2UINT(arg1);
532
+ fptr_glGetObjectParameterivARB(shader,GL_OBJECT_SHADER_SOURCE_LENGTH_ARB,&max_size);
533
+ CHECK_GLERROR_FROM("glGetObjectParameterivARB");
534
+ if (max_size==0)
535
+ rb_raise(rb_eTypeError, "Can't determine maximum shader source length");
536
+ buffer = allocate_buffer_with_string(max_size-1);
537
+ fptr_glGetShaderSourceARB(shader,max_size,&ret_length,RSTRING_PTR(buffer));
538
+ CHECK_GLERROR_FROM("glGetShaderSourceARB");
539
+ return buffer;
540
+ }
541
+
542
+ static void (APIENTRY * fptr_glGetActiveUniformARB)(GLuint,GLuint,GLsizei,GLsizei*,GLint*,GLenum*,GLchar*);
543
+ static VALUE
544
+ gl_GetActiveUniformARB(obj,arg1,arg2)
545
+ VALUE obj,arg1,arg2;
546
+ {
547
+ GLuint program;
548
+ GLuint index;
549
+ GLsizei max_size = 0;
550
+ GLsizei written = 0;
551
+ GLint uniform_size = 0;
552
+ GLenum uniform_type = 0;
553
+ VALUE buffer;
554
+ VALUE retary;
555
+ LOAD_GL_FUNC(glGetActiveUniformARB, "GL_ARB_shader_objects");
556
+ LOAD_GL_FUNC(glGetObjectParameterivARB, "GL_ARB_shader_objects");
557
+ program = (GLuint)NUM2UINT(arg1);
558
+ index = (GLuint)NUM2UINT(arg2);
559
+ fptr_glGetObjectParameterivARB(program,GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB,&max_size);
560
+ CHECK_GLERROR_FROM("glGetObjectParameterivARB");
561
+ /* Can't determine maximum uniform name length, so presume it */
562
+ if (max_size==0) max_size = 256;
563
+ buffer = allocate_buffer_with_string(max_size-1);
564
+
565
+ fptr_glGetActiveUniformARB(program,index,max_size,&written,&uniform_size,&uniform_type,RSTRING_PTR(buffer));
566
+
567
+ rb_str_set_len(buffer, written);
568
+ retary = rb_ary_new2(3);
569
+ rb_ary_push(retary, INT2NUM(uniform_size));
570
+ rb_ary_push(retary, INT2NUM(uniform_type));
571
+ rb_ary_push(retary, buffer);
572
+ CHECK_GLERROR_FROM("glGetACtiveUniformARB");
573
+ return retary;
574
+ }
575
+
576
+ #define GETUNIFORM_FUNC(_name_,_type_) \
577
+ static void (APIENTRY * fptr_gl##_name_)(GLuint,GLint,_type_ *); \
578
+ static VALUE \
579
+ gl_##_name_(obj,arg1,arg2) \
580
+ VALUE obj,arg1,arg2; \
581
+ { \
582
+ GLuint program; \
583
+ GLint location; \
584
+ _type_ params[16]; \
585
+ GLint unused = 0; \
586
+ GLenum uniform_type = 0; \
587
+ GLint uniform_size = 0; \
588
+ \
589
+ LOAD_GL_FUNC(gl##_name_, "GL_ARB_shader_objects"); \
590
+ LOAD_GL_FUNC(glGetActiveUniformARB, "GL_ARB_shader_objects"); \
591
+ program = (GLuint)NUM2UINT(arg1); \
592
+ location = (GLint)NUM2INT(arg2); \
593
+ \
594
+ fptr_glGetActiveUniformARB(program,location,0,NULL,&unused,&uniform_type,NULL); \
595
+ CHECK_GLERROR_FROM("glGetActiveUniformARB"); \
596
+ if (uniform_type==0) \
597
+ rb_raise(rb_eTypeError, "Can't determine the uniform's type"); \
598
+ \
599
+ uniform_size = get_uniform_size(uniform_type); \
600
+ \
601
+ memset(params,0,16*sizeof(_type_)); \
602
+ fptr_gl##_name_(program,location,params); \
603
+ CHECK_GLERROR_FROM("gl" #_name_); \
604
+ RET_ARRAY_OR_SINGLE("gl" #_name_, uniform_size, RETCONV_##_type_, params); \
605
+ }
606
+
607
+ GETUNIFORM_FUNC(GetUniformfvARB,GLfloat)
608
+ GETUNIFORM_FUNC(GetUniformivARB,GLint)
609
+ #undef GETUNIFORM_FUNC
610
+
611
+ static GLint (APIENTRY * fptr_glGetUniformLocationARB)(GLuint,const GLchar*);
612
+ static VALUE
613
+ gl_GetUniformLocationARB(obj,arg1,arg2)
614
+ VALUE obj,arg1,arg2;
615
+ {
616
+ GLuint program;
617
+ GLint ret;
618
+ LOAD_GL_FUNC(glGetUniformLocationARB, "GL_ARB_shader_objects");
619
+ program=(GLuint)NUM2UINT(arg1);
620
+ Check_Type(arg2,T_STRING);
621
+ ret = fptr_glGetUniformLocationARB(program,RSTRING_PTR(arg2));
622
+ CHECK_GLERROR_FROM("glGetUniformLocationARB");
623
+ return INT2NUM(ret);
624
+ }
625
+
626
+ static void (APIENTRY * fptr_glGetAttachedObjectsARB)(GLuint,GLsizei,GLsizei *,GLuint *);
627
+ static VALUE
628
+ gl_GetAttachedObjectsARB(obj,arg1)
629
+ VALUE obj,arg1;
630
+ {
631
+ GLuint program;
632
+ GLint shaders_num = 0;
633
+ GLuint *shaders;
634
+ GLsizei count = 0;
635
+ LOAD_GL_FUNC(glGetAttachedObjectsARB, "GL_ARB_shader_objects");
636
+ LOAD_GL_FUNC(glGetObjectParameterivARB, "GL_ARB_shader_objects");
637
+ program = (GLuint)NUM2UINT(arg1);
638
+ fptr_glGetObjectParameterivARB(program,GL_OBJECT_ATTACHED_OBJECTS_ARB,&shaders_num);
639
+ CHECK_GLERROR_FROM("glGetObjectParameterivARB");
640
+ if (shaders_num<=0)
641
+ return Qnil;
642
+ shaders = ALLOC_N(GLuint,shaders_num);
643
+ fptr_glGetAttachedObjectsARB(program,shaders_num,&count,shaders);
644
+ RET_ARRAY_OR_SINGLE_FREE("glGetAttachedObjectsARB", count, RETCONV_GLuint,
645
+ shaders);
646
+ }
647
+
648
+ /* #31 GL_ARB_vertex_shader */
649
+
650
+ static void (APIENTRY * fptr_glBindAttribLocationARB)(GLuint,GLuint,GLchar *);
651
+ static VALUE
652
+ gl_BindAttribLocationARB(obj,arg1,arg2,arg3)
653
+ VALUE obj,arg1,arg2,arg3;
654
+ {
655
+ GLuint program;
656
+ GLuint index;
657
+ LOAD_GL_FUNC(glBindAttribLocationARB, "GL_ARB_vertex_shader");
658
+ program = (GLuint)NUM2UINT(arg1);
659
+ index = (GLuint)NUM2UINT(arg2);
660
+ Check_Type(arg3, T_STRING);
661
+ fptr_glBindAttribLocationARB(program,index,RSTRING_PTR(arg3));
662
+ CHECK_GLERROR_FROM("glBindAttribLocationARB");
663
+ return Qnil;
664
+ }
665
+
666
+ static void (APIENTRY * fptr_glGetActiveAttribARB)(GLuint,GLuint,GLsizei,GLsizei *,GLint *,GLenum *,GLchar *);
667
+ static VALUE
668
+ gl_GetActiveAttribARB(obj,arg1,arg2)
669
+ VALUE obj,arg1,arg2;
670
+ {
671
+ GLuint program;
672
+ GLuint index;
673
+ GLsizei max_size = 0;
674
+ GLsizei written = 0;
675
+ GLint attrib_size = 0;
676
+ GLenum attrib_type = 0;
677
+ VALUE buffer;
678
+ VALUE retary;
679
+ LOAD_GL_FUNC(glGetActiveAttribARB, "GL_ARB_vertex_shader");
680
+ LOAD_GL_FUNC(glGetObjectParameterivARB, "GL_ARB_vertex_shader");
681
+ program = (GLuint)NUM2UINT(arg1);
682
+ index = (GLuint)NUM2UINT(arg2);
683
+ fptr_glGetObjectParameterivARB(program,GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB,&max_size);
684
+ CHECK_GLERROR_FROM("glGetObjectParameterivARB");
685
+ /* Can't determine maximum attribute name length, so presume it */
686
+ if (max_size==0) max_size = 256;
687
+ buffer = allocate_buffer_with_string(max_size-1);
688
+
689
+ fptr_glGetActiveAttribARB(program,index,max_size,&written,&attrib_size,&attrib_type,RSTRING_PTR(buffer));
690
+
691
+ rb_str_set_len(buffer, written);
692
+ retary = rb_ary_new2(3);
693
+ rb_ary_push(retary, INT2NUM(attrib_size));
694
+ rb_ary_push(retary, INT2NUM(attrib_type));
695
+ rb_ary_push(retary, buffer);
696
+ CHECK_GLERROR_FROM("glGetActiveAttribARB");
697
+ return retary;
698
+ }
699
+
700
+ static GLint (APIENTRY * fptr_glGetAttribLocationARB)(GLuint,const GLchar*);
701
+ static VALUE
702
+ gl_GetAttribLocationARB(obj,arg1,arg2)
703
+ VALUE obj,arg1,arg2;
704
+ {
705
+ GLuint program;
706
+ GLint ret;
707
+ LOAD_GL_FUNC(glGetAttribLocationARB, "GL_ARB_shader_objects");
708
+ program=(GLuint)NUM2UINT(arg1);
709
+ Check_Type(arg2,T_STRING);
710
+ ret = fptr_glGetAttribLocationARB(program,RSTRING_PTR(arg2));
711
+ CHECK_GLERROR_FROM("glGetAttribLocationARB");
712
+ return INT2NUM(ret);
713
+ }
714
+
715
+
716
+ /* #39 GL_ARB_color_buffer_float */
717
+ GL_FUNC_LOAD_2(ClampColorARB,GLvoid, GLenum,GLenum, "GL_ARB_color_buffer_float")
718
+
719
+ void gl_init_functions_ext_arb(VALUE module)
720
+ {
721
+ /* #3 GL_ARB_transpose_matrix */
722
+ rb_define_module_function(module, "glLoadTransposeMatrixfARB", gl_LoadTransposeMatrixfARB, 1);
723
+ rb_define_module_function(module, "glLoadTransposeMatrixdARB", gl_LoadTransposeMatrixdARB, 1);
724
+ rb_define_module_function(module, "glMultTransposeMatrixfARB", gl_MultTransposeMatrixfARB, 1);
725
+ rb_define_module_function(module, "glMultTransposeMatrixdARB", gl_MultTransposeMatrixdARB, 1);
726
+
727
+ /* #5 GL_ARB_multisample */
728
+ rb_define_module_function(module, "glSampleCoverageARB", gl_SampleCoverageARB, 2);
729
+
730
+ /* #14 GL_ARB_point_parameters */
731
+ rb_define_module_function(module, "glPointParameterfARB", gl_PointParameterfARB, 2);
732
+ rb_define_module_function(module, "glPointParameterfvARB", gl_PointParameterfvARB, 2);
733
+
734
+ /* #26 GL_ARB_window_pos */
735
+ rb_define_module_function(module, "glWindowPos2dARB", gl_WindowPos2dARB, 2);
736
+ rb_define_module_function(module, "glWindowPos2fARB", gl_WindowPos2fARB, 2);
737
+ rb_define_module_function(module, "glWindowPos2iARB", gl_WindowPos2iARB, 2);
738
+ rb_define_module_function(module, "glWindowPos2sARB", gl_WindowPos2sARB, 2);
739
+ rb_define_module_function(module, "glWindowPos3dARB", gl_WindowPos3dARB, 3);
740
+ rb_define_module_function(module, "glWindowPos3fARB", gl_WindowPos3fARB, 3);
741
+ rb_define_module_function(module, "glWindowPos3iARB", gl_WindowPos3iARB, 3);
742
+ rb_define_module_function(module, "glWindowPos3sARB", gl_WindowPos3sARB, 3);
743
+
744
+ rb_define_module_function(module, "glWindowPos2dvARB", gl_WindowPos2dvARB, 1);
745
+ rb_define_module_function(module, "glWindowPos2fvARB", gl_WindowPos2fvARB, 1);
746
+ rb_define_module_function(module, "glWindowPos2ivARB", gl_WindowPos2ivARB, 1);
747
+ rb_define_module_function(module, "glWindowPos2svARB", gl_WindowPos2svARB, 1);
748
+ rb_define_module_function(module, "glWindowPos3dvARB", gl_WindowPos3dvARB, 1);
749
+ rb_define_module_function(module, "glWindowPos3fvARB", gl_WindowPos3fvARB, 1);
750
+ rb_define_module_function(module, "glWindowPos3ivARB", gl_WindowPos3ivARB, 1);
751
+ rb_define_module_function(module, "glWindowPos3svARB", gl_WindowPos3svARB, 1);
752
+
753
+ /* #26 GL_ARB_vertex_program */
754
+ rb_define_module_function(module, "glProgramStringARB", gl_ProgramStringARB, 3);
755
+ rb_define_module_function(module, "glGetProgramStringARB", gl_GetProgramStringARB, 2);
756
+ rb_define_module_function(module, "glGetProgramivARB", gl_GetProgramivARB, 2);
757
+ rb_define_module_function(module, "glBindProgramARB", gl_BindProgramARB, 2);
758
+ rb_define_module_function(module, "glGenProgramsARB", gl_GenProgramsARB, 1);
759
+ rb_define_module_function(module, "glDeleteProgramsARB", gl_DeleteProgramsARB, 1);
760
+ rb_define_module_function(module, "glIsProgramARB", gl_IsProgramARB, 1);
761
+ rb_define_module_function(module, "glEnableVertexAttribArrayARB", gl_EnableVertexAttribArrayARB, 1);
762
+ rb_define_module_function(module, "glDisableVertexAttribArrayARB", gl_DisableVertexAttribArrayARB, 1);
763
+ rb_define_module_function(module, "glVertexAttribPointerARB", gl_VertexAttribPointerARB, 6);
764
+ rb_define_module_function(module, "glGetVertexAttribPointervARB", gl_GetVertexAttribPointervARB, 1);
765
+ rb_define_module_function(module, "glProgramEnvParameter4dARB", gl_ProgramEnvParameter4dARB, 6);
766
+ rb_define_module_function(module, "glProgramEnvParameter4fARB", gl_ProgramEnvParameter4fARB, 6);
767
+ rb_define_module_function(module, "glProgramLocalParameter4dARB", gl_ProgramLocalParameter4dARB, 6);
768
+ rb_define_module_function(module, "glProgramLocalParameter4fARB", gl_ProgramLocalParameter4fARB, 6);
769
+ rb_define_module_function(module, "glProgramEnvParameter4dvARB", gl_ProgramEnvParameter4dvARB, 3);
770
+ rb_define_module_function(module, "glProgramEnvParameter4fvARB", gl_ProgramEnvParameter4fvARB, 3);
771
+ rb_define_module_function(module, "glProgramLocalParameter4dvARB", gl_ProgramLocalParameter4dvARB, 3);
772
+ rb_define_module_function(module, "glProgramLocalParameter4fvARB", gl_ProgramLocalParameter4fvARB, 3);
773
+ rb_define_module_function(module, "glGetProgramEnvParameterdvARB", gl_GetProgramEnvParameterdvARB, 2);
774
+ rb_define_module_function(module, "glGetProgramEnvParameterfvARB", gl_GetProgramEnvParameterfvARB, 2);
775
+ rb_define_module_function(module, "glGetProgramLocalParameterdvARB", gl_GetProgramLocalParameterdvARB, 2);
776
+ rb_define_module_function(module, "glGetProgramLocalParameterfvARB", gl_GetProgramLocalParameterfvARB, 2);
777
+ rb_define_module_function(module, "glVertexAttrib1dARB", gl_VertexAttrib1dARB, 2);
778
+ rb_define_module_function(module, "glVertexAttrib1fARB", gl_VertexAttrib1fARB, 2);
779
+ rb_define_module_function(module, "glVertexAttrib1sARB", gl_VertexAttrib1sARB, 2);
780
+ rb_define_module_function(module, "glVertexAttrib2dARB", gl_VertexAttrib2dARB, 3);
781
+ rb_define_module_function(module, "glVertexAttrib2fARB", gl_VertexAttrib2fARB, 3);
782
+ rb_define_module_function(module, "glVertexAttrib2sARB", gl_VertexAttrib2sARB, 3);
783
+ rb_define_module_function(module, "glVertexAttrib3dARB", gl_VertexAttrib3dARB, 4);
784
+ rb_define_module_function(module, "glVertexAttrib3fARB", gl_VertexAttrib3fARB, 4);
785
+ rb_define_module_function(module, "glVertexAttrib3sARB", gl_VertexAttrib3sARB, 4);
786
+ rb_define_module_function(module, "glVertexAttrib4NbvARB", gl_VertexAttrib4NbvARB, 2);
787
+ rb_define_module_function(module, "glVertexAttrib4NivARB", gl_VertexAttrib4NivARB, 2);
788
+ rb_define_module_function(module, "glVertexAttrib4NsvARB", gl_VertexAttrib4NsvARB, 2);
789
+ rb_define_module_function(module, "glVertexAttrib4NubARB", gl_VertexAttrib4NubARB, 5);
790
+ rb_define_module_function(module, "glVertexAttrib4NubvARB", gl_VertexAttrib4NubvARB, 2);
791
+ rb_define_module_function(module, "glVertexAttrib4NuivARB", gl_VertexAttrib4NuivARB, 2);
792
+ rb_define_module_function(module, "glVertexAttrib4NusvARB", gl_VertexAttrib4NusvARB, 2);
793
+ rb_define_module_function(module, "glVertexAttrib4bvARB", gl_VertexAttrib4bvARB, 2);
794
+ rb_define_module_function(module, "glVertexAttrib4dARB", gl_VertexAttrib4dARB, 5);
795
+ rb_define_module_function(module, "glVertexAttrib4fARB", gl_VertexAttrib4fARB, 5);
796
+ rb_define_module_function(module, "glVertexAttrib4ivARB", gl_VertexAttrib4ivARB, 2);
797
+ rb_define_module_function(module, "glVertexAttrib4sARB", gl_VertexAttrib4sARB, 5);
798
+ rb_define_module_function(module, "glVertexAttrib4ubvARB", gl_VertexAttrib4ubvARB, 2);
799
+ rb_define_module_function(module, "glVertexAttrib4uivARB", gl_VertexAttrib4uivARB, 2);
800
+ rb_define_module_function(module, "glVertexAttrib4usvARB", gl_VertexAttrib4usvARB, 2);
801
+ rb_define_module_function(module, "glVertexAttrib1dvARB", gl_VertexAttrib1dvARB, 2);
802
+ rb_define_module_function(module, "glVertexAttrib1fvARB", gl_VertexAttrib1fvARB, 2);
803
+ rb_define_module_function(module, "glVertexAttrib1svARB", gl_VertexAttrib1svARB, 2);
804
+ rb_define_module_function(module, "glVertexAttrib2dvARB", gl_VertexAttrib2dvARB, 2);
805
+ rb_define_module_function(module, "glVertexAttrib2fvARB", gl_VertexAttrib2fvARB, 2);
806
+ rb_define_module_function(module, "glVertexAttrib2svARB", gl_VertexAttrib2svARB, 2);
807
+ rb_define_module_function(module, "glVertexAttrib3dvARB", gl_VertexAttrib3dvARB, 2);
808
+ rb_define_module_function(module, "glVertexAttrib3fvARB", gl_VertexAttrib3fvARB, 2);
809
+ rb_define_module_function(module, "glVertexAttrib3svARB", gl_VertexAttrib3svARB, 2);
810
+ rb_define_module_function(module, "glVertexAttrib4dvARB", gl_VertexAttrib4dvARB, 2);
811
+ rb_define_module_function(module, "glVertexAttrib4fvARB", gl_VertexAttrib4fvARB, 2);
812
+ rb_define_module_function(module, "glVertexAttrib4svARB", gl_VertexAttrib4svARB, 2);
813
+ rb_define_module_function(module, "glGetVertexAttribdvARB", gl_GetVertexAttribdvARB, 2);
814
+ rb_define_module_function(module, "glGetVertexAttribfvARB", gl_GetVertexAttribfvARB, 2);
815
+ rb_define_module_function(module, "glGetVertexAttribivARB", gl_GetVertexAttribivARB, 2);
816
+
817
+ /* #29 GL_ARB_occlusion_query */
818
+ rb_define_module_function(module, "glGenQueriesARB", gl_GenQueriesARB, 1);
819
+ rb_define_module_function(module, "glDeleteQueriesARB", gl_DeleteQueriesARB, 1);
820
+ rb_define_module_function(module, "glIsQueryARB", gl_IsQueryARB, 1);
821
+ rb_define_module_function(module, "glBeginQueryARB", gl_BeginQueryARB, 2);
822
+ rb_define_module_function(module, "glEndQueryARB", gl_EndQueryARB, 1);
823
+ rb_define_module_function(module, "glGetQueryivARB", gl_GetQueryivARB, 2);
824
+ rb_define_module_function(module, "glGetQueryObjectivARB", gl_GetQueryObjectivARB, 2);
825
+ rb_define_module_function(module, "glGetQueryObjectuivARB", gl_GetQueryObjectuivARB, 2);
826
+
827
+ /* #30 GL_ARB_shader_objects */
828
+ rb_define_module_function(module, "glDeleteObjectARB", gl_DeleteObjectARB, 1);
829
+ rb_define_module_function(module, "glGetHandleARB", gl_GetHandleARB, 1);
830
+ rb_define_module_function(module, "glDetachObjectARB", gl_DetachObjectARB, 2);
831
+ rb_define_module_function(module, "glCreateShaderObjectARB", gl_CreateShaderObjectARB, 1);
832
+ rb_define_module_function(module, "glShaderSourceARB", gl_ShaderSourceARB, 2);
833
+ rb_define_module_function(module, "glCompileShaderARB", gl_CompileShaderARB, 1);
834
+ rb_define_module_function(module, "glCreateProgramObjectARB", gl_CreateProgramObjectARB, 0);
835
+ rb_define_module_function(module, "glAttachObjectARB", gl_AttachObjectARB, 2);
836
+ rb_define_module_function(module, "glLinkProgramARB", gl_LinkProgramARB, 1);
837
+ rb_define_module_function(module, "glUseProgramObjectARB", gl_UseProgramObjectARB, 1);
838
+ rb_define_module_function(module, "glValidateProgramARB", gl_ValidateProgramARB, 1);
839
+ rb_define_module_function(module, "glUniform1fARB", gl_Uniform1fARB, 2);
840
+ rb_define_module_function(module, "glUniform2fARB", gl_Uniform2fARB, 3);
841
+ rb_define_module_function(module, "glUniform3fARB", gl_Uniform3fARB, 4);
842
+ rb_define_module_function(module, "glUniform4fARB", gl_Uniform4fARB, 5);
843
+ rb_define_module_function(module, "glUniform1iARB", gl_Uniform1iARB, 2);
844
+ rb_define_module_function(module, "glUniform2iARB", gl_Uniform2iARB, 3);
845
+ rb_define_module_function(module, "glUniform3iARB", gl_Uniform3iARB, 4);
846
+ rb_define_module_function(module, "glUniform4iARB", gl_Uniform4iARB, 5);
847
+ rb_define_module_function(module, "glUniform1fvARB", gl_Uniform1fvARB, 2);
848
+ rb_define_module_function(module, "glUniform2fvARB", gl_Uniform2fvARB, 2);
849
+ rb_define_module_function(module, "glUniform3fvARB", gl_Uniform3fvARB, 2);
850
+ rb_define_module_function(module, "glUniform4fvARB", gl_Uniform4fvARB, 2);
851
+ rb_define_module_function(module, "glUniform1ivARB", gl_Uniform1ivARB, 2);
852
+ rb_define_module_function(module, "glUniform2ivARB", gl_Uniform2ivARB, 2);
853
+ rb_define_module_function(module, "glUniform3ivARB", gl_Uniform3ivARB, 2);
854
+ rb_define_module_function(module, "glUniform4ivARB", gl_Uniform4ivARB, 2);
855
+ rb_define_module_function(module, "glUniformMatrix2fvARB", gl_UniformMatrix2fvARB, 3);
856
+ rb_define_module_function(module, "glUniformMatrix3fvARB", gl_UniformMatrix3fvARB, 3);
857
+ rb_define_module_function(module, "glUniformMatrix4fvARB", gl_UniformMatrix4fvARB, 3);
858
+ rb_define_module_function(module, "glGetObjectParameterfvARB", gl_GetObjectParameterfvARB, 2);
859
+ rb_define_module_function(module, "glGetObjectParameterivARB", gl_GetObjectParameterivARB, 2);
860
+ rb_define_module_function(module, "glGetInfoLogARB", gl_GetInfoLogARB, 1);
861
+ rb_define_module_function(module, "glGetShaderSourceARB", gl_GetShaderSourceARB, 1);
862
+ rb_define_module_function(module, "glGetAttachedObjectsARB", gl_GetAttachedObjectsARB, 1);
863
+ rb_define_module_function(module, "glGetUniformLocationARB", gl_GetUniformLocationARB, 2);
864
+ rb_define_module_function(module, "glGetActiveUniformARB", gl_GetActiveUniformARB, 2);
865
+ rb_define_module_function(module, "glGetUniformfvARB", gl_GetUniformfvARB, 2);
866
+ rb_define_module_function(module, "glGetUniformivARB", gl_GetUniformivARB, 2);
867
+
868
+ /* #31 GL_ARB_vertex_shader */
869
+ rb_define_module_function(module, "glBindAttribLocationARB", gl_BindAttribLocationARB, 3);
870
+ rb_define_module_function(module, "glGetActiveAttribARB", gl_GetActiveAttribARB, 2);
871
+ rb_define_module_function(module, "glGetAttribLocationARB", gl_GetAttribLocationARB, 2);
872
+
873
+ /* #39 GL_ARB_color_buffer_float */
874
+ rb_define_module_function(module, "glClampColorARB", gl_ClampColorARB, 2);
875
+ }