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
data/ext/gl/gl-error.c
ADDED
@@ -0,0 +1,104 @@
|
|
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
|
+
VALUE error_checking = Qtrue;
|
19
|
+
|
20
|
+
VALUE Class_GLError;
|
21
|
+
|
22
|
+
#define BUFSIZE 256
|
23
|
+
|
24
|
+
void check_for_glerror(void)
|
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
|
+
int queued_errors = 0;
|
35
|
+
char message[BUFSIZE];
|
36
|
+
VALUE exc;
|
37
|
+
|
38
|
+
/* check for queued errors */
|
39
|
+
for(queued_errors = 0;
|
40
|
+
glGetError()!=GL_NO_ERROR;
|
41
|
+
queued_errors++)
|
42
|
+
;
|
43
|
+
|
44
|
+
switch(error) {
|
45
|
+
case GL_INVALID_ENUM: error_string = "invalid enumerant"; break;
|
46
|
+
case GL_INVALID_VALUE: error_string = "invalid value"; break;
|
47
|
+
case GL_INVALID_OPERATION: error_string = "invalid operation"; break;
|
48
|
+
case GL_STACK_OVERFLOW: error_string = "stack overflow"; break;
|
49
|
+
case GL_STACK_UNDERFLOW: error_string = "stack underflow"; break;
|
50
|
+
case GL_OUT_OF_MEMORY: error_string = "out of memory"; break;
|
51
|
+
case GL_TABLE_TOO_LARGE: error_string = "table too large"; break;
|
52
|
+
case GL_INVALID_FRAMEBUFFER_OPERATION_EXT: error_string = "invalid framebuffer operation"; break;
|
53
|
+
default: error_string = "unknown error"; break;
|
54
|
+
}
|
55
|
+
|
56
|
+
if (queued_errors==0) {
|
57
|
+
snprintf(message,BUFSIZE,"%s",error_string);
|
58
|
+
} else {
|
59
|
+
snprintf(message,BUFSIZE,"%s [%i queued error(s) cleaned]",error_string,queued_errors);
|
60
|
+
}
|
61
|
+
|
62
|
+
exc = rb_funcall(Class_GLError, rb_intern("new"), 2, rb_str_new2(message), INT2NUM(error));
|
63
|
+
rb_funcall(rb_cObject, rb_intern("raise"), 1, exc);
|
64
|
+
}
|
65
|
+
}
|
66
|
+
|
67
|
+
VALUE GLError_initialize(VALUE obj,VALUE message, VALUE error_id)
|
68
|
+
{
|
69
|
+
rb_call_super(1, &message);
|
70
|
+
rb_iv_set(obj, "@id", error_id);
|
71
|
+
|
72
|
+
return obj;
|
73
|
+
}
|
74
|
+
|
75
|
+
static VALUE enable_error_checking(VALUE obj)
|
76
|
+
{
|
77
|
+
error_checking = Qtrue;
|
78
|
+
return Qnil;
|
79
|
+
}
|
80
|
+
|
81
|
+
static VALUE disable_error_checking(VALUE obj)
|
82
|
+
{
|
83
|
+
error_checking = Qfalse;
|
84
|
+
return Qnil;
|
85
|
+
}
|
86
|
+
|
87
|
+
static VALUE is_error_checking_enabled(VALUE obj)
|
88
|
+
{
|
89
|
+
return error_checking;
|
90
|
+
}
|
91
|
+
|
92
|
+
void gl_init_error(VALUE module)
|
93
|
+
{
|
94
|
+
Class_GLError = rb_define_class_under(module, "Error", rb_eStandardError);
|
95
|
+
|
96
|
+
rb_define_method(Class_GLError, "initialize", GLError_initialize, 2);
|
97
|
+
rb_define_attr(Class_GLError, "id", 1, 0);
|
98
|
+
|
99
|
+
rb_define_module_function(module, "enable_error_checking", enable_error_checking, 0);
|
100
|
+
rb_define_module_function(module, "disable_error_checking", disable_error_checking, 0);
|
101
|
+
rb_define_module_function(module, "is_error_checking_enabled?", is_error_checking_enabled, 0);
|
102
|
+
|
103
|
+
rb_global_variable(&error_checking);
|
104
|
+
}
|
@@ -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/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
|
+
}
|
data/ext/gl/gl-ext-arb.c
ADDED
@@ -0,0 +1,866 @@
|
|
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 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 \
|
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
|
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 \
|
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
|
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
|
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
|
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
|
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)NUM2INT(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 *)NUM2LONG(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
|
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 \
|
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(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 \
|
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(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(size,cond_GLBOOL2RUBY,pname,params)
|
350
|
+
}
|
351
|
+
|
352
|
+
|
353
|
+
/* #29 GL_ARB_occlusion_query */
|
354
|
+
GL_FUNC_GENOBJECTS_LOAD(GenQueriesARB,"GL_ARB_occlusion_query")
|
355
|
+
GL_FUNC_DELETEOBJECTS_LOAD(DeleteQueriesARB,"GL_ARB_occlusion_query")
|
356
|
+
GL_FUNC_LOAD_1(IsQueryARB,GLboolean, GLuint, "GL_ARB_occlusion_query")
|
357
|
+
GL_FUNC_LOAD_2(BeginQueryARB,GLvoid, GLuint,GLuint, "GL_ARB_occlusion_query")
|
358
|
+
GL_FUNC_LOAD_1(EndQueryARB,GLvoid, GLenum, "GL_ARB_occlusion_query")
|
359
|
+
|
360
|
+
#define GETQUERY_FUNC(_name_,_type_,_conv_) \
|
361
|
+
static void (APIENTRY * fptr_gl##_name_)(GLuint,GLenum,_type_ *); \
|
362
|
+
static VALUE gl_##_name_(VALUE obj,VALUE arg1,VALUE arg2) \
|
363
|
+
{ \
|
364
|
+
_type_ ret = 0; \
|
365
|
+
LOAD_GL_FUNC(gl##_name_,"GL_ARB_occlusion_query") \
|
366
|
+
fptr_gl##_name_(NUM2INT(arg1),NUM2INT(arg2),&ret); \
|
367
|
+
CHECK_GLERROR \
|
368
|
+
return _conv_(NUM2INT(arg2),ret); \
|
369
|
+
}
|
370
|
+
|
371
|
+
GETQUERY_FUNC(GetQueryivARB,GLint,cond_GLBOOL2RUBY)
|
372
|
+
GETQUERY_FUNC(GetQueryObjectivARB,GLint,cond_GLBOOL2RUBY)
|
373
|
+
GETQUERY_FUNC(GetQueryObjectuivARB,GLuint,cond_GLBOOL2RUBY_U)
|
374
|
+
#undef GETQUERY_FUNC
|
375
|
+
|
376
|
+
/* #30 GL_ARB_shader_objects */
|
377
|
+
GL_FUNC_LOAD_1(DeleteObjectARB,GLvoid, GLuint, "GL_ARB_shader_objects")
|
378
|
+
GL_FUNC_LOAD_2(DetachObjectARB,GLvoid, GLuint,GLuint, "GL_ARB_shader_objects")
|
379
|
+
GL_FUNC_LOAD_1(CompileShaderARB,GLvoid, GLuint, "GL_ARB_shader_objects")
|
380
|
+
GL_FUNC_LOAD_2(AttachObjectARB,GLvoid, GLuint,GLuint, "GL_ARB_shader_objects")
|
381
|
+
GL_FUNC_LOAD_1(LinkProgramARB,GLvoid, GLuint, "GL_ARB_shader_objects")
|
382
|
+
GL_FUNC_LOAD_1(UseProgramObjectARB,GLvoid, GLuint, "GL_ARB_shader_objects")
|
383
|
+
GL_FUNC_LOAD_1(ValidateProgramARB,GLvoid, GLuint, "GL_ARB_shader_objects")
|
384
|
+
GL_FUNC_LOAD_1(GetHandleARB,GLuint, GLenum, "GL_ARB_shader_objects")
|
385
|
+
GL_FUNC_LOAD_1(CreateShaderObjectARB,GLuint, GLenum, "GL_ARB_shader_objects")
|
386
|
+
GL_FUNC_LOAD_0(CreateProgramObjectARB,GLuint, "GL_ARB_shader_objects")
|
387
|
+
|
388
|
+
static void (APIENTRY * fptr_glShaderSourceARB)(GLuint,GLsizei,GLchar**,GLint *);
|
389
|
+
static VALUE
|
390
|
+
gl_ShaderSourceARB(obj,arg1,arg2)
|
391
|
+
VALUE obj,arg1,arg2;
|
392
|
+
{
|
393
|
+
GLuint shader;
|
394
|
+
GLint length;
|
395
|
+
GLchar *str;
|
396
|
+
LOAD_GL_FUNC(glShaderSourceARB,"GL_ARB_shader_objects")
|
397
|
+
shader = (GLuint)NUM2UINT(arg1);
|
398
|
+
Check_Type(arg2,T_STRING);
|
399
|
+
str = RSTRING_PTR(arg2);
|
400
|
+
length = (GLint)RSTRING_LENINT(arg2);
|
401
|
+
fptr_glShaderSourceARB(shader,1,&str,&length);
|
402
|
+
CHECK_GLERROR
|
403
|
+
return Qnil;
|
404
|
+
}
|
405
|
+
|
406
|
+
GL_FUNC_LOAD_2(Uniform1fARB,GLvoid, GLint,GLfloat, "GL_ARB_shader_objects")
|
407
|
+
GL_FUNC_LOAD_3(Uniform2fARB,GLvoid, GLint,GLfloat,GLfloat, "GL_ARB_shader_objects")
|
408
|
+
GL_FUNC_LOAD_4(Uniform3fARB,GLvoid, GLint,GLfloat,GLfloat,GLfloat, "GL_ARB_shader_objects")
|
409
|
+
GL_FUNC_LOAD_5(Uniform4fARB,GLvoid, GLint,GLfloat,GLfloat,GLfloat,GLfloat, "GL_ARB_shader_objects")
|
410
|
+
GL_FUNC_LOAD_2(Uniform1iARB,GLvoid, GLint,GLint, "GL_ARB_shader_objects")
|
411
|
+
GL_FUNC_LOAD_3(Uniform2iARB,GLvoid, GLint,GLint,GLint, "GL_ARB_shader_objects")
|
412
|
+
GL_FUNC_LOAD_4(Uniform3iARB,GLvoid, GLint,GLint,GLint,GLint, "GL_ARB_shader_objects")
|
413
|
+
GL_FUNC_LOAD_5(Uniform4iARB,GLvoid, GLint,GLint,GLint,GLint,GLint, "GL_ARB_shader_objects")
|
414
|
+
|
415
|
+
#define GLUNIFORM_VFUNC(_name_,_type_,_conv_,_size_) \
|
416
|
+
static void (APIENTRY * fptr_gl##_name_)(GLint,GLsizei,const _type_ *); \
|
417
|
+
static VALUE \
|
418
|
+
gl_##_name_(obj,arg1,arg2) \
|
419
|
+
VALUE obj,arg1,arg2; \
|
420
|
+
{ \
|
421
|
+
GLint location; \
|
422
|
+
GLsizei count; \
|
423
|
+
_type_ *value; \
|
424
|
+
LOAD_GL_FUNC(gl##_name_,"GL_ARB_shader_objects") \
|
425
|
+
Check_Type(arg2,T_ARRAY); \
|
426
|
+
count = (GLsizei)RARRAY_LENINT(arg2); \
|
427
|
+
if (count<=0 || (count % _size_) != 0) \
|
428
|
+
rb_raise(rb_eArgError, "Parameter array size must be multiplication of %i",_size_); \
|
429
|
+
location = (GLint)NUM2INT(arg1); \
|
430
|
+
value = ALLOC_N(_type_,count); \
|
431
|
+
_conv_(arg2,value,count); \
|
432
|
+
fptr_gl##_name_(location,count / _size_,value); \
|
433
|
+
xfree(value); \
|
434
|
+
CHECK_GLERROR \
|
435
|
+
return Qnil; \
|
436
|
+
}
|
437
|
+
|
438
|
+
GLUNIFORM_VFUNC(Uniform1fvARB,GLfloat,ary2cflt,1)
|
439
|
+
GLUNIFORM_VFUNC(Uniform2fvARB,GLfloat,ary2cflt,2)
|
440
|
+
GLUNIFORM_VFUNC(Uniform3fvARB,GLfloat,ary2cflt,3)
|
441
|
+
GLUNIFORM_VFUNC(Uniform4fvARB,GLfloat,ary2cflt,4)
|
442
|
+
GLUNIFORM_VFUNC(Uniform1ivARB,GLint,ary2cint,1)
|
443
|
+
GLUNIFORM_VFUNC(Uniform2ivARB,GLint,ary2cint,2)
|
444
|
+
GLUNIFORM_VFUNC(Uniform3ivARB,GLint,ary2cint,3)
|
445
|
+
GLUNIFORM_VFUNC(Uniform4ivARB,GLint,ary2cint,4)
|
446
|
+
#undef GLUNIFORM_VFUNC
|
447
|
+
|
448
|
+
#define UNIFORMMATRIX_FUNC(_name_,_size_) \
|
449
|
+
static void (APIENTRY * fptr_gl##_name_)(GLint,GLsizei,GLboolean,GLfloat *); \
|
450
|
+
static VALUE \
|
451
|
+
gl_##_name_(obj,arg1,arg2,arg3) \
|
452
|
+
VALUE obj,arg1,arg2,arg3; \
|
453
|
+
{ \
|
454
|
+
GLint location; \
|
455
|
+
GLsizei count; \
|
456
|
+
GLboolean transpose; \
|
457
|
+
GLfloat *value; \
|
458
|
+
LOAD_GL_FUNC(gl##_name_,"GL_ARB_shader_objects") \
|
459
|
+
location = (GLint)NUM2INT(arg1); \
|
460
|
+
count = (GLsizei)RARRAY_LENINT(rb_funcall(rb_Array(arg3),rb_intern("flatten"),0)); \
|
461
|
+
transpose = (GLboolean)NUM2INT(arg2); \
|
462
|
+
value = ALLOC_N(GLfloat, count); \
|
463
|
+
ary2cmatfloatcount(arg3,value,_size_,_size_); \
|
464
|
+
fptr_gl##_name_(location,count / (_size_*_size_),transpose,value); \
|
465
|
+
xfree(value); \
|
466
|
+
CHECK_GLERROR \
|
467
|
+
return Qnil; \
|
468
|
+
}
|
469
|
+
|
470
|
+
UNIFORMMATRIX_FUNC(UniformMatrix2fvARB,2)
|
471
|
+
UNIFORMMATRIX_FUNC(UniformMatrix3fvARB,3)
|
472
|
+
UNIFORMMATRIX_FUNC(UniformMatrix4fvARB,4)
|
473
|
+
#undef UNIFORMMATRIX_FUNC
|
474
|
+
|
475
|
+
#define GETOBJECTPARAMETER_FUNC(_name_,_type_,_conv_) \
|
476
|
+
static void (APIENTRY * fptr_gl##_name_)(GLuint,GLenum,_type_ *); \
|
477
|
+
static VALUE \
|
478
|
+
gl_##_name_(obj,arg1,arg2) \
|
479
|
+
VALUE obj,arg1,arg2; \
|
480
|
+
{ \
|
481
|
+
GLuint program; \
|
482
|
+
GLenum pname; \
|
483
|
+
_type_ params = 0; \
|
484
|
+
LOAD_GL_FUNC(gl##_name_,"GL_ARB_shader_objects") \
|
485
|
+
program = (GLuint)NUM2UINT(arg1); \
|
486
|
+
pname = (GLenum)NUM2INT(arg2); \
|
487
|
+
fptr_gl##_name_(program,pname,¶ms); \
|
488
|
+
CHECK_GLERROR \
|
489
|
+
return _conv_(pname,params); \
|
490
|
+
}
|
491
|
+
|
492
|
+
GETOBJECTPARAMETER_FUNC(GetObjectParameterivARB,GLint,cond_GLBOOL2RUBY)
|
493
|
+
GETOBJECTPARAMETER_FUNC(GetObjectParameterfvARB,GLfloat,cond_GLBOOL2RUBY_F)
|
494
|
+
|
495
|
+
#undef GETOBJECTPARAMETER_FUNC
|
496
|
+
|
497
|
+
static void (APIENTRY * fptr_glGetInfoLogARB)(GLuint,GLsizei,GLsizei *,GLchar *);
|
498
|
+
static VALUE
|
499
|
+
gl_GetInfoLogARB(obj,arg1)
|
500
|
+
VALUE obj,arg1;
|
501
|
+
{
|
502
|
+
GLuint program;
|
503
|
+
GLint max_size = 0;
|
504
|
+
GLsizei ret_length = 0;
|
505
|
+
VALUE buffer;
|
506
|
+
LOAD_GL_FUNC(glGetInfoLogARB,"GL_ARB_shader_objects")
|
507
|
+
LOAD_GL_FUNC(glGetObjectParameterivARB,"GL_ARB_shader_objects")
|
508
|
+
program = (GLuint)NUM2UINT(arg1);
|
509
|
+
fptr_glGetObjectParameterivARB(program,GL_OBJECT_INFO_LOG_LENGTH_ARB,&max_size);
|
510
|
+
CHECK_GLERROR
|
511
|
+
if (max_size<=0)
|
512
|
+
return rb_str_new2("");
|
513
|
+
buffer = allocate_buffer_with_string(max_size);
|
514
|
+
fptr_glGetInfoLogARB(program,max_size,&ret_length,RSTRING_PTR(buffer));
|
515
|
+
CHECK_GLERROR
|
516
|
+
return buffer;
|
517
|
+
}
|
518
|
+
|
519
|
+
static void (APIENTRY * fptr_glGetShaderSourceARB)(GLuint,GLsizei,GLsizei *,GLchar *);
|
520
|
+
static VALUE
|
521
|
+
gl_GetShaderSourceARB(obj,arg1)
|
522
|
+
VALUE obj,arg1;
|
523
|
+
{
|
524
|
+
GLuint shader;
|
525
|
+
GLint max_size = 0;
|
526
|
+
GLsizei ret_length = 0;
|
527
|
+
VALUE buffer;
|
528
|
+
LOAD_GL_FUNC(glGetShaderSourceARB,"GL_ARB_shader_objects")
|
529
|
+
LOAD_GL_FUNC(glGetObjectParameterivARB,"GL_ARB_shader_objects")
|
530
|
+
shader = (GLuint)NUM2UINT(arg1);
|
531
|
+
fptr_glGetObjectParameterivARB(shader,GL_OBJECT_SHADER_SOURCE_LENGTH_ARB,&max_size);
|
532
|
+
CHECK_GLERROR
|
533
|
+
if (max_size==0)
|
534
|
+
rb_raise(rb_eTypeError, "Can't determine maximum shader source length");
|
535
|
+
buffer = allocate_buffer_with_string(max_size-1);
|
536
|
+
fptr_glGetShaderSourceARB(shader,max_size,&ret_length,RSTRING_PTR(buffer));
|
537
|
+
CHECK_GLERROR
|
538
|
+
return buffer;
|
539
|
+
}
|
540
|
+
|
541
|
+
static void (APIENTRY * fptr_glGetActiveUniformARB)(GLuint,GLuint,GLsizei,GLsizei*,GLint*,GLenum*,GLchar*);
|
542
|
+
static VALUE
|
543
|
+
gl_GetActiveUniformARB(obj,arg1,arg2)
|
544
|
+
VALUE obj,arg1,arg2;
|
545
|
+
{
|
546
|
+
GLuint program;
|
547
|
+
GLuint index;
|
548
|
+
GLsizei max_size = 0;
|
549
|
+
GLsizei written = 0;
|
550
|
+
GLint uniform_size = 0;
|
551
|
+
GLenum uniform_type = 0;
|
552
|
+
VALUE buffer;
|
553
|
+
VALUE retary;
|
554
|
+
LOAD_GL_FUNC(glGetActiveUniformARB,"GL_ARB_shader_objects")
|
555
|
+
LOAD_GL_FUNC(glGetObjectParameterivARB,"GL_EXT_sahder_objects")
|
556
|
+
program = (GLuint)NUM2UINT(arg1);
|
557
|
+
index = (GLuint)NUM2UINT(arg2);
|
558
|
+
fptr_glGetObjectParameterivARB(program,GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB,&max_size);
|
559
|
+
CHECK_GLERROR
|
560
|
+
if (max_size==0)
|
561
|
+
rb_raise(rb_eTypeError, "Can't determine maximum uniform name length");
|
562
|
+
buffer = allocate_buffer_with_string(max_size-1);
|
563
|
+
fptr_glGetActiveUniformARB(program,index,max_size,&written,&uniform_size,&uniform_type,RSTRING_PTR(buffer));
|
564
|
+
retary = rb_ary_new2(3);
|
565
|
+
rb_ary_push(retary, INT2NUM(uniform_size));
|
566
|
+
rb_ary_push(retary, INT2NUM(uniform_type));
|
567
|
+
rb_ary_push(retary, buffer);
|
568
|
+
CHECK_GLERROR
|
569
|
+
return retary;
|
570
|
+
}
|
571
|
+
|
572
|
+
#define GETUNIFORM_FUNC(_name_,_type_) \
|
573
|
+
static void (APIENTRY * fptr_gl##_name_)(GLuint,GLint,_type_ *); \
|
574
|
+
static VALUE \
|
575
|
+
gl_##_name_(obj,arg1,arg2) \
|
576
|
+
VALUE obj,arg1,arg2; \
|
577
|
+
{ \
|
578
|
+
GLuint program; \
|
579
|
+
GLint location; \
|
580
|
+
_type_ params[16]; \
|
581
|
+
GLint unused = 0; \
|
582
|
+
GLenum uniform_type = 0; \
|
583
|
+
GLint uniform_size = 0; \
|
584
|
+
\
|
585
|
+
LOAD_GL_FUNC(gl##_name_,"GL_ARB_shader_objects") \
|
586
|
+
LOAD_GL_FUNC(glGetActiveUniformARB,"GL_ARB_shader_objects") \
|
587
|
+
program = (GLuint)NUM2UINT(arg1); \
|
588
|
+
location = (GLint)NUM2INT(arg2); \
|
589
|
+
\
|
590
|
+
fptr_glGetActiveUniformARB(program,location,0,NULL,&unused,&uniform_type,NULL); \
|
591
|
+
CHECK_GLERROR \
|
592
|
+
if (uniform_type==0) \
|
593
|
+
rb_raise(rb_eTypeError, "Can't determine the uniform's type"); \
|
594
|
+
\
|
595
|
+
uniform_size = get_uniform_size(uniform_type); \
|
596
|
+
\
|
597
|
+
memset(params,0,16*sizeof(_type_)); \
|
598
|
+
fptr_gl##_name_(program,location,params); \
|
599
|
+
RET_ARRAY_OR_SINGLE(uniform_size,RETCONV_##_type_,params) \
|
600
|
+
}
|
601
|
+
|
602
|
+
GETUNIFORM_FUNC(GetUniformfvARB,GLfloat)
|
603
|
+
GETUNIFORM_FUNC(GetUniformivARB,GLint)
|
604
|
+
#undef GETUNIFORM_FUNC
|
605
|
+
|
606
|
+
static GLint (APIENTRY * fptr_glGetUniformLocationARB)(GLuint,const GLchar*);
|
607
|
+
static VALUE
|
608
|
+
gl_GetUniformLocationARB(obj,arg1,arg2)
|
609
|
+
VALUE obj,arg1,arg2;
|
610
|
+
{
|
611
|
+
GLuint program;
|
612
|
+
GLint ret;
|
613
|
+
LOAD_GL_FUNC(glGetUniformLocationARB,"GL_ARB_shader_objects")
|
614
|
+
program=(GLuint)NUM2UINT(arg1);
|
615
|
+
Check_Type(arg2,T_STRING);
|
616
|
+
ret = fptr_glGetUniformLocationARB(program,RSTRING_PTR(arg2));
|
617
|
+
CHECK_GLERROR
|
618
|
+
return INT2NUM(ret);
|
619
|
+
}
|
620
|
+
|
621
|
+
static void (APIENTRY * fptr_glGetAttachedObjectsARB)(GLuint,GLsizei,GLsizei *,GLuint *);
|
622
|
+
static VALUE
|
623
|
+
gl_GetAttachedObjectsARB(obj,arg1)
|
624
|
+
VALUE obj,arg1;
|
625
|
+
{
|
626
|
+
GLuint program;
|
627
|
+
GLint shaders_num = 0;
|
628
|
+
GLuint *shaders;
|
629
|
+
GLsizei count = 0;
|
630
|
+
LOAD_GL_FUNC(glGetAttachedObjectsARB,"GL_ARB_shader_objects")
|
631
|
+
LOAD_GL_FUNC(glGetObjectParameterivARB,"GL_ARB_shader_objects")
|
632
|
+
program = (GLuint)NUM2UINT(arg1);
|
633
|
+
fptr_glGetObjectParameterivARB(program,GL_OBJECT_ATTACHED_OBJECTS_ARB,&shaders_num);
|
634
|
+
CHECK_GLERROR
|
635
|
+
if (shaders_num<=0)
|
636
|
+
return Qnil;
|
637
|
+
shaders = ALLOC_N(GLuint,shaders_num);
|
638
|
+
fptr_glGetAttachedObjectsARB(program,shaders_num,&count,shaders);
|
639
|
+
RET_ARRAY_OR_SINGLE_FREE(count,RETCONV_GLuint,shaders)
|
640
|
+
}
|
641
|
+
|
642
|
+
/* #31 GL_ARB_vertex_shader */
|
643
|
+
|
644
|
+
static void (APIENTRY * fptr_glBindAttribLocationARB)(GLuint,GLuint,GLchar *);
|
645
|
+
static VALUE
|
646
|
+
gl_BindAttribLocationARB(obj,arg1,arg2,arg3)
|
647
|
+
VALUE obj,arg1,arg2,arg3;
|
648
|
+
{
|
649
|
+
GLuint program;
|
650
|
+
GLuint index;
|
651
|
+
LOAD_GL_FUNC(glBindAttribLocationARB,"GL_ARB_vertex_shader")
|
652
|
+
program = (GLuint)NUM2UINT(arg1);
|
653
|
+
index = (GLuint)NUM2UINT(arg2);
|
654
|
+
Check_Type(arg3, T_STRING);
|
655
|
+
fptr_glBindAttribLocationARB(program,index,RSTRING_PTR(arg3));
|
656
|
+
CHECK_GLERROR
|
657
|
+
return Qnil;
|
658
|
+
}
|
659
|
+
|
660
|
+
static void (APIENTRY * fptr_glGetActiveAttribARB)(GLuint,GLuint,GLsizei,GLsizei *,GLint *,GLenum *,GLchar *);
|
661
|
+
static VALUE
|
662
|
+
gl_GetActiveAttribARB(obj,arg1,arg2)
|
663
|
+
VALUE obj,arg1,arg2;
|
664
|
+
{
|
665
|
+
GLuint program;
|
666
|
+
GLuint index;
|
667
|
+
GLsizei max_size = 0;
|
668
|
+
GLsizei written = 0;
|
669
|
+
GLint attrib_size = 0;
|
670
|
+
GLenum attrib_type = 0;
|
671
|
+
VALUE buffer;
|
672
|
+
VALUE retary;
|
673
|
+
LOAD_GL_FUNC(glGetActiveAttribARB,"GL_ARB_vertex_shader")
|
674
|
+
LOAD_GL_FUNC(glGetObjectParameterivARB,"GL_ARB_vertex_shader")
|
675
|
+
program = (GLuint)NUM2UINT(arg1);
|
676
|
+
index = (GLuint)NUM2UINT(arg2);
|
677
|
+
fptr_glGetObjectParameterivARB(program,GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB,&max_size);
|
678
|
+
CHECK_GLERROR
|
679
|
+
if (max_size==0)
|
680
|
+
rb_raise(rb_eTypeError, "Can't determine maximum attribute name length");
|
681
|
+
buffer = allocate_buffer_with_string(max_size-1);
|
682
|
+
fptr_glGetActiveAttribARB(program,index,max_size,&written,&attrib_size,&attrib_type,RSTRING_PTR(buffer));
|
683
|
+
retary = rb_ary_new2(3);
|
684
|
+
rb_ary_push(retary, INT2NUM(attrib_size));
|
685
|
+
rb_ary_push(retary, INT2NUM(attrib_type));
|
686
|
+
rb_ary_push(retary, buffer);
|
687
|
+
CHECK_GLERROR
|
688
|
+
return retary;
|
689
|
+
}
|
690
|
+
|
691
|
+
static GLint (APIENTRY * fptr_glGetAttribLocationARB)(GLuint,const GLchar*);
|
692
|
+
static VALUE
|
693
|
+
gl_GetAttribLocationARB(obj,arg1,arg2)
|
694
|
+
VALUE obj,arg1,arg2;
|
695
|
+
{
|
696
|
+
GLuint program;
|
697
|
+
GLint ret;
|
698
|
+
LOAD_GL_FUNC(glGetAttribLocationARB,"GL_ARB_shader_objects")
|
699
|
+
program=(GLuint)NUM2UINT(arg1);
|
700
|
+
Check_Type(arg2,T_STRING);
|
701
|
+
ret = fptr_glGetAttribLocationARB(program,RSTRING_PTR(arg2));
|
702
|
+
CHECK_GLERROR
|
703
|
+
return INT2NUM(ret);
|
704
|
+
}
|
705
|
+
|
706
|
+
|
707
|
+
/* #39 GL_ARB_color_buffer_float */
|
708
|
+
GL_FUNC_LOAD_2(ClampColorARB,GLvoid, GLenum,GLenum, "GL_ARB_color_buffer_float")
|
709
|
+
|
710
|
+
void gl_init_functions_ext_arb(VALUE module)
|
711
|
+
{
|
712
|
+
/* #3 GL_ARB_transpose_matrix */
|
713
|
+
rb_define_module_function(module, "glLoadTransposeMatrixfARB", gl_LoadTransposeMatrixfARB, 1);
|
714
|
+
rb_define_module_function(module, "glLoadTransposeMatrixdARB", gl_LoadTransposeMatrixdARB, 1);
|
715
|
+
rb_define_module_function(module, "glMultTransposeMatrixfARB", gl_MultTransposeMatrixfARB, 1);
|
716
|
+
rb_define_module_function(module, "glMultTransposeMatrixdARB", gl_MultTransposeMatrixdARB, 1);
|
717
|
+
|
718
|
+
/* #5 GL_ARB_multisample */
|
719
|
+
rb_define_module_function(module, "glSampleCoverageARB", gl_SampleCoverageARB, 2);
|
720
|
+
|
721
|
+
/* #14 GL_ARB_point_parameters */
|
722
|
+
rb_define_module_function(module, "glPointParameterfARB", gl_PointParameterfARB, 2);
|
723
|
+
rb_define_module_function(module, "glPointParameterfvARB", gl_PointParameterfvARB, 2);
|
724
|
+
|
725
|
+
/* #26 GL_ARB_window_pos */
|
726
|
+
rb_define_module_function(module, "glWindowPos2dARB", gl_WindowPos2dARB, 2);
|
727
|
+
rb_define_module_function(module, "glWindowPos2fARB", gl_WindowPos2fARB, 2);
|
728
|
+
rb_define_module_function(module, "glWindowPos2iARB", gl_WindowPos2iARB, 2);
|
729
|
+
rb_define_module_function(module, "glWindowPos2sARB", gl_WindowPos2sARB, 2);
|
730
|
+
rb_define_module_function(module, "glWindowPos3dARB", gl_WindowPos3dARB, 3);
|
731
|
+
rb_define_module_function(module, "glWindowPos3fARB", gl_WindowPos3fARB, 3);
|
732
|
+
rb_define_module_function(module, "glWindowPos3iARB", gl_WindowPos3iARB, 3);
|
733
|
+
rb_define_module_function(module, "glWindowPos3sARB", gl_WindowPos3sARB, 3);
|
734
|
+
|
735
|
+
rb_define_module_function(module, "glWindowPos2dvARB", gl_WindowPos2dvARB, 1);
|
736
|
+
rb_define_module_function(module, "glWindowPos2fvARB", gl_WindowPos2fvARB, 1);
|
737
|
+
rb_define_module_function(module, "glWindowPos2ivARB", gl_WindowPos2ivARB, 1);
|
738
|
+
rb_define_module_function(module, "glWindowPos2svARB", gl_WindowPos2svARB, 1);
|
739
|
+
rb_define_module_function(module, "glWindowPos3dvARB", gl_WindowPos3dvARB, 1);
|
740
|
+
rb_define_module_function(module, "glWindowPos3fvARB", gl_WindowPos3fvARB, 1);
|
741
|
+
rb_define_module_function(module, "glWindowPos3ivARB", gl_WindowPos3ivARB, 1);
|
742
|
+
rb_define_module_function(module, "glWindowPos3svARB", gl_WindowPos3svARB, 1);
|
743
|
+
|
744
|
+
/* #26 GL_ARB_vertex_program */
|
745
|
+
rb_define_module_function(module, "glProgramStringARB", gl_ProgramStringARB, 3);
|
746
|
+
rb_define_module_function(module, "glGetProgramStringARB", gl_GetProgramStringARB, 2);
|
747
|
+
rb_define_module_function(module, "glGetProgramivARB", gl_GetProgramivARB, 2);
|
748
|
+
rb_define_module_function(module, "glBindProgramARB", gl_BindProgramARB, 2);
|
749
|
+
rb_define_module_function(module, "glGenProgramsARB", gl_GenProgramsARB, 1);
|
750
|
+
rb_define_module_function(module, "glDeleteProgramsARB", gl_DeleteProgramsARB, 1);
|
751
|
+
rb_define_module_function(module, "glIsProgramARB", gl_IsProgramARB, 1);
|
752
|
+
rb_define_module_function(module, "glEnableVertexAttribArrayARB", gl_EnableVertexAttribArrayARB, 1);
|
753
|
+
rb_define_module_function(module, "glDisableVertexAttribArrayARB", gl_DisableVertexAttribArrayARB, 1);
|
754
|
+
rb_define_module_function(module, "glVertexAttribPointerARB", gl_VertexAttribPointerARB, 6);
|
755
|
+
rb_define_module_function(module, "glGetVertexAttribPointervARB", gl_GetVertexAttribPointervARB, 1);
|
756
|
+
rb_define_module_function(module, "glProgramEnvParameter4dARB", gl_ProgramEnvParameter4dARB, 6);
|
757
|
+
rb_define_module_function(module, "glProgramEnvParameter4fARB", gl_ProgramEnvParameter4fARB, 6);
|
758
|
+
rb_define_module_function(module, "glProgramLocalParameter4dARB", gl_ProgramLocalParameter4dARB, 6);
|
759
|
+
rb_define_module_function(module, "glProgramLocalParameter4fARB", gl_ProgramLocalParameter4fARB, 6);
|
760
|
+
rb_define_module_function(module, "glProgramEnvParameter4dvARB", gl_ProgramEnvParameter4dvARB, 3);
|
761
|
+
rb_define_module_function(module, "glProgramEnvParameter4fvARB", gl_ProgramEnvParameter4fvARB, 3);
|
762
|
+
rb_define_module_function(module, "glProgramLocalParameter4dvARB", gl_ProgramLocalParameter4dvARB, 3);
|
763
|
+
rb_define_module_function(module, "glProgramLocalParameter4fvARB", gl_ProgramLocalParameter4fvARB, 3);
|
764
|
+
rb_define_module_function(module, "glGetProgramEnvParameterdvARB", gl_GetProgramEnvParameterdvARB, 2);
|
765
|
+
rb_define_module_function(module, "glGetProgramEnvParameterfvARB", gl_GetProgramEnvParameterfvARB, 2);
|
766
|
+
rb_define_module_function(module, "glGetProgramLocalParameterdvARB", gl_GetProgramLocalParameterdvARB, 2);
|
767
|
+
rb_define_module_function(module, "glGetProgramLocalParameterfvARB", gl_GetProgramLocalParameterfvARB, 2);
|
768
|
+
rb_define_module_function(module, "glVertexAttrib1dARB", gl_VertexAttrib1dARB, 2);
|
769
|
+
rb_define_module_function(module, "glVertexAttrib1fARB", gl_VertexAttrib1fARB, 2);
|
770
|
+
rb_define_module_function(module, "glVertexAttrib1sARB", gl_VertexAttrib1sARB, 2);
|
771
|
+
rb_define_module_function(module, "glVertexAttrib2dARB", gl_VertexAttrib2dARB, 3);
|
772
|
+
rb_define_module_function(module, "glVertexAttrib2fARB", gl_VertexAttrib2fARB, 3);
|
773
|
+
rb_define_module_function(module, "glVertexAttrib2sARB", gl_VertexAttrib2sARB, 3);
|
774
|
+
rb_define_module_function(module, "glVertexAttrib3dARB", gl_VertexAttrib3dARB, 4);
|
775
|
+
rb_define_module_function(module, "glVertexAttrib3fARB", gl_VertexAttrib3fARB, 4);
|
776
|
+
rb_define_module_function(module, "glVertexAttrib3sARB", gl_VertexAttrib3sARB, 4);
|
777
|
+
rb_define_module_function(module, "glVertexAttrib4NbvARB", gl_VertexAttrib4NbvARB, 2);
|
778
|
+
rb_define_module_function(module, "glVertexAttrib4NivARB", gl_VertexAttrib4NivARB, 2);
|
779
|
+
rb_define_module_function(module, "glVertexAttrib4NsvARB", gl_VertexAttrib4NsvARB, 2);
|
780
|
+
rb_define_module_function(module, "glVertexAttrib4NubARB", gl_VertexAttrib4NubARB, 5);
|
781
|
+
rb_define_module_function(module, "glVertexAttrib4NubvARB", gl_VertexAttrib4NubvARB, 2);
|
782
|
+
rb_define_module_function(module, "glVertexAttrib4NuivARB", gl_VertexAttrib4NuivARB, 2);
|
783
|
+
rb_define_module_function(module, "glVertexAttrib4NusvARB", gl_VertexAttrib4NusvARB, 2);
|
784
|
+
rb_define_module_function(module, "glVertexAttrib4bvARB", gl_VertexAttrib4bvARB, 2);
|
785
|
+
rb_define_module_function(module, "glVertexAttrib4dARB", gl_VertexAttrib4dARB, 5);
|
786
|
+
rb_define_module_function(module, "glVertexAttrib4fARB", gl_VertexAttrib4fARB, 5);
|
787
|
+
rb_define_module_function(module, "glVertexAttrib4ivARB", gl_VertexAttrib4ivARB, 2);
|
788
|
+
rb_define_module_function(module, "glVertexAttrib4sARB", gl_VertexAttrib4sARB, 5);
|
789
|
+
rb_define_module_function(module, "glVertexAttrib4ubvARB", gl_VertexAttrib4ubvARB, 2);
|
790
|
+
rb_define_module_function(module, "glVertexAttrib4uivARB", gl_VertexAttrib4uivARB, 2);
|
791
|
+
rb_define_module_function(module, "glVertexAttrib4usvARB", gl_VertexAttrib4usvARB, 2);
|
792
|
+
rb_define_module_function(module, "glVertexAttrib1dvARB", gl_VertexAttrib1dvARB, 2);
|
793
|
+
rb_define_module_function(module, "glVertexAttrib1fvARB", gl_VertexAttrib1fvARB, 2);
|
794
|
+
rb_define_module_function(module, "glVertexAttrib1svARB", gl_VertexAttrib1svARB, 2);
|
795
|
+
rb_define_module_function(module, "glVertexAttrib2dvARB", gl_VertexAttrib2dvARB, 2);
|
796
|
+
rb_define_module_function(module, "glVertexAttrib2fvARB", gl_VertexAttrib2fvARB, 2);
|
797
|
+
rb_define_module_function(module, "glVertexAttrib2svARB", gl_VertexAttrib2svARB, 2);
|
798
|
+
rb_define_module_function(module, "glVertexAttrib3dvARB", gl_VertexAttrib3dvARB, 2);
|
799
|
+
rb_define_module_function(module, "glVertexAttrib3fvARB", gl_VertexAttrib3fvARB, 2);
|
800
|
+
rb_define_module_function(module, "glVertexAttrib3svARB", gl_VertexAttrib3svARB, 2);
|
801
|
+
rb_define_module_function(module, "glVertexAttrib4dvARB", gl_VertexAttrib4dvARB, 2);
|
802
|
+
rb_define_module_function(module, "glVertexAttrib4fvARB", gl_VertexAttrib4fvARB, 2);
|
803
|
+
rb_define_module_function(module, "glVertexAttrib4svARB", gl_VertexAttrib4svARB, 2);
|
804
|
+
rb_define_module_function(module, "glGetVertexAttribdvARB", gl_GetVertexAttribdvARB, 2);
|
805
|
+
rb_define_module_function(module, "glGetVertexAttribfvARB", gl_GetVertexAttribfvARB, 2);
|
806
|
+
rb_define_module_function(module, "glGetVertexAttribivARB", gl_GetVertexAttribivARB, 2);
|
807
|
+
|
808
|
+
/* #29 GL_ARB_occlusion_query */
|
809
|
+
rb_define_module_function(module, "glGenQueriesARB", gl_GenQueriesARB, 1);
|
810
|
+
rb_define_module_function(module, "glDeleteQueriesARB", gl_DeleteQueriesARB, 1);
|
811
|
+
rb_define_module_function(module, "glIsQueryARB", gl_IsQueryARB, 1);
|
812
|
+
rb_define_module_function(module, "glBeginQueryARB", gl_BeginQueryARB, 2);
|
813
|
+
rb_define_module_function(module, "glEndQueryARB", gl_EndQueryARB, 1);
|
814
|
+
rb_define_module_function(module, "glGetQueryivARB", gl_GetQueryivARB, 2);
|
815
|
+
rb_define_module_function(module, "glGetQueryObjectivARB", gl_GetQueryObjectivARB, 2);
|
816
|
+
rb_define_module_function(module, "glGetQueryObjectuivARB", gl_GetQueryObjectuivARB, 2);
|
817
|
+
|
818
|
+
/* #30 GL_ARB_shader_objects */
|
819
|
+
rb_define_module_function(module, "glDeleteObjectARB", gl_DeleteObjectARB, 1);
|
820
|
+
rb_define_module_function(module, "glGetHandleARB", gl_GetHandleARB, 1);
|
821
|
+
rb_define_module_function(module, "glDetachObjectARB", gl_DetachObjectARB, 2);
|
822
|
+
rb_define_module_function(module, "glCreateShaderObjectARB", gl_CreateShaderObjectARB, 1);
|
823
|
+
rb_define_module_function(module, "glShaderSourceARB", gl_ShaderSourceARB, 2);
|
824
|
+
rb_define_module_function(module, "glCompileShaderARB", gl_CompileShaderARB, 1);
|
825
|
+
rb_define_module_function(module, "glCreateProgramObjectARB", gl_CreateProgramObjectARB, 0);
|
826
|
+
rb_define_module_function(module, "glAttachObjectARB", gl_AttachObjectARB, 2);
|
827
|
+
rb_define_module_function(module, "glLinkProgramARB", gl_LinkProgramARB, 1);
|
828
|
+
rb_define_module_function(module, "glUseProgramObjectARB", gl_UseProgramObjectARB, 1);
|
829
|
+
rb_define_module_function(module, "glValidateProgramARB", gl_ValidateProgramARB, 1);
|
830
|
+
rb_define_module_function(module, "glUniform1fARB", gl_Uniform1fARB, 2);
|
831
|
+
rb_define_module_function(module, "glUniform2fARB", gl_Uniform2fARB, 3);
|
832
|
+
rb_define_module_function(module, "glUniform3fARB", gl_Uniform3fARB, 4);
|
833
|
+
rb_define_module_function(module, "glUniform4fARB", gl_Uniform4fARB, 5);
|
834
|
+
rb_define_module_function(module, "glUniform1iARB", gl_Uniform1iARB, 2);
|
835
|
+
rb_define_module_function(module, "glUniform2iARB", gl_Uniform2iARB, 3);
|
836
|
+
rb_define_module_function(module, "glUniform3iARB", gl_Uniform3iARB, 4);
|
837
|
+
rb_define_module_function(module, "glUniform4iARB", gl_Uniform4iARB, 5);
|
838
|
+
rb_define_module_function(module, "glUniform1fvARB", gl_Uniform1fvARB, 2);
|
839
|
+
rb_define_module_function(module, "glUniform2fvARB", gl_Uniform2fvARB, 2);
|
840
|
+
rb_define_module_function(module, "glUniform3fvARB", gl_Uniform3fvARB, 2);
|
841
|
+
rb_define_module_function(module, "glUniform4fvARB", gl_Uniform4fvARB, 2);
|
842
|
+
rb_define_module_function(module, "glUniform1ivARB", gl_Uniform1ivARB, 2);
|
843
|
+
rb_define_module_function(module, "glUniform2ivARB", gl_Uniform2ivARB, 2);
|
844
|
+
rb_define_module_function(module, "glUniform3ivARB", gl_Uniform3ivARB, 2);
|
845
|
+
rb_define_module_function(module, "glUniform4ivARB", gl_Uniform4ivARB, 2);
|
846
|
+
rb_define_module_function(module, "glUniformMatrix2fvARB", gl_UniformMatrix2fvARB, 3);
|
847
|
+
rb_define_module_function(module, "glUniformMatrix3fvARB", gl_UniformMatrix3fvARB, 3);
|
848
|
+
rb_define_module_function(module, "glUniformMatrix4fvARB", gl_UniformMatrix4fvARB, 3);
|
849
|
+
rb_define_module_function(module, "glGetObjectParameterfvARB", gl_GetObjectParameterfvARB, 2);
|
850
|
+
rb_define_module_function(module, "glGetObjectParameterivARB", gl_GetObjectParameterivARB, 2);
|
851
|
+
rb_define_module_function(module, "glGetInfoLogARB", gl_GetInfoLogARB, 1);
|
852
|
+
rb_define_module_function(module, "glGetShaderSourceARB", gl_GetShaderSourceARB, 1);
|
853
|
+
rb_define_module_function(module, "glGetAttachedObjectsARB", gl_GetAttachedObjectsARB, 1);
|
854
|
+
rb_define_module_function(module, "glGetUniformLocationARB", gl_GetUniformLocationARB, 2);
|
855
|
+
rb_define_module_function(module, "glGetActiveUniformARB", gl_GetActiveUniformARB, 2);
|
856
|
+
rb_define_module_function(module, "glGetUniformfvARB", gl_GetUniformfvARB, 2);
|
857
|
+
rb_define_module_function(module, "glGetUniformivARB", gl_GetUniformivARB, 2);
|
858
|
+
|
859
|
+
/* #31 GL_ARB_vertex_shader */
|
860
|
+
rb_define_module_function(module, "glBindAttribLocationARB", gl_BindAttribLocationARB, 3);
|
861
|
+
rb_define_module_function(module, "glGetActiveAttribARB", gl_GetActiveAttribARB, 2);
|
862
|
+
rb_define_module_function(module, "glGetAttribLocationARB", gl_GetAttribLocationARB, 2);
|
863
|
+
|
864
|
+
/* #39 GL_ARB_color_buffer_float */
|
865
|
+
rb_define_module_function(module, "glClampColorARB", gl_ClampColorARB, 2);
|
866
|
+
}
|