danabr75-opengl 0.10.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (149) hide show
  1. checksums.yaml +7 -0
  2. data/.autotest +29 -0
  3. data/.gemtest +0 -0
  4. data/.gitignore +6 -0
  5. data/.travis.yml +19 -0
  6. data/Gemfile +8 -0
  7. data/History.md +101 -0
  8. data/MIT-LICENSE +18 -0
  9. data/Manifest.txt +142 -0
  10. data/README.rdoc +105 -0
  11. data/Rakefile +170 -0
  12. data/danabr75-opengl.gemspec +32 -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 +157 -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/GL/gl.h +2115 -0
  96. data/ext/opengl/GL/glext.h +11770 -0
  97. data/ext/opengl/common.h +372 -0
  98. data/ext/opengl/conv.h +247 -0
  99. data/ext/opengl/extconf.rb +19 -0
  100. data/ext/opengl/fptr_struct.h +912 -0
  101. data/ext/opengl/funcdef.h +279 -0
  102. data/ext/opengl/gl-1.0-1.1.c +3345 -0
  103. data/ext/opengl/gl-1.2.c +155 -0
  104. data/ext/opengl/gl-1.3.c +447 -0
  105. data/ext/opengl/gl-1.4.c +346 -0
  106. data/ext/opengl/gl-1.5.c +225 -0
  107. data/ext/opengl/gl-2.0.c +665 -0
  108. data/ext/opengl/gl-2.1.c +57 -0
  109. data/ext/opengl/gl-3.0.c +502 -0
  110. data/ext/opengl/gl-enums.c +4853 -0
  111. data/ext/opengl/gl-enums.h +14528 -0
  112. data/ext/opengl/gl-error.c +110 -0
  113. data/ext/opengl/gl-error.h +25 -0
  114. data/ext/opengl/gl-ext-3dfx.c +27 -0
  115. data/ext/opengl/gl-ext-arb.c +880 -0
  116. data/ext/opengl/gl-ext-ati.c +41 -0
  117. data/ext/opengl/gl-ext-ext.c +885 -0
  118. data/ext/opengl/gl-ext-gremedy.c +41 -0
  119. data/ext/opengl/gl-ext-nv.c +679 -0
  120. data/ext/opengl/gl.c +265 -0
  121. data/ext/opengl/gl_buffer.c +202 -0
  122. data/ext/opengl/glimpl.c +187 -0
  123. data/ext/opengl/glimpl.h +47 -0
  124. data/ext/opengl/opengl.c +9 -0
  125. data/lib/gl.rb +1 -0
  126. data/lib/opengl.rb +79 -0
  127. data/lib/opengl/bindings_version.rb +4 -0
  128. data/lib/opengl/implementation.rb +38 -0
  129. data/lib/opengl/test_case.rb +86 -0
  130. data/test/dummy.xorg.conf +140 -0
  131. data/test/test_gl.rb +45 -0
  132. data/test/test_gl_10_11.rb +1363 -0
  133. data/test/test_gl_12.rb +71 -0
  134. data/test/test_gl_13.rb +221 -0
  135. data/test/test_gl_14.rb +218 -0
  136. data/test/test_gl_15.rb +258 -0
  137. data/test/test_gl_20.rb +417 -0
  138. data/test/test_gl_21.rb +436 -0
  139. data/test/test_gl_ext_arb.rb +508 -0
  140. data/test/test_gl_ext_ati.rb +28 -0
  141. data/test/test_gl_ext_ext.rb +608 -0
  142. data/test/test_gl_ext_gremedy.rb +29 -0
  143. data/test/test_gl_ext_nv.rb +349 -0
  144. data/test/test_glimpl.rb +23 -0
  145. data/test/test_opengl_buffer.rb +122 -0
  146. data/utils/README +6 -0
  147. data/utils/enumgen.rb +108 -0
  148. data/utils/extlistgen.rb +90 -0
  149. metadata +326 -0
@@ -0,0 +1,41 @@
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
+ /* Graphic Remedy extensions */
19
+
20
+ /* #311 GL_GREMEDY_string_marker */
21
+ static VALUE gl_StringMarkerGREMEDY(VALUE obj,VALUE arg1)
22
+ {
23
+ DECL_GL_FUNC_PTR(GLvoid,glStringMarkerGREMEDY,(GLsizei,const void *));
24
+ LOAD_GL_FUNC(glStringMarkerGREMEDY, "GL_GREMEDY_string_marker");
25
+ Check_Type(arg1,T_STRING);
26
+ fptr_glStringMarkerGREMEDY((GLsizei)RSTRING_LENINT(arg1),RSTRING_PTR(arg1));
27
+ CHECK_GLERROR_FROM("glStringMarkerGREMEDY");
28
+ return Qnil;
29
+ }
30
+
31
+ /* #345 GL_GREMEDY_frame_terminator */
32
+ GL_FUNC_LOAD_0(FrameTerminatorGREMEDY,GLvoid, "GL_GREMEDY_frame_terminator")
33
+
34
+ void gl_init_functions_ext_gremedy(VALUE klass)
35
+ {
36
+ /* #311 GL_GREMEDY_string_marker */
37
+ rb_define_method(klass, "glStringMarkerGREMEDY", gl_StringMarkerGREMEDY, 1);
38
+
39
+ /* #345 GL_GREMEDY_frame_terminator */
40
+ rb_define_method(klass, "glFrameTerminatorGREMEDY", gl_FrameTerminatorGREMEDY, 0);
41
+ }
@@ -0,0 +1,679 @@
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 NVIDIA extensions */
19
+
20
+ /* #222 GL_NV_fence */
21
+ GL_FUNC_GENOBJECTS_LOAD(GenFencesNV,"GL_NV_fence")
22
+ GL_FUNC_DELETEOBJECTS_LOAD(DeleteFencesNV,"GL_NV_fence")
23
+ GL_FUNC_LOAD_2(SetFenceNV,GLvoid, GLuint,GLenum, "GL_NV_fence")
24
+ GL_FUNC_LOAD_1(TestFenceNV,GLboolean, GLuint,"GL_NV_fence")
25
+ GL_FUNC_LOAD_1(IsFenceNV,GLboolean, GLuint,"GL_NV_fence")
26
+ GL_FUNC_LOAD_1(FinishFenceNV,GLvoid, GLuint,"GL_NV_fence")
27
+
28
+ static VALUE gl_GetFenceivNV(VALUE obj,VALUE arg1,VALUE arg2)
29
+ {
30
+ GLint ret = 0;
31
+ DECL_GL_FUNC_PTR(GLvoid,glGetFenceivNV,(GLuint,GLenum,GLint *));
32
+ LOAD_GL_FUNC(glGetFenceivNV, "GL_NV_fence");
33
+ fptr_glGetFenceivNV(NUM2INT(arg1),NUM2INT(arg2),&ret);
34
+ CHECK_GLERROR_FROM("glGetFenceivNV");
35
+ return cond_GLBOOL2RUBY(NUM2INT(arg2),ret);
36
+ }
37
+
38
+ /* #233 GL_NV_vertex_program */
39
+ static VALUE gl_LoadProgramNV(VALUE obj,VALUE arg1,VALUE arg2,VALUE arg3)
40
+ {
41
+ DECL_GL_FUNC_PTR(GLvoid,glLoadProgramNV,(GLenum,GLuint,GLsizei,const GLubyte *));
42
+ LOAD_GL_FUNC(glLoadProgramNV, "GL_NV_vertex_program");
43
+ Check_Type(arg3,T_STRING);
44
+ fptr_glLoadProgramNV((GLenum)NUM2INT(arg1),(GLuint)NUM2UINT(arg2),(GLsizei)RSTRING_LENINT(arg3),(GLubyte *)RSTRING_PTR(arg3));
45
+ CHECK_GLERROR_FROM("glLoadProgramNV");
46
+ return Qnil;
47
+ }
48
+
49
+ static VALUE gl_GetProgramivNV(VALUE obj,VALUE arg1,VALUE arg2)
50
+ {
51
+ GLint ret = 0;
52
+ DECL_GL_FUNC_PTR(GLvoid,glGetProgramivNV,(GLuint,GLenum,GLint *));
53
+ LOAD_GL_FUNC(glGetProgramivNV, "GL_NV_vertex_program");
54
+ fptr_glGetProgramivNV(NUM2INT(arg1),NUM2INT(arg2),&ret);
55
+ CHECK_GLERROR_FROM("glGetProgramivNV");
56
+ return cond_GLBOOL2RUBY(NUM2INT(arg2),ret);
57
+ }
58
+
59
+ static VALUE gl_GetProgramStringNV(VALUE obj,VALUE arg1,VALUE arg2)
60
+ {
61
+ GLsizei len = 0;
62
+ char *buffer;
63
+ VALUE ret_buffer;
64
+
65
+ DECL_GL_FUNC_PTR(GLvoid,glGetProgramStringNV,(GLuint,GLenum,void *string));
66
+ DECL_GL_FUNC_PTR(GLvoid,glGetProgramivNV,(GLuint,GLenum,GLint *));
67
+ LOAD_GL_FUNC(glGetProgramStringNV, "GL_NV_vertex_program");
68
+ LOAD_GL_FUNC(glGetProgramivNV, "GL_NV_vertex_program");
69
+
70
+ fptr_glGetProgramivNV(NUM2INT(arg1),GL_PROGRAM_LENGTH_NV,&len);
71
+ CHECK_GLERROR_FROM("glGetProgramivNV");
72
+ if (len<=0)
73
+ return rb_str_new2("");
74
+
75
+ buffer = ALLOC_N(GLchar,len+1);
76
+ memset(buffer,0,sizeof(GLchar) * (len+1));
77
+ fptr_glGetProgramStringNV(NUM2INT(arg1),NUM2INT(arg2),buffer);
78
+ ret_buffer = rb_str_new2(buffer);
79
+ xfree(buffer);
80
+
81
+ CHECK_GLERROR_FROM("glGetProgramStringNV");
82
+ return ret_buffer;
83
+ }
84
+
85
+ GL_FUNC_LOAD_2(BindProgramNV,GLvoid, GLenum,GLuint,"GL_NV_vertex_program")
86
+ GL_FUNC_LOAD_1(IsProgramNV,GLboolean, GLuint,"GL_NV_vertex_program")
87
+ GL_FUNC_GENOBJECTS_LOAD(GenProgramsNV,"GL_NV_vertex_program")
88
+ GL_FUNC_DELETEOBJECTS_LOAD(DeleteProgramsNV,"GL_NV_vertex_program")
89
+
90
+ static VALUE gl_ExecuteProgramNV(VALUE obj,VALUE arg1,VALUE arg2,VALUE arg3)
91
+ {
92
+ GLfloat params[4] = {0,0,0,0};
93
+ DECL_GL_FUNC_PTR(GLvoid,glExecuteProgramNV,(GLenum,GLuint,const GLfloat *));
94
+ LOAD_GL_FUNC(glExecuteProgramNV, "GL_NV_vertex_program");
95
+ ary2cflt(arg3,params,4);
96
+ fptr_glExecuteProgramNV(NUM2UINT(arg1),NUM2UINT(arg2),params);
97
+ CHECK_GLERROR_FROM("glExecuteProgramNV");
98
+ return Qnil;
99
+ }
100
+
101
+ static VALUE gl_VertexAttribPointerNV(VALUE obj,VALUE arg1,VALUE arg2,VALUE arg3,VALUE arg4,VALUE arg5)
102
+ {
103
+ GLuint index;
104
+ GLuint size;
105
+ GLenum type;
106
+ GLsizei stride;
107
+
108
+ DECL_GL_FUNC_PTR(GLvoid,glVertexAttribPointerNV,(GLuint,GLint,GLenum,GLsizei,const GLvoid *));
109
+ LOAD_GL_FUNC(glVertexAttribPointerNV, "GL_NV_vertex_program");
110
+
111
+ index = (GLuint)NUM2UINT(arg1);
112
+ size = (GLuint)NUM2UINT(arg2);
113
+ type = (GLenum)NUM2INT(arg3);
114
+ stride = (GLsizei)NUM2UINT(arg4);
115
+ if (index>_MAX_VERTEX_ATTRIBS)
116
+ rb_raise(rb_eArgError, "Index too large, maximum allowed value '%i'",_MAX_VERTEX_ATTRIBS);
117
+
118
+ if (CHECK_BUFFER_BINDING(GL_ARRAY_BUFFER_BINDING)) {
119
+ GET_GLIMPL_VARIABLE(VertexAttrib_ptr)[index] = arg5;
120
+ fptr_glVertexAttribPointerNV(index,size,type,stride,(GLvoid *)NUM2SIZET(arg5));
121
+ } else {
122
+ VALUE data;
123
+ data = pack_array_or_pass_string(type,arg5);
124
+ rb_str_freeze(data);
125
+ GET_GLIMPL_VARIABLE(VertexAttrib_ptr)[index] = data;
126
+ fptr_glVertexAttribPointerNV(index,size,type,stride,(GLvoid *)RSTRING_PTR(data));
127
+ }
128
+
129
+ CHECK_GLERROR_FROM("glVertexAttribPointerNV");
130
+ return Qnil;
131
+ }
132
+
133
+
134
+ static VALUE
135
+ gl_GetVertexAttribPointervNV(obj,arg1)
136
+ VALUE obj,arg1;
137
+ {
138
+ GLuint index;
139
+ DECL_GL_FUNC_PTR(GLvoid,glGetVertexAttribPointervNV,(GLuint,GLenum,GLvoid **));
140
+ LOAD_GL_FUNC(glGetVertexAttribPointervNV, "GL_NV_vertex_program");
141
+ index =(GLuint) NUM2INT(arg1);
142
+ if (index>_MAX_VERTEX_ATTRIBS)
143
+ rb_raise(rb_eArgError, "Index too large, maximum allowed value '%i'",_MAX_VERTEX_ATTRIBS);
144
+
145
+ return GET_GLIMPL_VARIABLE(VertexAttrib_ptr)[index];
146
+ }
147
+
148
+ GL_FUNC_LOAD_6(ProgramParameter4dNV,GLvoid, GLenum,GLuint,GLdouble,GLdouble,GLdouble,GLdouble, "GL_NV_vertex_program")
149
+ GL_FUNC_LOAD_6(ProgramParameter4fNV,GLvoid, GLenum,GLuint,GLfloat,GLfloat,GLfloat,GLfloat, "GL_NV_vertex_program")
150
+
151
+ #define PROGRAMPARAM_FUNC_V(_name_,_type_,_conv_,_extension_) \
152
+ static VALUE \
153
+ gl_##_name_(obj,arg1,arg2,arg3) \
154
+ VALUE obj,arg1,arg2,arg3; \
155
+ { \
156
+ _type_ cary[4]; \
157
+ DECL_GL_FUNC_PTR(GLvoid,gl##_name_,(GLenum,GLuint,const _type_ *)); \
158
+ LOAD_GL_FUNC(gl##_name_, _extension_); \
159
+ _conv_(arg3,cary,4); \
160
+ fptr_gl##_name_(NUM2UINT(arg1),NUM2UINT(arg2),cary); \
161
+ CHECK_GLERROR_FROM("gl" #_name_); \
162
+ return Qnil; \
163
+ }
164
+
165
+ PROGRAMPARAM_FUNC_V(ProgramParameter4dvNV,GLdouble,ary2cdbl,"GL_NV_vertex_program")
166
+ PROGRAMPARAM_FUNC_V(ProgramParameter4fvNV,GLfloat,ary2cflt,"GL_NV_vertex_program")
167
+
168
+ #define GETPROGRAMPARAM_FUNC(_name_,_type_,_extension_) \
169
+ static VALUE \
170
+ gl_##_name_(obj,arg1,arg2,arg3) \
171
+ VALUE obj,arg1,arg2,arg3; \
172
+ { \
173
+ _type_ cary[4] = {(_type_)0.0, (_type_)0.0, (_type_)0.0, (_type_)0.0}; \
174
+ DECL_GL_FUNC_PTR(GLvoid,gl##_name_,(GLenum,GLuint,GLenum,_type_ *)); \
175
+ LOAD_GL_FUNC(gl##_name_, _extension_); \
176
+ fptr_gl##_name_(NUM2UINT(arg1),NUM2UINT(arg2),NUM2UINT(arg3),cary); \
177
+ RET_ARRAY_OR_SINGLE("gl" #_name_, 4, RETCONV_##_type_, cary); \
178
+ }
179
+
180
+ GETPROGRAMPARAM_FUNC(GetProgramParameterdvNV,GLdouble,"GL_NV_vertex_program")
181
+ GETPROGRAMPARAM_FUNC(GetProgramParameterfvNV,GLfloat,"GL_NV_vertex_program")
182
+ #undef GETPROGRAMPARAM_FUNC
183
+
184
+ #define PROGRAMPARAM_MULTI_FUNC_V(_name_,_type_,_conv_,_extension_) \
185
+ static VALUE \
186
+ gl_##_name_(obj,arg1,arg2,arg3) \
187
+ VALUE obj,arg1,arg2,arg3; \
188
+ { \
189
+ _type_ *cary; \
190
+ GLuint len; \
191
+ DECL_GL_FUNC_PTR(GLvoid,gl##_name_,(GLenum,GLuint,GLuint,const _type_ *)); \
192
+ LOAD_GL_FUNC(gl##_name_, _extension_); \
193
+ len = (GLuint)RARRAY_LENINT(rb_Array(arg3)); \
194
+ if (len<=0 || (len % 4) != 0) \
195
+ rb_raise(rb_eArgError, "Parameter array size must be multiplication of 4"); \
196
+ cary = ALLOC_N(_type_,len); \
197
+ _conv_(arg3,cary,len); \
198
+ fptr_gl##_name_((GLenum)NUM2UINT(arg1),(GLuint)NUM2UINT(arg2),len / 4, cary); \
199
+ xfree(cary); \
200
+ CHECK_GLERROR_FROM("gl" #_name_); \
201
+ return Qnil; \
202
+ }
203
+
204
+ PROGRAMPARAM_MULTI_FUNC_V(ProgramParameters4dvNV,GLdouble,ary2cdbl,"GL_NV_vertex_program")
205
+ PROGRAMPARAM_MULTI_FUNC_V(ProgramParameters4fvNV,GLfloat,ary2cflt,"GL_NV_vertex_program")
206
+
207
+ GL_FUNC_LOAD_2(VertexAttrib1dNV,GLvoid, GLuint,GLdouble, "GL_NV_vertex_program")
208
+ GL_FUNC_LOAD_2(VertexAttrib1fNV,GLvoid, GLuint,GLfloat, "GL_NV_vertex_program")
209
+ GL_FUNC_LOAD_2(VertexAttrib1sNV,GLvoid, GLuint,GLshort, "GL_NV_vertex_program")
210
+ GL_FUNC_LOAD_3(VertexAttrib2dNV,GLvoid, GLuint,GLdouble,GLdouble, "GL_NV_vertex_program")
211
+ GL_FUNC_LOAD_3(VertexAttrib2fNV,GLvoid, GLuint,GLfloat,GLfloat, "GL_NV_vertex_program")
212
+ GL_FUNC_LOAD_3(VertexAttrib2sNV,GLvoid, GLuint,GLshort,GLshort, "GL_NV_vertex_program")
213
+ GL_FUNC_LOAD_4(VertexAttrib3dNV,GLvoid, GLuint,GLdouble,GLdouble,GLdouble, "GL_NV_vertex_program")
214
+ GL_FUNC_LOAD_4(VertexAttrib3fNV,GLvoid, GLuint,GLfloat,GLfloat,GLfloat, "GL_NV_vertex_program")
215
+ GL_FUNC_LOAD_4(VertexAttrib3sNV,GLvoid, GLuint,GLshort,GLshort,GLshort, "GL_NV_vertex_program")
216
+ GL_FUNC_LOAD_5(VertexAttrib4dNV,GLvoid, GLuint,GLdouble,GLdouble,GLdouble,GLdouble, "GL_NV_vertex_program")
217
+ GL_FUNC_LOAD_5(VertexAttrib4fNV,GLvoid, GLuint,GLfloat,GLfloat,GLfloat,GLfloat, "GL_NV_vertex_program")
218
+ GL_FUNC_LOAD_5(VertexAttrib4sNV,GLvoid, GLuint,GLshort,GLshort,GLshort,GLshort, "GL_NV_vertex_program")
219
+ GL_FUNC_LOAD_5(VertexAttrib4ubNV,GLvoid, GLuint,GLubyte,GLubyte,GLubyte,GLubyte, "GL_NV_vertex_program")
220
+
221
+ #define VERTEXATTRIB_FUNC_V(_name_,_type_,_conv_,_size_,_extension_) \
222
+ static VALUE \
223
+ gl_##_name_(obj,arg1,arg2) \
224
+ VALUE obj,arg1,arg2; \
225
+ { \
226
+ GLuint index; \
227
+ _type_ v[_size_]; \
228
+ DECL_GL_FUNC_PTR(GLvoid,gl##_name_,(GLuint,_type_ *)); \
229
+ LOAD_GL_FUNC(gl##_name_, _extension_); \
230
+ index = (GLuint)NUM2UINT(arg1); \
231
+ _conv_(arg2,v,_size_); \
232
+ fptr_gl##_name_(index,v); \
233
+ CHECK_GLERROR_FROM("gl" #_name_); \
234
+ return Qnil; \
235
+ }
236
+
237
+ VERTEXATTRIB_FUNC_V(VertexAttrib4ubvNV,GLubyte,ary2cubyte,4,"GL_NV_vertex_program")
238
+ VERTEXATTRIB_FUNC_V(VertexAttrib4dvNV,GLdouble,ary2cdbl,4,"GL_NV_vertex_program")
239
+ VERTEXATTRIB_FUNC_V(VertexAttrib4fvNV,GLfloat,ary2cflt,4,"GL_NV_vertex_program")
240
+ VERTEXATTRIB_FUNC_V(VertexAttrib4svNV,GLshort,ary2cshort,4,"GL_NV_vertex_program")
241
+ VERTEXATTRIB_FUNC_V(VertexAttrib3dvNV,GLdouble,ary2cdbl,3,"GL_NV_vertex_program")
242
+ VERTEXATTRIB_FUNC_V(VertexAttrib3fvNV,GLfloat,ary2cflt,3,"GL_NV_vertex_program")
243
+ VERTEXATTRIB_FUNC_V(VertexAttrib3svNV,GLshort,ary2cshort,3,"GL_NV_vertex_program")
244
+ VERTEXATTRIB_FUNC_V(VertexAttrib2dvNV,GLdouble,ary2cdbl,2,"GL_NV_vertex_program")
245
+ VERTEXATTRIB_FUNC_V(VertexAttrib2fvNV,GLfloat,ary2cflt,2,"GL_NV_vertex_program")
246
+ VERTEXATTRIB_FUNC_V(VertexAttrib2svNV,GLshort,ary2cshort,2,"GL_NV_vertex_program")
247
+ VERTEXATTRIB_FUNC_V(VertexAttrib1dvNV,GLdouble,ary2cdbl,1,"GL_NV_vertex_program")
248
+ VERTEXATTRIB_FUNC_V(VertexAttrib1fvNV,GLfloat,ary2cflt,1,"GL_NV_vertex_program")
249
+ VERTEXATTRIB_FUNC_V(VertexAttrib1svNV,GLshort,ary2cshort,1,"GL_NV_vertex_program")
250
+ #undef VERTEXATTRIB_FUNC_V
251
+
252
+ #define VERTEXATTRIB_MULTI_FUNC_V(_name_,_type_,_conv_,_size_,_extension_) \
253
+ static VALUE \
254
+ gl_##_name_(obj,arg1,arg2) \
255
+ VALUE obj,arg1,arg2; \
256
+ { \
257
+ GLuint index; \
258
+ _type_ *cary; \
259
+ GLsizei len; \
260
+ DECL_GL_FUNC_PTR(GLvoid,gl##_name_,(GLuint,GLsizei,_type_ *)); \
261
+ LOAD_GL_FUNC(gl##_name_, _extension_); \
262
+ len = (GLsizei)RARRAY_LENINT(rb_Array(arg2)); \
263
+ if (len<=0 || (len % _size_) != 0) \
264
+ rb_raise(rb_eArgError, "Parameter array size must be multiplication of %i",_size_); \
265
+ cary = ALLOC_N(_type_,len); \
266
+ index = (GLuint)NUM2UINT(arg1); \
267
+ _conv_(arg2,cary,len); \
268
+ fptr_gl##_name_(index,len / _size_,cary); \
269
+ xfree(cary); \
270
+ CHECK_GLERROR_FROM("gl" #_name_); \
271
+ return Qnil; \
272
+ }
273
+
274
+ VERTEXATTRIB_MULTI_FUNC_V(VertexAttribs4ubvNV,GLubyte,ary2cubyte,4,"GL_NV_vertex_program")
275
+ VERTEXATTRIB_MULTI_FUNC_V(VertexAttribs4dvNV,GLdouble,ary2cdbl,4,"GL_NV_vertex_program")
276
+ VERTEXATTRIB_MULTI_FUNC_V(VertexAttribs4fvNV,GLfloat,ary2cflt,4,"GL_NV_vertex_program")
277
+ VERTEXATTRIB_MULTI_FUNC_V(VertexAttribs4svNV,GLshort,ary2cshort,4,"GL_NV_vertex_program")
278
+ VERTEXATTRIB_MULTI_FUNC_V(VertexAttribs3dvNV,GLdouble,ary2cdbl,3,"GL_NV_vertex_program")
279
+ VERTEXATTRIB_MULTI_FUNC_V(VertexAttribs3fvNV,GLfloat,ary2cflt,3,"GL_NV_vertex_program")
280
+ VERTEXATTRIB_MULTI_FUNC_V(VertexAttribs3svNV,GLshort,ary2cshort,3,"GL_NV_vertex_program")
281
+ VERTEXATTRIB_MULTI_FUNC_V(VertexAttribs2dvNV,GLdouble,ary2cdbl,2,"GL_NV_vertex_program")
282
+ VERTEXATTRIB_MULTI_FUNC_V(VertexAttribs2fvNV,GLfloat,ary2cflt,2,"GL_NV_vertex_program")
283
+ VERTEXATTRIB_MULTI_FUNC_V(VertexAttribs2svNV,GLshort,ary2cshort,2,"GL_NV_vertex_program")
284
+ VERTEXATTRIB_MULTI_FUNC_V(VertexAttribs1dvNV,GLdouble,ary2cdbl,1,"GL_NV_vertex_program")
285
+ VERTEXATTRIB_MULTI_FUNC_V(VertexAttribs1fvNV,GLfloat,ary2cflt,1,"GL_NV_vertex_program")
286
+ VERTEXATTRIB_MULTI_FUNC_V(VertexAttribs1svNV,GLshort,ary2cshort,1,"GL_NV_vertex_program")
287
+ #undef VERTEXATTRIB_MULTI_FUNC_V
288
+
289
+ #define GETVERTEXATTRIB_FUNC(_name_,_type_,_extension_) \
290
+ static VALUE \
291
+ gl_##_name_(obj,arg1,arg2) \
292
+ VALUE obj,arg1,arg2; \
293
+ { \
294
+ GLuint index; \
295
+ GLenum pname; \
296
+ _type_ params[4] = {0,0,0,0}; \
297
+ GLint size; \
298
+ DECL_GL_FUNC_PTR(GLvoid,gl##_name_,(GLuint,GLenum,_type_ *)); \
299
+ LOAD_GL_FUNC(gl##_name_, _extension_); \
300
+ index = (GLuint)NUM2UINT(arg1); \
301
+ pname = (GLenum)NUM2INT(arg2); \
302
+ if (pname==GL_CURRENT_ATTRIB_NV) \
303
+ size = 4; \
304
+ else \
305
+ size = 1; \
306
+ fptr_gl##_name_(index,pname,params); \
307
+ RET_ARRAY_OR_SINGLE("gl" #_name_, size, RETCONV_##_type_, params); \
308
+ }
309
+
310
+ GETVERTEXATTRIB_FUNC(GetVertexAttribdvNV,GLdouble,"GL_NV_vertex_program")
311
+ GETVERTEXATTRIB_FUNC(GetVertexAttribfvNV,GLfloat,"GL_NV_vertex_program")
312
+ #undef GETVERTEXATTRIB_FUNC
313
+
314
+ static VALUE
315
+ gl_GetVertexAttribivNV(obj,arg1,arg2)
316
+ VALUE obj,arg1,arg2;
317
+ {
318
+ GLuint index;
319
+ GLenum pname;
320
+ GLint params[4] = {0,0,0,0};
321
+ GLint size;
322
+ DECL_GL_FUNC_PTR(GLvoid,glGetVertexAttribivNV,(GLuint,GLenum,GLint *));
323
+ LOAD_GL_FUNC(glGetVertexAttribivNV, "GL_NV_vertex_program");
324
+ index = (GLuint)NUM2UINT(arg1);
325
+ pname = (GLenum)NUM2INT(arg2);
326
+ if (pname==GL_CURRENT_VERTEX_ATTRIB)
327
+ size = 4;
328
+ else
329
+ size = 1;
330
+ fptr_glGetVertexAttribivNV(index,pname,params);
331
+ RET_ARRAY_OR_SINGLE_BOOL("glGetVertexAttribivNV", size, cond_GLBOOL2RUBY,
332
+ pname, params); \
333
+ }
334
+
335
+
336
+ GL_FUNC_LOAD_4(TrackMatrixNV,GLvoid, GLenum,GLuint,GLenum,GLenum, "GL_NV_vertex_program")
337
+
338
+ static VALUE gl_GetTrackMatrixivNV(VALUE obj,VALUE arg1,VALUE arg2,VALUE arg3)
339
+ {
340
+ GLint ret = 0;
341
+ DECL_GL_FUNC_PTR(GLvoid,glGetTrackMatrixivNV,(GLenum,GLuint,GLenum,GLint *));
342
+ LOAD_GL_FUNC(glGetTrackMatrixivNV, "GL_NV_vertex_program");
343
+ fptr_glGetTrackMatrixivNV(NUM2UINT(arg1),NUM2UINT(arg2),NUM2UINT(arg3),&ret);
344
+ CHECK_GLERROR_FROM("glGetTrackMatrixivNV");
345
+ return INT2NUM(ret);
346
+ }
347
+
348
+ static VALUE gl_RequestResidentProgramsNV(VALUE obj,VALUE arg1)
349
+ {
350
+ DECL_GL_FUNC_PTR(GLvoid,glRequestResidentProgramsNV,(GLsizei, GLuint *));
351
+ LOAD_GL_FUNC(glRequestResidentProgramsNV, "GL_NV_vertex_program");
352
+ if (TYPE(arg1)==T_ARRAY) {
353
+ GLsizei n;
354
+ GLuint *programs;
355
+ n = (GLsizei)RARRAY_LENINT(arg1);
356
+ programs = ALLOC_N(GLuint,n);
357
+ ary2cuint(arg1,programs,n);
358
+ fptr_glRequestResidentProgramsNV( n, programs);
359
+ xfree(programs);
360
+ } else {
361
+ GLuint program;
362
+ program = NUM2INT(arg1);
363
+ fptr_glRequestResidentProgramsNV( 1, &program);
364
+ }
365
+ CHECK_GLERROR_FROM("glRequestResidentProgramsNV");
366
+ return Qnil;
367
+ }
368
+
369
+ static VALUE gl_AreProgramsResidentNV(VALUE obj,VALUE arg1)
370
+ {
371
+ GLuint *programs;
372
+ GLboolean *residences;
373
+ GLsizei size;
374
+ GLboolean r;
375
+ VALUE retary;
376
+ VALUE ary;
377
+ int i;
378
+ DECL_GL_FUNC_PTR(GLboolean,glAreProgramsResidentNV,(GLsizei, const GLuint *, GLboolean *));
379
+ LOAD_GL_FUNC(glAreProgramsResidentNV, "GL_NV_vertex_program");
380
+ ary = rb_Array(arg1);
381
+ size = (GLsizei)RARRAY_LENINT(ary);
382
+ programs = ALLOC_N(GLuint,size);
383
+ residences = ALLOC_N(GLboolean,size);
384
+ ary2cuint(ary,programs,size);
385
+ r = fptr_glAreProgramsResidentNV(size,programs,residences);
386
+ retary = rb_ary_new2(size);
387
+ if (r==GL_TRUE) { /* all are resident */
388
+ for(i=0;i<size;i++)
389
+ rb_ary_push(retary, GLBOOL2RUBY(GL_TRUE));
390
+ } else {
391
+ for(i=0;i<size;i++)
392
+ rb_ary_push(retary, GLBOOL2RUBY(residences[i]));
393
+ }
394
+ xfree(programs);
395
+ xfree(residences);
396
+ CHECK_GLERROR_FROM("glAreProgramsResidentNV");
397
+ return retary;
398
+ }
399
+
400
+ /* #261 GL_NV_occlusion_query */
401
+ GL_FUNC_GENOBJECTS_LOAD(GenOcclusionQueriesNV,"GL_NV_occlusion_query")
402
+ GL_FUNC_DELETEOBJECTS_LOAD(DeleteOcclusionQueriesNV,"GL_NV_occlusion_query")
403
+ GL_FUNC_LOAD_1(IsOcclusionQueryNV,GLboolean, GLuint, "GL_NV_occlusion_query")
404
+ GL_FUNC_LOAD_1(BeginOcclusionQueryNV,GLvoid, GLuint, "GL_NV_occlusion_query")
405
+ GL_FUNC_LOAD_0(EndOcclusionQueryNV,GLvoid, "GL_NV_occlusion_query")
406
+
407
+ #define GETOCCLUSIONQUERY_FUNC(_name_,_type_,_conv_) \
408
+ static VALUE gl_##_name_(VALUE obj,VALUE arg1,VALUE arg2) \
409
+ { \
410
+ _type_ ret = 0; \
411
+ DECL_GL_FUNC_PTR(GLvoid,gl##_name_,(GLuint,GLenum,_type_ *)); \
412
+ LOAD_GL_FUNC(gl##_name_, "GL_NV_occlusion_query"); \
413
+ fptr_gl##_name_(NUM2INT(arg1),NUM2INT(arg2),&ret); \
414
+ CHECK_GLERROR_FROM("gl" #_name_); \
415
+ return _conv_(NUM2INT(arg2),ret); \
416
+ }
417
+
418
+ GETOCCLUSIONQUERY_FUNC(GetOcclusionQueryivNV,GLint,cond_GLBOOL2RUBY)
419
+ GETOCCLUSIONQUERY_FUNC(GetOcclusionQueryuivNV,GLuint,cond_GLBOOL2RUBY_U)
420
+ #undef GETOCCLUSIONQUERY_FUNC
421
+
422
+ /* #262 GL_NV_point_sprite */
423
+ GL_FUNC_LOAD_2(PointParameteriNV,GLvoid, GLenum,GLint, "GL_NV_point_sprite")
424
+
425
+ static VALUE gl_PointParameterivNV(VALUE obj,VALUE arg1,VALUE arg2)
426
+ {
427
+ GLint param = 0;
428
+ DECL_GL_FUNC_PTR(GLvoid,glPointParameterivNV,(GLenum,const GLint *));
429
+ LOAD_GL_FUNC(glPointParameterivNV, "GL_NV_point_sprite");
430
+ ary2cint(arg2,&param,1);
431
+ fptr_glPointParameterivNV(NUM2UINT(arg1),&param);
432
+ CHECK_GLERROR_FROM("glPointParameterivNV");
433
+ return Qnil;
434
+ }
435
+
436
+ /* #282 GL_NV_fragment_program */
437
+ #define PROGRAMNAMEDPARAM_FUNC(_name_,_type_,_conv_,_extension_) \
438
+ static VALUE \
439
+ gl_##_name_(obj,arg1,arg2,arg3,arg4,arg5,arg6) \
440
+ VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6; \
441
+ { \
442
+ DECL_GL_FUNC_PTR(GLvoid,gl##_name_,(GLuint,GLsizei,const GLubyte *,_type_,_type_,_type_,_type_)); \
443
+ LOAD_GL_FUNC(gl##_name_, _extension_); \
444
+ Check_Type(arg2,T_STRING); \
445
+ fptr_gl##_name_((GLuint)NUM2UINT(arg1),(GLsizei)RSTRING_LENINT(arg2),(GLubyte *)RSTRING_PTR(arg2),(_type_)_conv_(arg3),(_type_)_conv_(arg4),(_type_)_conv_(arg5),(_type_)_conv_(arg6)); \
446
+ CHECK_GLERROR_FROM("gl" #_name_); \
447
+ return Qnil; \
448
+ }
449
+
450
+ PROGRAMNAMEDPARAM_FUNC(ProgramNamedParameter4dNV,GLdouble,NUM2DBL,"GL_NV_fragment_program")
451
+ PROGRAMNAMEDPARAM_FUNC(ProgramNamedParameter4fNV,GLfloat,NUM2DBL,"GL_NV_fragment_program")
452
+ #undef PROGRAMNAMEDPARAM_FUNC
453
+
454
+ #define PROGRAMNAMEDPARAM_FUNC_V(_name_,_type_,_conv_,_extension_) \
455
+ static VALUE \
456
+ gl_##_name_(obj,arg1,arg2,arg3) \
457
+ VALUE obj,arg1,arg2,arg3; \
458
+ { \
459
+ _type_ cary[4]; \
460
+ DECL_GL_FUNC_PTR(GLvoid,gl##_name_,(GLuint,GLsizei,const GLubyte *,const _type_ *)); \
461
+ LOAD_GL_FUNC(gl##_name_, _extension_); \
462
+ Check_Type(arg2,T_STRING); \
463
+ _conv_(arg3,cary,4); \
464
+ fptr_gl##_name_(NUM2UINT(arg1),(GLsizei)RSTRING_LENINT(arg2),(GLubyte *)RSTRING_PTR(arg2),cary); \
465
+ CHECK_GLERROR_FROM("gl" #_name_); \
466
+ return Qnil; \
467
+ }
468
+
469
+ PROGRAMNAMEDPARAM_FUNC_V(ProgramNamedParameter4dvNV,GLdouble,ary2cdbl,"GL_NV_vertex_program")
470
+ PROGRAMNAMEDPARAM_FUNC_V(ProgramNamedParameter4fvNV,GLfloat,ary2cflt,"GL_NV_vertex_program")
471
+ #undef PROGRAMNAMEDPARAM_FUNC_V
472
+
473
+ #define GETPROGRAMNAMEDPARAM_FUNC(_name_,_type_,_extension_) \
474
+ static VALUE \
475
+ gl_##_name_(obj,arg1,arg2) \
476
+ VALUE obj,arg1,arg2; \
477
+ { \
478
+ _type_ cary[4] = {(_type_)0.0, (_type_)0.0, (_type_)0.0, (_type_)0.0}; \
479
+ DECL_GL_FUNC_PTR(GLvoid,gl##_name_,(GLuint,GLsizei,const GLubyte *,_type_ *)); \
480
+ LOAD_GL_FUNC(gl##_name_, _extension_); \
481
+ Check_Type(arg2,T_STRING); \
482
+ fptr_gl##_name_((GLuint)NUM2UINT(arg1),(GLsizei)RSTRING_LENINT(arg2),(GLubyte *)RSTRING_PTR(arg2),cary); \
483
+ RET_ARRAY_OR_SINGLE("gl" #_name_, 4, RETCONV_##_type_, cary); \
484
+ }
485
+
486
+ GETPROGRAMNAMEDPARAM_FUNC(GetProgramNamedParameterdvNV,GLdouble,"GL_NV_vertex_program")
487
+ GETPROGRAMNAMEDPARAM_FUNC(GetProgramNamedParameterfvNV,GLfloat,"GL_NV_vertex_program")
488
+ #undef GETPROGRAMNAMEDPARAM_FUNC
489
+
490
+ /* #285 GL_NV_primitive_restart */
491
+ GL_FUNC_LOAD_0(PrimitiveRestartNV,GLvoid, "GL_NV_primitive_restart")
492
+ GL_FUNC_LOAD_1(PrimitiveRestartIndexNV,GLvoid, GLuint, "GL_NV_primitive_restart")
493
+
494
+ /* #322 GL_NV_gpu_program4 */
495
+ GL_FUNC_LOAD_6(ProgramLocalParameterI4iNV,GLvoid, GLenum,GLuint, GLint,GLint,GLint,GLint, "GL_NV_gpu_program4")
496
+ GL_FUNC_LOAD_6(ProgramLocalParameterI4uiNV,GLvoid, GLenum,GLuint, GLuint,GLuint,GLuint,GLuint, "GL_NV_gpu_program4")
497
+ GL_FUNC_LOAD_6(ProgramEnvParameterI4iNV,GLvoid, GLenum,GLuint, GLint,GLint,GLint,GLint, "GL_NV_gpu_program4")
498
+ GL_FUNC_LOAD_6(ProgramEnvParameterI4uiNV,GLvoid, GLenum,GLuint, GLuint,GLuint,GLuint,GLuint, "GL_NV_gpu_program4")
499
+
500
+ PROGRAMPARAM_FUNC_V(ProgramLocalParameterI4ivNV,GLint,ary2cint,"GL_NV_gpu_program4")
501
+ PROGRAMPARAM_FUNC_V(ProgramLocalParameterI4uivNV,GLuint,ary2cuint,"GL_NV_gpu_program4")
502
+ PROGRAMPARAM_FUNC_V(ProgramEnvParameterI4ivNV,GLint,ary2cint,"GL_NV_gpu_program4")
503
+ PROGRAMPARAM_FUNC_V(ProgramEnvParameterI4uivNV,GLuint,ary2cuint,"GL_NV_gpu_program4")
504
+
505
+ PROGRAMPARAM_MULTI_FUNC_V(ProgramLocalParametersI4ivNV,GLint,ary2cint,"GL_NV_gpu_program4")
506
+ PROGRAMPARAM_MULTI_FUNC_V(ProgramLocalParametersI4uivNV,GLuint,ary2cuint,"GL_NV_gpu_program4")
507
+ PROGRAMPARAM_MULTI_FUNC_V(ProgramEnvParametersI4ivNV,GLint,ary2cint,"GL_NV_gpu_program4")
508
+ PROGRAMPARAM_MULTI_FUNC_V(ProgramEnvParametersI4uivNV,GLuint,ary2cuint,"GL_NV_gpu_program4")
509
+
510
+ #undef PROGRAMPARAM_MULTI_FUNC_V
511
+ #undef PROGRAMPARAM_FUNC_V
512
+
513
+ #define GETPROGRAMPARAM_FUNC_2(_name_,_type_,_extension_) \
514
+ static VALUE \
515
+ gl_##_name_(obj,arg1,arg2) \
516
+ VALUE obj,arg1,arg2; \
517
+ { \
518
+ _type_ cary[4] = {(_type_)0.0, (_type_)0.0, (_type_)0.0, (_type_)0.0}; \
519
+ DECL_GL_FUNC_PTR(GLvoid,gl##_name_,(GLenum,GLuint,_type_ *)); \
520
+ LOAD_GL_FUNC(gl##_name_, _extension_); \
521
+ fptr_gl##_name_(NUM2UINT(arg1),NUM2UINT(arg2),cary); \
522
+ RET_ARRAY_OR_SINGLE("gl" #_name_, 4, RETCONV_##_type_, cary); \
523
+ }
524
+
525
+ GETPROGRAMPARAM_FUNC_2(GetProgramLocalParameterIivNV,GLint,"GL_NV_gpu_program4")
526
+ GETPROGRAMPARAM_FUNC_2(GetProgramLocalParameterIuivNV,GLuint,"GL_NV_gpu_program4")
527
+ GETPROGRAMPARAM_FUNC_2(GetProgramEnvParameterIivNV,GLint,"GL_NV_gpu_program4")
528
+ GETPROGRAMPARAM_FUNC_2(GetProgramEnvParameterIuivNV,GLuint,"GL_NV_gpu_program4")
529
+ #undef GETPROGRAMPARAM_FUNC_2
530
+
531
+ /* #323 GL_NV_geometry_program4 */
532
+ GL_FUNC_LOAD_2(ProgramVertexLimitNV,GLvoid, GLenum,GLint, "GL_EXT_geometry_shader4")
533
+ GL_FUNC_LOAD_4(FramebufferTextureEXT,GLvoid, GLenum,GLenum,GLuint,GLuint, "GL_EXT_geometry_shader4")
534
+ GL_FUNC_LOAD_5(FramebufferTextureLayerEXT,GLvoid, GLenum,GLenum,GLuint,GLint,GLint, "GL_EXT_geometry_shader4")
535
+ GL_FUNC_LOAD_5(FramebufferTextureFaceEXT,GLvoid, GLenum,GLenum,GLuint,GLint,GLenum, "GL_EXT_geometry_shader4")
536
+
537
+ /* #334 GL_NV_depth_buffer_float */
538
+ GL_FUNC_LOAD_2(DepthRangedNV,GLvoid, GLdouble,GLdouble, "GL_NV_depth_buffer_float")
539
+ GL_FUNC_LOAD_1(ClearDepthdNV,GLvoid, GLdouble, "GL_NV_depth_buffer_float")
540
+ GL_FUNC_LOAD_2(DepthBoundsdNV,GLvoid, GLdouble,GLdouble, "GL_NV_depth_buffer_float")
541
+
542
+ /* #336 GL_NV_framebuffer_multisample_coverage */
543
+ GL_FUNC_LOAD_6(RenderbufferStorageMultisampleCoverageNV,GLvoid, GLenum,GLsizei,GLsizei,GLenum,GLsizei,GLsizei, "GL_NV_framebuffer_multisample_coverage")
544
+
545
+ void gl_init_functions_ext_nv(VALUE klass)
546
+ {
547
+ /* #222 GL_NV_fence */
548
+ rb_define_method(klass, "glGenFencesNV", gl_GenFencesNV, 1);
549
+ rb_define_method(klass, "glDeleteFencesNV", gl_DeleteFencesNV, 1);
550
+ rb_define_method(klass, "glSetFenceNV", gl_SetFenceNV, 2);
551
+ rb_define_method(klass, "glTestFenceNV", gl_TestFenceNV, 1);
552
+ rb_define_method(klass, "glFinishFenceNV", gl_FinishFenceNV, 1);
553
+ rb_define_method(klass, "glIsFenceNV", gl_IsFenceNV, 1);
554
+ rb_define_method(klass, "glGetFenceivNV", gl_GetFenceivNV, 2);
555
+
556
+ /* #233 GL_NV_vertex_program */
557
+ rb_define_method(klass, "glLoadProgramNV", gl_LoadProgramNV, 3);
558
+ rb_define_method(klass, "glGetProgramStringNV", gl_GetProgramStringNV, 2);
559
+ rb_define_method(klass, "glGetProgramivNV", gl_GetProgramivNV, 2);
560
+ rb_define_method(klass, "glBindProgramNV", gl_BindProgramNV, 2);
561
+ rb_define_method(klass, "glGenProgramsNV", gl_GenProgramsNV, 1);
562
+ rb_define_method(klass, "glDeleteProgramsNV", gl_DeleteProgramsNV, 1);
563
+ rb_define_method(klass, "glIsProgramNV", gl_IsProgramNV, 1);
564
+ rb_define_method(klass, "glExecuteProgramNV", gl_ExecuteProgramNV, 3);
565
+ rb_define_method(klass, "glVertexAttribPointerNV", gl_VertexAttribPointerNV, 5);
566
+ rb_define_method(klass, "glGetVertexAttribPointervNV", gl_GetVertexAttribPointervNV, 1);
567
+ rb_define_method(klass, "glProgramParameter4dNV", gl_ProgramParameter4dNV, 6);
568
+ rb_define_method(klass, "glProgramParameter4fNV", gl_ProgramParameter4fNV, 6);
569
+ rb_define_method(klass, "glProgramParameter4dvNV", gl_ProgramParameter4dvNV, 3);
570
+ rb_define_method(klass, "glProgramParameter4fvNV", gl_ProgramParameter4fvNV, 3);
571
+ rb_define_method(klass, "glProgramParameters4dvNV", gl_ProgramParameters4dvNV, 3);
572
+ rb_define_method(klass, "glProgramParameters4fvNV", gl_ProgramParameters4fvNV, 3);
573
+ rb_define_method(klass, "glGetProgramParameterdvNV", gl_GetProgramParameterdvNV, 3);
574
+ rb_define_method(klass, "glGetProgramParameterfvNV", gl_GetProgramParameterfvNV, 3);
575
+ rb_define_method(klass, "glVertexAttrib1dNV", gl_VertexAttrib1dNV, 2);
576
+ rb_define_method(klass, "glVertexAttrib1fNV", gl_VertexAttrib1fNV, 2);
577
+ rb_define_method(klass, "glVertexAttrib1sNV", gl_VertexAttrib1sNV, 2);
578
+ rb_define_method(klass, "glVertexAttrib2dNV", gl_VertexAttrib2dNV, 3);
579
+ rb_define_method(klass, "glVertexAttrib2fNV", gl_VertexAttrib2fNV, 3);
580
+ rb_define_method(klass, "glVertexAttrib2sNV", gl_VertexAttrib2sNV, 3);
581
+ rb_define_method(klass, "glVertexAttrib3dNV", gl_VertexAttrib3dNV, 4);
582
+ rb_define_method(klass, "glVertexAttrib3fNV", gl_VertexAttrib3fNV, 4);
583
+ rb_define_method(klass, "glVertexAttrib3sNV", gl_VertexAttrib3sNV, 4);
584
+ rb_define_method(klass, "glVertexAttrib4dNV", gl_VertexAttrib4dNV, 5);
585
+ rb_define_method(klass, "glVertexAttrib4fNV", gl_VertexAttrib4fNV, 5);
586
+ rb_define_method(klass, "glVertexAttrib4sNV", gl_VertexAttrib4sNV, 5);
587
+ rb_define_method(klass, "glVertexAttrib4ubNV", gl_VertexAttrib4ubNV, 5);
588
+ rb_define_method(klass, "glVertexAttrib1dvNV", gl_VertexAttrib1dvNV, 2);
589
+ rb_define_method(klass, "glVertexAttrib1fvNV", gl_VertexAttrib1fvNV, 2);
590
+ rb_define_method(klass, "glVertexAttrib1svNV", gl_VertexAttrib1svNV, 2);
591
+ rb_define_method(klass, "glVertexAttrib2dvNV", gl_VertexAttrib2dvNV, 2);
592
+ rb_define_method(klass, "glVertexAttrib2fvNV", gl_VertexAttrib2fvNV, 2);
593
+ rb_define_method(klass, "glVertexAttrib2svNV", gl_VertexAttrib2svNV, 2);
594
+ rb_define_method(klass, "glVertexAttrib3dvNV", gl_VertexAttrib3dvNV, 2);
595
+ rb_define_method(klass, "glVertexAttrib3fvNV", gl_VertexAttrib3fvNV, 2);
596
+ rb_define_method(klass, "glVertexAttrib3svNV", gl_VertexAttrib3svNV, 2);
597
+ rb_define_method(klass, "glVertexAttrib4dvNV", gl_VertexAttrib4dvNV, 2);
598
+ rb_define_method(klass, "glVertexAttrib4fvNV", gl_VertexAttrib4fvNV, 2);
599
+ rb_define_method(klass, "glVertexAttrib4svNV", gl_VertexAttrib4svNV, 2);
600
+ rb_define_method(klass, "glVertexAttrib4ubvNV", gl_VertexAttrib4ubvNV, 2);
601
+ rb_define_method(klass, "glVertexAttribs1dvNV", gl_VertexAttribs1dvNV, 2);
602
+ rb_define_method(klass, "glVertexAttribs1fvNV", gl_VertexAttribs1fvNV, 2);
603
+ rb_define_method(klass, "glVertexAttribs1svNV", gl_VertexAttribs1svNV, 2);
604
+ rb_define_method(klass, "glVertexAttribs2dvNV", gl_VertexAttribs2dvNV, 2);
605
+ rb_define_method(klass, "glVertexAttribs2fvNV", gl_VertexAttribs2fvNV, 2);
606
+ rb_define_method(klass, "glVertexAttribs2svNV", gl_VertexAttribs2svNV, 2);
607
+ rb_define_method(klass, "glVertexAttribs3dvNV", gl_VertexAttribs3dvNV, 2);
608
+ rb_define_method(klass, "glVertexAttribs3fvNV", gl_VertexAttribs3fvNV, 2);
609
+ rb_define_method(klass, "glVertexAttribs3svNV", gl_VertexAttribs3svNV, 2);
610
+ rb_define_method(klass, "glVertexAttribs4dvNV", gl_VertexAttribs4dvNV, 2);
611
+ rb_define_method(klass, "glVertexAttribs4fvNV", gl_VertexAttribs4fvNV, 2);
612
+ rb_define_method(klass, "glVertexAttribs4svNV", gl_VertexAttribs4svNV, 2);
613
+ rb_define_method(klass, "glVertexAttribs4ubvNV", gl_VertexAttribs4ubvNV, 2);
614
+ rb_define_method(klass, "glGetVertexAttribdvNV", gl_GetVertexAttribdvNV, 2);
615
+ rb_define_method(klass, "glGetVertexAttribfvNV", gl_GetVertexAttribfvNV, 2);
616
+ rb_define_method(klass, "glGetVertexAttribivNV", gl_GetVertexAttribivNV, 2);
617
+ rb_define_method(klass, "glTrackMatrixNV", gl_TrackMatrixNV, 4);
618
+ rb_define_method(klass, "glGetTrackMatrixivNV", gl_GetTrackMatrixivNV, 3);
619
+ rb_define_method(klass, "glRequestResidentProgramsNV", gl_RequestResidentProgramsNV, 1);
620
+ rb_define_method(klass, "glAreProgramsResidentNV", gl_AreProgramsResidentNV, 1);
621
+
622
+ /* #261 GL_NV_occlusion_query */
623
+ rb_define_method(klass, "glGenOcclusionQueriesNV", gl_GenOcclusionQueriesNV, 1);
624
+ rb_define_method(klass, "glDeleteOcclusionQueriesNV", gl_DeleteOcclusionQueriesNV, 1);
625
+ rb_define_method(klass, "glIsOcclusionQueryNV", gl_IsOcclusionQueryNV, 1);
626
+ rb_define_method(klass, "glBeginOcclusionQueryNV", gl_BeginOcclusionQueryNV, 1);
627
+ rb_define_method(klass, "glEndOcclusionQueryNV", gl_EndOcclusionQueryNV, 0);
628
+ rb_define_method(klass, "glGetOcclusionQueryivNV", gl_GetOcclusionQueryivNV, 2);
629
+ rb_define_method(klass, "glGetOcclusionQueryuivNV", gl_GetOcclusionQueryuivNV, 2);
630
+
631
+ /* #262 GL_NV_point_sprite */
632
+ rb_define_method(klass, "glPointParameteriNV", gl_PointParameteriNV, 2);
633
+ rb_define_method(klass, "glPointParameterivNV", gl_PointParameterivNV, 2);
634
+
635
+ /* #282 GL_NV_fragment_program */
636
+ rb_define_method(klass, "glProgramNamedParameter4fNV", gl_ProgramNamedParameter4fNV, 6);
637
+ rb_define_method(klass, "glProgramNamedParameter4dNV", gl_ProgramNamedParameter4dNV, 6);
638
+ rb_define_method(klass, "glProgramNamedParameter4fvNV", gl_ProgramNamedParameter4fvNV, 3);
639
+ rb_define_method(klass, "glProgramNamedParameter4dvNV", gl_ProgramNamedParameter4dvNV, 3);
640
+ rb_define_method(klass, "glGetProgramNamedParameterdvNV", gl_GetProgramNamedParameterdvNV, 2);
641
+ rb_define_method(klass, "glGetProgramNamedParameterfvNV", gl_GetProgramNamedParameterfvNV, 2);
642
+
643
+ /* #285 GL_NV_primitive_restart */
644
+ rb_define_method(klass, "glPrimitiveRestartNV", gl_PrimitiveRestartNV, 0);
645
+ rb_define_method(klass, "glPrimitiveRestartIndexNV", gl_PrimitiveRestartIndexNV, 1);
646
+
647
+ /* #322 GL_NV_gpu_program4 */
648
+ rb_define_method(klass, "glProgramLocalParameterI4iNV", gl_ProgramLocalParameterI4iNV, 6);
649
+ rb_define_method(klass, "glProgramLocalParameterI4uiNV", gl_ProgramLocalParameterI4uiNV, 6);
650
+ rb_define_method(klass, "glProgramLocalParameterI4ivNV", gl_ProgramLocalParameterI4ivNV, 3);
651
+ rb_define_method(klass, "glProgramLocalParameterI4uivNV", gl_ProgramLocalParameterI4uivNV, 3);
652
+ rb_define_method(klass, "glProgramLocalParametersI4ivNV", gl_ProgramLocalParametersI4ivNV, 3);
653
+ rb_define_method(klass, "glProgramLocalParametersI4uivNV", gl_ProgramLocalParametersI4uivNV, 3);
654
+ rb_define_method(klass, "glGetProgramLocalParameterIivNV", gl_GetProgramLocalParameterIivNV, 2);
655
+ rb_define_method(klass, "glGetProgramLocalParameterIuivNV", gl_GetProgramLocalParameterIuivNV, 2);
656
+ rb_define_method(klass, "glProgramEnvParameterI4iNV", gl_ProgramEnvParameterI4iNV, 6);
657
+ rb_define_method(klass, "glProgramEnvParameterI4uiNV", gl_ProgramEnvParameterI4uiNV, 6);
658
+ rb_define_method(klass, "glProgramEnvParameterI4ivNV", gl_ProgramEnvParameterI4ivNV, 3);
659
+ rb_define_method(klass, "glProgramEnvParameterI4uivNV", gl_ProgramEnvParameterI4uivNV, 3);
660
+ rb_define_method(klass, "glProgramEnvParametersI4ivNV", gl_ProgramEnvParametersI4ivNV, 3);
661
+ rb_define_method(klass, "glProgramEnvParametersI4uivNV", gl_ProgramEnvParametersI4uivNV, 3);
662
+ rb_define_method(klass, "glGetProgramEnvParameterIivNV", gl_GetProgramEnvParameterIivNV, 2);
663
+ rb_define_method(klass, "glGetProgramEnvParameterIuivNV", gl_GetProgramEnvParameterIuivNV, 2);
664
+
665
+ /* #323 GL_NV_geometry_program4 */
666
+ rb_define_method(klass, "glProgramVertexLimitNV", gl_ProgramVertexLimitNV, 2);
667
+ rb_define_method(klass, "glFramebufferTextureEXT", gl_FramebufferTextureEXT, 4);
668
+ rb_define_method(klass, "glFramebufferTextureLayerEXT", gl_FramebufferTextureLayerEXT, 5);
669
+ rb_define_method(klass, "glFramebufferTextureFaceEXT", gl_FramebufferTextureFaceEXT, 5);
670
+
671
+ /* #334 GL_NV_depth_buffer_float */
672
+ rb_define_method(klass, "glDepthRangedNV", gl_DepthRangedNV, 2);
673
+ rb_define_method(klass, "glClearDepthdNV", gl_ClearDepthdNV, 1);
674
+ rb_define_method(klass, "glDepthBoundsdNV", gl_DepthBoundsdNV, 2);
675
+
676
+ /* #336 GL_NV_framebuffer_multisample_coverage */
677
+ rb_define_method(klass, "glRenderbufferStorageMultisampleCoverageNV", gl_RenderbufferStorageMultisampleCoverageNV, 6);
678
+
679
+ }