opengl 0.7.0.pre1-x86-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- data/.gemtest +0 -0
- data/.gitignore +8 -0
- data/History.txt +36 -0
- data/MIT-LICENSE +18 -0
- data/Manifest.txt +140 -0
- data/README.rdoc +51 -0
- data/Rakefile +129 -0
- data/Rakefile.cross +104 -0
- data/doc/build_install.txt +119 -0
- data/doc/extensions.txt.in +348 -0
- data/doc/history.txt +66 -0
- data/doc/requirements_and_design.txt +117 -0
- data/doc/roadmap.txt +28 -0
- data/doc/scientific_use.txt +35 -0
- data/doc/supplies/page_template.html +71 -0
- data/doc/thanks.txt +29 -0
- data/doc/tutorial.txt +469 -0
- data/examples/NeHe/nehe_lesson02.rb +117 -0
- data/examples/NeHe/nehe_lesson03.rb +122 -0
- data/examples/NeHe/nehe_lesson04.rb +133 -0
- data/examples/NeHe/nehe_lesson05.rb +186 -0
- data/examples/NeHe/nehe_lesson36.rb +303 -0
- data/examples/OrangeBook/3Dlabs-License.txt +33 -0
- data/examples/OrangeBook/brick.frag +36 -0
- data/examples/OrangeBook/brick.rb +376 -0
- data/examples/OrangeBook/brick.vert +41 -0
- data/examples/OrangeBook/particle.frag +17 -0
- data/examples/OrangeBook/particle.rb +406 -0
- data/examples/OrangeBook/particle.vert +38 -0
- data/examples/README +16 -0
- data/examples/RedBook/aapoly.rb +142 -0
- data/examples/RedBook/aargb.rb +119 -0
- data/examples/RedBook/accanti.rb +162 -0
- data/examples/RedBook/accpersp.rb +215 -0
- data/examples/RedBook/alpha.rb +123 -0
- data/examples/RedBook/alpha3D.rb +158 -0
- data/examples/RedBook/bezcurve.rb +105 -0
- data/examples/RedBook/bezmesh.rb +137 -0
- data/examples/RedBook/checker.rb +124 -0
- data/examples/RedBook/clip.rb +95 -0
- data/examples/RedBook/colormat.rb +135 -0
- data/examples/RedBook/cube.rb +69 -0
- data/examples/RedBook/depthcue.rb +99 -0
- data/examples/RedBook/dof.rb +205 -0
- data/examples/RedBook/double.rb +105 -0
- data/examples/RedBook/drawf.rb +91 -0
- data/examples/RedBook/feedback.rb +145 -0
- data/examples/RedBook/fog.rb +167 -0
- data/examples/RedBook/font.rb +151 -0
- data/examples/RedBook/hello.rb +79 -0
- data/examples/RedBook/image.rb +137 -0
- data/examples/RedBook/jitter.rb +207 -0
- data/examples/RedBook/lines.rb +128 -0
- data/examples/RedBook/list.rb +111 -0
- data/examples/RedBook/material.rb +275 -0
- data/examples/RedBook/mipmap.rb +156 -0
- data/examples/RedBook/model.rb +113 -0
- data/examples/RedBook/movelight.rb +132 -0
- data/examples/RedBook/pickdepth.rb +179 -0
- data/examples/RedBook/planet.rb +108 -0
- data/examples/RedBook/quadric.rb +158 -0
- data/examples/RedBook/robot.rb +115 -0
- data/examples/RedBook/select.rb +196 -0
- data/examples/RedBook/smooth.rb +95 -0
- data/examples/RedBook/stencil.rb +163 -0
- data/examples/RedBook/stroke.rb +167 -0
- data/examples/RedBook/surface.rb +166 -0
- data/examples/RedBook/teaambient.rb +132 -0
- data/examples/RedBook/teapots.rb +182 -0
- data/examples/RedBook/tess.rb +183 -0
- data/examples/RedBook/texbind.rb +147 -0
- data/examples/RedBook/texgen.rb +169 -0
- data/examples/RedBook/texturesurf.rb +128 -0
- data/examples/RedBook/varray.rb +159 -0
- data/examples/RedBook/wrap.rb +148 -0
- data/examples/misc/OGLBench.rb +337 -0
- data/examples/misc/anisotropic.rb +194 -0
- data/examples/misc/fbo_test.rb +356 -0
- data/examples/misc/font-glut.rb +46 -0
- data/examples/misc/glfwtest.rb +30 -0
- data/examples/misc/plane.rb +161 -0
- data/examples/misc/readpixel.rb +65 -0
- data/examples/misc/sdltest.rb +34 -0
- data/examples/misc/trislam.rb +828 -0
- data/ext/common/common.h +448 -0
- data/ext/common/conv.h +234 -0
- data/ext/common/funcdef.h +280 -0
- data/ext/common/gl-enums.h +10031 -0
- data/ext/common/gl-error.h +23 -0
- data/ext/common/gl-types.h +67 -0
- data/ext/common/glu-enums.h +463 -0
- data/ext/gl/extconf.rb +43 -0
- data/ext/gl/gl-1.0-1.1.c +2811 -0
- data/ext/gl/gl-1.2.c +814 -0
- data/ext/gl/gl-1.3.c +443 -0
- data/ext/gl/gl-1.4.c +348 -0
- data/ext/gl/gl-1.5.c +225 -0
- data/ext/gl/gl-2.0.c +657 -0
- data/ext/gl/gl-2.1.c +57 -0
- data/ext/gl/gl-enums.c +3354 -0
- data/ext/gl/gl-error.c +104 -0
- data/ext/gl/gl-ext-3dfx.c +27 -0
- data/ext/gl/gl-ext-arb.c +866 -0
- data/ext/gl/gl-ext-ati.c +41 -0
- data/ext/gl/gl-ext-ext.c +889 -0
- data/ext/gl/gl-ext-gremedy.c +41 -0
- data/ext/gl/gl-ext-nv.c +679 -0
- data/ext/gl/gl.c +216 -0
- data/ext/glu/extconf.rb +51 -0
- data/ext/glu/glu-enums.c +164 -0
- data/ext/glu/glu.c +1530 -0
- data/ext/glut/extconf.rb +67 -0
- data/ext/glut/glut.c +1624 -0
- data/lib/opengl.rb +89 -0
- data/test/README +10 -0
- data/test/tc_common.rb +98 -0
- data/test/tc_ext_arb.rb +467 -0
- data/test/tc_ext_ati.rb +33 -0
- data/test/tc_ext_ext.rb +551 -0
- data/test/tc_ext_gremedy.rb +36 -0
- data/test/tc_ext_nv.rb +357 -0
- data/test/tc_func_10_11.rb +1281 -0
- data/test/tc_func_12.rb +186 -0
- data/test/tc_func_13.rb +229 -0
- data/test/tc_func_14.rb +197 -0
- data/test/tc_func_15.rb +270 -0
- data/test/tc_func_20.rb +346 -0
- data/test/tc_func_21.rb +541 -0
- data/test/tc_glu.rb +310 -0
- data/test/tc_include_gl.rb +35 -0
- data/test/tc_misc.rb +54 -0
- data/test/tc_require_gl.rb +34 -0
- data/utils/README +11 -0
- data/utils/enumgen.rb +112 -0
- data/utils/extlistgen.rb +90 -0
- data/utils/mkdn2html.rb +59 -0
- data/utils/post-mkdn2html.rb +91 -0
- data/website/images/ogl.jpg +0 -0
- data/website/images/tab_bottom.gif +0 -0
- data/website/style.css +198 -0
- metadata +274 -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/common.h"
|
17
|
+
|
18
|
+
/* Graphic Remedy extensions */
|
19
|
+
|
20
|
+
/* #311 GL_GREMEDY_string_marker */
|
21
|
+
static void (APIENTRY * fptr_glStringMarkerGREMEDY)(GLsizei,const void *);
|
22
|
+
static VALUE gl_StringMarkerGREMEDY(VALUE obj,VALUE arg1)
|
23
|
+
{
|
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
|
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 module)
|
35
|
+
{
|
36
|
+
/* #311 GL_GREMEDY_string_marker */
|
37
|
+
rb_define_module_function(module, "glStringMarkerGREMEDY", gl_StringMarkerGREMEDY, 1);
|
38
|
+
|
39
|
+
/* #345 GL_GREMEDY_frame_terminator */
|
40
|
+
rb_define_module_function(module, "glFrameTerminatorGREMEDY", gl_FrameTerminatorGREMEDY, 0);
|
41
|
+
}
|
data/ext/gl/gl-ext-nv.c
ADDED
@@ -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/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 void (APIENTRY * fptr_glGetFenceivNV)(GLuint,GLenum,GLint *);
|
29
|
+
static VALUE gl_GetFenceivNV(VALUE obj,VALUE arg1,VALUE arg2)
|
30
|
+
{
|
31
|
+
GLint ret = 0;
|
32
|
+
LOAD_GL_FUNC(glGetFenceivNV,"GL_NV_fence")
|
33
|
+
fptr_glGetFenceivNV(NUM2INT(arg1),NUM2INT(arg2),&ret);
|
34
|
+
CHECK_GLERROR
|
35
|
+
return cond_GLBOOL2RUBY(NUM2INT(arg2),ret);
|
36
|
+
}
|
37
|
+
|
38
|
+
/* #233 GL_NV_vertex_program */
|
39
|
+
static void (APIENTRY * fptr_glLoadProgramNV)(GLenum,GLuint,GLsizei,const GLubyte *);
|
40
|
+
static VALUE gl_LoadProgramNV(VALUE obj,VALUE arg1,VALUE arg2,VALUE arg3)
|
41
|
+
{
|
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
|
46
|
+
return Qnil;
|
47
|
+
}
|
48
|
+
|
49
|
+
static void (APIENTRY * fptr_glGetProgramivNV)(GLuint,GLenum,GLint *);
|
50
|
+
static VALUE gl_GetProgramivNV(VALUE obj,VALUE arg1,VALUE arg2)
|
51
|
+
{
|
52
|
+
GLint ret = 0;
|
53
|
+
LOAD_GL_FUNC(glGetProgramivNV,"GL_NV_vertex_program")
|
54
|
+
fptr_glGetProgramivNV(NUM2INT(arg1),NUM2INT(arg2),&ret);
|
55
|
+
CHECK_GLERROR
|
56
|
+
return cond_GLBOOL2RUBY(NUM2INT(arg2),ret);
|
57
|
+
}
|
58
|
+
|
59
|
+
static void (APIENTRY * fptr_glGetProgramStringNV)(GLuint,GLenum,void *string);
|
60
|
+
static VALUE gl_GetProgramStringNV(VALUE obj,VALUE arg1,VALUE arg2)
|
61
|
+
{
|
62
|
+
GLsizei len = 0;
|
63
|
+
char *buffer;
|
64
|
+
VALUE ret_buffer;
|
65
|
+
|
66
|
+
LOAD_GL_FUNC(glGetProgramStringNV,"GL_NV_vertex_program")
|
67
|
+
LOAD_GL_FUNC(glGetProgramivNV,"GL_NV_vertex_program")
|
68
|
+
|
69
|
+
fptr_glGetProgramivNV(NUM2INT(arg1),GL_PROGRAM_LENGTH_NV,&len);
|
70
|
+
CHECK_GLERROR
|
71
|
+
if (len<=0)
|
72
|
+
return rb_str_new2("");
|
73
|
+
|
74
|
+
buffer = ALLOC_N(GLchar,len+1);
|
75
|
+
memset(buffer,0,sizeof(GLchar) * (len+1));
|
76
|
+
fptr_glGetProgramStringNV(NUM2INT(arg1),NUM2INT(arg2),buffer);
|
77
|
+
ret_buffer = rb_str_new2(buffer);
|
78
|
+
xfree(buffer);
|
79
|
+
|
80
|
+
CHECK_GLERROR
|
81
|
+
return ret_buffer;
|
82
|
+
}
|
83
|
+
|
84
|
+
GL_FUNC_LOAD_2(BindProgramNV,GLvoid, GLenum,GLuint,"GL_NV_vertex_program")
|
85
|
+
GL_FUNC_LOAD_1(IsProgramNV,GLboolean, GLuint,"GL_NV_vertex_program")
|
86
|
+
GL_FUNC_GENOBJECTS_LOAD(GenProgramsNV,"GL_NV_vertex_program")
|
87
|
+
GL_FUNC_DELETEOBJECTS_LOAD(DeleteProgramsNV,"GL_NV_vertex_program")
|
88
|
+
|
89
|
+
static void (APIENTRY * fptr_glExecuteProgramNV)(GLenum,GLuint,const GLfloat *);
|
90
|
+
static VALUE gl_ExecuteProgramNV(VALUE obj,VALUE arg1,VALUE arg2,VALUE arg3)
|
91
|
+
{
|
92
|
+
GLfloat params[4] = {0,0,0,0};
|
93
|
+
LOAD_GL_FUNC(glExecuteProgramNV,"GL_NV_vertex_program")
|
94
|
+
ary2cflt(arg3,params,4);
|
95
|
+
fptr_glExecuteProgramNV(NUM2UINT(arg1),NUM2UINT(arg2),params);
|
96
|
+
CHECK_GLERROR
|
97
|
+
return Qnil;
|
98
|
+
}
|
99
|
+
|
100
|
+
extern VALUE g_VertexAttrib_ptr[];
|
101
|
+
|
102
|
+
static void (APIENTRY * fptr_glVertexAttribPointerNV)(GLuint,GLint,GLenum,GLsizei,const GLvoid *);
|
103
|
+
static VALUE gl_VertexAttribPointerNV(VALUE obj,VALUE arg1,VALUE arg2,VALUE arg3,VALUE arg4,VALUE arg5)
|
104
|
+
{
|
105
|
+
GLuint index;
|
106
|
+
GLuint size;
|
107
|
+
GLenum type;
|
108
|
+
GLsizei stride;
|
109
|
+
|
110
|
+
LOAD_GL_FUNC(glVertexAttribPointerNV,"GL_NV_vertex_program")
|
111
|
+
|
112
|
+
index = (GLuint)NUM2UINT(arg1);
|
113
|
+
size = (GLuint)NUM2UINT(arg2);
|
114
|
+
type = (GLenum)NUM2INT(arg3);
|
115
|
+
stride = (GLsizei)NUM2UINT(arg4);
|
116
|
+
if (index>_MAX_VERTEX_ATTRIBS)
|
117
|
+
rb_raise(rb_eArgError, "Index too large, maximum allowed value '%i'",_MAX_VERTEX_ATTRIBS);
|
118
|
+
|
119
|
+
if (CheckBufferBinding(GL_ARRAY_BUFFER_BINDING)) {
|
120
|
+
g_VertexAttrib_ptr[index] = arg5;
|
121
|
+
fptr_glVertexAttribPointerNV(index,size,type,stride,(GLvoid *)NUM2LONG(arg5));
|
122
|
+
} else {
|
123
|
+
VALUE data;
|
124
|
+
data = pack_array_or_pass_string(type,arg5);
|
125
|
+
rb_str_freeze(data);
|
126
|
+
g_VertexAttrib_ptr[index] = data;
|
127
|
+
fptr_glVertexAttribPointerNV(index,size,type,stride,(GLvoid *)RSTRING_PTR(data));
|
128
|
+
}
|
129
|
+
|
130
|
+
CHECK_GLERROR
|
131
|
+
return Qnil;
|
132
|
+
}
|
133
|
+
|
134
|
+
|
135
|
+
static void (APIENTRY * fptr_glGetVertexAttribPointervNV)(GLuint,GLenum,GLvoid **);
|
136
|
+
static VALUE
|
137
|
+
gl_GetVertexAttribPointervNV(obj,arg1)
|
138
|
+
VALUE obj,arg1;
|
139
|
+
{
|
140
|
+
GLuint index;
|
141
|
+
LOAD_GL_FUNC(glGetVertexAttribPointervNV,"GL_NV_vertex_program")
|
142
|
+
index =(GLuint) NUM2INT(arg1);
|
143
|
+
if (index>_MAX_VERTEX_ATTRIBS)
|
144
|
+
rb_raise(rb_eArgError, "Index too large, maximum allowed value '%i'",_MAX_VERTEX_ATTRIBS);
|
145
|
+
|
146
|
+
return g_VertexAttrib_ptr[index];
|
147
|
+
}
|
148
|
+
|
149
|
+
GL_FUNC_LOAD_6(ProgramParameter4dNV,GLvoid, GLenum,GLuint,GLdouble,GLdouble,GLdouble,GLdouble, "GL_NV_vertex_program")
|
150
|
+
GL_FUNC_LOAD_6(ProgramParameter4fNV,GLvoid, GLenum,GLuint,GLfloat,GLfloat,GLfloat,GLfloat, "GL_NV_vertex_program")
|
151
|
+
|
152
|
+
#define PROGRAMPARAM_FUNC_V(_name_,_type_,_conv_,_extension_) \
|
153
|
+
static void (APIENTRY * fptr_gl##_name_)(GLenum,GLuint,const _type_ *); \
|
154
|
+
static VALUE \
|
155
|
+
gl_##_name_(obj,arg1,arg2,arg3) \
|
156
|
+
VALUE obj,arg1,arg2,arg3; \
|
157
|
+
{ \
|
158
|
+
_type_ cary[4]; \
|
159
|
+
LOAD_GL_FUNC(gl##_name_,_extension_) \
|
160
|
+
_conv_(arg3,cary,4); \
|
161
|
+
fptr_gl##_name_(NUM2UINT(arg1),NUM2UINT(arg2),cary); \
|
162
|
+
CHECK_GLERROR \
|
163
|
+
return Qnil; \
|
164
|
+
}
|
165
|
+
|
166
|
+
PROGRAMPARAM_FUNC_V(ProgramParameter4dvNV,GLdouble,ary2cdbl,"GL_NV_vertex_program")
|
167
|
+
PROGRAMPARAM_FUNC_V(ProgramParameter4fvNV,GLfloat,ary2cflt,"GL_NV_vertex_program")
|
168
|
+
|
169
|
+
#define GETPROGRAMPARAM_FUNC(_name_,_type_,_extension_) \
|
170
|
+
static void (APIENTRY * fptr_gl##_name_)(GLenum,GLuint,GLenum,_type_ *); \
|
171
|
+
static VALUE \
|
172
|
+
gl_##_name_(obj,arg1,arg2,arg3) \
|
173
|
+
VALUE obj,arg1,arg2,arg3; \
|
174
|
+
{ \
|
175
|
+
_type_ cary[4] = {(_type_)0.0, (_type_)0.0, (_type_)0.0, (_type_)0.0}; \
|
176
|
+
LOAD_GL_FUNC(gl##_name_,_extension_) \
|
177
|
+
fptr_gl##_name_(NUM2UINT(arg1),NUM2UINT(arg2),NUM2UINT(arg3),cary); \
|
178
|
+
RET_ARRAY_OR_SINGLE(4,RETCONV_##_type_,cary) \
|
179
|
+
}
|
180
|
+
|
181
|
+
GETPROGRAMPARAM_FUNC(GetProgramParameterdvNV,GLdouble,"GL_NV_vertex_program")
|
182
|
+
GETPROGRAMPARAM_FUNC(GetProgramParameterfvNV,GLfloat,"GL_NV_vertex_program")
|
183
|
+
#undef GETPROGRAMPARAM_FUNC
|
184
|
+
|
185
|
+
#define PROGRAMPARAM_MULTI_FUNC_V(_name_,_type_,_conv_,_extension_) \
|
186
|
+
static void (APIENTRY * fptr_gl##_name_)(GLenum,GLuint,GLuint,const _type_ *); \
|
187
|
+
static VALUE \
|
188
|
+
gl_##_name_(obj,arg1,arg2,arg3) \
|
189
|
+
VALUE obj,arg1,arg2,arg3; \
|
190
|
+
{ \
|
191
|
+
_type_ *cary; \
|
192
|
+
GLuint len; \
|
193
|
+
LOAD_GL_FUNC(gl##_name_,_extension_) \
|
194
|
+
len = (GLuint)RARRAY_LENINT(rb_Array(arg3)); \
|
195
|
+
if (len<=0 || (len % 4) != 0) \
|
196
|
+
rb_raise(rb_eArgError, "Parameter array size must be multiplication of 4"); \
|
197
|
+
cary = ALLOC_N(_type_,len); \
|
198
|
+
_conv_(arg3,cary,len); \
|
199
|
+
fptr_gl##_name_((GLenum)NUM2UINT(arg1),(GLuint)NUM2UINT(arg2),len / 4, cary); \
|
200
|
+
xfree(cary); \
|
201
|
+
CHECK_GLERROR \
|
202
|
+
return Qnil; \
|
203
|
+
}
|
204
|
+
|
205
|
+
PROGRAMPARAM_MULTI_FUNC_V(ProgramParameters4dvNV,GLdouble,ary2cdbl,"GL_NV_vertex_program")
|
206
|
+
PROGRAMPARAM_MULTI_FUNC_V(ProgramParameters4fvNV,GLfloat,ary2cflt,"GL_NV_vertex_program")
|
207
|
+
|
208
|
+
GL_FUNC_LOAD_2(VertexAttrib1dNV,GLvoid, GLuint,GLdouble, "GL_NV_vertex_program")
|
209
|
+
GL_FUNC_LOAD_2(VertexAttrib1fNV,GLvoid, GLuint,GLfloat, "GL_NV_vertex_program")
|
210
|
+
GL_FUNC_LOAD_2(VertexAttrib1sNV,GLvoid, GLuint,GLshort, "GL_NV_vertex_program")
|
211
|
+
GL_FUNC_LOAD_3(VertexAttrib2dNV,GLvoid, GLuint,GLdouble,GLdouble, "GL_NV_vertex_program")
|
212
|
+
GL_FUNC_LOAD_3(VertexAttrib2fNV,GLvoid, GLuint,GLfloat,GLfloat, "GL_NV_vertex_program")
|
213
|
+
GL_FUNC_LOAD_3(VertexAttrib2sNV,GLvoid, GLuint,GLshort,GLshort, "GL_NV_vertex_program")
|
214
|
+
GL_FUNC_LOAD_4(VertexAttrib3dNV,GLvoid, GLuint,GLdouble,GLdouble,GLdouble, "GL_NV_vertex_program")
|
215
|
+
GL_FUNC_LOAD_4(VertexAttrib3fNV,GLvoid, GLuint,GLfloat,GLfloat,GLfloat, "GL_NV_vertex_program")
|
216
|
+
GL_FUNC_LOAD_4(VertexAttrib3sNV,GLvoid, GLuint,GLshort,GLshort,GLshort, "GL_NV_vertex_program")
|
217
|
+
GL_FUNC_LOAD_5(VertexAttrib4dNV,GLvoid, GLuint,GLdouble,GLdouble,GLdouble,GLdouble, "GL_NV_vertex_program")
|
218
|
+
GL_FUNC_LOAD_5(VertexAttrib4fNV,GLvoid, GLuint,GLfloat,GLfloat,GLfloat,GLfloat, "GL_NV_vertex_program")
|
219
|
+
GL_FUNC_LOAD_5(VertexAttrib4sNV,GLvoid, GLuint,GLshort,GLshort,GLshort,GLshort, "GL_NV_vertex_program")
|
220
|
+
GL_FUNC_LOAD_5(VertexAttrib4ubNV,GLvoid, GLuint,GLubyte,GLubyte,GLubyte,GLubyte, "GL_NV_vertex_program")
|
221
|
+
|
222
|
+
#define VERTEXATTRIB_FUNC_V(_name_,_type_,_conv_,_size_,_extension_) \
|
223
|
+
static void (APIENTRY * fptr_gl##_name_)(GLuint,_type_ *); \
|
224
|
+
static VALUE \
|
225
|
+
gl_##_name_(obj,arg1,arg2) \
|
226
|
+
VALUE obj,arg1,arg2; \
|
227
|
+
{ \
|
228
|
+
GLuint index; \
|
229
|
+
_type_ v[_size_]; \
|
230
|
+
LOAD_GL_FUNC(gl##_name_,_extension_) \
|
231
|
+
index = (GLuint)NUM2UINT(arg1); \
|
232
|
+
_conv_(arg2,v,_size_); \
|
233
|
+
fptr_gl##_name_(index,v); \
|
234
|
+
CHECK_GLERROR \
|
235
|
+
return Qnil; \
|
236
|
+
}
|
237
|
+
|
238
|
+
VERTEXATTRIB_FUNC_V(VertexAttrib4ubvNV,GLubyte,ary2cubyte,4,"GL_NV_vertex_program")
|
239
|
+
VERTEXATTRIB_FUNC_V(VertexAttrib4dvNV,GLdouble,ary2cdbl,4,"GL_NV_vertex_program")
|
240
|
+
VERTEXATTRIB_FUNC_V(VertexAttrib4fvNV,GLfloat,ary2cflt,4,"GL_NV_vertex_program")
|
241
|
+
VERTEXATTRIB_FUNC_V(VertexAttrib4svNV,GLshort,ary2cshort,4,"GL_NV_vertex_program")
|
242
|
+
VERTEXATTRIB_FUNC_V(VertexAttrib3dvNV,GLdouble,ary2cdbl,3,"GL_NV_vertex_program")
|
243
|
+
VERTEXATTRIB_FUNC_V(VertexAttrib3fvNV,GLfloat,ary2cflt,3,"GL_NV_vertex_program")
|
244
|
+
VERTEXATTRIB_FUNC_V(VertexAttrib3svNV,GLshort,ary2cshort,3,"GL_NV_vertex_program")
|
245
|
+
VERTEXATTRIB_FUNC_V(VertexAttrib2dvNV,GLdouble,ary2cdbl,2,"GL_NV_vertex_program")
|
246
|
+
VERTEXATTRIB_FUNC_V(VertexAttrib2fvNV,GLfloat,ary2cflt,2,"GL_NV_vertex_program")
|
247
|
+
VERTEXATTRIB_FUNC_V(VertexAttrib2svNV,GLshort,ary2cshort,2,"GL_NV_vertex_program")
|
248
|
+
VERTEXATTRIB_FUNC_V(VertexAttrib1dvNV,GLdouble,ary2cdbl,1,"GL_NV_vertex_program")
|
249
|
+
VERTEXATTRIB_FUNC_V(VertexAttrib1fvNV,GLfloat,ary2cflt,1,"GL_NV_vertex_program")
|
250
|
+
VERTEXATTRIB_FUNC_V(VertexAttrib1svNV,GLshort,ary2cshort,1,"GL_NV_vertex_program")
|
251
|
+
#undef VERTEXATTRIB_FUNC_V
|
252
|
+
|
253
|
+
#define VERTEXATTRIB_MULTI_FUNC_V(_name_,_type_,_conv_,_size_,_extension_) \
|
254
|
+
static void (APIENTRY * fptr_gl##_name_)(GLuint,GLsizei,_type_ *); \
|
255
|
+
static VALUE \
|
256
|
+
gl_##_name_(obj,arg1,arg2) \
|
257
|
+
VALUE obj,arg1,arg2; \
|
258
|
+
{ \
|
259
|
+
GLuint index; \
|
260
|
+
_type_ *cary; \
|
261
|
+
GLsizei len; \
|
262
|
+
LOAD_GL_FUNC(gl##_name_,_extension_) \
|
263
|
+
len = (GLsizei)RARRAY_LENINT(rb_Array(arg2)); \
|
264
|
+
if (len<=0 || (len % _size_) != 0) \
|
265
|
+
rb_raise(rb_eArgError, "Parameter array size must be multiplication of %i",_size_); \
|
266
|
+
cary = ALLOC_N(_type_,len); \
|
267
|
+
index = (GLuint)NUM2UINT(arg1); \
|
268
|
+
_conv_(arg2,cary,len); \
|
269
|
+
fptr_gl##_name_(index,len / _size_,cary); \
|
270
|
+
xfree(cary); \
|
271
|
+
CHECK_GLERROR \
|
272
|
+
return Qnil; \
|
273
|
+
}
|
274
|
+
|
275
|
+
VERTEXATTRIB_MULTI_FUNC_V(VertexAttribs4ubvNV,GLubyte,ary2cubyte,4,"GL_NV_vertex_program")
|
276
|
+
VERTEXATTRIB_MULTI_FUNC_V(VertexAttribs4dvNV,GLdouble,ary2cdbl,4,"GL_NV_vertex_program")
|
277
|
+
VERTEXATTRIB_MULTI_FUNC_V(VertexAttribs4fvNV,GLfloat,ary2cflt,4,"GL_NV_vertex_program")
|
278
|
+
VERTEXATTRIB_MULTI_FUNC_V(VertexAttribs4svNV,GLshort,ary2cshort,4,"GL_NV_vertex_program")
|
279
|
+
VERTEXATTRIB_MULTI_FUNC_V(VertexAttribs3dvNV,GLdouble,ary2cdbl,3,"GL_NV_vertex_program")
|
280
|
+
VERTEXATTRIB_MULTI_FUNC_V(VertexAttribs3fvNV,GLfloat,ary2cflt,3,"GL_NV_vertex_program")
|
281
|
+
VERTEXATTRIB_MULTI_FUNC_V(VertexAttribs3svNV,GLshort,ary2cshort,3,"GL_NV_vertex_program")
|
282
|
+
VERTEXATTRIB_MULTI_FUNC_V(VertexAttribs2dvNV,GLdouble,ary2cdbl,2,"GL_NV_vertex_program")
|
283
|
+
VERTEXATTRIB_MULTI_FUNC_V(VertexAttribs2fvNV,GLfloat,ary2cflt,2,"GL_NV_vertex_program")
|
284
|
+
VERTEXATTRIB_MULTI_FUNC_V(VertexAttribs2svNV,GLshort,ary2cshort,2,"GL_NV_vertex_program")
|
285
|
+
VERTEXATTRIB_MULTI_FUNC_V(VertexAttribs1dvNV,GLdouble,ary2cdbl,1,"GL_NV_vertex_program")
|
286
|
+
VERTEXATTRIB_MULTI_FUNC_V(VertexAttribs1fvNV,GLfloat,ary2cflt,1,"GL_NV_vertex_program")
|
287
|
+
VERTEXATTRIB_MULTI_FUNC_V(VertexAttribs1svNV,GLshort,ary2cshort,1,"GL_NV_vertex_program")
|
288
|
+
#undef VERTEXATTRIB_MULTI_FUNC_V
|
289
|
+
|
290
|
+
#define GETVERTEXATTRIB_FUNC(_name_,_type_,_extension_) \
|
291
|
+
static void (APIENTRY * fptr_gl##_name_)(GLuint,GLenum,_type_ *); \
|
292
|
+
static VALUE \
|
293
|
+
gl_##_name_(obj,arg1,arg2) \
|
294
|
+
VALUE obj,arg1,arg2; \
|
295
|
+
{ \
|
296
|
+
GLuint index; \
|
297
|
+
GLenum pname; \
|
298
|
+
_type_ params[4] = {0,0,0,0}; \
|
299
|
+
GLint size; \
|
300
|
+
LOAD_GL_FUNC(gl##_name_,_extension_) \
|
301
|
+
index = (GLuint)NUM2UINT(arg1); \
|
302
|
+
pname = (GLenum)NUM2INT(arg2); \
|
303
|
+
if (pname==GL_CURRENT_ATTRIB_NV) \
|
304
|
+
size = 4; \
|
305
|
+
else \
|
306
|
+
size = 1; \
|
307
|
+
fptr_gl##_name_(index,pname,params); \
|
308
|
+
RET_ARRAY_OR_SINGLE(size,RETCONV_##_type_,params) \
|
309
|
+
}
|
310
|
+
|
311
|
+
GETVERTEXATTRIB_FUNC(GetVertexAttribdvNV,GLdouble,"GL_NV_vertex_program")
|
312
|
+
GETVERTEXATTRIB_FUNC(GetVertexAttribfvNV,GLfloat,"GL_NV_vertex_program")
|
313
|
+
#undef GETVERTEXATTRIB_FUNC
|
314
|
+
|
315
|
+
static void (APIENTRY * fptr_glGetVertexAttribivNV)(GLuint,GLenum,GLint *);
|
316
|
+
static VALUE
|
317
|
+
gl_GetVertexAttribivNV(obj,arg1,arg2)
|
318
|
+
VALUE obj,arg1,arg2;
|
319
|
+
{
|
320
|
+
GLuint index;
|
321
|
+
GLenum pname;
|
322
|
+
GLint params[4] = {0,0,0,0};
|
323
|
+
GLint size;
|
324
|
+
LOAD_GL_FUNC(glGetVertexAttribivNV,"GL_NV_vertex_program")
|
325
|
+
index = (GLuint)NUM2UINT(arg1);
|
326
|
+
pname = (GLenum)NUM2INT(arg2);
|
327
|
+
if (pname==GL_CURRENT_VERTEX_ATTRIB)
|
328
|
+
size = 4;
|
329
|
+
else
|
330
|
+
size = 1;
|
331
|
+
fptr_glGetVertexAttribivNV(index,pname,params);
|
332
|
+
RET_ARRAY_OR_SINGLE_BOOL(size,cond_GLBOOL2RUBY,pname,params) \
|
333
|
+
}
|
334
|
+
|
335
|
+
|
336
|
+
GL_FUNC_LOAD_4(TrackMatrixNV,GLvoid, GLenum,GLuint,GLenum,GLenum, "GL_NV_vertex_program")
|
337
|
+
|
338
|
+
static void (APIENTRY * fptr_glGetTrackMatrixivNV)(GLenum,GLuint,GLenum,GLint *);
|
339
|
+
static VALUE gl_GetTrackMatrixivNV(VALUE obj,VALUE arg1,VALUE arg2,VALUE arg3)
|
340
|
+
{
|
341
|
+
GLint ret = 0;
|
342
|
+
LOAD_GL_FUNC(glGetTrackMatrixivNV,"GL_NV_vertex_program")
|
343
|
+
fptr_glGetTrackMatrixivNV(NUM2UINT(arg1),NUM2UINT(arg2),NUM2UINT(arg3),&ret);
|
344
|
+
CHECK_GLERROR
|
345
|
+
return INT2NUM(ret);
|
346
|
+
}
|
347
|
+
|
348
|
+
static void (APIENTRY * fptr_glRequestResidentProgramsNV)(GLsizei, GLuint *);
|
349
|
+
static VALUE gl_RequestResidentProgramsNV(VALUE obj,VALUE arg1)
|
350
|
+
{
|
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
|
366
|
+
return Qnil;
|
367
|
+
}
|
368
|
+
|
369
|
+
static GLboolean (APIENTRY * fptr_glAreProgramsResidentNV)(GLsizei, const GLuint *, GLboolean *);
|
370
|
+
static VALUE gl_AreProgramsResidentNV(VALUE obj,VALUE arg1)
|
371
|
+
{
|
372
|
+
GLuint *programs;
|
373
|
+
GLboolean *residences;
|
374
|
+
GLsizei size;
|
375
|
+
GLboolean r;
|
376
|
+
VALUE retary;
|
377
|
+
VALUE ary;
|
378
|
+
int i;
|
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
|
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 void (APIENTRY * fptr_gl##_name_)(GLuint,GLenum,_type_ *); \
|
409
|
+
static VALUE gl_##_name_(VALUE obj,VALUE arg1,VALUE arg2) \
|
410
|
+
{ \
|
411
|
+
_type_ ret = 0; \
|
412
|
+
LOAD_GL_FUNC(gl##_name_,"GL_NV_occlusion_query") \
|
413
|
+
fptr_gl##_name_(NUM2INT(arg1),NUM2INT(arg2),&ret); \
|
414
|
+
CHECK_GLERROR \
|
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 void (APIENTRY * fptr_glPointParameterivNV)(GLenum,const GLint *);
|
426
|
+
static VALUE gl_PointParameterivNV(VALUE obj,VALUE arg1,VALUE arg2)
|
427
|
+
{
|
428
|
+
GLint param = 0;
|
429
|
+
LOAD_GL_FUNC(glPointParameterivNV,"GL_NV_point_sprite")
|
430
|
+
ary2cint(arg2,¶m,1);
|
431
|
+
fptr_glPointParameterivNV(NUM2UINT(arg1),¶m);
|
432
|
+
CHECK_GLERROR
|
433
|
+
return Qnil;
|
434
|
+
}
|
435
|
+
|
436
|
+
/* #282 GL_NV_fragment_program */
|
437
|
+
#define PROGRAMNAMEDPARAM_FUNC(_name_,_type_,_conv_,_extension_) \
|
438
|
+
static void (APIENTRY * fptr_gl##_name_)(GLuint,GLsizei,const GLubyte *,_type_,_type_,_type_,_type_); \
|
439
|
+
static VALUE \
|
440
|
+
gl_##_name_(obj,arg1,arg2,arg3,arg4,arg5,arg6) \
|
441
|
+
VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6; \
|
442
|
+
{ \
|
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 \
|
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 void (APIENTRY * fptr_gl##_name_)(GLuint,GLsizei,const GLubyte *,const _type_ *); \
|
456
|
+
static VALUE \
|
457
|
+
gl_##_name_(obj,arg1,arg2,arg3) \
|
458
|
+
VALUE obj,arg1,arg2,arg3; \
|
459
|
+
{ \
|
460
|
+
_type_ cary[4]; \
|
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 \
|
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 void (APIENTRY * fptr_gl##_name_)(GLuint,GLsizei,const GLubyte *,_type_ *); \
|
475
|
+
static VALUE \
|
476
|
+
gl_##_name_(obj,arg1,arg2) \
|
477
|
+
VALUE obj,arg1,arg2; \
|
478
|
+
{ \
|
479
|
+
_type_ cary[4] = {(_type_)0.0, (_type_)0.0, (_type_)0.0, (_type_)0.0}; \
|
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(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 void (APIENTRY * fptr_gl##_name_)(GLenum,GLuint,_type_ *); \
|
515
|
+
static VALUE \
|
516
|
+
gl_##_name_(obj,arg1,arg2) \
|
517
|
+
VALUE obj,arg1,arg2; \
|
518
|
+
{ \
|
519
|
+
_type_ cary[4] = {(_type_)0.0, (_type_)0.0, (_type_)0.0, (_type_)0.0}; \
|
520
|
+
LOAD_GL_FUNC(gl##_name_,_extension_) \
|
521
|
+
fptr_gl##_name_(NUM2UINT(arg1),NUM2UINT(arg2),cary); \
|
522
|
+
RET_ARRAY_OR_SINGLE(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_NV_gpu_program4")
|
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 module)
|
546
|
+
{
|
547
|
+
/* #222 GL_NV_fence */
|
548
|
+
rb_define_module_function(module, "glGenFencesNV", gl_GenFencesNV, 1);
|
549
|
+
rb_define_module_function(module, "glDeleteFencesNV", gl_DeleteFencesNV, 1);
|
550
|
+
rb_define_module_function(module, "glSetFenceNV", gl_SetFenceNV, 2);
|
551
|
+
rb_define_module_function(module, "glTestFenceNV", gl_TestFenceNV, 1);
|
552
|
+
rb_define_module_function(module, "glFinishFenceNV", gl_FinishFenceNV, 1);
|
553
|
+
rb_define_module_function(module, "glIsFenceNV", gl_IsFenceNV, 1);
|
554
|
+
rb_define_module_function(module, "glGetFenceivNV", gl_GetFenceivNV, 2);
|
555
|
+
|
556
|
+
/* #233 GL_NV_vertex_program */
|
557
|
+
rb_define_module_function(module, "glLoadProgramNV", gl_LoadProgramNV, 3);
|
558
|
+
rb_define_module_function(module, "glGetProgramStringNV", gl_GetProgramStringNV, 2);
|
559
|
+
rb_define_module_function(module, "glGetProgramivNV", gl_GetProgramivNV, 2);
|
560
|
+
rb_define_module_function(module, "glBindProgramNV", gl_BindProgramNV, 2);
|
561
|
+
rb_define_module_function(module, "glGenProgramsNV", gl_GenProgramsNV, 1);
|
562
|
+
rb_define_module_function(module, "glDeleteProgramsNV", gl_DeleteProgramsNV, 1);
|
563
|
+
rb_define_module_function(module, "glIsProgramNV", gl_IsProgramNV, 1);
|
564
|
+
rb_define_module_function(module, "glExecuteProgramNV", gl_ExecuteProgramNV, 3);
|
565
|
+
rb_define_module_function(module, "glVertexAttribPointerNV", gl_VertexAttribPointerNV, 5);
|
566
|
+
rb_define_module_function(module, "glGetVertexAttribPointervNV", gl_GetVertexAttribPointervNV, 1);
|
567
|
+
rb_define_module_function(module, "glProgramParameter4dNV", gl_ProgramParameter4dNV, 6);
|
568
|
+
rb_define_module_function(module, "glProgramParameter4fNV", gl_ProgramParameter4fNV, 6);
|
569
|
+
rb_define_module_function(module, "glProgramParameter4dvNV", gl_ProgramParameter4dvNV, 3);
|
570
|
+
rb_define_module_function(module, "glProgramParameter4fvNV", gl_ProgramParameter4fvNV, 3);
|
571
|
+
rb_define_module_function(module, "glProgramParameters4dvNV", gl_ProgramParameters4dvNV, 3);
|
572
|
+
rb_define_module_function(module, "glProgramParameters4fvNV", gl_ProgramParameters4fvNV, 3);
|
573
|
+
rb_define_module_function(module, "glGetProgramParameterdvNV", gl_GetProgramParameterdvNV, 3);
|
574
|
+
rb_define_module_function(module, "glGetProgramParameterfvNV", gl_GetProgramParameterfvNV, 3);
|
575
|
+
rb_define_module_function(module, "glVertexAttrib1dNV", gl_VertexAttrib1dNV, 2);
|
576
|
+
rb_define_module_function(module, "glVertexAttrib1fNV", gl_VertexAttrib1fNV, 2);
|
577
|
+
rb_define_module_function(module, "glVertexAttrib1sNV", gl_VertexAttrib1sNV, 2);
|
578
|
+
rb_define_module_function(module, "glVertexAttrib2dNV", gl_VertexAttrib2dNV, 3);
|
579
|
+
rb_define_module_function(module, "glVertexAttrib2fNV", gl_VertexAttrib2fNV, 3);
|
580
|
+
rb_define_module_function(module, "glVertexAttrib2sNV", gl_VertexAttrib2sNV, 3);
|
581
|
+
rb_define_module_function(module, "glVertexAttrib3dNV", gl_VertexAttrib3dNV, 4);
|
582
|
+
rb_define_module_function(module, "glVertexAttrib3fNV", gl_VertexAttrib3fNV, 4);
|
583
|
+
rb_define_module_function(module, "glVertexAttrib3sNV", gl_VertexAttrib3sNV, 4);
|
584
|
+
rb_define_module_function(module, "glVertexAttrib4dNV", gl_VertexAttrib4dNV, 5);
|
585
|
+
rb_define_module_function(module, "glVertexAttrib4fNV", gl_VertexAttrib4fNV, 5);
|
586
|
+
rb_define_module_function(module, "glVertexAttrib4sNV", gl_VertexAttrib4sNV, 5);
|
587
|
+
rb_define_module_function(module, "glVertexAttrib4ubNV", gl_VertexAttrib4ubNV, 5);
|
588
|
+
rb_define_module_function(module, "glVertexAttrib1dvNV", gl_VertexAttrib1dvNV, 2);
|
589
|
+
rb_define_module_function(module, "glVertexAttrib1fvNV", gl_VertexAttrib1fvNV, 2);
|
590
|
+
rb_define_module_function(module, "glVertexAttrib1svNV", gl_VertexAttrib1svNV, 2);
|
591
|
+
rb_define_module_function(module, "glVertexAttrib2dvNV", gl_VertexAttrib2dvNV, 2);
|
592
|
+
rb_define_module_function(module, "glVertexAttrib2fvNV", gl_VertexAttrib2fvNV, 2);
|
593
|
+
rb_define_module_function(module, "glVertexAttrib2svNV", gl_VertexAttrib2svNV, 2);
|
594
|
+
rb_define_module_function(module, "glVertexAttrib3dvNV", gl_VertexAttrib3dvNV, 2);
|
595
|
+
rb_define_module_function(module, "glVertexAttrib3fvNV", gl_VertexAttrib3fvNV, 2);
|
596
|
+
rb_define_module_function(module, "glVertexAttrib3svNV", gl_VertexAttrib3svNV, 2);
|
597
|
+
rb_define_module_function(module, "glVertexAttrib4dvNV", gl_VertexAttrib4dvNV, 2);
|
598
|
+
rb_define_module_function(module, "glVertexAttrib4fvNV", gl_VertexAttrib4fvNV, 2);
|
599
|
+
rb_define_module_function(module, "glVertexAttrib4svNV", gl_VertexAttrib4svNV, 2);
|
600
|
+
rb_define_module_function(module, "glVertexAttrib4ubvNV", gl_VertexAttrib4ubvNV, 2);
|
601
|
+
rb_define_module_function(module, "glVertexAttribs1dvNV", gl_VertexAttribs1dvNV, 2);
|
602
|
+
rb_define_module_function(module, "glVertexAttribs1fvNV", gl_VertexAttribs1fvNV, 2);
|
603
|
+
rb_define_module_function(module, "glVertexAttribs1svNV", gl_VertexAttribs1svNV, 2);
|
604
|
+
rb_define_module_function(module, "glVertexAttribs2dvNV", gl_VertexAttribs2dvNV, 2);
|
605
|
+
rb_define_module_function(module, "glVertexAttribs2fvNV", gl_VertexAttribs2fvNV, 2);
|
606
|
+
rb_define_module_function(module, "glVertexAttribs2svNV", gl_VertexAttribs2svNV, 2);
|
607
|
+
rb_define_module_function(module, "glVertexAttribs3dvNV", gl_VertexAttribs3dvNV, 2);
|
608
|
+
rb_define_module_function(module, "glVertexAttribs3fvNV", gl_VertexAttribs3fvNV, 2);
|
609
|
+
rb_define_module_function(module, "glVertexAttribs3svNV", gl_VertexAttribs3svNV, 2);
|
610
|
+
rb_define_module_function(module, "glVertexAttribs4dvNV", gl_VertexAttribs4dvNV, 2);
|
611
|
+
rb_define_module_function(module, "glVertexAttribs4fvNV", gl_VertexAttribs4fvNV, 2);
|
612
|
+
rb_define_module_function(module, "glVertexAttribs4svNV", gl_VertexAttribs4svNV, 2);
|
613
|
+
rb_define_module_function(module, "glVertexAttribs4ubvNV", gl_VertexAttribs4ubvNV, 2);
|
614
|
+
rb_define_module_function(module, "glGetVertexAttribdvNV", gl_GetVertexAttribdvNV, 2);
|
615
|
+
rb_define_module_function(module, "glGetVertexAttribfvNV", gl_GetVertexAttribfvNV, 2);
|
616
|
+
rb_define_module_function(module, "glGetVertexAttribivNV", gl_GetVertexAttribivNV, 2);
|
617
|
+
rb_define_module_function(module, "glTrackMatrixNV", gl_TrackMatrixNV, 4);
|
618
|
+
rb_define_module_function(module, "glGetTrackMatrixivNV", gl_GetTrackMatrixivNV, 3);
|
619
|
+
rb_define_module_function(module, "glRequestResidentProgramsNV", gl_RequestResidentProgramsNV, 1);
|
620
|
+
rb_define_module_function(module, "glAreProgramsResidentNV", gl_AreProgramsResidentNV, 1);
|
621
|
+
|
622
|
+
/* #261 GL_NV_occlusion_query */
|
623
|
+
rb_define_module_function(module, "glGenOcclusionQueriesNV", gl_GenOcclusionQueriesNV, 1);
|
624
|
+
rb_define_module_function(module, "glDeleteOcclusionQueriesNV", gl_DeleteOcclusionQueriesNV, 1);
|
625
|
+
rb_define_module_function(module, "glIsOcclusionQueryNV", gl_IsOcclusionQueryNV, 1);
|
626
|
+
rb_define_module_function(module, "glBeginOcclusionQueryNV", gl_BeginOcclusionQueryNV, 1);
|
627
|
+
rb_define_module_function(module, "glEndOcclusionQueryNV", gl_EndOcclusionQueryNV, 0);
|
628
|
+
rb_define_module_function(module, "glGetOcclusionQueryivNV", gl_GetOcclusionQueryivNV, 2);
|
629
|
+
rb_define_module_function(module, "glGetOcclusionQueryuivNV", gl_GetOcclusionQueryuivNV, 2);
|
630
|
+
|
631
|
+
/* #262 GL_NV_point_sprite */
|
632
|
+
rb_define_module_function(module, "glPointParameteriNV", gl_PointParameteriNV, 2);
|
633
|
+
rb_define_module_function(module, "glPointParameterivNV", gl_PointParameterivNV, 2);
|
634
|
+
|
635
|
+
/* #282 GL_NV_fragment_program */
|
636
|
+
rb_define_module_function(module, "glProgramNamedParameter4fNV", gl_ProgramNamedParameter4fNV, 6);
|
637
|
+
rb_define_module_function(module, "glProgramNamedParameter4dNV", gl_ProgramNamedParameter4dNV, 6);
|
638
|
+
rb_define_module_function(module, "glProgramNamedParameter4fvNV", gl_ProgramNamedParameter4fvNV, 3);
|
639
|
+
rb_define_module_function(module, "glProgramNamedParameter4dvNV", gl_ProgramNamedParameter4dvNV, 3);
|
640
|
+
rb_define_module_function(module, "glGetProgramNamedParameterdvNV", gl_GetProgramNamedParameterdvNV, 2);
|
641
|
+
rb_define_module_function(module, "glGetProgramNamedParameterfvNV", gl_GetProgramNamedParameterfvNV, 2);
|
642
|
+
|
643
|
+
/* #285 GL_NV_primitive_restart */
|
644
|
+
rb_define_module_function(module, "glPrimitiveRestartNV", gl_PrimitiveRestartNV, 0);
|
645
|
+
rb_define_module_function(module, "glPrimitiveRestartIndexNV", gl_PrimitiveRestartIndexNV, 1);
|
646
|
+
|
647
|
+
/* #322 GL_NV_gpu_program4 */
|
648
|
+
rb_define_module_function(module, "glProgramLocalParameterI4iNV", gl_ProgramLocalParameterI4iNV, 6);
|
649
|
+
rb_define_module_function(module, "glProgramLocalParameterI4uiNV", gl_ProgramLocalParameterI4uiNV, 6);
|
650
|
+
rb_define_module_function(module, "glProgramLocalParameterI4ivNV", gl_ProgramLocalParameterI4ivNV, 3);
|
651
|
+
rb_define_module_function(module, "glProgramLocalParameterI4uivNV", gl_ProgramLocalParameterI4uivNV, 3);
|
652
|
+
rb_define_module_function(module, "glProgramLocalParametersI4ivNV", gl_ProgramLocalParametersI4ivNV, 3);
|
653
|
+
rb_define_module_function(module, "glProgramLocalParametersI4uivNV", gl_ProgramLocalParametersI4uivNV, 3);
|
654
|
+
rb_define_module_function(module, "glGetProgramLocalParameterIivNV", gl_GetProgramLocalParameterIivNV, 2);
|
655
|
+
rb_define_module_function(module, "glGetProgramLocalParameterIuivNV", gl_GetProgramLocalParameterIuivNV, 2);
|
656
|
+
rb_define_module_function(module, "glProgramEnvParameterI4iNV", gl_ProgramEnvParameterI4iNV, 6);
|
657
|
+
rb_define_module_function(module, "glProgramEnvParameterI4uiNV", gl_ProgramEnvParameterI4uiNV, 6);
|
658
|
+
rb_define_module_function(module, "glProgramEnvParameterI4ivNV", gl_ProgramEnvParameterI4ivNV, 3);
|
659
|
+
rb_define_module_function(module, "glProgramEnvParameterI4uivNV", gl_ProgramEnvParameterI4uivNV, 3);
|
660
|
+
rb_define_module_function(module, "glProgramEnvParametersI4ivNV", gl_ProgramEnvParametersI4ivNV, 3);
|
661
|
+
rb_define_module_function(module, "glProgramEnvParametersI4uivNV", gl_ProgramEnvParametersI4uivNV, 3);
|
662
|
+
rb_define_module_function(module, "glGetProgramEnvParameterIivNV", gl_GetProgramEnvParameterIivNV, 2);
|
663
|
+
rb_define_module_function(module, "glGetProgramEnvParameterIuivNV", gl_GetProgramEnvParameterIuivNV, 2);
|
664
|
+
|
665
|
+
/* #323 GL_NV_geometry_program4 */
|
666
|
+
rb_define_module_function(module, "glProgramVertexLimitNV", gl_ProgramVertexLimitNV, 2);
|
667
|
+
rb_define_module_function(module, "glFramebufferTextureEXT", gl_FramebufferTextureEXT, 4);
|
668
|
+
rb_define_module_function(module, "glFramebufferTextureLayerEXT", gl_FramebufferTextureLayerEXT, 5);
|
669
|
+
rb_define_module_function(module, "glFramebufferTextureFaceEXT", gl_FramebufferTextureFaceEXT, 5);
|
670
|
+
|
671
|
+
/* #334 GL_NV_depth_buffer_float */
|
672
|
+
rb_define_module_function(module, "glDepthRangedNV", gl_DepthRangedNV, 2);
|
673
|
+
rb_define_module_function(module, "glClearDepthdNV", gl_ClearDepthdNV, 1);
|
674
|
+
rb_define_module_function(module, "glDepthBoundsdNV", gl_DepthBoundsdNV, 2);
|
675
|
+
|
676
|
+
/* #336 GL_NV_framebuffer_multisample_coverage */
|
677
|
+
rb_define_module_function(module, "glRenderbufferStorageMultisampleCoverageNV", gl_RenderbufferStorageMultisampleCoverageNV, 6);
|
678
|
+
|
679
|
+
}
|