ruby-opengl-0.60.1.orig/0000755000000000000000000000000011377006423013501 5ustar rootrootruby-opengl-0.60.1.orig/examples/0000755000000000000000000000000012163761140015315 5ustar rootrootruby-opengl-0.60.1.orig/examples/RedBook/0000755000000000000000000000000011377006423016644 5ustar rootrootruby-opengl-0.60.1.orig/examples/RedBook/double.rb0000755000000000000000000000647411377006423020461 0ustar rootroot# # Copyright (c) 1993-1997, Silicon Graphics, Inc. # ALL RIGHTS RESERVED # Permission to use, copy, modify, and distribute this software for # any purpose and without fee is hereby granted, provided that the above # copyright notice appear in all copies and that both the copyright notice # and this permission notice appear in supporting documentation, and that # the name of Silicon Graphics, Inc. not be used in advertising # or publicity pertaining to distribution of the software without specific, # written prior permission. # # THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS" # AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE, # INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR # FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON # GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT, # SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY # KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION, # LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF # THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN # ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON # ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE # POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE. # # US Government Users Restricted Rights # Use, duplication, or disclosure by the Government is subject to # restrictions set forth in FAR 52.227.19(c)(2) or subparagraph # (c)(1)(ii) of the Rights in Technical Data and Computer Software # clause at DFARS 252.227-7013 and/or in similar or successor # clauses in the FAR or the DOD or NASA FAR Supplement. # Unpublished-- rights reserved under the copyright laws of the # United States. Contractor/manufacturer is Silicon Graphics, # Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311. # # OpenGL(R) is a registered trademark of Silicon Graphics, Inc. # # double.c # This is a simple double buffered program. # Pressing the left mouse button rotates the rectangle. # Pressing the middle mouse button stops the rotation. require 'opengl' require 'rational' include Gl,Glu,Glut $spin = 0.0 display = Proc.new do glClear(GL_COLOR_BUFFER_BIT) glPushMatrix() glRotate($spin, 0.0, 0.0, 1.0) glColor(1.0, 1.0, 1.0) glRect(-25.0, -25.0, 25.0, 25.0) glPopMatrix() glutSwapBuffers() end $spinDisplay = Proc.new do $spin = $spin + 4.0 $spin = $spin - 360.0 if ($spin > 360.0) glutPostRedisplay() end def init glClearColor(0.0, 0.0, 0.0, 0.0) glShadeModel(GL_FLAT) end reshape = Proc.new do |w, h| glViewport(0, 0, w, h) glMatrixMode(GL_PROJECTION) glLoadIdentity() glOrtho(-50.0, 50.0, -50.0, 50.0, -1.0, 1.0) glMatrixMode(GL_MODELVIEW) glLoadIdentity() end mouse = Proc.new do |button, state, x, y| case button when GLUT_LEFT_BUTTON glutIdleFunc($spinDisplay) if (state == GLUT_DOWN) when GLUT_MIDDLE_BUTTON glutIdleFunc(nil) if (state == GLUT_DOWN) end end keyboard = Proc.new do |key, x, y| case (key) when ?\e exit(0) end end # Request double buffer display mode. # Register mouse input callback functions glutInit glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB) glutInitWindowSize(500, 500) glutInitWindowPosition(100, 100) glutCreateWindow($0) init() glutDisplayFunc(display) glutReshapeFunc(reshape) glutKeyboardFunc(keyboard) glutMouseFunc(mouse) glutMainLoop() ruby-opengl-0.60.1.orig/examples/RedBook/stroke.rb0000755000000000000000000001165011377006423020506 0ustar rootroot# # Copyright (c) Mark J. Kilgard, 1994. # # (c) Copyright 1993, Silicon Graphics, Inc. # ALL RIGHTS RESERVED # Permission to use, copy, modify, and distribute this software for # any purpose and without fee is hereby granted, provided that the above # copyright notice appear in all copies and that both the copyright notice # and this permission notice appear in supporting documentation, and that # the name of Silicon Graphics, Inc. not be used in advertising # or publicity pertaining to distribution of the software without specific, # written prior permission. # # THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS" # AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE, # INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR # FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON # GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT, # SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY # KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION, # LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF # THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN # ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON # ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE # POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE. # # US Government Users Restricted Rights # Use, duplication, or disclosure by the Government is subject to # restrictions set forth in FAR 52.227.19(c)(2) or subparagraph # (c)(1)(ii) of the Rights in Technical Data and Computer Software # clause at DFARS 252.227-7013 and/or in similar or successor # clauses in the FAR or the DOD or NASA FAR Supplement. # Unpublished-- rights reserved under the copyright laws of the # United States. Contractor/manufacturer is Silicon Graphics, # Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311. # # OpenGL(TM) is a trademark of Silicon Graphics, Inc. # # stroke.c # This program demonstrates some characters of a # stroke (vector) font. The characters are represented # by display lists, which are given numbers which # correspond to the ASCII values of the characters. # Use of glCallLists() is demonstrated. require 'opengl' require 'mathn' include Gl,Glu,Glut PT=1 STROKE=2 END_=3 Adata = [ [[0, 0], PT], [[0, 9], PT], [[1, 10], PT], [[4, 10], PT], [[5, 9], PT], [[5, 0], STROKE], [[0, 5], PT], [[5, 5], END_] ] Edata = [ [[5, 0], PT], [[0, 0], PT], [[0, 10], PT], [[5, 10], STROKE], [[0, 5], PT], [[4, 5], END_] ] Pdata = [ [[0, 0], PT], [[0, 10], PT], [[4, 10], PT], [[5, 9], PT], [[5, 6], PT], [[4, 5], PT], [[0, 5], END_] ] Rdata = [ [[0, 0], PT], [[0, 10], PT], [[4, 10], PT], [[5, 9], PT], [[5, 6], PT], [[4, 5], PT], [[0, 5], STROKE], [[3, 5], PT], [[5, 0], END_] ] Sdata = [ [[0, 1], PT], [[1, 0], PT], [[4, 0], PT], [[5, 1], PT], [[5, 4], PT], [[4, 5], PT], [[1, 5], PT], [[0, 6], PT], [[0, 9], PT], [[1, 10], PT], [[4, 10], PT], [[5, 9], END_] ] # drawLetter() interprets the instructions from the array # for that letter and renders the letter with line segments. def drawLetter(l) i = 0 glBegin(GL_LINE_STRIP) while true case (l[i][1]) when PT glVertex(l[i][0]) when STROKE glVertex(l[i][0]) glEnd() glBegin(GL_LINE_STRIP) when END_ glVertex(l[i][0]) glEnd() glTranslate(8.0, 0.0, 0.0) return end i += 1 end end # Create a display list for each of 6 characters def myinit glShadeModel(GL_FLAT) base = glGenLists(128) glListBase(base) glNewList(base+'A'[0], GL_COMPILE); drawLetter(Adata); glEndList() glNewList(base+'E'[0], GL_COMPILE); drawLetter(Edata); glEndList() glNewList(base+'P'[0], GL_COMPILE); drawLetter(Pdata); glEndList() glNewList(base+'R'[0], GL_COMPILE); drawLetter(Rdata); glEndList() glNewList(base+'S'[0], GL_COMPILE); drawLetter(Sdata); glEndList() glNewList(base+' '[0], GL_COMPILE); glTranslate(8.0, 0.0, 0.0); glEndList() end $test1 = "A SPARE SERAPE APPEARS AS" $test2 = "APES PREPARE RARE PEPPERS" def printStrokedString(s) glCallLists(GL_BYTE,s) end display = Proc.new do glClear(GL_COLOR_BUFFER_BIT) glColor(1.0, 1.0, 1.0) glPushMatrix() glScale(2.0, 2.0, 2.0) glTranslate(10.0, 30.0, 0.0) printStrokedString($test1) glPopMatrix() glPushMatrix() glScale(2.0, 2.0, 2.0) glTranslate(10.0, 13.0, 0.0) printStrokedString($test2) glPopMatrix() glutSwapBuffers() end reshape = Proc.new do |w, h| glViewport(0, 0, w, h) glMatrixMode(GL_PROJECTION) glLoadIdentity() glOrtho(0.0, w, 0.0, h, -1.0, 1.0) glMatrixMode(GL_MODELVIEW) glLoadIdentity() end keyboard = Proc.new do |key, x, y| case (key) when ?\e exit(0); end end # Main Loop # Open window with initial window size, title bar, # RGBA display mode, and handle input events. glutInit glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB) glutInitWindowSize(440, 120) glutInitWindowPosition(100, 100) glutCreateWindow($0) myinit() glutDisplayFunc(display) glutReshapeFunc(reshape) glutKeyboardFunc(keyboard) glutMainLoop() ruby-opengl-0.60.1.orig/examples/RedBook/smooth.rb0000755000000000000000000000557511377006423020521 0ustar rootroot# # Copyright (c) 1993-1997, Silicon Graphics, Inc. # ALL RIGHTS RESERVED # Permission to use, copy, modify, and distribute this software for # any purpose and without fee is hereby granted, provided that the above # copyright notice appear in all copies and that both the copyright notice # and this permission notice appear in supporting documentation, and that # the name of Silicon Graphics, Inc. not be used in advertising # or publicity pertaining to distribution of the software without specific, # written prior permission. # # THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS" # AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE, # INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR # FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON # GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT, # SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY # KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION, # LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF # THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN # ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON # ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE # POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE. # # US Government Users Restricted Rights # Use, duplication, or disclosure by the Government is subject to # restrictions set forth in FAR 52.227.19(c)(2) or subparagraph # (c)(1)(ii) of the Rights in Technical Data and Computer Software # clause at DFARS 252.227-7013 and/or in similar or successor # clauses in the FAR or the DOD or NASA FAR Supplement. # Unpublished-- rights reserved under the copyright laws of the # United States. Contractor/manufacturer is Silicon Graphics, # Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311. # # OpenGL(R) is a registered trademark of Silicon Graphics, Inc. # # smooth.c # This program demonstrates smooth shading. # A smooth shaded polygon is drawn in a 2-D projection. require 'opengl' include Gl,Glu,Glut def init glClearColor(0,0,0,0) glShadeModel(GL_SMOOTH) end def triangle glBegin(GL_TRIANGLES) glColor3f(1.0, 0.0, 0.0) glVertex2f(5, 5) glColor3f(0.0, 1.0, 0.0) glVertex2f(25, 5) glColor3f(0.0, 0.0, 1.0) glVertex2f(5, 25) glEnd() end display = Proc.new do glClear(GL_COLOR_BUFFER_BIT) triangle glutSwapBuffers() end reshape = Proc.new do |w, h| glViewport(0, 0, w, h) glMatrixMode(GL_PROJECTION) glLoadIdentity if w<=h gluOrtho2D(0,30,0, 30 * h/w) else gluOrtho2D(0,30 * w/h, 0,30) end glMatrixMode(GL_MODELVIEW) end keyboard = lambda do |key, x, y| case(key) when ?\e exit(0) end end glutInit() glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB) glutInitWindowSize(500, 500) glutInitWindowPosition(100, 100) glutCreateWindow($0) init() glutDisplayFunc(display) glutReshapeFunc(reshape) glutKeyboardFunc(keyboard) glutMainLoop() ruby-opengl-0.60.1.orig/examples/RedBook/material.rb0000755000000000000000000002326611377006423021003 0ustar rootroot# # Copyright (c) Mark J. Kilgard, 1994. # # (c) Copyright 1993, Silicon Graphics, Inc. # ALL RIGHTS RESERVED # Permission to use, copy, modify, and distribute this software for # any purpose and without fee is hereby granted, provided that the above # copyright notice appear in all copies and that both the copyright notice # and this permission notice appear in supporting documentation, and that # the name of Silicon Graphics, Inc. not be used in advertising # or publicity pertaining to distribution of the software without specific, # written prior permission. # # THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS" # AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE, # INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR # FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON # GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT, # SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY # KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION, # LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF # THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN # ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON # ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE # POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE. # # US Government Users Restricted Rights # Use, duplication, or disclosure by the Government is subject to # restrictions set forth in FAR 52.227.19(c)(2) or subparagraph # (c)(1)(ii) of the Rights in Technical Data and Computer Software # clause at DFARS 252.227-7013 and/or in similar or successor # clauses in the FAR or the DOD or NASA FAR Supplement. # Unpublished-- rights reserved under the copyright laws of the # United States. Contractor/manufacturer is Silicon Graphics, # Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311. # # OpenGL(TM) is a trademark of Silicon Graphics, Inc. # # material.c # This program demonstrates the use of the GL lighting model. # Several objects are drawn using different material characteristics. # A single light source illuminates the objects. require 'opengl' include Gl,Glu,Glut # Initialize z-buffer, projection matrix, light source, # and lighting model. Do not specify a material property here. def myinit ambient = [ 0.0, 0.0, 0.0, 1.0 ] diffuse = [ 1.0, 1.0, 1.0, 1.0 ] position = [ 0.0, 3.0, 2.0, 0.0 ] lmodel_ambient = [ 0.4, 0.4, 0.4, 1.0 ] local_view = [ 0.0 ] glEnable(GL_DEPTH_TEST) glDepthFunc(GL_LESS) glLight(GL_LIGHT0, GL_AMBIENT, ambient) glLight(GL_LIGHT0, GL_DIFFUSE, diffuse) glLight(GL_LIGHT0, GL_POSITION, position) glLightModel(GL_LIGHT_MODEL_AMBIENT, lmodel_ambient) glLightModel(GL_LIGHT_MODEL_LOCAL_VIEWER, local_view) glEnable(GL_LIGHTING) glEnable(GL_LIGHT0) glClearColor(0.0, 0.1, 0.1, 0.0) end # Draw twelve spheres in 3 rows with 4 columns. # The spheres in the first row have materials with no ambient reflection. # The second row has materials with significant ambient reflection. # The third row has materials with colored ambient reflection. # # The first column has materials with blue, diffuse reflection only. # The second column has blue diffuse reflection, as well as specular # reflection with a low shininess exponent. # The third column has blue diffuse reflection, as well as specular # reflection with a high shininess exponent (a more concentrated highlight). # The fourth column has materials which also include an emissive component. # # glTranslatef() is used to move spheres to their appropriate locations. display = proc do no_mat = [ 0.0, 0.0, 0.0, 1.0 ] mat_ambient = [ 0.7, 0.7, 0.7, 1.0 ] mat_ambient_color = [ 0.8, 0.8, 0.2, 1.0 ] mat_diffuse = [ 0.1, 0.5, 0.8, 1.0 ] mat_specular = [ 1.0, 1.0, 1.0, 1.0 ] no_shininess = [ 0.0 ] low_shininess = [ 5.0 ] high_shininess = [ 100.0 ] mat_emission = [0.3, 0.2, 0.2, 0.0] glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) # draw sphere in first row, first column # diffuse reflection only no ambient or specular glPushMatrix() glTranslate(-3.75, 3.0, 0.0) glMaterial(GL_FRONT, GL_AMBIENT, no_mat) glMaterial(GL_FRONT, GL_DIFFUSE, mat_diffuse) glMaterial(GL_FRONT, GL_SPECULAR, no_mat) glMaterial(GL_FRONT, GL_SHININESS, no_shininess) glMaterial(GL_FRONT, GL_EMISSION, no_mat) glutSolidSphere(1.0, 16, 16) glPopMatrix() # draw sphere in first row, second column # diffuse and specular reflection low shininess no ambient glPushMatrix() glTranslate(-1.25, 3.0, 0.0) glMaterial(GL_FRONT, GL_AMBIENT, no_mat) glMaterial(GL_FRONT, GL_DIFFUSE, mat_diffuse) glMaterial(GL_FRONT, GL_SPECULAR, mat_specular) glMaterial(GL_FRONT, GL_SHININESS, low_shininess) glMaterial(GL_FRONT, GL_EMISSION, no_mat) glutSolidSphere(1.0, 16, 16) glPopMatrix() # draw sphere in first row, third column # diffuse and specular reflection high shininess no ambient glPushMatrix() glTranslate(1.25, 3.0, 0.0) glMaterial(GL_FRONT, GL_AMBIENT, no_mat) glMaterial(GL_FRONT, GL_DIFFUSE, mat_diffuse) glMaterial(GL_FRONT, GL_SPECULAR, mat_specular) glMaterial(GL_FRONT, GL_SHININESS, high_shininess) glMaterial(GL_FRONT, GL_EMISSION, no_mat) glutSolidSphere(1.0, 16, 16) glPopMatrix() # draw sphere in first row, fourth column # diffuse reflection emission no ambient or specular reflection glPushMatrix() glTranslate(3.75, 3.0, 0.0) glMaterial(GL_FRONT, GL_AMBIENT, no_mat) glMaterial(GL_FRONT, GL_DIFFUSE, mat_diffuse) glMaterial(GL_FRONT, GL_SPECULAR, no_mat) glMaterial(GL_FRONT, GL_SHININESS, no_shininess) glMaterial(GL_FRONT, GL_EMISSION, mat_emission) glutSolidSphere(1.0, 16, 16) glPopMatrix() # draw sphere in second row, first column # ambient and diffuse reflection no specular glPushMatrix() glTranslate(-3.75, 0.0, 0.0) glMaterial(GL_FRONT, GL_AMBIENT, mat_ambient) glMaterial(GL_FRONT, GL_DIFFUSE, mat_diffuse) glMaterial(GL_FRONT, GL_SPECULAR, no_mat) glMaterial(GL_FRONT, GL_SHININESS, no_shininess) glMaterial(GL_FRONT, GL_EMISSION, no_mat) glutSolidSphere(1.0, 16, 16) glPopMatrix() # draw sphere in second row, second column # ambient, diffuse and specular reflection low shininess glPushMatrix() glTranslate(-1.25, 0.0, 0.0) glMaterial(GL_FRONT, GL_AMBIENT, mat_ambient) glMaterial(GL_FRONT, GL_DIFFUSE, mat_diffuse) glMaterial(GL_FRONT, GL_SPECULAR, mat_specular) glMaterial(GL_FRONT, GL_SHININESS, low_shininess) glMaterial(GL_FRONT, GL_EMISSION, no_mat) glutSolidSphere(1.0, 16, 16) glPopMatrix() # draw sphere in second row, third column # ambient, diffuse and specular reflection high shininess glPushMatrix() glTranslate(1.25, 0.0, 0.0) glMaterial(GL_FRONT, GL_AMBIENT, mat_ambient) glMaterial(GL_FRONT, GL_DIFFUSE, mat_diffuse) glMaterial(GL_FRONT, GL_SPECULAR, mat_specular) glMaterial(GL_FRONT, GL_SHININESS, high_shininess) glMaterial(GL_FRONT, GL_EMISSION, no_mat) glutSolidSphere(1.0, 16, 16) glPopMatrix() # draw sphere in second row, fourth column # ambient and diffuse reflection emission no specular glPushMatrix() glTranslate(3.75, 0.0, 0.0) glMaterial(GL_FRONT, GL_AMBIENT, mat_ambient) glMaterial(GL_FRONT, GL_DIFFUSE, mat_diffuse) glMaterial(GL_FRONT, GL_SPECULAR, no_mat) glMaterial(GL_FRONT, GL_SHININESS, no_shininess) glMaterial(GL_FRONT, GL_EMISSION, mat_emission) glutSolidSphere(1.0, 16, 16) glPopMatrix() # draw sphere in third row, first column # colored ambient and diffuse reflection no specular glPushMatrix() glTranslate(-3.75, -3.0, 0.0) glMaterial(GL_FRONT, GL_AMBIENT, mat_ambient_color) glMaterial(GL_FRONT, GL_DIFFUSE, mat_diffuse) glMaterial(GL_FRONT, GL_SPECULAR, no_mat) glMaterial(GL_FRONT, GL_SHININESS, no_shininess) glMaterial(GL_FRONT, GL_EMISSION, no_mat) glutSolidSphere(1.0, 16, 16) glPopMatrix() # draw sphere in third row, second column # colored ambient, diffuse and specular reflection low shininess glPushMatrix() glTranslate(-1.25, -3.0, 0.0) glMaterial(GL_FRONT, GL_AMBIENT, mat_ambient_color) glMaterial(GL_FRONT, GL_DIFFUSE, mat_diffuse) glMaterial(GL_FRONT, GL_SPECULAR, mat_specular) glMaterial(GL_FRONT, GL_SHININESS, low_shininess) glMaterial(GL_FRONT, GL_EMISSION, no_mat) glutSolidSphere(1.0, 16, 16) glPopMatrix() # draw sphere in third row, third column # colored ambient, diffuse and specular reflection high shininess glPushMatrix() glTranslate(1.25, -3.0, 0.0) glMaterial(GL_FRONT, GL_AMBIENT, mat_ambient_color) glMaterial(GL_FRONT, GL_DIFFUSE, mat_diffuse) glMaterial(GL_FRONT, GL_SPECULAR, mat_specular) glMaterial(GL_FRONT, GL_SHININESS, high_shininess) glMaterial(GL_FRONT, GL_EMISSION, no_mat) glutSolidSphere(1.0, 16, 16) glPopMatrix() # draw sphere in third row, fourth column # colored ambient and diffuse reflection emission no specular glPushMatrix() glTranslate(3.75, -3.0, 0.0) glMaterial(GL_FRONT, GL_AMBIENT, mat_ambient_color) glMaterial(GL_FRONT, GL_DIFFUSE, mat_diffuse) glMaterial(GL_FRONT, GL_SPECULAR, no_mat) glMaterial(GL_FRONT, GL_SHININESS, no_shininess) glMaterial(GL_FRONT, GL_EMISSION, mat_emission) glutSolidSphere(1.0, 16, 16) glPopMatrix() glutSwapBuffers() end myReshape = proc do |w, h| glViewport(0, 0, w, h) glMatrixMode(GL_PROJECTION) glLoadIdentity() if (w <= (h * 2)) glOrtho(-6.0, 6.0, -3.0*(h.to_f*2)/w, 3.0*(h.to_f*2)/w, -10.0, 10.0) else glOrtho(-6.0*w.to_f/(h*2), 6.0*w.to_f/(h*2), -3.0, 3.0, -10.0, 10.0) end glMatrixMode(GL_MODELVIEW) end keyboard = Proc.new do |key, x, y| case (key) when ?\e exit(0); end end # Main Loop # Open window with initial window size, title bar, # RGBA display mode, and handle input events. glutInit() glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH) glutInitWindowSize(600, 600) glutInitWindowPosition(100, 100) glutCreateWindow() myinit() glutReshapeFunc(myReshape) glutDisplayFunc(display) glutKeyboardFunc(keyboard) glutMainLoop() ruby-opengl-0.60.1.orig/examples/RedBook/teapots.rb0000755000000000000000000001525711377006423020665 0ustar rootroot# # Copyright (c) Mark J. Kilgard, 1994. # # (c) Copyright 1993, Silicon Graphics, Inc. # ALL RIGHTS RESERVED # Permission to use, copy, modify, and distribute this software for # any purpose and without fee is hereby granted, provided that the above # copyright notice appear in all copies and that both the copyright notice # and this permission notice appear in supporting documentation, and that # the name of Silicon Graphics, Inc. not be used in advertising # or publicity pertaining to distribution of the software without specific, # written prior permission. # # THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS" # AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE, # INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR # FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON # GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT, # SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY # KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION, # LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF # THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN # ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON # ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE # POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE. # # US Government Users Restricted Rights # Use, duplication, or disclosure by the Government is subject to # restrictions set forth in FAR 52.227.19(c)(2) or subparagraph # (c)(1)(ii) of the Rights in Technical Data and Computer Software # clause at DFARS 252.227-7013 and/or in similar or successor # clauses in the FAR or the DOD or NASA FAR Supplement. # Unpublished-- rights reserved under the copyright laws of the # United States. Contractor/manufacturer is Silicon Graphics, # Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311. # # OpenGL(TM) is a trademark of Silicon Graphics, Inc. # # teapots.c # This program demonstrates lots of material properties. # A single light source illuminates the objects. require 'opengl' include Gl,Glu,Glut # Initialize depth buffer, projection matrix, light source, and lighting # model. Do not specify a material property here. def myinit ambient = [0.0, 0.0, 0.0, 1.0] diffuse = [1.0, 1.0, 1.0, 1.0] position = [0.0, 3.0, 3.0, 0.0] lmodel_ambient = [0.2, 0.2, 0.2, 1.0] local_view = [0.0] glLight(GL_LIGHT0, GL_AMBIENT, ambient) glLight(GL_LIGHT0, GL_DIFFUSE, diffuse) glLight(GL_LIGHT0, GL_POSITION, position) glLightModel(GL_LIGHT_MODEL_AMBIENT, lmodel_ambient) glLightModel(GL_LIGHT_MODEL_LOCAL_VIEWER, local_view) glFrontFace(GL_CW) glEnable(GL_LIGHTING) glEnable(GL_LIGHT0) glEnable(GL_AUTO_NORMAL) glEnable(GL_NORMALIZE) glEnable(GL_DEPTH_TEST) glDepthFunc(GL_LESS) end # Move object into position. Use 3rd through 12th parameters to specify the # material property. Draw a teapot. def renderTeapot(x, y, ambr, ambg, ambb, difr, difg, difb, specr, specg, specb, shine) mat = [] glPushMatrix() glTranslate(x, y, 0.0) mat[0] = ambr mat[1] = ambg mat[2] = ambb mat[3] = 1.0 glMaterial(GL_FRONT, GL_AMBIENT, mat) mat[0] = difr mat[1] = difg mat[2] = difb glMaterial(GL_FRONT, GL_DIFFUSE, mat) mat[0] = specr mat[1] = specg mat[2] = specb glMaterial(GL_FRONT, GL_SPECULAR, mat) glMaterial(GL_FRONT, GL_SHININESS, shine * 128.0) glutSolidTeapot(1.0) glPopMatrix() end # First column: emerald, jade, obsidian, pearl, ruby, turquoise # 2nd column: brass, bronze, chrome, copper, gold, silver # 3rd column: black, cyan, green, red, white, yellow plastic # 4th column: black, cyan, green, red, white, yellow rubber display = proc do glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) renderTeapot(2.0, 17.0, 0.0215, 0.1745, 0.0215, 0.07568, 0.61424, 0.07568, 0.633, 0.727811, 0.633, 0.6) renderTeapot(2.0, 14.0, 0.135, 0.2225, 0.1575, 0.54, 0.89, 0.63, 0.316228, 0.316228, 0.316228, 0.1) renderTeapot(2.0, 11.0, 0.05375, 0.05, 0.06625, 0.18275, 0.17, 0.22525, 0.332741, 0.328634, 0.346435, 0.3) renderTeapot(2.0, 8.0, 0.25, 0.20725, 0.20725, 1, 0.829, 0.829, 0.296648, 0.296648, 0.296648, 0.088) renderTeapot(2.0, 5.0, 0.1745, 0.01175, 0.01175, 0.61424, 0.04136, 0.04136, 0.727811, 0.626959, 0.626959, 0.6) renderTeapot(2.0, 2.0, 0.1, 0.18725, 0.1745, 0.396, 0.74151, 0.69102, 0.297254, 0.30829, 0.306678, 0.1) renderTeapot(6.0, 17.0, 0.329412, 0.223529, 0.027451, 0.780392, 0.568627, 0.113725, 0.992157, 0.941176, 0.807843, 0.21794872) renderTeapot(6.0, 14.0, 0.2125, 0.1275, 0.054, 0.714, 0.4284, 0.18144, 0.393548, 0.271906, 0.166721, 0.2) renderTeapot(6.0, 11.0, 0.25, 0.25, 0.25, 0.4, 0.4, 0.4, 0.774597, 0.774597, 0.774597, 0.6) renderTeapot(6.0, 8.0, 0.19125, 0.0735, 0.0225, 0.7038, 0.27048, 0.0828, 0.256777, 0.137622, 0.086014, 0.1) renderTeapot(6.0, 5.0, 0.24725, 0.1995, 0.0745, 0.75164, 0.60648, 0.22648, 0.628281, 0.555802, 0.366065, 0.4) renderTeapot(6.0, 2.0, 0.19225, 0.19225, 0.19225, 0.50754, 0.50754, 0.50754, 0.508273, 0.508273, 0.508273, 0.4) renderTeapot(10.0, 17.0, 0.0, 0.0, 0.0, 0.01, 0.01, 0.01, 0.50, 0.50, 0.50, 0.25) renderTeapot(10.0, 14.0, 0.0, 0.1, 0.06, 0.0, 0.50980392, 0.50980392, 0.50196078, 0.50196078, 0.50196078, 0.25) renderTeapot(10.0, 11.0, 0.0, 0.0, 0.0, 0.1, 0.35, 0.1, 0.45, 0.55, 0.45, 0.25) renderTeapot(10.0, 8.0, 0.0, 0.0, 0.0, 0.5, 0.0, 0.0, 0.7, 0.6, 0.6, 0.25) renderTeapot(10.0, 5.0, 0.0, 0.0, 0.0, 0.55, 0.55, 0.55, 0.70, 0.70, 0.70, 0.25) renderTeapot(10.0, 2.0, 0.0, 0.0, 0.0, 0.5, 0.5, 0.0, 0.60, 0.60, 0.50, 0.25) renderTeapot(14.0, 17.0, 0.02, 0.02, 0.02, 0.01, 0.01, 0.01, 0.4, 0.4, 0.4, 0.078125) renderTeapot(14.0, 14.0, 0.0, 0.05, 0.05, 0.4, 0.5, 0.5, 0.04, 0.7, 0.7, 0.078125) renderTeapot(14.0, 11.0, 0.0, 0.05, 0.0, 0.4, 0.5, 0.4, 0.04, 0.7, 0.04, 0.078125) renderTeapot(14.0, 8.0, 0.05, 0.0, 0.0, 0.5, 0.4, 0.4, 0.7, 0.04, 0.04, 0.078125) renderTeapot(14.0, 5.0, 0.05, 0.05, 0.05, 0.5, 0.5, 0.5, 0.7, 0.7, 0.7, 0.078125) renderTeapot(14.0, 2.0, 0.05, 0.05, 0.0, 0.5, 0.5, 0.4, 0.7, 0.7, 0.04, 0.078125) glutSwapBuffers() end myReshape = proc do |w, h| glViewport(0, 0, w, h) glMatrixMode(GL_PROJECTION) glLoadIdentity() if (w <= h) glOrtho(0.0, 16.0, 0.0, 16.0 * h.to_f / w, -10.0, 10.0) else glOrtho(0.0, 16.0 * w.to_f / h, 0.0, 16.0,-10.0, 10.0) end glMatrixMode(GL_MODELVIEW) end keyboard = Proc.new do |key, x, y| case (key) when ?\e exit(0); end end # Main Loop Open window with initial window size, title bar, RGBA display # mode, and handle input events. glutInit() glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH) glutInitWindowSize(500, 500) glutInitWindowPosition(100, 100) glutCreateWindow() myinit() glutReshapeFunc(myReshape) glutDisplayFunc(display) glutKeyboardFunc(keyboard) glutMainLoop() ruby-opengl-0.60.1.orig/examples/RedBook/depthcue.rb0000755000000000000000000000634411377006423021004 0ustar rootroot# # Copyright (c) Mark J. Kilgard, 1994. # # (c) Copyright 1993, Silicon Graphics, Inc. # ALL RIGHTS RESERVED # Permission to use, copy, modify, and distribute this software for # any purpose and without fee is hereby granted, provided that the above # copyright notice appear in all copies and that both the copyright notice # and this permission notice appear in supporting documentation, and that # the name of Silicon Graphics, Inc. not be used in advertising # or publicity pertaining to distribution of the software without specific, # written prior permission. # # THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS" # AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE, # INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR # FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON # GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT, # SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY # KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION, # LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF # THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN # ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON # ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE # POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE. # # US Government Users Restricted Rights # Use, duplication, or disclosure by the Government is subject to # restrictions set forth in FAR 52.227.19(c)(2) or subparagraph # (c)(1)(ii) of the Rights in Technical Data and Computer Software # clause at DFARS 252.227-7013 and/or in similar or successor # clauses in the FAR or the DOD or NASA FAR Supplement. # Unpublished-- rights reserved under the copyright laws of the # United States. Contractor/manufacturer is Silicon Graphics, # Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311. # # OpenGL(TM) is a trademark of Silicon Graphics, Inc. # # depthcue.c # This program draws a wireframe model, which uses # intensity (brightness) to give clues to distance. # Fog is used to achieve this effect. require 'opengl' require 'mathn' include Gl,Glu,Glut # Initialize linear fog for depth cueing. def myinit fogColor = [0.0, 0.0, 0.0, 1.0] glEnable(GL_FOG) glFog(GL_FOG_MODE, GL_LINEAR) glHint(GL_FOG_HINT, GL_NICEST) # per pixel glFog(GL_FOG_START, 3.0) glFog(GL_FOG_END, 5.0) glFog(GL_FOG_COLOR, fogColor) glClearColor(0.0, 0.0, 0.0, 1.0) glDepthFunc(GL_LESS) glEnable(GL_DEPTH_TEST) glShadeModel(GL_FLAT) end # display() draws an icosahedron. display = Proc.new do glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) glColor(1.0, 1.0, 1.0) glutWireIcosahedron() glFlush() end myReshape = Proc.new do |w, h| glViewport(0, 0, w, h) glMatrixMode(GL_PROJECTION) glLoadIdentity() gluPerspective(45.0, w/h, 3.0, 5.0) glMatrixMode(GL_MODELVIEW) glLoadIdentity() glTranslate(0.0, 0.0, -4.0) # move object into view end keyboard = Proc.new do |key, x, y| case (key) when ?\e exit(0) end end # Main Loop glutInit glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB | GLUT_DEPTH) glutInitWindowSize(500, 500) glutInitWindowPosition(100, 100) glutCreateWindow($0) myinit() glutReshapeFunc(myReshape) glutDisplayFunc(display) glutKeyboardFunc(keyboard) glutMainLoop() ruby-opengl-0.60.1.orig/examples/RedBook/movelight.rb0000755000000000000000000001027311377006423021175 0ustar rootroot# # Copyright (c) 1993-1997, Silicon Graphics, Inc. # ALL RIGHTS RESERVED # Permission to use, copy, modify, and distribute this software for # any purpose and without fee is hereby granted, provided that the above # copyright notice appear in all copies and that both the copyright notice # and this permission notice appear in supporting documentation, and that # the name of Silicon Graphics, Inc. not be used in advertising # or publicity pertaining to distribution of the software without specific, # written prior permission. # # THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS" # AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE, # INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR # FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON # GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT, # SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY # KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION, # LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF # THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN # ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON # ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE # POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE. # # US Government Users Restricted Rights # Use, duplication, or disclosure by the Government is subject to # restrictions set forth in FAR 52.227.19(c)(2) or subparagraph # (c)(1)(ii) of the Rights in Technical Data and Computer Software # clause at DFARS 252.227-7013 and/or in similar or successor # clauses in the FAR or the DOD or NASA FAR Supplement. # Unpublished-- rights reserved under the copyright laws of the # United States. Contractor/manufacturer is Silicon Graphics, # Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311. # # OpenGL(R) is a registered trademark of Silicon Graphics, Inc. # # movelight.c # This program demonstrates when to issue lighting and # transformation commands to render a model with a light # which is moved by a modeling transformation (rotate or # translate). The light position is reset after the modeling # transformation is called. The eye position does not change. # # A sphere is drawn using a grey material characteristic. # A single light source illuminates the object. # # Interaction: pressing the left mouse button alters # the modeling transformation (x rotation) by 30 degrees. # The scene is then redrawn with the light in a new position. require 'opengl' require 'rational' require 'mathn' include Gl,Glu,Glut $spin = 0 # Initialize material property, light source, lighting model, # and depth buffer. def init glClearColor(0.0, 0.0, 0.0, 0.0) glShadeModel(GL_SMOOTH) glEnable(GL_LIGHTING) glEnable(GL_LIGHT0) glEnable(GL_DEPTH_TEST) end # Here is where the light position is reset after the modeling # transformation (glRotated) is called. This places the # light at a new position in world coordinates. The cube # represents the position of the light. display = Proc.new do position = [ 0.0, 0.0, 1.5, 1.0 ] glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) glPushMatrix() GLU.LookAt(0.0, 0.0, 5.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) glPushMatrix() glRotate($spin, 1.0, 0.0, 0.0) glLight(GL_LIGHT0, GL_POSITION, position) glTranslate(0.0, 0.0, 1.5) glDisable(GL_LIGHTING) glColor(0.0, 1.0, 1.0) glutWireCube(0.1) glEnable(GL_LIGHTING) glPopMatrix() glutSolidTorus(0.275, 0.85, 8, 15) glPopMatrix() glutSwapBuffers() end reshape = Proc.new do |w, h| glViewport(0, 0, w, h) glMatrixMode(GL_PROJECTION) glLoadIdentity() gluPerspective(40.0, w/h, 1.0, 20.0) glMatrixMode(GL_MODELVIEW) glLoadIdentity() end mouse = Proc.new do |button, state, x, y| case button when GLUT_LEFT_BUTTON if (state == GLUT_DOWN) $spin = ($spin + 30) % 360 glutPostRedisplay() end end end keyboard = Proc.new do |key, x, y| case key when ?\e exit(0) end end # main glutInit glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH) glutInitWindowSize(500, 500) glutInitWindowPosition(100, 100) glutCreateWindow($0) init() glutDisplayFunc(display) glutReshapeFunc(reshape) glutMouseFunc(mouse) glutKeyboardFunc(keyboard) glutMainLoop() ruby-opengl-0.60.1.orig/examples/RedBook/teaambient.rb0000755000000000000000000001030511377006423021304 0ustar rootroot# # Copyright (c) Mark J. Kilgard, 1994. # # (c) Copyright 1993, Silicon Graphics, Inc. # ALL RIGHTS RESERVED # Permission to use, copy, modify, and distribute this software for # any purpose and without fee is hereby granted, provided that the above # copyright notice appear in all copies and that both the copyright notice # and this permission notice appear in supporting documentation, and that # the name of Silicon Graphics, Inc. not be used in advertising # or publicity pertaining to distribution of the software without specific, # written prior permission. # # THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS" # AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE, # INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR # FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON # GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT, # SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY # KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION, # LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF # THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN # ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON # ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE # POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE. # # US Government Users Restricted Rights # Use, duplication, or disclosure by the Government is subject to # restrictions set forth in FAR 52.227.19(c)(2) or subparagraph # (c)(1)(ii) of the Rights in Technical Data and Computer Software # clause at DFARS 252.227-7013 and/or in similar or successor # clauses in the FAR or the DOD or NASA FAR Supplement. # Unpublished-- rights reserved under the copyright laws of the # United States. Contractor/manufacturer is Silicon Graphics, # Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311. # # OpenGL(TM) is a trademark of Silicon Graphics, Inc. # # teaambient.c # This program renders three lighted, shaded teapots, with # different ambient values. require 'opengl' include Gl,Glu,Glut # Initialize light source and lighting model. def myinit light_ambient = [0.0, 0.0, 0.0, 1.0] light_diffuse = [1.0, 1.0, 1.0, 1.0] light_specular = [1.0, 1.0, 1.0, 1.0] # light_position is NOT default value light_position = [1.0, 0.0, 0.0, 0.0] global_ambient = [0.75, 0.75, 0.75, 1.0] glLight(GL_LIGHT0, GL_AMBIENT, light_ambient) glLight(GL_LIGHT0, GL_DIFFUSE, light_diffuse) glLight(GL_LIGHT0, GL_SPECULAR, light_specular) glLight(GL_LIGHT0, GL_POSITION, light_position) glLightModel(GL_LIGHT_MODEL_AMBIENT, global_ambient) glFrontFace(GL_CW) glEnable(GL_LIGHTING) glEnable(GL_LIGHT0) glEnable(GL_AUTO_NORMAL) glEnable(GL_NORMALIZE) glDepthFunc(GL_LESS) glEnable(GL_DEPTH_TEST) end display = proc do low_ambient = [0.1, 0.1, 0.1, 1.0] more_ambient = [0.4, 0.4, 0.4, 1.0] most_ambient = [1.0, 1.0, 1.0, 1.0] glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) # material has small ambient reflection glMaterial(GL_FRONT, GL_AMBIENT, low_ambient) glMaterial(GL_FRONT, GL_SHININESS, 40.0) glPushMatrix() glTranslate(0.0, 2.0, 0.0) glutSolidTeapot(1.0) glPopMatrix() # material has moderate ambient reflection glMaterial(GL_FRONT, GL_AMBIENT, more_ambient) glPushMatrix() glTranslate(0.0, 0.0, 0.0) glutSolidTeapot(1.0) glPopMatrix() # material has large ambient reflection glMaterial(GL_FRONT, GL_AMBIENT, most_ambient) glPushMatrix() glTranslate(0.0, -2.0, 0.0) glutSolidTeapot(1.0) glPopMatrix() glFlush() end myReshape = proc do |w, h| glViewport(0, 0, w, h) glMatrixMode(GL_PROJECTION) glLoadIdentity() if (w <= h) glOrtho(-4.0, 4.0, -4.0 * h / w, 4.0 * h / w, -10.0, 10.0) else glOrtho(-4.0 * w / h, 4.0 * w / h, -4.0, 4.0, -10.0, 10.0) end glMatrixMode(GL_MODELVIEW) end keyboard = Proc.new do |key, x, y| case (key) when ?\e exit(0); end end # Main Loop # Open window with initial window size, title bar, # RGBA display mode, and handle input events. glutInit() glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB | GLUT_DEPTH) glutInitWindowSize(500, 500) glutInitWindowPosition(100, 100) glutCreateWindow() myinit() glutReshapeFunc(myReshape) glutDisplayFunc(display) glutKeyboardFunc(keyboard) glutMainLoop() ruby-opengl-0.60.1.orig/examples/RedBook/pickdepth.rb0000755000000000000000000001223011377006423021145 0ustar rootroot# # Copyright (c) Mark J. Kilgard, 1994. */ # # # (c) Copyright 1993, Silicon Graphics, Inc. # ALL RIGHTS RESERVED # Permission to use, copy, modify, and distribute this software for # any purpose and without fee is hereby granted, provided that the above # copyright notice appear in all copies and that both the copyright notice # and this permission notice appear in supporting documentation, and that # the name of Silicon Graphics, Inc. not be used in advertising # or publicity pertaining to distribution of the software without specific, # written prior permission. # # THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS" # AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE, # INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR # FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON # GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT, # SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY # KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION, # LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF # THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN # ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON # ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE # POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE. # # US Government Users Restricted Rights # Use, duplication, or disclosure by the Government is subject to # restrictions set forth in FAR 52.227.19(c)(2) or subparagraph # (c)(1)(ii) of the Rights in Technical Data and Computer Software # clause at DFARS 252.227-7013 and/or in similar or successor # clauses in the FAR or the DOD or NASA FAR Supplement. # Unpublished-- rights reserved under the copyright laws of the # United States. Contractor/manufacturer is Silicon Graphics, # Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311. # # OpenGL(TM) is a trademark of Silicon Graphics, Inc. # # pickdepth.c # Picking is demonstrated in this program. In # rendering mode, three overlapping rectangles are # drawn. When the left mouse button is pressed, # selection mode is entered with the picking matrix. # Rectangles which are drawn under the cursor position # are "picked." Pay special attention to the depth # value range, which is returned. require 'opengl' include Gl,Glu,Glut def myinit glClearColor(0.0, 0.0, 0.0, 0.0) glDepthFunc(GL_LESS) glEnable(GL_DEPTH_TEST) glShadeModel(GL_FLAT) glDepthRange(0.0, 1.0) #/* The default z mapping */ end # The three rectangles are drawn. In selection mode, # each rectangle is given the same name. Note that # each rectangle is drawn with a different z value. def drawRects(mode) if (mode == GL_SELECT) glLoadName(1) end glBegin(GL_QUADS) glColor(1.0, 1.0, 0.0) glVertex(2, 0, 0) glVertex(2, 6, 0) glVertex(6, 6, 0) glVertex(6, 0, 0) glEnd() if (mode == GL_SELECT) glLoadName(2) end glBegin(GL_QUADS) glColor(0.0, 1.0, 1.0) glVertex(3, 2, -1) glVertex(3, 8, -1) glVertex(8, 8, -1) glVertex(8, 2, -1) glEnd() if (mode == GL_SELECT) glLoadName(3) end glBegin(GL_QUADS) glColor(1.0, 0.0, 1.0) glVertex(0, 2, -2) glVertex(0, 7, -2) glVertex(5, 7, -2) glVertex(5, 2, -2) glEnd() end # processHits() prints out the contents of the # selection array. def processHits(hits, buffer) printf("hits = %d\n", hits) ptr = buffer.unpack("I*") p = 0 for i in 0...hits # for each hit names = ptr[p] printf(" number of names for hit = %d\n", names); p+=1 printf(" z1 is %g", ptr[p].to_f/0xffffffff); p+=1 printf(" z2 is %g\n", ptr[p].to_f/0xffffffff); p+=1 printf(" the name is ") for j in 0...names # for each name printf("%d ", ptr[p]) ; p+=1 end printf("\n") end end # pickRects() sets up selection mode, name stack, # and projection matrix for picking. Then the objects # are drawn. BUFSIZE=512 pickRects = proc do |button, state, x, y| if (button == GLUT_LEFT_BUTTON && state == GLUT_DOWN) viewport = glGetDoublev(GL_VIEWPORT) selectBuf = glSelectBuffer(BUFSIZE) glRenderMode(GL_SELECT) glInitNames() glPushName(~0) glMatrixMode(GL_PROJECTION) glPushMatrix() glLoadIdentity() # create 5x5 pixel picking region near cursor location gluPickMatrix( x, viewport[3] - y, 5.0, 5.0, viewport) glOrtho(0.0, 8.0, 0.0, 8.0, -0.5, 2.5) drawRects(GL_SELECT) glPopMatrix() glFlush() hits = glRenderMode(GL_RENDER) processHits(hits, selectBuf) end end display = proc do glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) drawRects(GL_RENDER) glutSwapBuffers() end myReshape = proc do |w, h| glViewport(0, 0, w, h) glMatrixMode(GL_PROJECTION) glLoadIdentity() glOrtho(0.0, 8.0, 0.0, 8.0, -0.5, 2.5) glMatrixMode(GL_MODELVIEW) glLoadIdentity() end keyboard = Proc.new do |key, x, y| case (key) when ?\e exit(0) end end # Main Loop # Open window with initial window size, title bar, # RGBA display mode, depth buffer, and handle input events. glutInitWindowSize(500, 500) glutInitWindowPosition(100, 100) glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH) glutInit() glutCreateWindow() myinit() glutMouseFunc(pickRects) glutReshapeFunc(myReshape) glutDisplayFunc(display) glutKeyboardFunc(keyboard) glutMainLoop() ruby-opengl-0.60.1.orig/examples/RedBook/model.rb0000755000000000000000000000640111377006423020275 0ustar rootroot# # Copyright (c) 1993-1997, Silicon Graphics, Inc. # ALL RIGHTS RESERVED # Permission to use, copy, modify, and distribute this software for # any purpose and without fee is hereby granted, provided that the above # copyright notice appear in all copies and that both the copyright notice # and this permission notice appear in supporting documentation, and that # the name of Silicon Graphics, Inc. not be used in advertising # or publicity pertaining to distribution of the software without specific, # written prior permission. # # THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS" # AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE, # INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR # FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON # GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT, # SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY # KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION, # LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF # THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN # ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON # ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE # POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE. # # US Government Users Restricted Rights # Use, duplication, or disclosure by the Government is subject to # restrictions set forth in FAR 52.227.19(c)(2) or subparagraph # (c)(1)(ii) of the Rights in Technical Data and Computer Software # clause at DFARS 252.227-7013 and/or in similar or successor # clauses in the FAR or the DOD or NASA FAR Supplement. # Unpublished-- rights reserved under the copyright laws of the # United States. Contractor/manufacturer is Silicon Graphics, # Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311. # # OpenGL(R) is a registered trademark of Silicon Graphics, Inc. # # model.c # This program demonstrates modeling transformations require 'opengl' require 'mathn' include Gl,Glu,Glut def init glClearColor(0.0, 0.0, 0.0, 0.0) glShadeModel(GL_FLAT) end def draw_triangle glBegin(GL_LINE_LOOP) glVertex(0.0, 25.0) glVertex(25.0, -25.0) glVertex(-25.0, -25.0) glEnd() end display = Proc.new do glClear(GL_COLOR_BUFFER_BIT) glColor(1.0, 1.0, 1.0) glLoadIdentity() glColor(1.0, 1.0, 1.0) draw_triangle() glEnable(GL_LINE_STIPPLE) glLineStipple(1, 0xF0F0) glLoadIdentity() glTranslate(-20.0, 0.0, 0.0) draw_triangle() glLineStipple(1, 0xF00F) glLoadIdentity() glScale(1.5, 0.5, 1.0) draw_triangle() glLineStipple(1, 0x8888) glLoadIdentity() glRotate(90.0, 0.0, 0.0, 1.0) draw_triangle() glDisable(GL_LINE_STIPPLE) glutSwapBuffers() end reshape = Proc.new do |w, h| glViewport(0, 0, w, h) glMatrixMode(GL_PROJECTION) glLoadIdentity() if (w <= h) glOrtho(-50.0, 50.0, -50.0*h/w, 50.0*h/w, -1.0, 1.0) else glOrtho(-50.0*w/h,50.0*w/h, -50.0, 50.0, -1.0, 1.0) end glMatrixMode(GL_MODELVIEW) end keyboard = Proc.new do |key, x, y| case key when ?\e exit(0) end end # main glutInit() glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB) glutInitWindowSize(500, 500) glutInitWindowPosition(100, 100) glutCreateWindow($0) init() glutDisplayFunc(display) glutReshapeFunc(reshape) glutKeyboardFunc(keyboard) glutMainLoop() ruby-opengl-0.60.1.orig/examples/RedBook/texbind.rb0000755000000000000000000001215211377006423020632 0ustar rootroot# # Copyright (c) 1993-1997, Silicon Graphics, Inc. # ALL RIGHTS RESERVED # Permission to use, copy, modify, and distribute this software for # any purpose and without fee is hereby granted, provided that the above # copyright notice appear in all copies and that both the copyright notice # and this permission notice appear in supporting documentation, and that # the name of Silicon Graphics, Inc. not be used in advertising # or publicity pertaining to distribution of the software without specific, # written prior permission. # # THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS" # AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE, # INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR # FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON # GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT, # SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY # KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION, # LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF # THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN # ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON # ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE # POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE. # # US Government Users Restricted Rights # Use, duplication, or disclosure by the Government is subject to # restrictions set forth in FAR 52.227.19(c)(2) or subparagraph # (c)(1)(ii) of the Rights in Technical Data and Computer Software # clause at DFARS 252.227-7013 and/or in similar or successor # clauses in the FAR or the DOD or NASA FAR Supplement. # Unpublished-- rights reserved under the copyright laws of the # United States. Contractor/manufacturer is Silicon Graphics, # Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311. # # OpenGL(R) is a registered trademark of Silicon Graphics, Inc. # # texbind.c # This program demonstrates using glBindTexture() by # creating and managing two textures. require 'opengl' require 'mathn' include Gl,Glu,Glut CheckImageWidth = 64 CheckImageHeight = 64 $checkImage = [] $otherImage = [] $texName = [] def makeCheckImages for i in (0..CheckImageHeight-1) for j in (0..CheckImageWidth-1) if ((i&0x8==0)!=(j&0x8==0)) then tmp = 1 else tmp=0 end #c = ((((i&0x8)==0)^((j&0x8))==0))*255 c = tmp * 255 $checkImage[i*CheckImageWidth*4+j*4+0] = c $checkImage[i*CheckImageWidth*4+j*4+1] = c $checkImage[i*CheckImageWidth*4+j*4+2] = c $checkImage[i*CheckImageWidth*4+j*4+3] = 255 #c = ((((i&0x10)==0)^((j&0x10))==0))*255 if ((i&0x10==0)!=(j&0x10==0)) then tmp = 1 else tmp=0 end c = tmp * 255 $otherImage[i*CheckImageWidth*4+j*4+0] = c $otherImage[i*CheckImageWidth*4+j*4+1] = 0 $otherImage[i*CheckImageWidth*4+j*4+2] = 0 $otherImage[i*CheckImageWidth*4+j*4+3] = 255 end end end def init glClearColor(0.0, 0.0, 0.0, 0.0) glShadeModel(GL_FLAT) glEnable(GL_DEPTH_TEST) makeCheckImages() glPixelStorei(GL_UNPACK_ALIGNMENT, 1) $texName = glGenTextures(2) glBindTexture(GL_TEXTURE_2D, $texName[0]) glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP) glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP) glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER,GL_NEAREST) glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER,GL_NEAREST) glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, CheckImageWidth, CheckImageHeight, 0, GL_RGBA, GL_UNSIGNED_BYTE, $checkImage.pack("C*")) glBindTexture(GL_TEXTURE_2D, $texName[1]) glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP) glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP) glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST) glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST) glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL) glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, CheckImageWidth, CheckImageHeight, 0, GL_RGBA, GL_UNSIGNED_BYTE, $otherImage.pack("C*")) glEnable(GL_TEXTURE_2D) end display = Proc.new do glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) glBindTexture(GL_TEXTURE_2D, $texName[0]) glBegin(GL_QUADS) glTexCoord(0.0, 0.0); glVertex(-2.0, -1.0, 0.0) glTexCoord(0.0, 1.0); glVertex(-2.0, 1.0, 0.0) glTexCoord(1.0, 1.0); glVertex(0.0, 1.0, 0.0) glTexCoord(1.0, 0.0); glVertex(0.0, -1.0, 0.0) glEnd() glBindTexture(GL_TEXTURE_2D, $texName[1]) glBegin(GL_QUADS) glTexCoord(0.0, 0.0); glVertex(1.0, -1.0, 0.0) glTexCoord(0.0, 1.0); glVertex(1.0, 1.0, 0.0) glTexCoord(1.0, 1.0); glVertex(2.41421, 1.0, -1.41421) glTexCoord(1.0, 0.0); glVertex(2.41421, -1.0, -1.41421) glEnd() glutSwapBuffers() end reshape = Proc.new do |w, h| glViewport(0, 0, w, h) glMatrixMode(GL_PROJECTION) glLoadIdentity() gluPerspective(60.0, w/h, 1.0, 30.0) glMatrixMode(GL_MODELVIEW) glLoadIdentity() glTranslate(0.0, 0.0, -3.6) end keyboard = Proc.new do |key, x, y| case (key) when ?\e exit(0) end end # main glutInit glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH) glutInitWindowSize(500, 500) glutInitWindowPosition(100, 100) glutCreateWindow($0) init() glutReshapeFunc(reshape) glutDisplayFunc(display) glutKeyboardFunc(keyboard) glutMainLoop() ruby-opengl-0.60.1.orig/examples/RedBook/planet.rb0000755000000000000000000000661111377006423020463 0ustar rootroot# # Copyright (c) 1993-1997, Silicon Graphics, Inc. # ALL RIGHTS RESERVED # Permission to use, copy, modify, and distribute this software for # any purpose and without fee is hereby granted, provided that the above # copyright notice appear in all copies and that both the copyright notice # and this permission notice appear in supporting documentation, and that # the name of Silicon Graphics, Inc. not be used in advertising # or publicity pertaining to distribution of the software without specific, # written prior permission. # # THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS" # AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE, # INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR # FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON # GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT, # SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY # KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION, # LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF # THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN # ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON # ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE # POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE. # # US Government Users Restricted Rights # Use, duplication, or disclosure by the Government is subject to # restrictions set forth in FAR 52.227.19(c)(2) or subparagraph # (c)(1)(ii) of the Rights in Technical Data and Computer Software # clause at DFARS 252.227-7013 and/or in similar or successor # clauses in the FAR or the DOD or NASA FAR Supplement. # Unpublished-- rights reserved under the copyright laws of the # United States. Contractor/manufacturer is Silicon Graphics, # Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311. # # OpenGL(R) is a registered trademark of Silicon Graphics, Inc. # # planet.c # This program shows how to composite modeling transformations # to draw translated and rotated models. # Interaction: pressing the d and y keys (day and year) # alters the rotation of the planet around the sun. require 'opengl' require 'rational' include Gl,Glu,Glut STDOUT.sync = TRUE $year = 0 $day = 0 def init glClearColor(0.0, 0.0, 0.0, 0.0) glShadeModel(GL_FLAT) end display = Proc.new do glClear(GL_COLOR_BUFFER_BIT) glColor(1.0, 1.0, 1.0) glPushMatrix() glutWireSphere(1.0, 20, 16) # draw sun glRotate($year, 0.0, 1.0, 0.0) glTranslate(2.0, 0.0, 0.0) glRotate($day, 0.0, 1.0, 0.0) glutWireSphere(0.2, 10, 8) # draw smaller planet glPopMatrix() glutSwapBuffers() end reshape = Proc.new do |w, h| glViewport(0, 0, w, h) glMatrixMode(GL_PROJECTION) glLoadIdentity() gluPerspective(60.0, w.to_f/h.to_f, 1.0, 20.0) glMatrixMode(GL_MODELVIEW) glLoadIdentity() gluLookAt(0.0, 0.0, 5.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) end keyboard = Proc.new do |key, x, y| case (key) when ?d $day = ($day + 10) % 360 glutPostRedisplay() when ?D $day = ($day - 10) % 360 glutPostRedisplay() when ?y $year = ($year + 5) % 360 glutPostRedisplay() when ?Y $year = ($year - 5) % 360 glutPostRedisplay() when ?\e exit(0) end end glutInit glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB) glutInitWindowSize(500, 500) glutInitWindowPosition(100, 100) glutCreateWindow($0) init() glutDisplayFunc(display) glutReshapeFunc(reshape) glutKeyboardFunc(keyboard) glutMainLoop() ruby-opengl-0.60.1.orig/examples/RedBook/checker.rb0000755000000000000000000001030711377006423020601 0ustar rootroot# # Copyright (c) Mark J. Kilgard, 1994. # # (c) Copyright 1993, Silicon Graphics, Inc. # ALL RIGHTS RESERVED # Permission to use, copy, modify, and distribute this software for # any purpose and without fee is hereby granted, provided that the above # copyright notice appear in all copies and that both the copyright notice # and this permission notice appear in supporting documentation, and that # the name of Silicon Graphics, Inc. not be used in advertising # or publicity pertaining to distribution of the software without specific, # written prior permission. # # THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS" # AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE, # INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR # FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON # GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT, # SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY # KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION, # LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF # THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN # ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON # ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE # POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE. # # US Government Users Restricted Rights # Use, duplication, or disclosure by the Government is subject to # restrictions set forth in FAR 52.227.19(c)(2) or subparagraph # (c)(1)(ii) of the Rights in Technical Data and Computer Software # clause at DFARS 252.227-7013 and/or in similar or successor # clauses in the FAR or the DOD or NASA FAR Supplement. # Unpublished-- rights reserved under the copyright laws of the # United States. Contractor/manufacturer is Silicon Graphics, # Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311. # # OpenGL(TM) is a trademark of Silicon Graphics, Inc. # # checker.c # This program texture maps a checkerboard image onto # two rectangles. This program clamps the texture, if # the texture coordinates fall outside 0.0 and 1.0. require 'opengl' require 'mathn' include Gl,Glu,Glut # Create checkerboard texture CheckImageWidth=64 CheckImageHeight=64 $checkImage = [] def makeCheckImage for i in 0..CheckImageWidth-1 for j in 0..CheckImageHeight-1 c = if ((i&0x8==0) != (j&0x8==0)) then 255 else 0 end $checkImage[(i+CheckImageWidth*j)*3+0] = c $checkImage[(i+CheckImageWidth*j)*3+1] = c $checkImage[(i+CheckImageWidth*j)*3+2] = c end end end def myinit glClearColor(0.0, 0.0, 0.0, 0.0) glEnable(GL_DEPTH_TEST) glDepthFunc(GL_LESS) makeCheckImage() glPixelStore(GL_UNPACK_ALIGNMENT, 1) glTexImage2D(GL_TEXTURE_2D, 0, 3, CheckImageWidth, CheckImageHeight, 0, GL_RGB, GL_UNSIGNED_BYTE, $checkImage.pack("C*")) glTexParameter(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP) glTexParameter(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP) glTexParameter(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR) glTexParameter(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR) glTexEnv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL) glEnable(GL_TEXTURE_2D) glShadeModel(GL_FLAT) end display = Proc.new do glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) glBegin(GL_QUADS) glTexCoord(0.0, 0.0); glVertex(-2.0, -1.0, 0.0) glTexCoord(0.0, 1.0); glVertex(-2.0, 1.0, 0.0) glTexCoord(1.0, 1.0); glVertex(0.0, 1.0, 0.0) glTexCoord(1.0, 0.0); glVertex(0.0, -1.0, 0.0) glTexCoord(0.0, 0.0); glVertex(1.0, -1.0, 0.0) glTexCoord(0.0, 1.0); glVertex(1.0, 1.0, 0.0) glTexCoord(1.0, 1.0); glVertex(2.41421, 1.0, -1.41421) glTexCoord(1.0, 0.0); glVertex(2.41421, -1.0, -1.41421) glEnd() glutSwapBuffers() end myReshape = Proc.new do |w, h| glViewport(0, 0, w, h) glMatrixMode(GL_PROJECTION) glLoadIdentity() gluPerspective(60.0, 1.0*w/h, 1.0, 30.0) glMatrixMode(GL_MODELVIEW) glLoadIdentity() glTranslate(0.0, 0.0, -3.6) end keyboard = Proc.new do |key, x, y| case (key) when ?\e exit(0) end end glutInit glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH) glutInitWindowSize(500, 500) glutInitWindowPosition(100, 100) glutCreateWindow("checker") myinit() glutReshapeFunc(myReshape) glutDisplayFunc(display) glutKeyboardFunc(keyboard) glutMainLoop() ruby-opengl-0.60.1.orig/examples/RedBook/alpha3D.rb0000755000000000000000000001103411377006423020447 0ustar rootroot# # Copyright (c) 1993-1997, Silicon Graphics, Inc. # ALL RIGHTS RESERVED # Permission to use, copy, modify, and distribute this software for # any purpose and without fee is hereby granted, provided that the above # copyright notice appear in all copies and that both the copyright notice # and this permission notice appear in supporting documentation, and that # the name of Silicon Graphics, Inc. not be used in advertising # or publicity pertaining to distribution of the software without specific, # written prior permission. # # THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS" # AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE, # INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR # FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON # GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT, # SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY # KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION, # LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF # THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN # ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON # ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE # POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE. # # US Government Users Restricted Rights # Use, duplication, or disclosure by the Government is subject to # restrictions set forth in FAR 52.227.19(c)(2) or subparagraph # (c)(1)(ii) of the Rights in Technical Data and Computer Software # clause at DFARS 252.227-7013 and/or in similar or successor # clauses in the FAR or the DOD or NASA FAR Supplement. # Unpublished-- rights reserved under the copyright laws of the # United States. Contractor/manufacturer is Silicon Graphics, # Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311. # # OpenGL(R) is a registered trademark of Silicon Graphics, Inc. # # alpha3D.c # This program demonstrates how to intermix opaque and # alpha blended polygons in the same scene, by using # glDepthMask. Press the 'a' key to animate moving the # transparent object through the opaque object. Press # the 'r' key to reset the scene. require 'opengl' include Gl,Glu,Glut MAXZ=1.0 MINZ=-2.0 ZINC=0.1 $solidZ = MAXZ $transparentZ = MINZ $sphereList=nil $cubeList=nil def init mat_specular = [ 1.0, 1.0, 1.0, 0.15 ] mat_shininess = [ 100.0 ] position = [ 0.5, 0.5, 1.0, 0.0 ] glMaterial(GL_FRONT, GL_SPECULAR, mat_specular) glMaterial(GL_FRONT, GL_SHININESS, mat_shininess) glLight(GL_LIGHT0, GL_POSITION, position) glEnable(GL_LIGHTING) glEnable(GL_LIGHT0) glEnable(GL_DEPTH_TEST) $sphereList = glGenLists(1) glNewList($sphereList, GL_COMPILE) glutSolidSphere(0.4, 16, 16) glEndList() $cubeList = glGenLists(1) glNewList($cubeList, GL_COMPILE) glutSolidCube(0.6) glEndList() end display = proc do mat_solid = [ 0.75, 0.75, 0.0, 1.0 ] mat_zero = [ 0.0, 0.0, 0.0, 1.0 ] mat_transparent = [ 0.0, 0.8, 0.8, 0.6 ] mat_emission = [ 0.0, 0.3, 0.3, 0.6 ] glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) glPushMatrix() glTranslate(-0.15, -0.15, $solidZ) glMaterial(GL_FRONT, GL_EMISSION, mat_zero) glMaterial(GL_FRONT, GL_DIFFUSE, mat_solid) glCallList($sphereList) glPopMatrix() glPushMatrix() glTranslate(0.15, 0.15, $transparentZ) glRotate(15.0, 1.0, 1.0, 0.0) glRotate(30.0, 0.0, 1.0, 0.0) glMaterial(GL_FRONT, GL_EMISSION, mat_emission) glMaterial(GL_FRONT, GL_DIFFUSE, mat_transparent) glEnable(GL_BLEND) glDepthMask(GL_FALSE) glBlendFunc(GL_SRC_ALPHA, GL_ONE) glCallList($cubeList) glDepthMask(GL_TRUE) glDisable(GL_BLEND) glPopMatrix() glutSwapBuffers() end reshape = proc do |w, h| glViewport(0, 0, w, h) glMatrixMode(GL_PROJECTION) glLoadIdentity() if (w <= h) glOrtho(-1.5, 1.5, -1.5*h.to_f/w, 1.5*h.to_f/w, -10.0, 10.0) else glOrtho(-1.5*w.to_f/h, 1.5*w.to_f/h, -1.5, 1.5, -10.0, 10.0) end glMatrixMode(GL_MODELVIEW) glLoadIdentity() end animate = proc do if ($solidZ <= MINZ || $transparentZ >= MAXZ) glutIdleFunc(nil) else $solidZ -= ZINC $transparentZ += ZINC glutPostRedisplay() end end keyboard = proc do |key, x, y| case (key) when ?a,?A $solidZ = MAXZ $transparentZ = MINZ glutIdleFunc(animate) when ?r, ?R $solidZ = MAXZ $transparentZ = MINZ glutPostRedisplay() when ?\e exit(0) end end glutInit() glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH) glutInitWindowSize(500, 500) glutInitWindowPosition(100, 100) glutCreateWindow($0) init() glutReshapeFunc(reshape) glutKeyboardFunc(keyboard) glutDisplayFunc(display) glutMainLoop() ruby-opengl-0.60.1.orig/examples/RedBook/clip.rb0000755000000000000000000000600311377006423020122 0ustar rootroot# # Copyright (c) 1993-1997, Silicon Graphics, Inc. # ALL RIGHTS RESERVED # Permission to use, copy, modify, and distribute this software for # any purpose and without fee is hereby granted, provided that the above # copyright notice appear in all copies and that both the copyright notice # and this permission notice appear in supporting documentation, and that # the name of Silicon Graphics, Inc. not be used in advertising # or publicity pertaining to distribution of the software without specific, # written prior permission. # # THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS" # AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE, # INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR # FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON # GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT, # SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY # KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION, # LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF # THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN # ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON # ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE # POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE. # # US Government Users Restricted Rights # Use, duplication, or disclosure by the Government is subject to # restrictions set forth in FAR 52.227.19(c)(2) or subparagraph # (c)(1)(ii) of the Rights in Technical Data and Computer Software # clause at DFARS 252.227-7013 and/or in similar or successor # clauses in the FAR or the DOD or NASA FAR Supplement. # Unpublished-- rights reserved under the copyright laws of the # United States. Contractor/manufacturer is Silicon Graphics, # Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311. # # OpenGL(R) is a registered trademark of Silicon Graphics, Inc. # # clip.c # This program demonstrates arbitrary clipping planes. require 'opengl' require 'mathn' include Gl,Glu,Glut def init glClearColor(0.0, 0.0, 0.0, 0.0) glShadeModel(GL_FLAT) end display = Proc.new do eqn = [0.0, 1.0, 0.0, 0.0] eqn2 = [1.0, 0.0, 0.0, 0.0] glClear(GL_COLOR_BUFFER_BIT) glColor(1.0, 1.0, 1.0) glPushMatrix() glTranslate(0.0, 0.0, -5.0) # clip lower half -- y < 0 glClipPlane(GL_CLIP_PLANE0, eqn) glEnable(GL_CLIP_PLANE0) # clip left half -- x < 0 glClipPlane(GL_CLIP_PLANE1, eqn2) glEnable(GL_CLIP_PLANE1) glRotate(90.0, 1.0, 0.0, 0.0) glutWireSphere(1.0, 20, 16) glPopMatrix() glutSwapBuffers() end reshape = Proc.new do |w, h| glViewport(0, 0, w, h) glMatrixMode(GL_PROJECTION) glLoadIdentity() gluPerspective(60.0, w/ h, 1.0, 20.0) glMatrixMode(GL_MODELVIEW) end keyboard = Proc.new do |key, x, y| case (key) when ?\e exit(0) end end glutInit glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB) glutInitWindowSize(500, 500) glutInitWindowPosition(100, 100) glutCreateWindow($0) init() glutDisplayFunc(display) glutReshapeFunc(reshape) glutKeyboardFunc(keyboard) glutMainLoop() ruby-opengl-0.60.1.orig/examples/RedBook/cube.rb0000755000000000000000000000276411377006423020123 0ustar rootroot#!/usr/bin/env ruby -rubygems require 'opengl' include Gl,Glu,Glut $light_diffuse = [1.0, 0.0, 0.0, 1.0] $light_position = [1.0, 1.0, 1.0, 0.0] $n = [ [-1.0, 0.0, 0.0], [0.0, 1.0, 0.0], [1.0, 0.0, 0.0], [0.0, -1.0, 0.0], [0.0, 0.0, 1.0], [0.0, 0.0, -1.0] ] $faces = [ [0, 1, 2, 3], [3, 2, 6, 7], [7, 6, 5, 4], [4, 5, 1, 0], [5, 6, 2, 1], [7, 4, 0, 3] ] $v = 0 def drawBox for i in (0..5) glBegin(GL_QUADS) glNormal(*($n[i])) glVertex($v[$faces[i][0]]) glVertex($v[$faces[i][1]]) glVertex($v[$faces[i][2]]) glVertex($v[$faces[i][3]]) glEnd() end end display = Proc.new do glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) drawBox glutSwapBuffers end def myinit $v = [[-1, -1,1],[-1, -1,-1], [-1,1,-1], [-1,1,1], [1, -1,1], [1, -1,-1], [1, 1,-1], [1,1,1]] glLight(GL_LIGHT0, GL_DIFFUSE, $light_diffuse) glLight(GL_LIGHT0, GL_POSITION, $light_position) glEnable(GL_LIGHT0) glEnable(GL_LIGHTING) glEnable(GL_DEPTH_TEST) glMatrixMode(GL_PROJECTION) gluPerspective(40.0, 1.0, 1.0, 10.0) glMatrixMode(GL_MODELVIEW) gluLookAt(0.0, 0.0, 5.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) glTranslate(0.0, 0.0, -1.0) glRotate(60, 1.0, 0.0, 0.0) glRotate(-20, 0.0, 0.0, 1.0) end keyboard = Proc.new do |key, x, y| case (key) when ?\e exit(0); end end glutInit glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH) glutInitWindowSize(500, 500) glutInitWindowPosition(100, 100) glutCreateWindow("red 3D lighted cube") glutDisplayFunc(display) glutKeyboardFunc(keyboard) myinit glutMainLoop() ruby-opengl-0.60.1.orig/examples/RedBook/feedback.rb0000755000000000000000000001070311377006423020721 0ustar rootroot# # Copyright (c) 1993-1997, Silicon Graphics, Inc. # ALL RIGHTS RESERVED # Permission to use, copy, modify, and distribute this software for # any purpose and without fee is hereby granted, provided that the above # copyright notice appear in all copies and that both the copyright notice # and this permission notice appear in supporting documentation, and that # the name of Silicon Graphics, Inc. not be used in advertising # or publicity pertaining to distribution of the software without specific, # written prior permission. # # THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS" # AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE, # INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR # FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON # GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT, # SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY # KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION, # LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF # THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN # ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON # ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE # POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE. # # US Government Users Restricted Rights # Use, duplication, or disclosure by the Government is subject to # restrictions set forth in FAR 52.227.19(c)(2) or subparagraph # (c)(1)(ii) of the Rights in Technical Data and Computer Software # clause at DFARS 252.227-7013 and/or in similar or successor # clauses in the FAR or the DOD or NASA FAR Supplement. # Unpublished-- rights reserved under the copyright laws of the # United States. Contractor/manufacturer is Silicon Graphics, # Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311. # # OpenGL(R) is a registered trademark of Silicon Graphics, Inc. # # feedback.c # This program demonstrates use of OpenGL feedback. First, # a lighting environment is set up and a few lines are drawn. # Then feedback mode is entered, and the same lines are # drawn. The results in the feedback buffer are printed. require 'opengl' include Gl,Glu,Glut # Initialize lighting. def init glEnable(GL_LIGHTING) glEnable(GL_LIGHT0) end # Draw a few lines and two points, one of which will # be clipped. If in feedback mode, a passthrough token # is issued between the each primitive. def drawGeometry(mode) glBegin(GL_LINE_STRIP) glNormal(0.0, 0.0, 1.0) glVertex(30.0, 30.0, 0.0) glVertex(50.0, 60.0, 0.0) glVertex(70.0, 40.0, 0.0) glEnd() if (mode == GL_FEEDBACK) glPassThrough(1.0) end glBegin(GL_POINTS) glVertex(-100.0, -100.0, -100.0) # will be clipped glEnd() if (mode == GL_FEEDBACK) glPassThrough(2.0) end glBegin(GL_POINTS) glNormal(0.0, 0.0, 1.0) glVertex(50.0, 50.0, 0.0) glEnd() end # Write contents of one vertex to stdout. def print3DcolorVertex(size, count, buffer) printf(" ") for i in 0...7 printf("%4.2f ", buffer[size-count]) count -= 1 end printf("\n") return count end # Write contents of entire buffer. (Parse tokens!) def printBuffer(size, buffer) count = size while (count!=0) token = buffer[size-count] count-=1 if (token == GL_PASS_THROUGH_TOKEN) printf("GL_PASS_THROUGH_TOKEN\n") printf(" %4.2f\n", buffer[size-count]) count-=1 elsif (token == GL_POINT_TOKEN) printf("GL_POINT_TOKEN\n") count = print3DcolorVertex(size, count, buffer) elsif (token == GL_LINE_TOKEN) printf("GL_LINE_TOKEN\n") count = print3DcolorVertex(size, count, buffer) count = print3DcolorVertex(size, count, buffer) elsif (token == GL_LINE_RESET_TOKEN) printf("GL_LINE_RESET_TOKEN\n") count = print3DcolorVertex(size, count, buffer) count = print3DcolorVertex(size, count, buffer) end end end display = proc do glMatrixMode(GL_PROJECTION) glLoadIdentity() glOrtho(0.0, 100.0, 0.0, 100.0, 0.0, 1.0) glClearColor(0.0, 0.0, 0.0, 0.0) glClear(GL_COLOR_BUFFER_BIT) drawGeometry(GL_RENDER) feedBuffer = glFeedbackBuffer(1024, GL_3D_COLOR) glRenderMode(GL_FEEDBACK) drawGeometry(GL_FEEDBACK) size = glRenderMode(GL_RENDER) printBuffer(size, feedBuffer.unpack("f#{size}")) glutSwapBuffers() end keyboard = proc do |key, x, y| case (key) when ?\e exit(0) end end glutInit() glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB) glutInitWindowSize(100, 100) glutInitWindowPosition(100, 100) glutCreateWindow() init() glutDisplayFunc(display) glutKeyboardFunc(keyboard) glutMainLoop() ruby-opengl-0.60.1.orig/examples/RedBook/stencil.rb0000755000000000000000000001157511377006423020646 0ustar rootroot# # Copyright (c) Mark J. Kilgard, 1994. # # (c) Copyright 1993, Silicon Graphics, Inc. # ALL RIGHTS RESERVED # Permission to use, copy, modify, and distribute this software for # any purpose and without fee is hereby granted, provided that the above # copyright notice appear in all copies and that both the copyright notice # and this permission notice appear in supporting documentation, and that # the name of Silicon Graphics, Inc. not be used in advertising # or publicity pertaining to distribution of the software without specific, # written prior permission. # # THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS" # AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE, # INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR # FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON # GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT, # SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY # KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION, # LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF # THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN # ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON # ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE # POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE. # # US Government Users Restricted Rights # Use, duplication, or disclosure by the Government is subject to # restrictions set forth in FAR 52.227.19(c)(2) or subparagraph # (c)(1)(ii) of the Rights in Technical Data and Computer Software # clause at DFARS 252.227-7013 and/or in similar or successor # clauses in the FAR or the DOD or NASA FAR Supplement. # Unpublished-- rights reserved under the copyright laws of the # United States. Contractor/manufacturer is Silicon Graphics, # Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311. # # OpenGL(TM) is a trademark of Silicon Graphics, Inc. # # stencil.c # This program draws two rotated tori in a window. # A diamond in the center of the window masks out part # of the scene. Within this mask, a different model # (a sphere) is drawn in a different color. # require 'opengl' require 'rational' include Gl,Glu,Glut YELLOWMAT=1 BLUEMAT=2 def myinit yellow_diffuse = [ 0.7, 0.7, 0.0, 1.0 ] yellow_specular = [ 1.0, 1.0, 1.0, 1.0 ] blue_diffuse = [ 0.1, 0.1, 0.7, 1.0 ] blue_specular = [ 0.1, 1.0, 1.0, 1.0 ] position_one = [ 1.0, 1.0, 1.0, 0.0 ] glNewList(YELLOWMAT, GL_COMPILE) glMaterial(GL_FRONT, GL_DIFFUSE, yellow_diffuse) glMaterial(GL_FRONT, GL_SPECULAR, yellow_specular) glMaterial(GL_FRONT, GL_SHININESS, 64.0) glEndList() glNewList(BLUEMAT, GL_COMPILE) glMaterial(GL_FRONT, GL_DIFFUSE, blue_diffuse) glMaterial(GL_FRONT, GL_SPECULAR, blue_specular) glMaterial(GL_FRONT, GL_SHININESS, 45.0) glEndList() glLight(GL_LIGHT0, GL_POSITION, position_one) glEnable(GL_LIGHT0) glEnable(GL_LIGHTING) glEnable(GL_DEPTH_TEST) glClearStencil(0x0) glEnable(GL_STENCIL_TEST) end # Draw a sphere in a diamond-shaped section in the # middle of a window with 2 tori. display = Proc.new do glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) # draw blue sphere where the stencil is 1 glStencilFunc(GL_EQUAL, 0x1, 0x1) glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP) glCallList(BLUEMAT) glutSolidSphere(0.5, 15, 15) # draw the tori where the stencil is not 1 glStencilFunc(GL_NOTEQUAL, 0x1, 0x1) glPushMatrix() glRotate(45.0, 0.0, 0.0, 1.0) glRotate(45.0, 0.0, 1.0, 0.0) glCallList(YELLOWMAT) glutSolidTorus(0.275, 0.85, 15, 15) glPushMatrix() glRotate(90.0, 1.0, 0.0, 0.0) glutSolidTorus(0.275, 0.85, 15, 15) glPopMatrix() glPopMatrix() glutSwapBuffers() end # Whenever the window is reshaped, redefine the # coordinate system and redraw the stencil area. myReshape = Proc.new do |w, h| glViewport(0, 0, w, h) # create a diamond shaped stencil area glMatrixMode(GL_PROJECTION) glLoadIdentity() if w<=h gluOrtho2D(-3.0, 3.0, -3.0*h/w, 3*h/w) else gluOrtho2D(-3.0*w/h, 3.0*w/h, -3.0, 3) end glMatrixMode(GL_MODELVIEW) glLoadIdentity() glClear(GL_STENCIL_BUFFER_BIT) glStencilFunc(GL_ALWAYS, 0x1, 0x1) glStencilOp(GL_REPLACE, GL_REPLACE, GL_REPLACE) glBegin(GL_QUADS) glVertex2f(-1.0, 0.0) glVertex2f(0.0, 1.0) glVertex2f(1.0, 0.0) glVertex2f(0.0, -1.0) glEnd() glMatrixMode(GL_PROJECTION) glLoadIdentity() GLU.Perspective(45.0, w.to_f/h.to_f, 3.0, 7.0) glMatrixMode(GL_MODELVIEW) glLoadIdentity() glTranslate(0.0, 0.0, -5.0) end keyboard = Proc.new do |key, x, y| case (key) when ?\e exit(0); end end # Main Loop # Open window with initial window size, title bar, # RGB display mode, and handle input events. glutInit() glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH | GLUT_STENCIL) glutInitWindowSize(500, 500) glutInitWindowPosition(100, 100) glutCreateWindow($0) myinit glutReshapeFunc(myReshape) glutDisplayFunc(display) glutKeyboardFunc(keyboard) glutMainLoop() ruby-opengl-0.60.1.orig/examples/RedBook/image.rb0000755000000000000000000001050411377006423020256 0ustar rootroot# # Copyright (c) 1993-1997, Silicon Graphics, Inc. # ALL RIGHTS RESERVED # Permission to use, copy, modify, and distribute this software for # any purpose and without fee is hereby granted, provided that the above # copyright notice appear in all copies and that both the copyright notice # and this permission notice appear in supporting documentation, and that # the name of Silicon Graphics, Inc. not be used in advertising # or publicity pertaining to distribution of the software without specific, # written prior permission. # # THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS" # AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE, # INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR # FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON # GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT, # SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY # KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION, # LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF # THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN # ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON # ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE # POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE. # # US Government Users Restricted Rights # Use, duplication, or disclosure by the Government is subject to # restrictions set forth in FAR 52.227.19(c)(2) or subparagraph # (c)(1)(ii) of the Rights in Technical Data and Computer Software # clause at DFARS 252.227-7013 and/or in similar or successor # clauses in the FAR or the DOD or NASA FAR Supplement. # Unpublished-- rights reserved under the copyright laws of the # United States. Contractor/manufacturer is Silicon Graphics, # Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311. # # OpenGL(R) is a registered trademark of Silicon Graphics, Inc. # # image.c # This program demonstrates drawing pixels and shows the effect # of glDrawPixels(), glCopyPixels(), and glPixelZoom(). # Interaction: moving the mouse while pressing the mouse button # will copy the image in the lower-left corner of the window # to the mouse position, using the current pixel zoom factors. # There is no attempt to prevent you from drawing over the original # image. If you press the 'r' key, the original image and zoom # factors are reset. If you press the 'z' or 'Z' keys, you change # the zoom factors. require 'opengl' require 'mathn' include Gl,Glu,Glut # Create checkerboard image CheckImageWidth=64 CheckImageHeight=64 $checkImage=[] $zoomFactor = 1.0 $height = 0.0 def makeCheckImage for i in 0..CheckImageWidth-1 for j in 0..CheckImageHeight-1 c = if ((i&0x8==0) != (j&0x8==0)) then 255 else 0 end $checkImage[(i+CheckImageWidth*j)*3+0] = c $checkImage[(i+CheckImageWidth*j)*3+1] = c $checkImage[(i+CheckImageWidth*j)*3+2] = c end end end def init glClearColor(0.0, 0.0, 0.0, 0.0) glShadeModel(GL_FLAT) makeCheckImage() glPixelStorei(GL_UNPACK_ALIGNMENT, 1) end display = Proc.new do glClear(GL_COLOR_BUFFER_BIT) glRasterPos(0, 0) glDrawPixels(CheckImageWidth, CheckImageHeight, GL_RGB, GL_UNSIGNED_BYTE, $checkImage.pack("C*")) glFlush() end reshape = Proc.new do |w, h| glViewport(0, 0, w, h) $height = h glMatrixMode(GL_PROJECTION) glLoadIdentity() gluOrtho2D(0.0, w, 0.0, h) glMatrixMode(GL_MODELVIEW) glLoadIdentity() end $screeny = 0.0 motion = Proc.new do |x, y| $screeny = $height - y glRasterPos(x, $screeny) glPixelZoom($zoomFactor, $zoomFactor) glCopyPixels(0, 0, CheckImageWidth, CheckImageHeight, GL_COLOR) glPixelZoom(1.0, 1.0) glFlush() end keyboard = Proc.new do |key, x, y| case (key) when ?r,?R $zoomFactor = 1.0 glutPostRedisplay() printf("zoomFactor reset to 1.0\n") when ?z $zoomFactor = $zoomFactor + 0.5 if ($zoomFactor >= 3.0) $zoomFactor = 3.0 end printf("zoomFactor is now %4.1f\n", $zoomFactor) when ?Z $zoomFactor = $zoomFactor - 0.5 if ($zoomFactor <= 0.5) $zoomFactor = 0.5 end printf("zoomFactor is now %4.1f\n", $zoomFactor) when ?\e exit(0) end end glutInit glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB) glutInitWindowSize(250, 250) glutInitWindowPosition(100, 100) glutCreateWindow($0) init() glutDisplayFunc(display) glutReshapeFunc(reshape) glutKeyboardFunc(keyboard) glutMotionFunc(motion) glutMainLoop() ruby-opengl-0.60.1.orig/examples/RedBook/jitter.rb0000755000000000000000000001307111377006423020477 0ustar rootroot# # (c) Copyright 1993, Silicon Graphics, Inc. # ALL RIGHTS RESERVED # Permission to use, copy, modify, and distribute this software for # any purpose and without fee is hereby granted, provided that the above # copyright notice appear in all copies and that both the copyright notice # and this permission notice appear in supporting documentation, and that # the name of Silicon Graphics, Inc. not be used in advertising # or publicity pertaining to distribution of the software without specific, # written prior permission. # # THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS" # AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE, # INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR # FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON # GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT, # SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY # KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION, # LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF # THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN # ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON # ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE # POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE. # # US Government Users Restricted Rights # Use, duplication, or disclosure by the Government is subject to # restrictions set forth in FAR 52.227.19(c)(2) or subparagraph # (c)(1)(ii) of the Rights in Technical Data and Computer Software # clause at DFARS 252.227-7013 and/or in similar or successor # clauses in the FAR or the DOD or NASA FAR Supplement. # Unpublished-- rights reserved under the copyright laws of the # United States. Contractor/manufacturer is Silicon Graphics, # Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311. # # OpenGL(TM) is a trademark of Silicon Graphics, Inc. # # jitter.h # # This file contains jitter point arrays for 2,3,4,8,15,24 and 66 jitters. # # The arrays are named j2, j3, etc. Each element in the array has the form, # for example, j8[0].x and j8[0].y # # Values are floating point in the range -.5 < x < .5, -.5 < y < .5, and # have a gaussian distribution around the origin. # # Use these to do model jittering for scene anti-aliasing and view volume # jittering for depth of field effects. Use in conjunction with the # accwindow() routine. # MAX_SAMPLES=66 # 2 jitter points $j2 = [ [ 0.246490, 0.249999], [-0.246490, -0.249999] ] # 3 jitter points $j3 = [ [-0.373411, -0.250550], [ 0.256263, 0.368119], [ 0.117148, -0.117570] ] # 4 jitter points $j4 = [ [-0.208147, 0.353730], [ 0.203849, -0.353780], [-0.292626, -0.149945], [ 0.296924, 0.149994] ] # 8 jitter points $j8 = [ [-0.334818, 0.435331], [ 0.286438, -0.393495], [ 0.459462, 0.141540], [-0.414498, -0.192829], [-0.183790, 0.082102], [-0.079263, -0.317383], [ 0.102254, 0.299133], [ 0.164216, -0.054399] ] # 15 jitter points $j15 = [ [ 0.285561, 0.188437], [ 0.360176, -0.065688], [-0.111751, 0.275019], [-0.055918, -0.215197], [-0.080231, -0.470965], [ 0.138721, 0.409168], [ 0.384120, 0.458500], [-0.454968, 0.134088], [ 0.179271, -0.331196], [-0.307049, -0.364927], [ 0.105354, -0.010099], [-0.154180, 0.021794], [-0.370135, -0.116425], [ 0.451636, -0.300013], [-0.370610, 0.387504] ] # 24 jitter points $j24 = [ [ 0.030245, 0.136384], [ 0.018865, -0.348867], [-0.350114, -0.472309], [ 0.222181, 0.149524], [-0.393670, -0.266873], [ 0.404568, 0.230436], [ 0.098381, 0.465337], [ 0.462671, 0.442116], [ 0.400373, -0.212720], [-0.409988, 0.263345], [-0.115878, -0.001981], [ 0.348425, -0.009237], [-0.464016, 0.066467], [-0.138674, -0.468006], [ 0.144932, -0.022780], [-0.250195, 0.150161], [-0.181400, -0.264219], [ 0.196097, -0.234139], [-0.311082, -0.078815], [ 0.268379, 0.366778], [-0.040601, 0.327109], [-0.234392, 0.354659], [-0.003102, -0.154402], [ 0.297997, -0.417965] ] # 66 jitter points $j66 = [ [ 0.266377, -0.218171], [-0.170919, -0.429368], [ 0.047356, -0.387135], [-0.430063, 0.363413], [-0.221638, -0.313768], [ 0.124758, -0.197109], [-0.400021, 0.482195], [ 0.247882, 0.152010], [-0.286709, -0.470214], [-0.426790, 0.004977], [-0.361249, -0.104549], [-0.040643, 0.123453], [-0.189296, 0.438963], [-0.453521, -0.299889], [ 0.408216, -0.457699], [ 0.328973, -0.101914], [-0.055540, -0.477952], [ 0.194421, 0.453510], [ 0.404051, 0.224974], [ 0.310136, 0.419700], [-0.021743, 0.403898], [-0.466210, 0.248839], [ 0.341369, 0.081490], [ 0.124156, -0.016859], [-0.461321, -0.176661], [ 0.013210, 0.234401], [ 0.174258, -0.311854], [ 0.294061, 0.263364], [-0.114836, 0.328189], [ 0.041206, -0.106205], [ 0.079227, 0.345021], [-0.109319, -0.242380], [ 0.425005, -0.332397], [ 0.009146, 0.015098], [-0.339084, -0.355707], [-0.224596, -0.189548], [ 0.083475, 0.117028], [ 0.295962, -0.334699], [ 0.452998, 0.025397], [ 0.206511, -0.104668], [ 0.447544, -0.096004], [-0.108006, -0.002471], [-0.380810, 0.130036], [-0.242440, 0.186934], [-0.200363, 0.070863], [-0.344844, -0.230814], [ 0.408660, 0.345826], [-0.233016, 0.305203], [ 0.158475, -0.430762], [ 0.486972, 0.139163], [-0.301610, 0.009319], [ 0.282245, -0.458671], [ 0.482046, 0.443890], [-0.121527, 0.210223], [-0.477606, -0.424878], [-0.083941, -0.121440], [-0.345773, 0.253779], [ 0.234646, 0.034549], [ 0.394102, -0.210901], [-0.312571, 0.397656], [ 0.200906, 0.333293], [ 0.018703, -0.261792], [-0.209349, -0.065383], [ 0.076248, 0.478538], [-0.073036, -0.355064], [ 0.145087, 0.221726] ] ruby-opengl-0.60.1.orig/examples/RedBook/hello.rb0000755000000000000000000000522011377006423020276 0ustar rootroot# # Copyright (c) 1993-1997, Silicon Graphics, Inc. # ALL RIGHTS RESERVED # Permission to use, copy, modify, and distribute this software for # any purpose and without fee is hereby granted, provided that the above # copyright notice appear in all copies and that both the copyright notice # and this permission notice appear in supporting documentation, and that # the name of Silicon Graphics, Inc. not be used in advertising # or publicity pertaining to distribution of the software without specific, # written prior permission. # # THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS" # AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE, # INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR # FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON # GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT, # SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY # KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION, # LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF # THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN # ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON # ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE # POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE. # # US Government Users Restricted Rights # Use, duplication, or disclosure by the Government is subject to # restrictions set forth in FAR 52.227.19(c)(2) or subparagraph # (c)(1)(ii) of the Rights in Technical Data and Computer Software # clause at DFARS 252.227-7013 and/or in similar or successor # clauses in the FAR or the DOD or NASA FAR Supplement. # Unpublished-- rights reserved under the copyright laws of the # United States. Contractor/manufacturer is Silicon Graphics, # Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311. # # OpenGL(R) is a registered trademark of Silicon Graphics, Inc. # # hello.c # This is a simple, introductory OpenGL program. require 'opengl' include Gl,Glu,Glut display = Proc.new do glClear(GL_COLOR_BUFFER_BIT) glColor(1.0, 1.0, 1.0) glBegin(GL_POLYGON) glVertex(0.25, 0.25, 0.0) glVertex(0.75, 0.25, 0.0) glVertex(0.75, 0.75, 0.0) glVertex(0.25, 0.75, 0.0) glEnd() glutSwapBuffers() end def init glClearColor(0.0, 0.0, 0.0, 0.0) glMatrixMode(GL_PROJECTION) glLoadIdentity() glOrtho(0.0, 1.0, 0.0, 1.0, -1.0, 1.0) end keyboard = Proc.new do |key, x, y| case (key) when ?\e exit(0); end end glutInit glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB) glutInitWindowSize(500, 500) glutInitWindowPosition(100, 100) glutCreateWindow("hello") init() glutDisplayFunc(display) glutKeyboardFunc(keyboard) glutMainLoop() ruby-opengl-0.60.1.orig/examples/RedBook/lines.rb0000755000000000000000000000772411377006423020320 0ustar rootroot# # Copyright (c) 1993-1997, Silicon Graphics, Inc. # ALL RIGHTS RESERVED # Permission to use, copy, modify, and distribute this software for # any purpose and without fee is hereby granted, provided that the above # copyright notice appear in all copies and that both the copyright notice # and this permission notice appear in supporting documentation, and that # the name of Silicon Graphics, Inc. not be used in advertising # or publicity pertaining to distribution of the software without specific, # written prior permission. # # THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS" # AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE, # INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR # FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON # GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT, # SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY # KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION, # LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF # THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN # ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON # ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE # POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE. # # US Government Users Restricted Rights # Use, duplication, or disclosure by the Government is subject to # restrictions set forth in FAR 52.227.19(c)(2) or subparagraph # (c)(1)(ii) of the Rights in Technical Data and Computer Software # clause at DFARS 252.227-7013 and/or in similar or successor # clauses in the FAR or the DOD or NASA FAR Supplement. # Unpublished-- rights reserved under the copyright laws of the # United States. Contractor/manufacturer is Silicon Graphics, # Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311. # # OpenGL(R) is a registered trademark of Silicon Graphics, Inc. # # lines.c # This program demonstrates geometric primitives and # their attributes. require 'opengl' require 'mathn' include Gl,Glu,Glut def drawOneLine(x1,y1,x2,y2) glBegin(GL_LINES) glVertex((x1),(y1)) glVertex((x2),(y2)) glEnd() end def init glClearColor(0.0, 0.0, 0.0, 0.0) glShadeModel(GL_FLAT) end display = Proc.new do glClear(GL_COLOR_BUFFER_BIT) # select white for all lines glColor(1.0, 1.0, 1.0) # in 1st row, 3 lines, each with a different stipple glEnable(GL_LINE_STIPPLE) glLineStipple(1, 0x0101) # dotted drawOneLine(50.0, 125.0, 150.0, 125.0) glLineStipple(1, 0x00FF) # dashed drawOneLine(150.0, 125.0, 250.0, 125.0) glLineStipple(1, 0x1C47) # dash/dot/dash drawOneLine(250.0, 125.0, 350.0, 125.0) # in 2nd row, 3 wide lines, each with different stipple glLineWidth(5.0) glLineStipple(1, 0x0101) # dotted drawOneLine(50.0, 100.0, 150.0, 100.0) glLineStipple(1, 0x00FF) # dashed drawOneLine(150.0, 100.0, 250.0, 100.0) glLineStipple(1, 0x1C47) # dash/dot/dash drawOneLine(250.0, 100.0, 350.0, 100.0) glLineWidth(1.0) # in 3rd row, 6 lines, with dash/dot/dash stipple # as part of a single connected line strip glLineStipple(1, 0x1C47) # dash/dot/dash glBegin(GL_LINE_STRIP) for i in 0..6 glVertex(50.0 + (i * 50.0), 75.0) end glEnd() # in 4th row, 6 independent lines with same stipple for i in 0..5 drawOneLine(50.0 + (i * 50.0), 50.0, 50.0 + ((i+1) * 50.0), 50.0) end # in 5th row, 1 line, with dash/dot/dash stipple # and a stipple repeat factor of 5 glLineStipple(5, 0x1C47) # dash/dot/dash drawOneLine(50.0, 25.0, 350.0, 25.0) glDisable(GL_LINE_STIPPLE) glutSwapBuffers() end reshape = Proc.new do |w, h| glViewport(0, 0, w, h) glMatrixMode(GL_PROJECTION) glLoadIdentity() GLU.Ortho2D(0.0, w, 0.0, h) end keyboard = Proc.new do |key, x, y| case (key) when ?\e exit(0) end end glutInit glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB) glutInitWindowSize(400, 150) glutInitWindowPosition(100, 100) glutCreateWindow($0) init() glutDisplayFunc(display) glutReshapeFunc(reshape) glutKeyboardFunc(keyboard) glutMainLoop() ruby-opengl-0.60.1.orig/examples/RedBook/varray.rb0000755000000000000000000001060311377006423020500 0ustar rootroot# # Copyright (c) 1993-1997, Silicon Graphics, Inc. # ALL RIGHTS RESERVED # Permission to use, copy, modify, and distribute this software for # any purpose and without fee is hereby granted, provided that the above # copyright notice appear in all copies and that both the copyright notice # and this permission notice appear in supporting documentation, and that # the name of Silicon Graphics, Inc. not be used in advertising # or publicity pertaining to distribution of the software without specific, # written prior permission. # # THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS" # AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE, # INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR # FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON # GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT, # SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY # KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION, # LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF # THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN # ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON # ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE # POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE. # # US Government Users Restricted Rights # Use, duplication, or disclosure by the Government is subject to # restrictions set forth in FAR 52.227.19(c)(2) or subparagraph # (c)(1)(ii) of the Rights in Technical Data and Computer Software # clause at DFARS 252.227-7013 and/or in similar or successor # clauses in the FAR or the DOD or NASA FAR Supplement. # Unpublished-- rights reserved under the copyright laws of the # United States. Contractor/manufacturer is Silicon Graphics, # Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311. # # OpenGL(R) is a registered trademark of Silicon Graphics, Inc. # # varray.c # This program demonstrates vertex arrays. require 'opengl' include Gl,Glu,Glut POINTER=1 INTERLEAVED=2 DRAWARRAY=1 ARRAYELEMENT=2 DRAWELEMENTS=3 $setupMethod = POINTER $derefMethod = DRAWARRAY def setupPointers $vertices = [25, 25, 100, 325, 175, 25, 175, 325, 250, 25, 325, 325].pack("i*") $colors = [1.0, 0.2, 0.2, 0.2, 0.2, 1.0, 0.8, 1.0, 0.2, 0.75, 0.75, 0.75, 0.35, 0.35, 0.35, 0.5, 0.5, 0.5].pack("f*") glEnableClientState(GL_VERTEX_ARRAY) glEnableClientState(GL_COLOR_ARRAY) glVertexPointer(2, GL_INT, 0, $vertices) glColorPointer(3, GL_FLOAT, 0, $colors) end def setupInterleave $intertwined = [1.0, 0.2, 1.0, 100.0, 100.0, 0.0, 1.0, 0.2, 0.2, 0.0, 200.0, 0.0, 1.0, 1.0, 0.2, 100.0, 300.0, 0.0, 0.2, 1.0, 0.2, 200.0, 300.0, 0.0, 0.2, 1.0, 1.0, 300.0, 200.0, 0.0, 0.2, 0.2, 1.0, 200.0, 100.0, 0.0].pack("f*") glInterleavedArrays(GL_C3F_V3F, 0, $intertwined) end def init glClearColor(0.0, 0.0, 0.0, 0.0) glShadeModel(GL_SMOOTH) setupPointers() end display = proc do glClear(GL_COLOR_BUFFER_BIT) if ($derefMethod == DRAWARRAY) glDrawArrays(GL_TRIANGLES, 0, 6) elsif ($derefMethod == ARRAYELEMENT) glBegin(GL_TRIANGLES) glArrayElement(2) glArrayElement(3) glArrayElement(5) glEnd() elsif ($derefMethod == DRAWELEMENTS) $indices = [0, 1, 3, 4].pack("I*") glDrawElements(GL_POLYGON, 4, GL_UNSIGNED_INT, $indices) end glutSwapBuffers() end reshape = proc do|w, h| glViewport(0, 0, w, h) glMatrixMode(GL_PROJECTION) glLoadIdentity() gluOrtho2D(0.0, w, 0.0, h) end mouse = proc do |button, state, x, y| case (button) when GLUT_LEFT_BUTTON if (state == GLUT_DOWN) if ($setupMethod == POINTER) $setupMethod = INTERLEAVED setupInterleave() elsif ($setupMethod == INTERLEAVED) $setupMethod = POINTER setupPointers() end glutPostRedisplay() end when GLUT_MIDDLE_BUTTON,GLUT_RIGHT_BUTTON if (state == GLUT_DOWN) if ($derefMethod == DRAWARRAY) $derefMethod = ARRAYELEMENT elsif ($derefMethod == ARRAYELEMENT) $derefMethod = DRAWELEMENTS elsif ($derefMethod == DRAWELEMENTS) $derefMethod = DRAWARRAY end glutPostRedisplay() end end end keyboard = proc do |key, x, y| case (key) when ?\e exit(0) end end glutInit() glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB) glutInitWindowSize(350, 350) glutInitWindowPosition(100, 100) glutCreateWindow() init() glutDisplayFunc(display) glutReshapeFunc(reshape) glutMouseFunc(mouse) glutKeyboardFunc(keyboard) glutMainLoop() ruby-opengl-0.60.1.orig/examples/RedBook/font.rb0000755000000000000000000001337511377006423020153 0ustar rootroot# # Copyright (c) 1993-1997, Silicon Graphics, Inc. # ALL RIGHTS RESERVED # Permission to use, copy, modify, and distribute this software for # any purpose and without fee is hereby granted, provided that the above # copyright notice appear in all copies and that both the copyright notice # and this permission notice appear in supporting documentation, and that # the name of Silicon Graphics, Inc. not be used in advertising # or publicity pertaining to distribution of the software without specific, # written prior permission. # # THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS" # AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE, # INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR # FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON # GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT, # SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY # KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION, # LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF # THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN # ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON # ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE # POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE. # # US Government Users Restricted Rights # Use, duplication, or disclosure by the Government is subject to # restrictions set forth in FAR 52.227.19(c)(2) or subparagraph # (c)(1)(ii) of the Rights in Technical Data and Computer Software # clause at DFARS 252.227-7013 and/or in similar or successor # clauses in the FAR or the DOD or NASA FAR Supplement. # Unpublished-- rights reserved under the copyright laws of the # United States. Contractor/manufacturer is Silicon Graphics, # Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311. # # OpenGL(R) is a registered trademark of Silicon Graphics, Inc. # # font.c # # Draws some text in a bitmapped font. Uses glBitmap() # and other pixel routines. Also demonstrates use of # display lists. require 'opengl' include Gl,Glu,Glut $space = [0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] $letters = [ [0x00, 0x00, 0xc3, 0xc3, 0xc3, 0xc3, 0xff, 0xc3, 0xc3, 0xc3, 0x66, 0x3c, 0x18], [0x00, 0x00, 0xfe, 0xc7, 0xc3, 0xc3, 0xc7, 0xfe, 0xc7, 0xc3, 0xc3, 0xc7, 0xfe], [0x00, 0x00, 0x7e, 0xe7, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xe7, 0x7e], [0x00, 0x00, 0xfc, 0xce, 0xc7, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc7, 0xce, 0xfc], [0x00, 0x00, 0xff, 0xc0, 0xc0, 0xc0, 0xc0, 0xfc, 0xc0, 0xc0, 0xc0, 0xc0, 0xff], [0x00, 0x00, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xfc, 0xc0, 0xc0, 0xc0, 0xff], [0x00, 0x00, 0x7e, 0xe7, 0xc3, 0xc3, 0xcf, 0xc0, 0xc0, 0xc0, 0xc0, 0xe7, 0x7e], [0x00, 0x00, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xff, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3], [0x00, 0x00, 0x7e, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x7e], [0x00, 0x00, 0x7c, 0xee, 0xc6, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06], [0x00, 0x00, 0xc3, 0xc6, 0xcc, 0xd8, 0xf0, 0xe0, 0xf0, 0xd8, 0xcc, 0xc6, 0xc3], [0x00, 0x00, 0xff, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0], [0x00, 0x00, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xdb, 0xff, 0xff, 0xe7, 0xc3], [0x00, 0x00, 0xc7, 0xc7, 0xcf, 0xcf, 0xdf, 0xdb, 0xfb, 0xf3, 0xf3, 0xe3, 0xe3], [0x00, 0x00, 0x7e, 0xe7, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xe7, 0x7e], [0x00, 0x00, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xfe, 0xc7, 0xc3, 0xc3, 0xc7, 0xfe], [0x00, 0x00, 0x3f, 0x6e, 0xdf, 0xdb, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0x66, 0x3c], [0x00, 0x00, 0xc3, 0xc6, 0xcc, 0xd8, 0xf0, 0xfe, 0xc7, 0xc3, 0xc3, 0xc7, 0xfe], [0x00, 0x00, 0x7e, 0xe7, 0x03, 0x03, 0x07, 0x7e, 0xe0, 0xc0, 0xc0, 0xe7, 0x7e], [0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xff], [0x00, 0x00, 0x7e, 0xe7, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3], [0x00, 0x00, 0x18, 0x3c, 0x3c, 0x66, 0x66, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3], [0x00, 0x00, 0xc3, 0xe7, 0xff, 0xff, 0xdb, 0xdb, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3], [0x00, 0x00, 0xc3, 0x66, 0x66, 0x3c, 0x3c, 0x18, 0x3c, 0x3c, 0x66, 0x66, 0xc3], [0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x3c, 0x66, 0x66, 0xc3], [0x00, 0x00, 0xff, 0xc0, 0xc0, 0x60, 0x30, 0x7e, 0x0c, 0x06, 0x03, 0x03, 0xff] ] $fontOffset = 0 def makeRasterFont glPixelStorei(GL_UNPACK_ALIGNMENT, 1) $fontOffset = glGenLists(128) i = 0 j = ?A for i in 0...26 glNewList($fontOffset + j, GL_COMPILE) glBitmap(8, 13, 0.0, 2.0, 10.0, 0.0, $letters[i].pack("C*")) glEndList() j+=1 end glNewList($fontOffset + ' '[0], GL_COMPILE) glBitmap(8, 13, 0.0, 2.0, 10.0, 0.0, $space.pack("C*")) glEndList() end def init glShadeModel(GL_FLAT) makeRasterFont() end def printString(s) glPushAttrib(GL_LIST_BIT) glListBase($fontOffset) glCallLists(GL_BYTE,s) glPopAttrib() end # Everything above this line could be in a library # that defines a font. To make it work, you've got # to call makeRasterFont() before you start making # calls to printString(). display = proc do white = [ 1.0, 1.0, 1.0 ] glClear(GL_COLOR_BUFFER_BIT) glColor(white) glRasterPos(20, 60) printString("THE QUICK BROWN FOX JUMPS") glRasterPos(20, 40) printString("OVER A LAZY DOG") glutSwapBuffers() end reshape = proc do |w, h| glViewport(0, 0, w, h) glMatrixMode(GL_PROJECTION) glLoadIdentity() glOrtho(0.0, w, 0.0, h, -1.0, 1.0) glMatrixMode(GL_MODELVIEW) end keyboard = proc do |key, x, y| case (key) when ?\e exit(0) end end # Main Loop # Open window with initial window size, title bar, # RGBA display mode, and handle input events. glutInit() glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB) glutInitWindowSize(400, 100) glutInitWindowPosition(100, 100) glutCreateWindow() init() glutReshapeFunc(reshape) glutKeyboardFunc(keyboard) glutDisplayFunc(display) glutMainLoop() ruby-opengl-0.60.1.orig/examples/RedBook/mipmap.rb0000755000000000000000000001213711377006423020463 0ustar rootroot# # Copyright (c) Mark J. Kilgard, 1994. */ # # (c) Copyright 1993, Silicon Graphics, Inc. # ALL RIGHTS RESERVED # Permission to use, copy, modify, and distribute this software for # any purpose and without fee is hereby granted, provided that the above # copyright notice appear in all copies and that both the copyright notice # and this permission notice appear in supporting documentation, and that # the name of Silicon Graphics, Inc. not be used in advertising # or publicity pertaining to distribution of the software without specific, # written prior permission. # # THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS" # AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE, # INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR # FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON # GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT, # SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY # KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION, # LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF # THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN # ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON # ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE # POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE. # # US Government Users Restricted Rights # Use, duplication, or disclosure by the Government is subject to # restrictions set forth in FAR 52.227.19(c)(2) or subparagraph # (c)(1)(ii) of the Rights in Technical Data and Computer Software # clause at DFARS 252.227-7013 and/or in similar or successor # clauses in the FAR or the DOD or NASA FAR Supplement. # Unpublished-- rights reserved under the copyright laws of the # United States. Contractor/manufacturer is Silicon Graphics, # Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311. # # OpenGL(TM) is a trademark of Silicon Graphics, Inc. # # mipmap.c # This program demonstrates using mipmaps for texture maps. # To overtly show the effect of mipmaps, each mipmap reduction # level has a solidly colored, contrasting texture image. # Thus, the quadrilateral which is drawn is drawn with several # different colors. require 'opengl' require 'mathn' include Gl,Glu,Glut $mipmapImage32 = [] $mipmapImage16 = [] $mipmapImage8 = [] $mipmapImage4 = [] $mipmapImage2 = [] $mipmapImage1 = [] def makeImages for i in 0..31 for j in 0..31 $mipmapImage32[(j*32+i)*3+0] = 255 $mipmapImage32[(j*32+i)*3+1] = 255 $mipmapImage32[(j*32+i)*3+2] = 0 end end for i in 0..15 for j in 0..15 $mipmapImage16[(j*16+i)*3+0] = 255 $mipmapImage16[(j*16+i)*3+1] = 0 $mipmapImage16[(j*16+i)*3+2] = 255 end end for i in 0..7 for j in 0..7 $mipmapImage8[(j*8+i)*3+0] = 255 $mipmapImage8[(j*8+i)*3+1] = 0 $mipmapImage8[(j*8+i)*3+2] = 0 end end for i in 0..3 for j in 0..3 $mipmapImage4[(j*4+i)*3+0] = 0 $mipmapImage4[(j*4+i)*3+1] = 255 $mipmapImage4[(j*4+i)*3+2] = 0 end end for i in 0..1 for j in 0..1 $mipmapImage2[(j*2+i)*3+0] = 0 $mipmapImage2[(j*2+i)*3+1] = 0 $mipmapImage2[(j*2+i)*3+2] = 255 end end $mipmapImage1[0] = 255 $mipmapImage1[1] = 255 $mipmapImage1[2] = 255 end def myinit glEnable(GL_DEPTH_TEST) glDepthFunc(GL_LESS) glShadeModel(GL_FLAT) glTranslate(0.0, 0.0, -3.6) makeImages() glPixelStore(GL_UNPACK_ALIGNMENT, 1) glTexImage2D(GL_TEXTURE_2D, 0, 3, 32, 32, 0, GL_RGB, GL_UNSIGNED_BYTE, $mipmapImage32.pack("C*")) glTexImage2D(GL_TEXTURE_2D, 1, 3, 16, 16, 0, GL_RGB, GL_UNSIGNED_BYTE, $mipmapImage16.pack("C*")) glTexImage2D(GL_TEXTURE_2D, 2, 3, 8, 8, 0, GL_RGB, GL_UNSIGNED_BYTE, $mipmapImage8.pack("C*")) glTexImage2D(GL_TEXTURE_2D, 3, 3, 4, 4, 0, GL_RGB, GL_UNSIGNED_BYTE, $mipmapImage4.pack("C*")) glTexImage2D(GL_TEXTURE_2D, 4, 3, 2, 2, 0, GL_RGB, GL_UNSIGNED_BYTE, $mipmapImage2.pack("C*")) glTexImage2D(GL_TEXTURE_2D, 5, 3, 1, 1, 0, GL_RGB, GL_UNSIGNED_BYTE, $mipmapImage1.pack("C*")) glTexParameter(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT) glTexParameter(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT) glTexParameter(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST) glTexParameter(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST_MIPMAP_NEAREST) glTexEnv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL) glEnable(GL_TEXTURE_2D) end display = Proc.new do glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) glBegin(GL_QUADS) glTexCoord(0.0, 0.0); glVertex(-2.0, -1.0, 0.0) glTexCoord(0.0, 8.0); glVertex(-2.0, 1.0, 0.0) glTexCoord(8.0, 8.0); glVertex(2000.0, 1.0, -6000.0) glTexCoord(8.0, 0.0); glVertex(2000.0, -1.0, -6000.0) glEnd() glutSwapBuffers() end myReshape = Proc.new do |w, h| glViewport(0, 0, w, h) glMatrixMode(GL_PROJECTION) glLoadIdentity() gluPerspective(60.0, 1.0*w/h, 1.0, 30000.0) glMatrixMode(GL_MODELVIEW) glLoadIdentity() end keyboard = Proc.new do |key, x, y| case (key) when ?\e exit(0); end end glutInit glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH) glutInitWindowSize(500, 500) glutInitWindowPosition(100, 100) glutCreateWindow($0) myinit() glutReshapeFunc(myReshape) glutDisplayFunc(display) glutKeyboardFunc(keyboard) glutMainLoop() ruby-opengl-0.60.1.orig/examples/RedBook/accpersp.rb0000755000000000000000000001501411377006423020775 0ustar rootroot# # Copyright (c) 1993-1997, Silicon Graphics, Inc. # ALL RIGHTS RESERVED # Permission to use, copy, modify, and distribute this software for # any purpose and without fee is hereby granted, provided that the above # copyright notice appear in all copies and that both the copyright notice # and this permission notice appear in supporting documentation, and that # the name of Silicon Graphics, Inc. not be used in advertising # or publicity pertaining to distribution of the software without specific, # written prior permission. # # THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS" # AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE, # INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR # FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON # GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT, # SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY # KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION, # LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF # THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN # ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON # ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE # POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE. # # US Government Users Restricted Rights # Use, duplication, or disclosure by the Government is subject to # restrictions set forth in FAR 52.227.19(c)(2) or subparagraph # (c)(1)(ii) of the Rights in Technical Data and Computer Software # clause at DFARS 252.227-7013 and/or in similar or successor # clauses in the FAR or the DOD or NASA FAR Supplement. # Unpublished-- rights reserved under the copyright laws of the # United States. Contractor/manufacturer is Silicon Graphics, # Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311. # # OpenGL(R) is a registered trademark of Silicon Graphics, Inc. # # accpersp.c # Use the accumulation buffer to do full-scene antialiasing # on a scene with perspective projection, using the special # routines accFrustum() and accPerspective(). require 'opengl' include Gl,Glu,Glut $j8 = [ [-0.334818, 0.435331], [ 0.286438, -0.393495], [ 0.459462, 0.141540], [-0.414498, -0.192829], [-0.183790, 0.082102], [-0.079263, -0.317383], [ 0.102254, 0.299133], [ 0.164216, -0.054399] ] # accFrustum() # The first 6 arguments are identical to the glFrustum() call. # # pixdx and pixdy are anti-alias jitter in pixels. # Set both equal to 0.0 for no anti-alias jitter. # eyedx and eyedy are depth-of field jitter in pixels. # Set both equal to 0.0 for no depth of field effects. # # focus is distance from eye to plane in focus. # focus must be greater than, but not equal to 0.0. # # Note that accFrustum() calls glTranslatef(). You will # probably want to insure that your ModelView matrix has been # initialized to identity before calling accFrustum(). def accFrustum(left, right, bottom, top, nnear, ffar, pixdx, pixdy, eyedx, eyedy, focus) viewport = glGetDoublev(GL_VIEWPORT) xwsize = right - left ywsize = top - bottom dx = -(pixdx*xwsize/viewport[2] + eyedx*nnear/focus) dy = -(pixdy*ywsize/viewport[3] + eyedy*nnear/focus) glMatrixMode(GL_PROJECTION) glLoadIdentity() glFrustum(left + dx, right + dx, bottom + dy, top + dy, nnear, ffar) glMatrixMode(GL_MODELVIEW) glLoadIdentity() glTranslate(-eyedx, -eyedy, 0.0) end # accPerspective() # # The first 4 arguments are identical to the gluPerspective() call. # pixdx and pixdy are anti-alias jitter in pixels. # Set both equal to 0.0 for no anti-alias jitter. # eyedx and eyedy are depth-of field jitter in pixels. # Set both equal to 0.0 for no depth of field effects. # # focus is distance from eye to plane in focus. # focus must be greater than, but not equal to 0.0. # # Note that accPerspective() calls accFrustum(). def accPerspective(fovy, aspect, nnear, ffar, pixdx, pixdy, eyedx, eyedy, focus) fov2 = ((fovy*Math::PI) / 180.0) / 2.0 top = nnear / (Math::cos(fov2) / Math::sin(fov2)) bottom = -top right = top * aspect left = -right accFrustum(left, right, bottom, top, nnear, ffar, pixdx, pixdy, eyedx, eyedy, focus) end # Initialize lighting and other values. def init mat_ambient = [ 1.0, 1.0, 1.0, 1.0 ] mat_specular = [ 1.0, 1.0, 1.0, 1.0 ] light_position = [ 0.0, 0.0, 10.0, 1.0 ] lm_ambient = [ 0.2, 0.2, 0.2, 1.0 ] glMaterial(GL_FRONT, GL_AMBIENT, mat_ambient) glMaterial(GL_FRONT, GL_SPECULAR, mat_specular) glMaterial(GL_FRONT, GL_SHININESS, 50.0) glLight(GL_LIGHT0, GL_POSITION, light_position) glLightModel(GL_LIGHT_MODEL_AMBIENT, lm_ambient) glEnable(GL_LIGHTING) glEnable(GL_LIGHT0) glEnable(GL_DEPTH_TEST) glShadeModel(GL_FLAT) glClearColor(0.0, 0.0, 0.0, 0.0) glClearAccum(0.0, 0.0, 0.0, 0.0) end def displayObjects torus_diffuse = [ 0.7, 0.7, 0.0, 1.0 ] cube_diffuse = [ 0.0, 0.7, 0.7, 1.0 ] sphere_diffuse = [ 0.7, 0.0, 0.7, 1.0 ] octa_diffuse = [ 0.7, 0.4, 0.4, 1.0 ] glPushMatrix() glTranslate(0.0, 0.0, -5.0) glRotate(30.0, 1.0, 0.0, 0.0) glPushMatrix() glTranslate(-0.80, 0.35, 0.0) glRotate(100.0, 1.0, 0.0, 0.0) glMaterial(GL_FRONT, GL_DIFFUSE, torus_diffuse) glutSolidTorus(0.275, 0.85, 16, 16) glPopMatrix() glPushMatrix() glTranslate(-0.75, -0.50, 0.0) glRotate(45.0, 0.0, 0.0, 1.0) glRotate(45.0, 1.0, 0.0, 0.0) glMaterial(GL_FRONT, GL_DIFFUSE, cube_diffuse) glutSolidCube(1.5) glPopMatrix() glPushMatrix() glTranslate(0.75, 0.60, 0.0) glRotate(30.0, 1.0, 0.0, 0.0) glMaterial(GL_FRONT, GL_DIFFUSE, sphere_diffuse) glutSolidSphere(1.0, 16, 16) glPopMatrix() glPushMatrix() glTranslate(0.70, -0.90, 0.25) glMaterial(GL_FRONT, GL_DIFFUSE, octa_diffuse) glutSolidOctahedron() glPopMatrix() glPopMatrix() end ACSIZE=8 display = proc do viewport = glGetDoublev(GL_VIEWPORT) glClear(GL_ACCUM_BUFFER_BIT) for jitter in 0...ACSIZE glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) accPerspective(50.0, viewport[2]/ viewport[3], 1.0, 15.0, $j8[jitter][0], $j8[jitter][1], 0.0, 0.0, 1.0) displayObjects() glAccum(GL_ACCUM, 1.0/ACSIZE) end glAccum(GL_RETURN, 1.0) glutSwapBuffers() end reshape = proc do |w, h| glViewport(0, 0, w, h) end keyboard = proc do |key, x, y| case (key) when ?\e exit(0) end end # Main Loop # Be certain you request an accumulation buffer. glutInit() glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_ACCUM | GLUT_DEPTH) glutInitWindowSize(500, 500) glutInitWindowPosition(100, 100) glutCreateWindow($0) init() glutReshapeFunc(reshape) glutDisplayFunc(display) glutKeyboardFunc(keyboard) glutMainLoop() ruby-opengl-0.60.1.orig/examples/RedBook/bezcurve.rb0000755000000000000000000000625111377006423021025 0ustar rootroot# # Copyright (c) 1993-1997, Silicon Graphics, Inc. # ALL RIGHTS RESERVED # Permission to use, copy, modify, and distribute this software for # any purpose and without fee is hereby granted, provided that the above # copyright notice appear in all copies and that both the copyright notice # and this permission notice appear in supporting documentation, and that # the name of Silicon Graphics, Inc. not be used in advertising # or publicity pertaining to distribution of the software without specific, # written prior permission. # # THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS" # AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE, # INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR # FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON # GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT, # SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY # KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION, # LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF # THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN # ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON # ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE # POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE. # # US Government Users Restricted Rights # Use, duplication, or disclosure by the Government is subject to # restrictions set forth in FAR 52.227.19(c)(2) or subparagraph # (c)(1)(ii) of the Rights in Technical Data and Computer Software # clause at DFARS 252.227-7013 and/or in similar or successor # clauses in the FAR or the DOD or NASA FAR Supplement. # Unpublished-- rights reserved under the copyright laws of the # United States. Contractor/manufacturer is Silicon Graphics, # Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311. # # OpenGL(R) is a registered trademark of Silicon Graphics, Inc. # # bezcurve.c # This program uses evaluators to draw a Bezier curve. require "opengl" include Gl,Glu,Glut $ctrlpoints = [ [-4.0,-4.0, 0.0], [-2.0, 4.0, 0.0], [ 2.0,-4.0, 0.0], [ 4.0, 4.0, 0.0] ] def init glClearColor(0.0, 0.0, 0.0, 0.0) glShadeModel(GL_FLAT) glMap1d(GL_MAP1_VERTEX_3, 0.0, 1.0, 3, 4, $ctrlpoints.flatten) glEnable(GL_MAP1_VERTEX_3) end display = proc do glClear(GL_COLOR_BUFFER_BIT) glColor(1.0, 1.0, 1.0) glBegin(GL_LINE_STRIP) for i in 0..30 glEvalCoord1d(i.to_f/30.0) end glEnd() # The following code displays the control points as dots. glPointSize(5.0) glColor(1.0, 1.0, 0.0) glBegin(GL_POINTS) for i in 0...4 glVertex($ctrlpoints[i]) end glEnd() glutSwapBuffers() end reshape = proc do |w, h| glViewport(0, 0, w, h) glMatrixMode(GL_PROJECTION) glLoadIdentity() if (w <= h) glOrtho(-5.0, 5.0, -5.0*h/w, 5.0*h/w, -5.0, 5.0) else glOrtho(-5.0*w/h, 5.0*w/h, -5.0, 5.0, -5.0, 5.0) end glMatrixMode(GL_MODELVIEW) glLoadIdentity() end keyboard = proc do |key, x, y| case (key) when ?\e exit(0) end end glutInit() glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB) glutInitWindowSize(500, 500) glutInitWindowPosition(100, 100) glutCreateWindow() init() glutDisplayFunc(display) glutReshapeFunc(reshape) glutKeyboardFunc(keyboard) glutMainLoop() ruby-opengl-0.60.1.orig/examples/RedBook/surface.rb0000755000000000000000000001111111377006423020617 0ustar rootroot# # (c) Copyright 1993, Silicon Graphics, Inc. # ALL RIGHTS RESERVED # Permission to use, copy, modify, and distribute this software for # any purpose and without fee is hereby granted, provided that the above # copyright notice appear in all copies and that both the copyright notice # and this permission notice appear in supporting documentation, and that # the name of Silicon Graphics, Inc. not be used in advertising # or publicity pertaining to distribution of the software without specific, # written prior permission. # # THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS" # AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE, # INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR # FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON # GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT, # SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY # KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION, # LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF # THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN # ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON # ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE # POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE. # # US Government Users Restricted Rights # Use, duplication, or disclosure by the Government is subject to # restrictions set forth in FAR 52.227.19(c)(2) or subparagraph # (c)(1)(ii) of the Rights in Technical Data and Computer Software # clause at DFARS 252.227-7013 and/or in similar or successor # clauses in the FAR or the DOD or NASA FAR Supplement. # Unpublished-- rights reserved under the copyright laws of the # United States. Contractor/manufacturer is Silicon Graphics, # Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311. # # OpenGL(TM) is a trademark of Silicon Graphics, Inc. # # # surface.c # This program draws a NURBS surface in the shape of a # symmetrical hill. # require 'opengl' include Gl,Glu,Glut $ctlpoints = Array.new(4).collect { Array.new(4).collect { Array.new(3, nil) } } # 4*4*3 array $showPoints = 0 $theNurb = nil # Initializes the control points of the surface to a small hill. # The control points range from -3 to +3 in x, y, and z def init_surface for u in 0..3 for v in 0..3 $ctlpoints[u][v][0] = 2.0*(u - 1.5) $ctlpoints[u][v][1] = 2.0*(v - 1.5) if ( (u == 1 || u == 2) && (v == 1 || v == 2)) $ctlpoints[u][v][2] = 3 else $ctlpoints[u][v][2] = -3 end end end end # Initialize material property and depth buffer. def myinit mat_diffuse = [ 0.7, 0.7, 0.7, 1.0 ] mat_specular = [ 1.0, 1.0, 1.0, 1.0 ] mat_shininess = [ 100.0 ] glClearColor(0.0, 0.0, 0.0, 1.0) glMaterial(GL_FRONT, GL_DIFFUSE, mat_diffuse) glMaterial(GL_FRONT, GL_SPECULAR, mat_specular) glMaterial(GL_FRONT, GL_SHININESS, mat_shininess) glEnable(GL_LIGHTING) glEnable(GL_LIGHT0) glDepthFunc(GL_LESS) glEnable(GL_DEPTH_TEST) glEnable(GL_AUTO_NORMAL) glEnable(GL_NORMALIZE) init_surface() $theNurb = gluNewNurbsRenderer() gluNurbsProperty($theNurb, GLU_SAMPLING_TOLERANCE, 25.0) gluNurbsProperty($theNurb, GLU_DISPLAY_MODE, GLU_FILL) end display = Proc.new do knots = [0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0] glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) glPushMatrix() glRotate(330.0, 1.0,0.0,0.0) glScale(0.5, 0.5, 0.5) gluBeginSurface($theNurb) gluNurbsSurface($theNurb, 8, knots, 8, knots, 4 * 3, 3, $ctlpoints.flatten, 4, 4, GL_MAP2_VERTEX_3) gluEndSurface($theNurb) if($showPoints==1) glPointSize(5.0) glDisable(GL_LIGHTING) glColor(1.0, 1.0, 0.0) glBegin(GL_POINTS) for i in 0..3 for j in 0..3 glVertex($ctlpoints[i][j][0], $ctlpoints[i][j][1], $ctlpoints[i][j][2]) end end glEnd() glEnable(GL_LIGHTING) end glPopMatrix() glutSwapBuffers() end reshape = Proc.new do |w, h| glViewport(0, 0, w, h) glMatrixMode(GL_PROJECTION) glLoadIdentity() gluPerspective(45.0, w/h, 3.0, 8.0) glMatrixMode(GL_MODELVIEW) glLoadIdentity() glTranslate(0.0, 0.0, -5.0) end menu = Proc.new do |value| $showPoints = value glutPostRedisplay() end keyboard = Proc.new do |key, x, y| case (key) when ?\e exit(0); end end glutInit glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH) glutInitWindowSize(500, 500) glutInitWindowPosition(100, 100) glutCreateWindow($0) myinit() glutReshapeFunc(reshape) glutDisplayFunc(display) glutKeyboardFunc(keyboard) glutCreateMenu(menu) glutAddMenuEntry("Show control points", 1) glutAddMenuEntry("Hide control points", 0) glutAttachMenu(GLUT_RIGHT_BUTTON) glutMainLoop() ruby-opengl-0.60.1.orig/examples/RedBook/aapoly.rb0000755000000000000000000001072611377006423020467 0ustar rootroot# # Copyright (c) 1993-1997, Silicon Graphics, Inc. # ALL RIGHTS RESERVED # Permission to use, copy, modify, and distribute this software for # any purpose and without fee is hereby granted, provided that the above # copyright notice appear in all copies and that both the copyright notice # and this permission notice appear in supporting documentation, and that # the name of Silicon Graphics, Inc. not be used in advertising # or publicity pertaining to distribution of the software without specific, # written prior permission. # # THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS" # AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE, # INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR # FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON # GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT, # SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY # KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION, # LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF # THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN # ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON # ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE # POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE. # # US Government Users Restricted Rights # Use, duplication, or disclosure by the Government is subject to # restrictions set forth in FAR 52.227.19(c)(2) or subparagraph # (c)(1)(ii) of the Rights in Technical Data and Computer Software # clause at DFARS 252.227-7013 and/or in similar or successor # clauses in the FAR or the DOD or NASA FAR Supplement. # Unpublished-- rights reserved under the copyright laws of the # United States. Contractor/manufacturer is Silicon Graphics, # Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311. # # OpenGL(R) is a registered trademark of Silicon Graphics, Inc. # # aapoly.c # This program draws filled polygons with antialiased # edges. The special GL_SRC_ALPHA_SATURATE blending # function is used. # Pressing the 't' key turns the antialiasing on and off. require 'opengl' include Gl,Glu,Glut $polySmooth = true def init glCullFace(GL_BACK) glEnable(GL_CULL_FACE) glBlendFunc(GL_SRC_ALPHA_SATURATE, GL_ONE) glClearColor(0.0, 0.0, 0.0, 0.0) end NFACE=6 NVERT=8 $indices = [ [4, 5, 6, 7], [2, 3, 7, 6], [0, 4, 7, 3], [0, 1, 5, 4], [1, 5, 6, 2], [0, 3, 2, 1] ] def drawCube(x0, x1, y0, y1, z0, z1) v = [[],[],[],[],[],[],[],[]] c = [ [0.0, 0.0, 0.0, 1.0], [1.0, 0.0, 0.0, 1.0], [0.0, 1.0, 0.0, 1.0], [1.0, 1.0, 0.0, 1.0], [0.0, 0.0, 1.0, 1.0], [1.0, 0.0, 1.0, 1.0], [0.0, 1.0, 1.0, 1.0], [1.0, 1.0, 1.0, 1.0] ] # indices of front, top, left, bottom, right, back faces v[0][0] = v[3][0] = v[4][0] = v[7][0] = x0 v[1][0] = v[2][0] = v[5][0] = v[6][0] = x1 v[0][1] = v[1][1] = v[4][1] = v[5][1] = y0 v[2][1] = v[3][1] = v[6][1] = v[7][1] = y1 v[0][2] = v[1][2] = v[2][2] = v[3][2] = z0 v[4][2] = v[5][2] = v[6][2] = v[7][2] = z1 glEnableClientState(GL_VERTEX_ARRAY) glEnableClientState(GL_COLOR_ARRAY) glVertexPointer(3, GL_FLOAT, 0, v.flatten!.pack("f*")) glColorPointer(4, GL_FLOAT, 0, c.flatten!.pack("f*")) glDrawElements(GL_QUADS, NFACE*4, GL_UNSIGNED_BYTE, $indices.flatten.pack("C*")) glDisableClientState(GL_VERTEX_ARRAY) glDisableClientState(GL_COLOR_ARRAY) end # Note: polygons must be drawn from front to back # for proper blending. display = proc do if ($polySmooth) glClear(GL_COLOR_BUFFER_BIT) glEnable(GL_BLEND) glEnable(GL_POLYGON_SMOOTH) glDisable(GL_DEPTH_TEST) else glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) glDisable(GL_BLEND) glDisable(GL_POLYGON_SMOOTH) glEnable(GL_DEPTH_TEST) end glPushMatrix() glTranslate(0.0, 0.0, -8.0) glRotate(30.0, 1.0, 0.0, 0.0) glRotate(60.0, 0.0, 1.0, 0.0) drawCube(-0.5, 0.5, -0.5, 0.5, -0.5, 0.5) glPopMatrix() glutSwapBuffers() end reshape = proc do |w, h| glViewport(0, 0, w, h) glMatrixMode(GL_PROJECTION) glLoadIdentity() gluPerspective(30.0, w.to_f/ h.to_f, 1.0, 20.0) glMatrixMode(GL_MODELVIEW) glLoadIdentity() end keyboard = proc do |key, x, y| case (key) when ?t ,?T $polySmooth = !$polySmooth glutPostRedisplay() when ?\e exit(0) # Escape key end end # Main Loop glutInit glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_ALPHA | GLUT_DEPTH) glutInitWindowSize(500, 500) glutInitWindowPosition(100, 100) glutCreateWindow($0) init() glutReshapeFunc(reshape) glutKeyboardFunc(keyboard) glutDisplayFunc(display) glutMainLoop() ruby-opengl-0.60.1.orig/examples/RedBook/texturesurf.rb0000755000000000000000000001065011377006423021576 0ustar rootroot# # Copyright (c) Mark J. Kilgard, 1994. */ # # (c) Copyright 1993, Silicon Graphics, Inc. # ALL RIGHTS RESERVED # Permission to use, copy, modify, and distribute this software for # any purpose and without fee is hereby granted, provided that the above # copyright notice appear in all copies and that both the copyright notice # and this permission notice appear in supporting documentation, and that # the name of Silicon Graphics, Inc. not be used in advertising # or publicity pertaining to distribution of the software without specific, # written prior permission. # # THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS" # AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE, # INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR # FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON # GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT, # SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY # KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION, # LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF # THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN # ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON # ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE # POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE. # # US Government Users Restricted Rights # Use, duplication, or disclosure by the Government is subject to # restrictions set forth in FAR 52.227.19(c)(2) or subparagraph # (c)(1)(ii) of the Rights in Technical Data and Computer Software # clause at DFARS 252.227-7013 and/or in similar or successor # clauses in the FAR or the DOD or NASA FAR Supplement. # Unpublished-- rights reserved under the copyright laws of the # United States. Contractor/manufacturer is Silicon Graphics, # Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311. # # OpenGL(TM) is a trademark of Silicon Graphics, Inc. # # texturesurf.c # This program uses evaluators to generate a curved # surface and automatically generated texture coordinates. require 'opengl' include Gl,Glu,Glut $ctrlpoints = [ [[ -1.5, -1.5, 4.0], [ -0.5, -1.5, 2.0], [0.5, -1.5, -1.0], [1.5, -1.5, 2.0]], [[ -1.5, -0.5, 1.0], [ -0.5, -0.5, 3.0], [0.5, -0.5, 0.0], [1.5, -0.5, -1.0]], [[ -1.5, 0.5, 4.0], [ -0.5, 0.5, 0.0], [0.5, 0.5, 3.0], [1.5, 0.5, 4.0]], [[ -1.5, 1.5, -2.0], [ -0.5, 1.5, -2.0], [0.5, 1.5, 0.0], [1.5, 1.5, -1.0]] ].flatten $texpts = [[[0.0, 0.0], [0.0, 1.0]], [[1.0, 0.0], [1.0, 1.0]]].flatten display = proc do glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) glColor(1.0, 1.0, 1.0) glEvalMesh2(GL_FILL, 0, 20, 0, 20) glutSwapBuffers() end ImageWidth=64 ImageHeight=64 $image = [] def makeImage for i in 0...ImageWidth ti = 2.0*Math::PI*i/ImageWidth.to_f for j in 0...ImageHeight tj = 2.0*Math::PI*j/ImageHeight.to_f $image[3*(ImageHeight*i+j)] = 127*(1.0+Math::sin(ti)) $image[3*(ImageHeight*i+j)+1] = 127*(1.0+Math::cos(2*tj)) $image[3*(ImageHeight*i+j)+2] = 127*(1.0+Math::cos(ti+tj)) end end end def myinit glMap2d(GL_MAP2_VERTEX_3, 0, 1, 3, 4, 0, 1, 12, 4, $ctrlpoints) glMap2d(GL_MAP2_TEXTURE_COORD_2, 0, 1, 2, 2, 0, 1, 4, 2, $texpts) glEnable(GL_MAP2_TEXTURE_COORD_2) glEnable(GL_MAP2_VERTEX_3) glMapGrid2d(20, 0.0, 1.0, 20, 0.0, 1.0) makeImage() glTexEnv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL) glTexParameter(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT) glTexParameter(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT) glTexParameter(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST) glTexParameter(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST) glTexImage2D(GL_TEXTURE_2D, 0, 3, ImageWidth, ImageHeight, 0, GL_RGB, GL_UNSIGNED_BYTE, $image.pack("C*")) glEnable(GL_TEXTURE_2D) glEnable(GL_DEPTH_TEST) glEnable(GL_NORMALIZE) glShadeModel(GL_FLAT) end myReshape = proc do|w, h| glViewport(0, 0, w, h) glMatrixMode(GL_PROJECTION) glLoadIdentity() if (w <= h) glOrtho(-4.0, 4.0, -4.0*h.to_f/w, 4.0*h.to_f/w, -4.0, 4.0) else glOrtho(-4.0*w.to_f/h, 4.0*w.to_f/h, -4.0, 4.0, -4.0, 4.0) end glMatrixMode(GL_MODELVIEW) glLoadIdentity() glRotate(85.0, 1.0, 1.0, 1.0) end keyboard = Proc.new do |key, x, y| case (key) when ?\e exit(0); end end glutInit() glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH) glutInitWindowSize(500, 500) glutInitWindowPosition(100, 100) glutCreateWindow() myinit() glutReshapeFunc(myReshape) glutDisplayFunc(display) glutKeyboardFunc(keyboard) glutMainLoop() ruby-opengl-0.60.1.orig/examples/RedBook/colormat.rb0000755000000000000000000001032411377006423021014 0ustar rootroot# # Copyright (c) 1993-1997, Silicon Graphics, Inc. # ALL RIGHTS RESERVED # Permission to use, copy, modify, and distribute this software for # any purpose and without fee is hereby granted, provided that the above # copyright notice appear in all copies and that both the copyright notice # and this permission notice appear in supporting documentation, and that # the name of Silicon Graphics, Inc. not be used in advertising # or publicity pertaining to distribution of the software without specific, # written prior permission. # # THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS" # AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE, # INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR # FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON # GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT, # SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY # KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION, # LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF # THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN # ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON # ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE # POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE. # # US Government Users Restricted Rights # Use, duplication, or disclosure by the Government is subject to # restrictions set forth in FAR 52.227.19(c)(2) or subparagraph # (c)(1)(ii) of the Rights in Technical Data and Computer Software # clause at DFARS 252.227-7013 and/or in similar or successor # clauses in the FAR or the DOD or NASA FAR Supplement. # Unpublished-- rights reserved under the copyright laws of the # United States. Contractor/manufacturer is Silicon Graphics, # Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311. # # OpenGL(R) is a registered trademark of Silicon Graphics, Inc. # # colormat.c # After initialization, the program will be in # ColorMaterial mode. Interaction: pressing the # mouse buttons will change the diffuse reflection values. require 'opengl' require 'mathn' include Gl,Glu,Glut $diffuseMaterial = [0.5,0.5,0.5,1.0] # Initialize material property, light source, lighting model, # and depth buffer. def init mat_specular = [ 1.0, 1.0, 1.0, 1.0 ] light_position = [ 1.0, 1.0, 1.0, 0.0 ] glClearColor(0.0, 0.0, 0.0, 0.0) glShadeModel(GL_SMOOTH) glEnable(GL_DEPTH_TEST) glMaterial(GL_FRONT, GL_DIFFUSE, $diffuseMaterial) glMaterial(GL_FRONT, GL_SPECULAR, mat_specular) glMaterial(GL_FRONT, GL_SHININESS, 25.0) glLight(GL_LIGHT0, GL_POSITION, light_position) glEnable(GL_LIGHTING) glEnable(GL_LIGHT0) glColorMaterial(GL_FRONT, GL_DIFFUSE) glEnable(GL_COLOR_MATERIAL) end display = Proc.new do glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) glutSolidSphere(1.0, 20, 16) glutSwapBuffers() end reshape = Proc.new do |w, h| glViewport(0, 0, w, h) glMatrixMode(GL_PROJECTION) glLoadIdentity() if (w <= h) glOrtho(-1.5, 1.5, -1.5*h/w, 1.5*h/w, -10.0, 10.0) else glOrtho(-1.5*w/h, 1.5*w/h, -1.5, 1.5, -10.0, 10.0) end glMatrixMode(GL_MODELVIEW) glLoadIdentity() end mouse = Proc.new do |button, state, x, y| case (button) when GLUT_LEFT_BUTTON if (state == GLUT_DOWN) $diffuseMaterial[0] = $diffuseMaterial[0] + 0.1 if ($diffuseMaterial[0] > 1.0) $diffuseMaterial[0] = 0.0 end glColor($diffuseMaterial) glutPostRedisplay() end when GLUT_MIDDLE_BUTTON if (state == GLUT_DOWN) $diffuseMaterial[1] = $diffuseMaterial[1] + 0.1 if ($diffuseMaterial[1] > 1.0) $diffuseMaterial[1] = 0.0 end glColor($diffuseMaterial) glutPostRedisplay() end when GLUT_RIGHT_BUTTON if (state == GLUT_DOWN) $diffuseMaterial[2] = $diffuseMaterial[2] + 0.1 if ($diffuseMaterial[2] > 1.0) $diffuseMaterial[2] = 0.0 end glColor($diffuseMaterial) glutPostRedisplay() end end end keyboard = Proc.new do |key, x, y| case (key) when ?\e exit(0) end end glutInit glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH) glutInitWindowSize(500, 500) glutInitWindowPosition(100, 100) glutCreateWindow($0) init() glutDisplayFunc(display) glutReshapeFunc(reshape) glutMouseFunc(mouse) glutKeyboardFunc(keyboard) glutMainLoop() ruby-opengl-0.60.1.orig/examples/RedBook/select.rb0000755000000000000000000001372311377006423020461 0ustar rootroot# # Copyright (c) 1993-1997, Silicon Graphics, Inc. # ALL RIGHTS RESERVED # Permission to use, copy, modify, and distribute this software for # any purpose and without fee is hereby granted, provided that the above # copyright notice appear in all copies and that both the copyright notice # and this permission notice appear in supporting documentation, and that # the name of Silicon Graphics, Inc. not be used in advertising # or publicity pertaining to distribution of the software without specific, # written prior permission. # # THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS" # AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE, # INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR # FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON # GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT, # SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY # KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION, # LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF # THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN # ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON # ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE # POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE. # # US Government Users Restricted Rights # Use, duplication, or disclosure by the Government is subject to # restrictions set forth in FAR 52.227.19(c)(2) or subparagraph # (c)(1)(ii) of the Rights in Technical Data and Computer Software # clause at DFARS 252.227-7013 and/or in similar or successor # clauses in the FAR or the DOD or NASA FAR Supplement. # Unpublished-- rights reserved under the copyright laws of the # United States. Contractor/manufacturer is Silicon Graphics, # Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311. # # OpenGL(R) is a registered trademark of Silicon Graphics, Inc. # # # select.c # This is an illustration of the selection mode and # name stack, which detects whether objects which collide # with a viewing volume. First, four triangles and a # rectangular box representing a viewing volume are drawn # (drawScene routine). The green triangle and yellow # triangles appear to lie within the viewing volume, but # the red triangle appears to lie outside it. Then the # selection mode is entered (selectObjects routine). # Drawing to the screen ceases. To see if any collisions # occur, the four triangles are called. In this example, # the green triangle causes one hit with the name 1, and # the yellow triangles cause one hit with the name 3. require 'opengl' include Gl,Glu,Glut # draw a triangle with vertices at (x1, y1), (x2, y2) # and (x3, y3) at z units away from the origin. def drawTriangle(x1, y1, x2, y2, x3, y3, z) glBegin(GL_TRIANGLES) glVertex(x1, y1, z) glVertex(x2, y2, z) glVertex(x3, y3, z) glEnd() end # draw a rectangular box with these outer x, y, and z values def drawViewVolume(x1, x2, y1, y2, z1, z2) glColor(1.0, 1.0, 1.0) glBegin(GL_LINE_LOOP) glVertex(x1, y1, -z1) glVertex(x2, y1, -z1) glVertex(x2, y2, -z1) glVertex(x1, y2, -z1) glEnd() glBegin(GL_LINE_LOOP) glVertex(x1, y1, -z2) glVertex(x2, y1, -z2) glVertex(x2, y2, -z2) glVertex(x1, y2, -z2) glEnd() glBegin(GL_LINES)# 4 lines glVertex(x1, y1, -z1) glVertex(x1, y1, -z2) glVertex(x1, y2, -z1) glVertex(x1, y2, -z2) glVertex(x2, y1, -z1) glVertex(x2, y1, -z2) glVertex(x2, y2, -z1) glVertex(x2, y2, -z2) glEnd() end # drawScene draws 4 triangles and a wire frame # which represents the viewing volume. def drawScene() glMatrixMode(GL_PROJECTION) glLoadIdentity() gluPerspective(40.0, 4.0/3.0, 1.0, 100.0) glMatrixMode(GL_MODELVIEW) glLoadIdentity() gluLookAt(7.5, 7.5, 12.5, 2.5, 2.5, -5.0, 0.0, 1.0, 0.0) glColor(0.0, 1.0, 0.0)# green triangle drawTriangle(2.0, 2.0, 3.0, 2.0, 2.5, 3.0, -5.0) glColor(1.0, 0.0, 0.0)# red triangle drawTriangle(2.0, 7.0, 3.0, 7.0, 2.5, 8.0, -5.0) glColor(1.0, 1.0, 0.0)# yellow triangles drawTriangle(2.0, 2.0, 3.0, 2.0, 2.5, 3.0, 0.0) drawTriangle(2.0, 2.0, 3.0, 2.0, 2.5, 3.0, -10.0) drawViewVolume(0.0, 5.0, 0.0, 5.0, 0.0, 10.0) end # processHits prints out the contents of the selection array def processHits(hits, buffer) printf("hits = %d\n", hits) ptr = buffer.unpack("I*") p = 0 for i in 0...hits # for each hit names = ptr[p] printf(" number of names for hit = %d\n", names); p+=1 printf(" z1 is %g", ptr[p].to_f/0xffffffff); p+=1 printf(" z2 is %g\n", ptr[p].to_f/0xffffffff); p+=1 printf(" the name is ") for j in 0...names # for each name printf("%d ", ptr[p]); p+=1 end printf("\n") end end # selectObjects "draws" the triangles in selection mode, # assigning names for the triangles. Note that the third # and fourth triangles share one name, so that if either # or both triangles intersects the viewing/clipping volume, # only one hit will be registered. BUFSIZE=512 def selectObjects selectBuf = glSelectBuffer(BUFSIZE) glRenderMode(GL_SELECT) glInitNames() glPushName(0) glPushMatrix() glMatrixMode(GL_PROJECTION) glLoadIdentity() glOrtho(0.0, 5.0, 0.0, 5.0, 0.0, 10.0) glMatrixMode(GL_MODELVIEW) glLoadIdentity() glLoadName(1) drawTriangle(2.0, 2.0, 3.0, 2.0, 2.5, 3.0, -5.0) glLoadName(2) drawTriangle(2.0, 7.0, 3.0, 7.0, 2.5, 8.0, -5.0) glLoadName(3) drawTriangle(2.0, 2.0, 3.0, 2.0, 2.5, 3.0, 0.0) drawTriangle(2.0, 2.0, 3.0, 2.0, 2.5, 3.0, -10.0) glPopMatrix() glFlush() hits = glRenderMode(GL_RENDER) processHits(hits, selectBuf) end def init glEnable(GL_DEPTH_TEST) glShadeModel(GL_FLAT) end display = proc do glClearColor(0.0, 0.0, 0.0, 0.0) glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) drawScene() selectObjects() glFlush() end keyboard = proc do |key, x, y| case (key) when ?\e exit(0) end end # Main Loop GLUT.Init glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB | GLUT_DEPTH) glutInitWindowSize(500, 500) glutInitWindowPosition(100, 100) glutCreateWindow $0 init() glutDisplayFunc(display) glutKeyboardFunc(keyboard) glutMainLoop() ruby-opengl-0.60.1.orig/examples/RedBook/texgen.rb0000755000000000000000000001270711377006423020475 0ustar rootroot# # Copyright (c) 1993-1997, Silicon Graphics, Inc. # ALL RIGHTS RESERVED # Permission to use, copy, modify, and distribute this software for # any purpose and without fee is hereby granted, provided that the above # copyright notice appear in all copies and that both the copyright notice # and this permission notice appear in supporting documentation, and that # the name of Silicon Graphics, Inc. not be used in advertising # or publicity pertaining to distribution of the software without specific, # written prior permission. # # THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS" # AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE, # INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR # FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON # GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT, # SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY # KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION, # LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF # THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN # ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON # ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE # POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE. # # US Government Users Restricted Rights # Use, duplication, or disclosure by the Government is subject to # restrictions set forth in FAR 52.227.19(c)(2) or subparagraph # (c)(1)(ii) of the Rights in Technical Data and Computer Software # clause at DFARS 252.227-7013 and/or in similar or successor # clauses in the FAR or the DOD or NASA FAR Supplement. # Unpublished-- rights reserved under the copyright laws of the # United States. Contractor/manufacturer is Silicon Graphics, # Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311. # # OpenGL(R) is a registered trademark of Silicon Graphics, Inc. # # texgen.c # This program draws a texture mapped teapot with # automatically generated texture coordinates. The # texture is rendered as stripes on the teapot. # Initially, the object is drawn with texture coordinates # based upon the object coordinates of the vertex # and distance from the plane x = 0. Pressing the 'e' # key changes the coordinate generation to eye coordinates # of the vertex. Pressing the 'o' key switches it back # to the object coordinates. Pressing the 's' key # changes the plane to a slanted one (x + y + z = 0). # Pressing the 'x' key switches it back to x = 0. require 'opengl' require 'mathn' include Gl,Glu,Glut StripeImageWidth = 32 $stripeImage = [] $texName def makeStripeImage for j in (0..StripeImageWidth-1) $stripeImage[4*j] = if (j<=4) then 255 else 0 end $stripeImage[4*j+1] = if (j>4) then 255 else 0 end $stripeImage[4*j+2] = 0 $stripeImage[4*j+3] = 255 end end # planes for texture coordinate generation $xequalzero = [1.0, 0.0, 0.0, 0.0] $slanted = [1.0, 1.0, 1.0, 0.0] $currentCoeff = nil $currentPlane = nil $currentGenMode = nil def init glClearColor(0.0, 0.0, 0.0, 0.0) glEnable(GL_DEPTH_TEST) glShadeModel(GL_SMOOTH) makeStripeImage() glPixelStorei(GL_UNPACK_ALIGNMENT, 1) $texName = glGenTextures(1) glBindTexture(GL_TEXTURE_2D, $texName[0]) glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT) glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR) glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR) glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, StripeImageWidth, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, $stripeImage.pack("C*")) glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE) $currentCoeff = $xequalzero $currentGenMode = GL_OBJECT_LINEAR $currentPlane = GL_OBJECT_PLANE glTexGen(GL_S, GL_TEXTURE_GEN_MODE, $currentGenMode) glTexGen(GL_S, $currentPlane, $currentCoeff) glEnable(GL_TEXTURE_GEN_S) glEnable(GL_TEXTURE_2D) glEnable(GL_CULL_FACE) glEnable(GL_LIGHTING) glEnable(GL_LIGHT0) glEnable(GL_AUTO_NORMAL) glEnable(GL_NORMALIZE) glFrontFace(GL_CW) glCullFace(GL_BACK) glMaterial(GL_FRONT, GL_SHININESS, 64.0) end display = Proc.new do glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) glPushMatrix() glRotate(45.0, 0.0, 0.0, 1.0) glBindTexture(GL_TEXTURE_2D, $texName[0]) glutSolidTeapot(2.0) glPopMatrix() glutSwapBuffers() end reshape = Proc.new do |w, h| glViewport(0, 0, w, h) glMatrixMode(GL_PROJECTION) glLoadIdentity() if (w <= h) glOrtho(-3.5, 3.5, -3.5*h/w,3.5*h/w, -3.5, 3.5) else glOrtho(-3.5*w/h, 3.5*w/h, -3.5, 3.5, -3.5, 3.5) end glMatrixMode(GL_MODELVIEW) glLoadIdentity() end keyboard = Proc.new do |key, x, y| case (key) when ?e,?E $currentGenMode = GL_EYE_LINEAR $currentPlane = GL_EYE_PLANE glTexGen(GL_S, GL_TEXTURE_GEN_MODE, $currentGenMode) glTexGen(GL_S, $currentPlane, $currentCoeff) glutPostRedisplay() when ?o, ?O $currentGenMode = GL_OBJECT_LINEAR $currentPlane = GL_OBJECT_PLANE glTexGen(GL_S, GL_TEXTURE_GEN_MODE, $currentGenMode) glTexGen(GL_S, $currentPlane, $currentCoeff) glutPostRedisplay() when ?s,?S $currentCoeff = $slanted glTexGen(GL_S, $currentPlane, $currentCoeff) glutPostRedisplay() when ?x,?X $currentCoeff = $xequalzero glTexGen(GL_S, $currentPlane, $currentCoeff) glutPostRedisplay() when ?\e exit(0) end end # main glutInit glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH) glutInitWindowSize(500, 500) glutInitWindowPosition(100, 100) glutCreateWindow($0) init() glutDisplayFunc(display) glutReshapeFunc(reshape) glutKeyboardFunc(keyboard) glutMainLoop() ruby-opengl-0.60.1.orig/examples/RedBook/drawf.rb0000755000000000000000000000621311377006423020301 0ustar rootroot# # Copyright (c) 1993-1997, Silicon Graphics, Inc. # ALL RIGHTS RESERVED # Permission to use, copy, modify, and distribute this software for # any purpose and without fee is hereby granted, provided that the above # copyright notice appear in all copies and that both the copyright notice # and this permission notice appear in supporting documentation, and that # the name of Silicon Graphics, Inc. not be used in advertising # or publicity pertaining to distribution of the software without specific, # written prior permission. # # THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS" # AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE, # INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR # FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON # GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT, # SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY # KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION, # LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF # THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN # ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON # ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE # POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE. # # US Government Users Restricted Rights # Use, duplication, or disclosure by the Government is subject to # restrictions set forth in FAR 52.227.19(c)(2) or subparagraph # (c)(1)(ii) of the Rights in Technical Data and Computer Software # clause at DFARS 252.227-7013 and/or in similar or successor # clauses in the FAR or the DOD or NASA FAR Supplement. # Unpublished-- rights reserved under the copyright laws of the # United States. Contractor/manufacturer is Silicon Graphics, # Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311. # # OpenGL(R) is a registered trademark of Silicon Graphics, Inc. # # drawf.c # Draws the bitmapped letter F on the screen (several times). # This demonstrates use of the glBitmap() call. require 'opengl' include Gl,Glu,Glut $rasters = [ 0xc0, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0xff, 0x00, 0xff, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0xff, 0xc0, 0xff, 0xc0 ].pack("C*") def init glPixelStorei(GL_UNPACK_ALIGNMENT, 1) glClearColor(0.0, 0.0, 0.0, 0.0) end display = Proc.new do glClear(GL_COLOR_BUFFER_BIT) glColor(1.0, 1.0, 1.0) glRasterPos2i(20, 20) glBitmap(10, 12, 0.0, 0.0, 11.0, 0.0, $rasters) glBitmap(10, 12, 0.0, 0.0, 11.0, 0.0, $rasters) glBitmap(10, 12, 0.0, 0.0, 11.0, 0.0, $rasters) glutSwapBuffers() end reshape = Proc.new do |w, h| glViewport(0, 0, w, h) glMatrixMode(GL_PROJECTION) glLoadIdentity() glOrtho(0, w, 0, h, -1.0, 1.0) glMatrixMode(GL_MODELVIEW) end keyboard = Proc.new do |key, x, y| case (key) when ?\e exit(0) end end # Main Loop # Open window with initial window size, title bar, # RGBA display mode, and handle input events. glutInit glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB) glutInitWindowSize(100, 100) glutInitWindowPosition(100, 100) glutCreateWindow($0) init() glutReshapeFunc(reshape) glutKeyboardFunc(keyboard) glutDisplayFunc(display) glutMainLoop() ruby-opengl-0.60.1.orig/examples/RedBook/robot.rb0000755000000000000000000000675311377006423020334 0ustar rootroot# # Copyright (c) 1993-1997, Silicon Graphics, Inc. # ALL RIGHTS RESERVED # Permission to use, copy, modify, and distribute this software for # any purpose and without fee is hereby granted, provided that the above # copyright notice appear in all copies and that both the copyright notice # and this permission notice appear in supporting documentation, and that # the name of Silicon Graphics, Inc. not be used in advertising # or publicity pertaining to distribution of the software without specific, # written prior permission. # # THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS" # AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE, # INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR # FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON # GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT, # SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY # KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION, # LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF # THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN # ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON # ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE # POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE. # # US Government Users Restricted Rights # Use, duplication, or disclosure by the Government is subject to # restrictions set forth in FAR 52.227.19(c)(2) or subparagraph # (c)(1)(ii) of the Rights in Technical Data and Computer Software # clause at DFARS 252.227-7013 and/or in similar or successor # clauses in the FAR or the DOD or NASA FAR Supplement. # Unpublished-- rights reserved under the copyright laws of the # United States. Contractor/manufacturer is Silicon Graphics, # Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311. # # OpenGL(R) is a registered trademark of Silicon Graphics, Inc. # # robot.c # This program shows how to composite modeling transformations # to draw translated and rotated hierarchical models. # Interaction: pressing the s and e keys (shoulder and elbow) # alters the rotation of the robot arm. require 'opengl' require 'mathn' include Gl,Glu,Glut $shoulder = 0 $elbow = 0 def init glClearColor(0.0, 0.0, 0.0, 0.0) glShadeModel(GL_FLAT) end display = Proc.new do glClear(GL_COLOR_BUFFER_BIT) glPushMatrix() glTranslate(-1.0, 0.0, 0.0) glRotate($shoulder, 0.0, 0.0, 1.0) glTranslate(1.0, 0.0, 0.0) glPushMatrix() glScale(2.0, 0.4, 1.0) glutWireCube(1.0) glPopMatrix() glTranslate(1.0, 0.0, 0.0) glRotate($elbow, 0.0, 0.0, 1.0) glTranslate(1.0, 0.0, 0.0) glPushMatrix() glScale(2.0, 0.4, 1.0) glutWireCube(1.0) glPopMatrix() glPopMatrix() glutSwapBuffers() end reshape = Proc.new do |w, h| glViewport(0, 0, w, h) glMatrixMode(GL_PROJECTION) glLoadIdentity() gluPerspective(65.0, w/ h, 1.0, 20.0) glMatrixMode(GL_MODELVIEW) glLoadIdentity() glTranslate(0.0, 0.0, -5.0) end keyboard = Proc.new do|key, x, y| case (key) when ?s $shoulder = ($shoulder + 5) % 360 glutPostRedisplay() when ?S $shoulder = ($shoulder - 5) % 360 glutPostRedisplay() when ?e $elbow = ($elbow + 5) % 360 glutPostRedisplay() when ?E $elbow = ($elbow - 5) % 360 glutPostRedisplay() when ?\e exit(0) end end glutInit glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB) glutInitWindowSize(500, 500) glutInitWindowPosition(100, 100) glutCreateWindow($0) init() glutDisplayFunc(display) glutReshapeFunc(reshape) glutKeyboardFunc(keyboard) glutMainLoop() ruby-opengl-0.60.1.orig/examples/RedBook/fog.rb0000755000000000000000000001200311377006423017743 0ustar rootroot# # Copyright (c) Mark J. Kilgard, 1994. # # (c) Copyright 1993, Silicon Graphics, Inc. # ALL RIGHTS RESERVED # Permission to use, copy, modify, and distribute this software for # any purpose and without fee is hereby granted, provided that the above # copyright notice appear in all copies and that both the copyright notice # and this permission notice appear in supporting documentation, and that # the name of Silicon Graphics, Inc. not be used in advertising # or publicity pertaining to distribution of the software without specific, # written prior permission. # # THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS" # AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE, # INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR # FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON # GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT, # SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY # KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION, # LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF # THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN # ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON # ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE # POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE. # # US Government Users Restricted Rights # Use, duplication, or disclosure by the Government is subject to # restrictions set forth in FAR 52.227.19(c)(2) or subparagraph # (c)(1)(ii) of the Rights in Technical Data and Computer Software # clause at DFARS 252.227-7013 and/or in similar or successor # clauses in the FAR or the DOD or NASA FAR Supplement. # Unpublished-- rights reserved under the copyright laws of the # United States. Contractor/manufacturer is Silicon Graphics, # Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311. # # OpenGL(TM) is a trademark of Silicon Graphics, Inc. # # fog.c # This program draws 5 red teapots, each at a different # z distance from the eye, in different types of fog. # Pressing the left mouse button chooses between 3 types of # fog: exponential, exponential squared, and linear. # In this program, there is a fixed density value, as well # as fixed start and end values for the linear fog. require 'opengl' require 'mathn' include Gl,Glu,Glut $fogMode = 0 selectFog = Proc.new do |mode| if (mode == GL_LINEAR) glFog(GL_FOG_START, 1.0) glFog(GL_FOG_END, 5.0) # falls through glFog(GL_FOG_MODE, mode) glutPostRedisplay() end if (mode == GL_EXP2 || mode == GL_EXP) glFog(GL_FOG_MODE, mode) glutPostRedisplay() end exit(0) if (mode == 0) end # Initialize z-buffer, projection matrix, light source, # and lighting model. Do not specify a material property here. def myinit position = [0.0, 3.0, 3.0, 0.0] local_view = [0.0] glEnable(GL_DEPTH_TEST) glDepthFunc(GL_LESS) glLight(GL_LIGHT0, GL_POSITION, position) glLightModel(GL_LIGHT_MODEL_LOCAL_VIEWER, local_view) glFrontFace(GL_CW) glEnable(GL_LIGHTING) glEnable(GL_LIGHT0) glEnable(GL_AUTO_NORMAL) glEnable(GL_NORMALIZE) glEnable(GL_FOG) fogColor = [0.5, 0.5, 0.5, 1.0] fogMode = GL_EXP glFog(GL_FOG_MODE, fogMode) glFog(GL_FOG_COLOR, fogColor) glFog(GL_FOG_DENSITY, 0.35) glHint(GL_FOG_HINT, GL_DONT_CARE) glClearColor(0.5, 0.5, 0.5, 1.0) end def renderRedTeapot(x, y, z) mat = [] glPushMatrix() glTranslate(x, y, z) mat[0] = 0.1745 mat[1] = 0.01175 mat[2] = 0.01175 mat[3] = 1.0 glMaterial(GL_FRONT, GL_AMBIENT, mat) mat[0] = 0.61424 mat[1] = 0.04136 mat[2] = 0.04136 glMaterial(GL_FRONT, GL_DIFFUSE, mat) mat[0] = 0.727811 mat[1] = 0.626959 mat[2] = 0.626959 glMaterial(GL_FRONT, GL_SPECULAR, mat) glMaterial(GL_FRONT, GL_SHININESS, 0.6 * 128.0) glutSolidTeapot(1.0) glPopMatrix() end # display() draws 5 teapots at different z positions. display = Proc.new do glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) renderRedTeapot(-4.0, -0.5, -1.0) renderRedTeapot(-2.0, -0.5, -2.0) renderRedTeapot(0.0, -0.5, -3.0) renderRedTeapot(2.0, -0.5, -4.0) renderRedTeapot(4.0, -0.5, -5.0) glFlush() end myReshape = Proc.new do |w, h| glViewport(0, 0, w, h) glMatrixMode(GL_PROJECTION) glLoadIdentity() if (w <= (h * 3)) glOrtho(-6.0, 6.0, -2.0 * h * 3 / w, 2.0 * h * 3 / w, 0.0, 10.0) elsif glOrtho(-6.0 * w / h * 3, 6.0 * w / h * 3, -2.0, 2.0, 0.0, 10.0) end glMatrixMode(GL_MODELVIEW) glLoadIdentity() end keyboard = Proc.new do |key, x, y| case (key) when ?\e exit(0) end end # Main Loop # Open window with initial window size, title bar, # RGBA display mode, depth buffer, and handle input events. glutInit glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB | GLUT_DEPTH) glutInitWindowSize(800, 300) glutInitWindowPosition(100, 100) glutCreateWindow($0) myinit() glutReshapeFunc(myReshape) glutDisplayFunc(display) glutKeyboardFunc(keyboard) glutCreateMenu(selectFog) glutAddMenuEntry("Fog EXP", GL_EXP) glutAddMenuEntry("Fog EXP2", GL_EXP2) glutAddMenuEntry("Fog LINEAR", GL_LINEAR) glutAddMenuEntry("Quit", 0) glutAttachMenu(GLUT_RIGHT_BUTTON) glutMainLoop() ruby-opengl-0.60.1.orig/examples/RedBook/wrap.rb0000755000000000000000000001176011377006423020152 0ustar rootroot# # Copyright (c) 1993-1997, Silicon Graphics, Inc. # ALL RIGHTS RESERVED # Permission to use, copy, modify, and distribute this software for # any purpose and without fee is hereby granted, provided that the above # copyright notice appear in all copies and that both the copyright notice # and this permission notice appear in supporting documentation, and that # the name of Silicon Graphics, Inc. not be used in advertising # or publicity pertaining to distribution of the software without specific, # written prior permission. # # THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS" # AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE, # INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR # FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON # GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT, # SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY # KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION, # LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF # THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN # ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON # ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE # POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE. # # US Government Users Restricted Rights # Use, duplication, or disclosure by the Government is subject to # restrictions set forth in FAR 52.227.19(c)(2) or subparagraph # (c)(1)(ii) of the Rights in Technical Data and Computer Software # clause at DFARS 252.227-7013 and/or in similar or successor # clauses in the FAR or the DOD or NASA FAR Supplement. # Unpublished-- rights reserved under the copyright laws of the # United States. Contractor/manufacturer is Silicon Graphics, # Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311. # # OpenGL(R) is a registered trademark of Silicon Graphics, Inc. # # wrap.c # This program texture maps a checkerboard image onto # two rectangles. This program demonstrates the wrapping # modes, if the texture coordinates fall outside 0.0 and 1.0. # Interaction: Pressing the 's' and 'S' keys switch the # wrapping between clamping and repeating for the s parameter. # The 't' and 'T' keys control the wrapping for the t parameter. # # If running this program on OpenGL 1.0, texture objects are # not used. require 'opengl' require 'mathn' include Gl,Glu,Glut # Create checkerboard texture CheckImageWidth=64 CheckImageHeight=64 $checkImage = [] $texName = 0 def makeCheckImage for i in 0..CheckImageHeight-1 for j in 0..CheckImageWidth-1 c = if (((i&0x8)==0)!=((j&0x8)==0)) then 255 else 0 end $checkImage[(i*CheckImageWidth+j)*4+0] = c $checkImage[(i*CheckImageWidth+j)*4+1] = c $checkImage[(i*CheckImageWidth+j)*4+2] = c $checkImage[(i*CheckImageWidth+j)*4+3] = 255 end end end def init glClearColor(0.0, 0.0, 0.0, 0.0) glShadeModel(GL_FLAT) glEnable(GL_DEPTH_TEST) makeCheckImage() glPixelStore(GL_UNPACK_ALIGNMENT, 1) $texName = glGenTextures(1) glBindTexture(GL_TEXTURE_2D, $texName[0]) glTexParameter(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT) glTexParameter(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT) glTexParameter(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST) glTexParameter(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST) glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, CheckImageWidth, CheckImageHeight, 0, GL_RGBA, GL_UNSIGNED_BYTE, $checkImage.pack("C*")) end display = Proc.new do glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) glEnable(GL_TEXTURE_2D) glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL) glBindTexture(GL_TEXTURE_2D, $texName[0]) glBegin(GL_QUADS) glTexCoord(0.0, 0.0); glVertex(-2.0, -1.0, 0.0) glTexCoord(0.0, 3.0); glVertex(-2.0, 1.0, 0.0) glTexCoord(3.0, 3.0); glVertex(0.0, 1.0, 0.0) glTexCoord(3.0, 0.0); glVertex(0.0, -1.0, 0.0) glTexCoord(0.0, 0.0); glVertex(1.0, -1.0, 0.0) glTexCoord(0.0, 3.0); glVertex(1.0, 1.0, 0.0) glTexCoord(3.0, 3.0); glVertex(2.41421, 1.0, -1.41421) glTexCoord(3.0, 0.0); glVertex(2.41421, -1.0, -1.41421) glEnd() glutSwapBuffers() glDisable(GL_TEXTURE_2D) end reshape = Proc.new do |w, h| glViewport(0, 0, w, h) glMatrixMode(GL_PROJECTION) glLoadIdentity() GLU.Perspective(60.0, w/h, 1.0, 30.0) glMatrixMode(GL_MODELVIEW) glLoadIdentity() glTranslate(0.0, 0.0, -3.6) end keyboard = Proc.new do |key, x, y| case (key) when ?s glTexParameter(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP) glutPostRedisplay() when ?S glTexParameter(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT) glutPostRedisplay() when ?t glTexParameter(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP) glutPostRedisplay() when ?T glTexParameter(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT) glutPostRedisplay() when ?\e exit(0) end end glutInit glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH) glutInitWindowSize(500, 500) glutInitWindowPosition(100, 100) glutCreateWindow($0) init() glutDisplayFunc(display) glutReshapeFunc(reshape) glutKeyboardFunc(keyboard) glutMainLoop() ruby-opengl-0.60.1.orig/examples/RedBook/tess.rb0000755000000000000000000001354611377006423020163 0ustar rootroot# # Copyright (c) 1993-1997, Silicon Graphics, Inc. # ALL RIGHTS RESERVED # Permission to use, copy, modify, and distribute this software for # any purpose and without fee is hereby granted, provided that the above # copyright notice appear in all copies and that both the copyright notice # and this permission notice appear in supporting documentation, and that # the name of Silicon Graphics, Inc. not be used in advertising # or publicity pertaining to distribution of the software without specific, # written prior permission. # # THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS" # AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE, # INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR # FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON # GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT, # SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY # KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION, # LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF # THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN # ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON # ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE # POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE. # # US Government Users Restricted Rights # Use, duplication, or disclosure by the Government is subject to # restrictions set forth in FAR 52.227.19(c)(2) or subparagraph # (c)(1)(ii) of the Rights in Technical Data and Computer Software # clause at DFARS 252.227-7013 and/or in similar or successor # clauses in the FAR or the DOD or NASA FAR Supplement. # Unpublished-- rights reserved under the copyright laws of the # United States. Contractor/manufacturer is Silicon Graphics, # Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311. # # OpenGL(R) is a registered trademark of Silicon Graphics, Inc. # # tess.c # This program demonstrates polygon tessellation. # Two tesselated objects are drawn. The first is a # rectangle with a triangular hole. The second is a # smooth shaded, self-intersecting star. # # Note the exterior rectangle is drawn with its vertices # in counter-clockwise order, but its interior clockwise. # Note the combineCallback is needed for the self-intersecting # star. Also note that removing the TessProperty for the # star will make the interior unshaded (WINDING_ODD). require 'opengl' include Gl,Glu,Glut $startList = nil display = proc do glClear(GL_COLOR_BUFFER_BIT) glColor(1.0, 1.0, 1.0) glCallList($startList) glCallList($startList + 1) glutSwapBuffers() end $beginCallback = proc do |which| glBegin(which) end $errorCallback = proc do |errorCode| print "Tessellation Error: #{gluErrorString(errorCode)}" exit(0) end $endCallback = proc do glEnd() end $vertexCallback = proc do |vertex| glColor(vertex[3], vertex[4], vertex[5]) glVertex(vertex[0], vertex[1], vertex[2]) end # combineCallback is used to create a new vertex when edges # intersect. coordinate location is trivial to calculate, # but weight[4] may be used to average color, normal, or texture # coordinate data. In this program, color is weighted. $combineCallback = proc do |coords, vertex_data, weight| vertex = [] vertex[0] = coords[0] vertex[1] = coords[1] vertex[2] = coords[2] for i in 3...6 vertex[i] = weight[0] * vertex_data[0][i] + weight[1] * vertex_data[1][i] + weight[2] * vertex_data[2][i] + weight[3] * vertex_data[3][i] end vertex end def init rect = [[50.0, 50.0, 0.0], [200.0, 50.0, 0.0], [200.0, 200.0, 0.0], [50.0, 200.0, 0.0]] tri = [[75.0, 75.0, 0.0], [125.0, 175.0, 0.0], [175.0, 75.0, 0.0]] star= [[250.0, 50.0, 0.0, 1.0, 0.0, 1.0], [325.0, 200.0, 0.0, 1.0, 1.0, 0.0], [400.0, 50.0, 0.0, 0.0, 1.0, 1.0], [250.0, 150.0, 0.0, 1.0, 0.0, 0.0], [400.0, 150.0, 0.0, 0.0, 1.0, 0.0]] glClearColor(0.0, 0.0, 0.0, 0.0) $startList = glGenLists(2) tobj = gluNewTess() gluTessCallback(tobj, GLU_TESS_VERTEX, proc do |v| glVertex(v) end ) gluTessCallback(tobj, GLU_TESS_BEGIN, $beginCallback) gluTessCallback(tobj, GLU_TESS_END, $endCallback) gluTessCallback(tobj, GLU_TESS_ERROR, $errorCallback) # rectangle with triangular hole inside glNewList($startList, GL_COMPILE) glShadeModel(GL_FLAT) gluTessBeginPolygon(tobj, nil) gluTessBeginContour(tobj) gluTessVertex(tobj, rect[0], rect[0]) gluTessVertex(tobj, rect[1], rect[1]) gluTessVertex(tobj, rect[2], rect[2]) gluTessVertex(tobj, rect[3], rect[3]) gluTessEndContour(tobj) gluTessBeginContour(tobj) gluTessVertex(tobj, tri[0], tri[0]) gluTessVertex(tobj, tri[1], tri[1]) gluTessVertex(tobj, tri[2], tri[2]) gluTessEndContour(tobj) gluTessEndPolygon(tobj) glEndList() gluTessCallback(tobj, GLU_TESS_VERTEX, $vertexCallback) gluTessCallback(tobj, GLU_TESS_BEGIN, $beginCallback) gluTessCallback(tobj, GLU_TESS_END, $endCallback) gluTessCallback(tobj, GLU_TESS_ERROR, $errorCallback) gluTessCallback(tobj, GLU_TESS_COMBINE, $combineCallback) # smooth shaded, self-intersecting star glNewList($startList + 1, GL_COMPILE) glShadeModel(GL_SMOOTH) gluTessProperty(tobj, GLU_TESS_WINDING_RULE, GLU_TESS_WINDING_POSITIVE) gluTessBeginPolygon(tobj, nil) gluTessBeginContour(tobj) gluTessVertex(tobj, star[0], star[0]) gluTessVertex(tobj, star[1], star[1]) gluTessVertex(tobj, star[2], star[2]) gluTessVertex(tobj, star[3], star[3]) gluTessVertex(tobj, star[4], star[4]) gluTessEndContour(tobj) gluTessEndPolygon(tobj) glEndList() gluDeleteTess(tobj) end reshape = proc do |w, h| glViewport(0, 0, w, h) glMatrixMode(GL_PROJECTION) glLoadIdentity() gluOrtho2D(0.0, w, 0.0, h) end keyboard = proc do |key, x, y| case (key) when ?\e exit(0) end end glutInit() glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB) glutInitWindowSize(500, 500) glutInitWindowPosition(100, 100) glutCreateWindow() init() glutDisplayFunc(display) glutReshapeFunc(reshape) glutKeyboardFunc(keyboard) glutMainLoop() ruby-opengl-0.60.1.orig/examples/RedBook/aargb.rb0000755000000000000000000000736311377006423020261 0ustar rootroot# # Copyright (c) 1993-1997, Silicon Graphics, Inc. # ALL RIGHTS RESERVED # Permission to use, copy, modify, and distribute this software for # any purpose and without fee is hereby granted, provided that the above # copyright notice appear in all copies and that both the copyright notice # and this permission notice appear in supporting documentation, and that # the name of Silicon Graphics, Inc. not be used in advertising # or publicity pertaining to distribution of the software without specific, # written prior permission. # # THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS" # AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE, # INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR # FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON # GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT, # SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY # KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION, # LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF # THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN # ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON # ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE # POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE. # # US Government Users Restricted Rights # Use, duplication, or disclosure by the Government is subject to # restrictions set forth in FAR 52.227.19(c)(2) or subparagraph # (c)(1)(ii) of the Rights in Technical Data and Computer Software # clause at DFARS 252.227-7013 and/or in similar or successor # clauses in the FAR or the DOD or NASA FAR Supplement. # Unpublished-- rights reserved under the copyright laws of the # United States. Contractor/manufacturer is Silicon Graphics, # Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311. # # OpenGL(R) is a registered trademark of Silicon Graphics, Inc. # # aargb.c # This program draws shows how to draw anti-aliased lines. It draws # two diagonal lines to form an X when 'r' is typed in the window, # the lines are rotated in opposite directions. require 'opengl' require 'mathn' include Gl,Glu,Glut $rotAngle = 0.0 # Initialize antialiasing for RGBA mode, including alpha # blending, hint, and line width. Print out implementation # specific info on line width granularity and width. def init glEnable(GL_LINE_SMOOTH) glEnable(GL_BLEND) glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) glHint(GL_LINE_SMOOTH_HINT, GL_DONT_CARE) glLineWidth(1.5) glClearColor(0.0, 0.0, 0.0, 0.0) end # Draw 2 diagonal lines to form an X display = Proc.new do glClear(GL_COLOR_BUFFER_BIT) glColor(0.0, 1.0, 0.0) glPushMatrix() glRotate(-$rotAngle, 0.0, 0.0, 0.1) glBegin(GL_LINES) glVertex(-0.5, 0.5) glVertex(0.5, -0.5) glEnd() glPopMatrix() glColor(0.0, 0.0, 1.0) glPushMatrix() glRotate($rotAngle, 0.0, 0.0, 0.1) glBegin(GL_LINES) glVertex(0.5, 0.5) glVertex(-0.5, -0.5) glEnd() glPopMatrix() glutSwapBuffers() end reshape = Proc.new do |w, h| glViewport(0, 0, w, h) glMatrixMode(GL_PROJECTION) glLoadIdentity() if (w <= h) gluOrtho2D(-1.0, 1.0, -1.0*h/w, 1.0*h/w) else gluOrtho2D(-1.0*w/h, 1.0*w/h, -1.0, 1.0) end glMatrixMode(GL_MODELVIEW) glLoadIdentity() end keyboard = Proc.new do |key, x, y| case (key) when ?r,?R $rotAngle = $rotAngle + 20.0 $rotAngle = 0.0 if ($rotAngle >= 360.0) glutPostRedisplay() when ?\e # Escape Key exit(0) end end # Main Loop # Open window with initial window size, title bar, # RGBA display mode, and handle input events. glutInit glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB) glutInitWindowSize(500, 500) glutInitWindowPosition(100, 100) glutCreateWindow($0) init() glutReshapeFunc(reshape) glutKeyboardFunc(keyboard) glutDisplayFunc(display) glutMainLoop() ruby-opengl-0.60.1.orig/examples/RedBook/accanti.rb0000755000000000000000000001145511377006423020604 0ustar rootroot# # Copyright (c) Mark J. Kilgard, 1994. # # (c) Copyright 1993, Silicon Graphics, Inc. # ALL RIGHTS RESERVED # Permission to use, copy, modify, and distribute this software for # any purpose and without fee is hereby granted, provided that the above # copyright notice appear in all copies and that both the copyright notice # and this permission notice appear in supporting documentation, and that # the name of Silicon Graphics, Inc. not be used in advertising # or publicity pertaining to distribution of the software without specific, # written prior permission. # # THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS" # AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE, # INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR # FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON # GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT, # SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY # KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION, # LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF # THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN # ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON # ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE # POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE. # # US Government Users Restricted Rights # Use, duplication, or disclosure by the Government is subject to # restrictions set forth in FAR 52.227.19(c)(2) or subparagraph # (c)(1)(ii) of the Rights in Technical Data and Computer Software # clause at DFARS 252.227-7013 and/or in similar or successor # clauses in the FAR or the DOD or NASA FAR Supplement. # Unpublished-- rights reserved under the copyright laws of the # United States. Contractor/manufacturer is Silicon Graphics, # Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311. # # OpenGL(TM) is a trademark of Silicon Graphics, Inc. # # accanti.c require 'opengl' require 'jitter' include Gl,Glu,Glut # Initialize lighting and other values. def myinit mat_ambient = [ 1.0, 1.0, 1.0, 1.0 ] mat_specular = [ 1.0, 1.0, 1.0, 1.0 ] light_position = [ 0.0, 0.0, 10.0, 1.0 ] lm_ambient = [ 0.2, 0.2, 0.2, 1.0 ] glMaterial(GL_FRONT, GL_AMBIENT, mat_ambient) glMaterial(GL_FRONT, GL_SPECULAR, mat_specular) glMaterial(GL_FRONT, GL_SHININESS, 50.0) glLight(GL_LIGHT0, GL_POSITION, light_position) glLightModel(GL_LIGHT_MODEL_AMBIENT, lm_ambient) glEnable(GL_LIGHTING) glEnable(GL_LIGHT0) glDepthFunc(GL_LESS) glEnable(GL_DEPTH_TEST) glShadeModel(GL_FLAT) glClearColor(0.0, 0.0, 0.0, 0.0) glClearAccum(0.0, 0.0, 0.0, 0.0) end def displayObjects torus_diffuse = [ 0.7, 0.7, 0.0, 1.0 ] cube_diffuse = [ 0.0, 0.7, 0.7, 1.0 ] sphere_diffuse = [ 0.7, 0.0, 0.7, 1.0 ] octa_diffuse = [ 0.7, 0.4, 0.4, 1.0 ] glPushMatrix() glRotate(30.0, 1.0, 0.0, 0.0) glPushMatrix() glTranslate(-0.80, 0.35, 0.0) glRotate(100.0, 1.0, 0.0, 0.0) glMaterial(GL_FRONT, GL_DIFFUSE, torus_diffuse) glutSolidTorus(0.275, 0.85, 16, 16) glPopMatrix() glPushMatrix() glTranslate(-0.75, -0.50, 0.0) glRotate(45.0, 0.0, 0.0, 1.0) glRotate(45.0, 1.0, 0.0, 0.0) glMaterial(GL_FRONT, GL_DIFFUSE, cube_diffuse) glutSolidCube(1.5) glPopMatrix() glPushMatrix() glTranslate(0.75, 0.60, 0.0) glRotate(30.0, 1.0, 0.0, 0.0) glMaterial(GL_FRONT, GL_DIFFUSE, sphere_diffuse) glutSolidSphere(1.0, 16, 16) glPopMatrix() glPushMatrix() glTranslate(0.70, -0.90, 0.25) glMaterial(GL_FRONT, GL_DIFFUSE, octa_diffuse) glutSolidOctahedron() glPopMatrix() glPopMatrix() end ACSIZE=8 myDisplay = proc do viewport = glGetDoublev(GL_VIEWPORT) glClear(GL_ACCUM_BUFFER_BIT) for jitter in 0...ACSIZE glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) glPushMatrix() # Note that 4.5 is the distance in world space between # left and right and bottom and top. # This formula converts fractional pixel movement to # world coordinates. glTranslate($j8[jitter][0]*4.5/viewport[2], $j8[jitter][1]*4.5/viewport[3], 0.0) displayObjects() glPopMatrix() glAccum(GL_ACCUM, 1.0/ACSIZE) end glAccum(GL_RETURN, 1.0) glutSwapBuffers() end myReshape = proc do |w, h| glViewport(0, 0, w, h) glMatrixMode(GL_PROJECTION) glLoadIdentity() if (w <= h) glOrtho(-2.25, 2.25, -2.25*h/w, 2.25*h/w, -10.0, 10.0) else glOrtho(-2.25*w/h, 2.25*w/h, -2.25, 2.25, -10.0, 10.0) end glMatrixMode(GL_MODELVIEW) end keyboard = Proc.new do |key, x, y| case (key) when ?\e exit(0); end end # Main Loop # Open window with initial window size, title bar, # RGBA display mode, and handle input events. # glutInit() glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_ACCUM | GLUT_DEPTH) glutInitWindowSize(500, 500) glutInitWindowPosition(100, 100) glutCreateWindow($0) myinit() glutReshapeFunc(myReshape) glutDisplayFunc(myDisplay) glutKeyboardFunc(keyboard) glutMainLoop() ruby-opengl-0.60.1.orig/examples/RedBook/list.rb0000755000000000000000000000666311377006423020162 0ustar rootroot# # Copyright (c) 1993-1997, Silicon Graphics, Inc. # ALL RIGHTS RESERVED # Permission to use, copy, modify, and distribute this software for # any purpose and without fee is hereby granted, provided that the above # copyright notice appear in all copies and that both the copyright notice # and this permission notice appear in supporting documentation, and that # the name of Silicon Graphics, Inc. not be used in advertising # or publicity pertaining to distribution of the software without specific, # written prior permission. # # THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS" # AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE, # INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR # FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON # GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT, # SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY # KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION, # LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF # THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN # ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON # ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE # POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE. # # US Government Users Restricted Rights # Use, duplication, or disclosure by the Government is subject to # restrictions set forth in FAR 52.227.19(c)(2) or subparagraph # (c)(1)(ii) of the Rights in Technical Data and Computer Software # clause at DFARS 252.227-7013 and/or in similar or successor # clauses in the FAR or the DOD or NASA FAR Supplement. # Unpublished-- rights reserved under the copyright laws of the # United States. Contractor/manufacturer is Silicon Graphics, # Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311. # # OpenGL(R) is a registered trademark of Silicon Graphics, Inc. # # list.c # This program demonstrates how to make and execute a # display list. Note that attributes, such as current # color and matrix, are changed. require 'opengl' require 'mathn' include Gl,Glu,Glut $listName = 0 def init $listName = glGenLists(1) glNewList($listName, GL_COMPILE) glColor(1.0, 0.0, 0.0) # /* current color red */ glBegin(GL_TRIANGLES) glVertex(0.0, 0.0) glVertex(1.0, 0.0) glVertex(0.0, 1.0) glEnd() glTranslate(1.5, 0.0, 0.0) # /* move position */ glEndList() glShadeModel(GL_FLAT) end def drawLine glBegin(GL_LINES) glVertex(0.0, 0.5) glVertex(15.0, 0.5) glEnd() end display = Proc.new do glClear(GL_COLOR_BUFFER_BIT) glColor(0.0, 1.0, 0.0) # current color green for i in (0..9 ) # draw 10 triangles glCallList($listName) end drawLine() # is this line green? NO! # where is the line drawn? glutSwapBuffers() end reshape = Proc.new do |w, h| glViewport(0, 0, w, h) glMatrixMode(GL_PROJECTION) glLoadIdentity() if (w <= h) GLU.Ortho2D(0.0, 2.0, -0.5 * h/w, 1.5 * h/w) else GLU.Ortho2D(0.0, 2.0 * w/h, -0.5, 1.5) end glMatrixMode(GL_MODELVIEW) glLoadIdentity() end keyboard = Proc.new do |key, x, y| case (key) when ?\e exit(0) end end # Main Loop # Open window with initial window size, title bar, # RGBA display mode, and handle input events. glutInit glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB) glutInitWindowSize(650, 100) glutInitWindowPosition(100, 100) glutCreateWindow($0) init() glutReshapeFunc(reshape) glutDisplayFunc(display) glutKeyboardFunc(keyboard) glutMainLoop() ruby-opengl-0.60.1.orig/examples/RedBook/dof.rb0000755000000000000000000001624011377006423017747 0ustar rootroot# # Copyright (c) Mark J. Kilgard, 1994. # # (c) Copyright 1993, Silicon Graphics, Inc. # ALL RIGHTS RESERVED # Permission to use, copy, modify, and distribute this software for # any purpose and without fee is hereby granted, provided that the above # copyright notice appear in all copies and that both the copyright notice # and this permission notice appear in supporting documentation, and that # the name of Silicon Graphics, Inc. not be used in advertising # or publicity pertaining to distribution of the software without specific, # written prior permission. # # THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS" # AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE, # INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR # FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON # GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT, # SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY # KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION, # LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF # THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN # ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON # ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE # POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE. # # US Government Users Restricted Rights # Use, duplication, or disclosure by the Government is subject to # restrictions set forth in FAR 52.227.19(c)(2) or subparagraph # (c)(1)(ii) of the Rights in Technical Data and Computer Software # clause at DFARS 252.227-7013 and/or in similar or successor # clauses in the FAR or the DOD or NASA FAR Supplement. # Unpublished-- rights reserved under the copyright laws of the # United States. Contractor/manufacturer is Silicon Graphics, # Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311. # # OpenGL(TM) is a trademark of Silicon Graphics, Inc. # # dof.c # This program demonstrates use of the accumulation buffer to # create an out-of-focus depth-of-field effect. The teapots # are drawn several times into the accumulation buffer. The # viewing volume is jittered, except at the focal point, where # the viewing volume is at the same position, each time. In # this case, the gold teapot remains in focus. require 'opengl' require 'jitter' include Gl,Glu,Glut # accFrustum() # The first 6 arguments are identical to the glFrustum() call. # # pixdx and pixdy are anti-alias jitter in pixels. # Set both equal to 0.0 for no anti-alias jitter. # eyedx and eyedy are depth-of field jitter in pixels. # Set both equal to 0.0 for no depth of field effects. # # focus is distance from eye to plane in focus. # focus must be greater than, but not equal to 0.0. # # Note that accFrustum() calls glTranslatef(). You will # probably want to insure that your ModelView matrix has been # initialized to identity before calling accFrustum(). def accFrustum(left, right, bottom, top, nnear, ffar, pixdx, pixdy, eyedx, eyedy, focus) viewport = glGetDoublev(GL_VIEWPORT) xwsize = right - left ywsize = top - bottom dx = -(pixdx*xwsize/viewport[2] + eyedx*nnear/focus) dy = -(pixdy*ywsize/viewport[3] + eyedy*nnear/focus) glMatrixMode(GL_PROJECTION) glLoadIdentity() glFrustum(left + dx, right + dx, bottom + dy, top + dy, nnear, ffar) glMatrixMode(GL_MODELVIEW) glLoadIdentity() glTranslate(-eyedx, -eyedy, 0.0) end # accPerspective() # # The first 4 arguments are identical to the gluPerspective() call. # pixdx and pixdy are anti-alias jitter in pixels. # Set both equal to 0.0 for no anti-alias jitter. # eyedx and eyedy are depth-of field jitter in pixels. # Set both equal to 0.0 for no depth of field effects. # # focus is distance from eye to plane in focus. # focus must be greater than, but not equal to 0.0. # # Note that accPerspective() calls accFrustum(). def accPerspective(fovy, aspect, nnear, ffar, pixdx, pixdy, eyedx, eyedy, focus) fov2 = ((fovy*Math::PI) / 180.0) / 2.0 top = nnear / (Math::cos(fov2) / Math::sin(fov2)) bottom = -top right = top * aspect left = -right accFrustum(left, right, bottom, top, nnear, ffar, pixdx, pixdy, eyedx, eyedy, focus) end def myinit ambient = [ 0.0, 0.0, 0.0, 1.0 ] diffuse = [ 1.0, 1.0, 1.0, 1.0 ] position = [ 0.0, 3.0, 3.0, 0.0 ] lmodel_ambient = [ 0.2, 0.2, 0.2, 1.0 ] local_view = [ 0.0 ] glEnable(GL_DEPTH_TEST) glDepthFunc(GL_LESS) glLight(GL_LIGHT0, GL_AMBIENT, ambient) glLight(GL_LIGHT0, GL_DIFFUSE, diffuse) glLight(GL_LIGHT0, GL_POSITION, position) glLightModel(GL_LIGHT_MODEL_AMBIENT, lmodel_ambient) glLightModel(GL_LIGHT_MODEL_LOCAL_VIEWER, local_view) glFrontFace(GL_CW) glEnable(GL_LIGHTING) glEnable(GL_LIGHT0) glEnable(GL_AUTO_NORMAL) glEnable(GL_NORMALIZE) glMatrixMode(GL_MODELVIEW) glLoadIdentity() glClearColor(0.0, 0.0, 0.0, 0.0) glClearAccum(0.0, 0.0, 0.0, 0.0) end def renderTeapot (x, y, z, ambr, ambg, ambb, difr, difg, difb, specr, specg, specb, shine) glPushMatrix() glTranslate(x, y, z) mat = [] mat[0] = ambr; mat[1] = ambg; mat[2] = ambb; mat[3] = 1.0 glMaterial(GL_FRONT, GL_AMBIENT, mat) mat[0] = difr; mat[1] = difg; mat[2] = difb glMaterial(GL_FRONT, GL_DIFFUSE, mat) mat[0] = specr; mat[1] = specg; mat[2] = specb glMaterial(GL_FRONT, GL_SPECULAR, mat) glMaterial(GL_FRONT, GL_SHININESS, shine*128.0) glutSolidTeapot(0.5) glPopMatrix() end # display() draws 5 teapots into the accumulation buffer # several times each time with a jittered perspective. # The focal point is at z = 5.0, so the gold teapot will # stay in focus. The amount of jitter is adjusted by the # magnitude of the accPerspective() jitter in this example, 0.33. # In this example, the teapots are drawn 8 times. See jitter.rb display = proc do viewport = glGetDoublev(GL_VIEWPORT) glClear(GL_ACCUM_BUFFER_BIT) for jitter in 0...8 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) accPerspective(45.0, viewport[2]/ viewport[3], 1.0, 15.0, 0.0, 0.0, 0.33*$j8[jitter][0], 0.33*$j8[jitter][1], 5.0) # ruby, gold, silver, emerald, and cyan teapots renderTeapot(-1.1, -0.5, -4.5, 0.1745, 0.01175, 0.01175, 0.61424, 0.04136, 0.04136, 0.727811, 0.626959, 0.626959, 0.6) renderTeapot(-0.5, -0.5, -5.0, 0.24725, 0.1995, 0.0745, 0.75164, 0.60648, 0.22648, 0.628281, 0.555802, 0.366065, 0.4) renderTeapot(0.2, -0.5, -5.5, 0.19225, 0.19225, 0.19225, 0.50754, 0.50754, 0.50754, 0.508273, 0.508273, 0.508273, 0.4) renderTeapot(1.0, -0.5, -6.0, 0.0215, 0.1745, 0.0215, 0.07568, 0.61424, 0.07568, 0.633, 0.727811, 0.633, 0.6) renderTeapot(1.8, -0.5, -6.5, 0.0, 0.1, 0.06, 0.0, 0.50980392, 0.50980392, 0.50196078, 0.50196078, 0.50196078, 0.25) glAccum(GL_ACCUM, 0.125) end glAccum(GL_RETURN, 1.0) glutSwapBuffers() end myReshape = proc do |w, h| glViewport(0, 0, w, h) end keyboard = proc do |key, x, y| case (key) when ?\e exit(0) end end # Main Loop # Open window with initial window size, title bar, # RGBA display mode, depth buffer, and handle input events. glutInit() glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_ACCUM | GLUT_DEPTH) glutInitWindowSize(500, 500) glutInitWindowPosition(100, 100) glutCreateWindow() myinit() glutReshapeFunc(myReshape) glutDisplayFunc(display) glutKeyboardFunc(keyboard) glutMainLoop() ruby-opengl-0.60.1.orig/examples/RedBook/quadric.rb0000755000000000000000000001151711377006423020631 0ustar rootroot# # Copyright (c) 1993-1997, Silicon Graphics, Inc. # ALL RIGHTS RESERVED # Permission to use, copy, modify, and distribute this software for # any purpose and without fee is hereby granted, provided that the above # copyright notice appear in all copies and that both the copyright notice # and this permission notice appear in supporting documentation, and that # the name of Silicon Graphics, Inc. not be used in advertising # or publicity pertaining to distribution of the software without specific, # written prior permission. # # THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS" # AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE, # INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR # FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON # GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT, # SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY # KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION, # LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF # THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN # ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON # ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE # POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE. # # US Government Users Restricted Rights # Use, duplication, or disclosure by the Government is subject to # restrictions set forth in FAR 52.227.19(c)(2) or subparagraph # (c)(1)(ii) of the Rights in Technical Data and Computer Software # clause at DFARS 252.227-7013 and/or in similar or successor # clauses in the FAR or the DOD or NASA FAR Supplement. # Unpublished-- rights reserved under the copyright laws of the # United States. Contractor/manufacturer is Silicon Graphics, # Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311. # # OpenGL(R) is a registered trademark of Silicon Graphics, Inc. # # quadric.c # This program demonstrates the use of some of the gluQuadric* # routines. Quadric objects are created with some quadric # properties and the callback routine to handle errors. # Note that the cylinder has no top or bottom and the circle # has a hole in it. require 'opengl' require 'mathn' include Gl,Glu,Glut $startList = nil def init mat_ambient = [ 0.5, 0.5, 0.5, 1.0 ] mat_specular = [ 1.0, 1.0, 1.0, 1.0 ] mat_shininess = [ 50.0 ] light_position = [ 1.0, 1.0, 1.0, 0.0 ] model_ambient = [ 0.5, 0.5, 0.5, 1.0 ] glClearColor(0.0, 0.0, 0.0, 0.0) glMaterial(GL_FRONT, GL_AMBIENT, mat_ambient) glMaterial(GL_FRONT, GL_SPECULAR, mat_specular) glMaterial(GL_FRONT, GL_SHININESS, mat_shininess) glLight(GL_LIGHT0, GL_POSITION, light_position) glLightModel(GL_LIGHT_MODEL_AMBIENT, model_ambient) glEnable(GL_LIGHTING) glEnable(GL_LIGHT0) glEnable(GL_DEPTH_TEST) # Create 4 display lists, each with a different quadric object. # Different drawing styles and surface normal specifications # are demonstrated. $startList = glGenLists(4) qobj = gluNewQuadric() gluQuadricDrawStyle(qobj, GLU_FILL) # smooth shaded gluQuadricNormals(qobj, GLU_SMOOTH) glNewList($startList, GL_COMPILE) gluSphere(qobj, 0.75, 15, 10) glEndList() gluQuadricDrawStyle(qobj, GLU_FILL) # flat shaded gluQuadricNormals(qobj, GLU_FLAT) glNewList($startList+1, GL_COMPILE) gluCylinder(qobj, 0.5, 0.3, 1.0, 15, 5) glEndList() gluQuadricDrawStyle(qobj, GLU_LINE) # all polygons wireframe gluQuadricNormals(qobj, GLU_NONE) glNewList($startList+2, GL_COMPILE) gluDisk(qobj, 0.25, 1.0, 20, 4) glEndList() gluQuadricDrawStyle(qobj, GLU_SILHOUETTE) # boundary only gluQuadricNormals(qobj, GLU_NONE) glNewList($startList+3, GL_COMPILE) gluPartialDisk(qobj, 0.0, 1.0, 20, 4, 0.0, 225.0) glEndList() end display = Proc.new do glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) glPushMatrix() glEnable(GL_LIGHTING) glShadeModel(GL_SMOOTH) glTranslate(-1.0, -1.0, 0.0) glCallList($startList) glShadeModel(GL_FLAT) glTranslate(0.0, 2.0, 0.0) glPushMatrix() glRotate(300.0, 1.0, 0.0, 0.0) glCallList($startList+1) glPopMatrix() glDisable(GL_LIGHTING) glColor(0.0, 1.0, 1.0) glTranslate(2.0, -2.0, 0.0) glCallList($startList+2) glColor(1.0, 1.0, 0.0) glTranslate(0.0, 2.0, 0.0) glCallList($startList+3) glPopMatrix() glutSwapBuffers() end reshape = Proc.new do |w, h| glViewport(0, 0, w, h) glMatrixMode(GL_PROJECTION) glLoadIdentity() if (w <= h) glOrtho(-2.5, 2.5, -2.5*h/w, 2.5*h/w, -10.0, 10.0) else glOrtho(-2.5*w/h, 2.5*w/h, -2.5, 2.5, -10.0, 10.0) end glMatrixMode(GL_MODELVIEW) glLoadIdentity() end keyboard = Proc.new do |key, x, y| case (key) when ?\e exit(0) end end # main glutInit glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH) glutInitWindowSize(500, 500) glutInitWindowPosition(100, 100) glutCreateWindow($0) init() glutDisplayFunc(display) glutReshapeFunc(reshape) glutKeyboardFunc(keyboard) glutMainLoop() ruby-opengl-0.60.1.orig/examples/RedBook/alpha.rb0000755000000000000000000000716111377006423020266 0ustar rootroot# # Copyright (c) 1993-1997, Silicon Graphics, Inc. # ALL RIGHTS RESERVED # Permission to use, copy, modify, and distribute this software for # any purpose and without fee is hereby granted, provided that the above # copyright notice appear in all copies and that both the copyright notice # and this permission notice appear in supporting documentation, and that # the name of Silicon Graphics, Inc. not be used in advertising # or publicity pertaining to distribution of the software without specific, # written prior permission. # # THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS" # AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE, # INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR # FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON # GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT, # SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY # KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION, # LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF # THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN # ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON # ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE # POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE. # # US Government Users Restricted Rights # Use, duplication, or disclosure by the Government is subject to # restrictions set forth in FAR 52.227.19(c)(2) or subparagraph # (c)(1)(ii) of the Rights in Technical Data and Computer Software # clause at DFARS 252.227-7013 and/or in similar or successor # clauses in the FAR or the DOD or NASA FAR Supplement. # Unpublished-- rights reserved under the copyright laws of the # United States. Contractor/manufacturer is Silicon Graphics, # Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311. # # OpenGL(R) is a registered trademark of Silicon Graphics, Inc. # # alpha.c # This program draws several overlapping filled polygons # to demonstrate the effect order has on alpha blending results. # Use the 't' key to toggle the order of drawing polygons. require 'opengl' require 'mathn' include Gl,Glu,Glut $leftFirst = GL_TRUE # Initialize alpha blending function. def init glEnable(GL_BLEND) glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) glShadeModel(GL_FLAT) glClearColor(0.0, 0.0, 0.0, 0.0) end def drawLeftTriangle # draw yellow triangle on LHS of screen glBegin(GL_TRIANGLES) glColor(1.0, 1.0, 0.0, 0.75) glVertex(0.1, 0.9, 0.0) glVertex(0.1, 0.1, 0.0) glVertex(0.7, 0.5, 0.0) glEnd() end def drawRightTriangle # draw cyan triangle on RHS of screen glBegin(GL_TRIANGLES) glColor(0.0, 1.0, 1.0, 0.75) glVertex(0.9, 0.9, 0.0) glVertex(0.3, 0.5, 0.0) glVertex(0.9, 0.1, 0.0) glEnd() end display = Proc.new do glClear(GL_COLOR_BUFFER_BIT) if ($leftFirst) drawLeftTriangle() drawRightTriangle() else drawRightTriangle() drawLeftTriangle() end glutSwapBuffers() end reshape = Proc.new do |w, h| glViewport(0, 0, w, h) glMatrixMode(GL_PROJECTION) glLoadIdentity() if (w <= h) gluOrtho2D(0.0, 1.0, 0.0, 1.0*h/w) else gluOrtho2D(0.0, 1.0*w/h, 0.0, 1.0) end end keyboard = Proc.new do|key, x, y| case (key) when ?t,?T $leftFirst = !$leftFirst glutPostRedisplay() when ?\e # Escape key exit(0) end end # Main Loop # Open window with initial window size, title bar, # RGBA display mode, and handle input events. glutInit glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB) glutInitWindowSize(500, 500) glutInitWindowPosition(100, 100) glutCreateWindow($0) init() glutReshapeFunc(reshape) glutKeyboardFunc(keyboard) glutDisplayFunc(display) glutMainLoop() ruby-opengl-0.60.1.orig/examples/RedBook/bezmesh.rb0000755000000000000000000000772411377006423020643 0ustar rootroot# # Copyright (c) Mark J. Kilgard, 1994. # # (c) Copyright 1993, Silicon Graphics, Inc. # ALL RIGHTS RESERVED # Permission to use, copy, modify, and distribute this software for # any purpose and without fee is hereby granted, provided that the above # copyright notice appear in all copies and that both the copyright notice # and this permission notice appear in supporting documentation, and that # the name of Silicon Graphics, Inc. not be used in advertising # or publicity pertaining to distribution of the software without specific, # written prior permission. # # THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS" # AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE, # INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR # FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON # GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT, # SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY # KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION, # LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF # THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN # ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON # ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE # POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE. # # US Government Users Restricted Rights # Use, duplication, or disclosure by the Government is subject to # restrictions set forth in FAR 52.227.19(c)(2) or subparagraph # (c)(1)(ii) of the Rights in Technical Data and Computer Software # clause at DFARS 252.227-7013 and/or in similar or successor # clauses in the FAR or the DOD or NASA FAR Supplement. # Unpublished-- rights reserved under the copyright laws of the # United States. Contractor/manufacturer is Silicon Graphics, # Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311. # # OpenGL(TM) is a trademark of Silicon Graphics, Inc. # # bezsurf.c # This program renders a lighted, filled Bezier surface, # using two-dimensional evaluators. # require 'opengl' include Gl,Glu,Glut $ctrlpoints = [ [ [-1.5, -1.5, 4.0], [-0.5, -1.5, 2.0], [0.5, -1.5, -1.0], [1.5, -1.5, 2.0]], [ [-1.5, -0.5, 1.0], [-0.5, -0.5, 3.0], [0.5, -0.5, 0.0], [1.5, -0.5, -1.0]], [ [-1.5, 0.5, 4.0], [-0.5, 0.5, 0.0], [0.5, 0.5, 3.0], [1.5, 0.5, 4.0]], [ [-1.5, 1.5, -2.0], [-0.5, 1.5, -2.0], [0.5, 1.5, 0.0], [1.5, 1.5, -1.0]] ] def initlights ambient = [0.2, 0.2, 0.2, 1.0] position = [0.0, 0.0, 2.0, 1.0] mat_diffuse = [0.6, 0.6, 0.6, 1.0] mat_specular = [1.0, 1.0, 1.0, 1.0] mat_shininess = [50.0] glEnable(GL_LIGHTING) glEnable(GL_LIGHT0) glLight(GL_LIGHT0, GL_AMBIENT, ambient) glLight(GL_LIGHT0, GL_POSITION, position) glMaterial(GL_FRONT, GL_DIFFUSE, mat_diffuse) glMaterial(GL_FRONT, GL_SPECULAR, mat_specular) glMaterial(GL_FRONT, GL_SHININESS, mat_shininess) end display = proc do glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) glPushMatrix() glRotate(85.0, 1.0, 1.0, 1.0) glEvalMesh2(GL_FILL, 0, 20, 0, 20) glPopMatrix() glutSwapBuffers() end def myinit glClearColor(0.0, 0.0, 0.0, 1.0) glEnable(GL_DEPTH_TEST) glMap2d(GL_MAP2_VERTEX_3, 0, 1, 3, 4, 0, 1, 12, 4, $ctrlpoints.flatten) glEnable(GL_MAP2_VERTEX_3) glEnable(GL_AUTO_NORMAL) glEnable(GL_NORMALIZE) glMapGrid2d(20, 0.0, 1.0, 20, 0.0, 1.0) initlights() # for lighted version only end myReshape = proc do |w, h| glViewport(0, 0, w, h) glMatrixMode(GL_PROJECTION) glLoadIdentity() if (w <= h) glOrtho(-4.0, 4.0, -4.0 * h / w, 4.0 * h / w, -4.0, 4.0) else glOrtho(-4.0 * w / h, 4.0 * w / h, -4.0, 4.0, -4.0, 4.0) end glMatrixMode(GL_MODELVIEW) glLoadIdentity() end keyboard = Proc.new do |key, x, y| case (key) when ?\e exit(0); end end glutInit() glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH) glutInitWindowSize(500, 500) glutInitWindowPosition(100, 100) glutCreateWindow($0) myinit() glutReshapeFunc(myReshape) glutDisplayFunc(display) glutKeyboardFunc(keyboard) glutMainLoop() ruby-opengl-0.60.1.orig/examples/README0000644000000000000000000000103311377006423016174 0ustar rootrootExamples ======== This directory contains OpenGL examples converted to ruby from various sources. As such, they are distributed under various terms - see each file for licensing info. RedBook/ Examples from OpenGL Red Book and SGI's example code in general, licensed under SGI open-source license. OrangeBook/ Examples from OpenGL Orange Book (GLSL), distributed under BSD license NeHe/ NeHe's opengl tutorials (http://nehe.gamedev.net), licensed under free license. Misc/ Other examples. If license is not given, MIT is assumed. ruby-opengl-0.60.1.orig/examples/misc/0000755000000000000000000000000012163761140016250 5ustar rootrootruby-opengl-0.60.1.orig/examples/misc/plane.rb0000644000000000000000000001262011377006423017677 0ustar rootroot#!/usr/bin/env ruby -rubygems #/* Copyright (c) Mark J. Kilgard, 1994. */ # #/* # * (c) Copyright 1993, Silicon Graphics, Inc. # * ALL RIGHTS RESERVED # * Permission to use, copy, modify, and distribute this software for # * any purpose and without fee is hereby granted, provided that the above # * copyright notice appear in all copies and that both the copyright notice # * and this permission notice appear in supporting documentation, and that # * the name of Silicon Graphics, Inc. not be used in advertising # * or publicity pertaining to distribution of the software without specific, # * written prior permission. # * # * THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS" # * AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE, # * INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR # * FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON # * GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT, # * SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY # * KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION, # * LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF # * THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN # * ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON # * ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE # * POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE. # * # * US Government Users Restricted Rights # * Use, duplication, or disclosure by the Government is subject to # * restrictions set forth in FAR 52.227.19(c)(2) or subparagraph # * (c)(1)(ii) of the Rights in Technical Data and Computer Software # * clause at DFARS 252.227-7013 and/or in similar or successor # * clauses in the FAR or the DOD or NASA FAR Supplement. # * Unpublished-- rights reserved under the copyright laws of the # * United States. Contractor/manufacturer is Silicon Graphics, # * Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311. # * # * OpenGL(TM) is a trademark of Silicon Graphics, Inc. # */ #/* # * plane.c # * This program demonstrates the use of local versus # * infinite lighting on a flat plane. # */ require "gl" require "glut" require "mathn" # /* Initialize material property, light source, and lighting model. # */ def myinit mat_ambient = [ 0.0, 0.0, 0.0, 1.0 ]; #/* mat_specular and mat_shininess are NOT default values */ mat_diffuse = [ 0.4, 0.4, 0.4, 1.0 ]; mat_specular = [ 1.0, 1.0, 1.0, 1.0 ]; mat_shininess = [ 15.0 ]; light_ambient = [ 0.0, 0.0, 0.0, 1.0 ]; light_diffuse = [ 1.0, 1.0, 1.0, 1.0 ]; light_specular = [ 1.0, 1.0, 1.0, 1.0 ]; lmodel_ambient = [ 0.2, 0.2, 0.2, 1.0 ]; Gl.glMaterial(Gl::GL_FRONT, Gl::GL_AMBIENT, mat_ambient); Gl.glMaterial(Gl::GL_FRONT, Gl::GL_DIFFUSE, mat_diffuse); Gl.glMaterial(Gl::GL_FRONT, Gl::GL_SPECULAR, mat_specular); Gl.glMaterial(Gl::GL_FRONT, Gl::GL_SHININESS, *mat_shininess); Gl.glLight(Gl::GL_LIGHT0, Gl::GL_AMBIENT, light_ambient); Gl.glLight(Gl::GL_LIGHT0, Gl::GL_DIFFUSE, light_diffuse); Gl.glLight(Gl::GL_LIGHT0, Gl::GL_SPECULAR, light_specular); Gl.glLightModel(Gl::GL_LIGHT_MODEL_AMBIENT, lmodel_ambient); Gl.glEnable(Gl::GL_LIGHTING); Gl.glEnable(Gl::GL_LIGHT0); Gl.glDepthFunc(Gl::GL_LESS); Gl.glEnable(Gl::GL_DEPTH_TEST); end def drawPlane Gl.glBegin(Gl::GL_QUADS); Gl.glNormal(0.0, 0.0, 1.0); Gl.glVertex(-1.0, -1.0, 0.0); Gl.glVertex(0.0, -1.0, 0.0); Gl.glVertex(0.0, 0.0, 0.0); Gl.glVertex(-1.0, 0.0, 0.0); Gl.glNormal(0.0, 0.0, 1.0); Gl.glVertex(0.0, -1.0, 0.0); Gl.glVertex(1.0, -1.0, 0.0); Gl.glVertex(1.0, 0.0, 0.0); Gl.glVertex(0.0, 0.0, 0.0); Gl.glNormal(0.0, 0.0, 1.0); Gl.glVertex(0.0, 0.0, 0.0); Gl.glVertex(1.0, 0.0, 0.0); Gl.glVertex(1.0, 1.0, 0.0); Gl.glVertex(0.0, 1.0, 0.0); Gl.glNormal(0.0, 0.0, 1.0); Gl.glVertex(0.0, 0.0, 0.0); Gl.glVertex(0.0, 1.0, 0.0); Gl.glVertex(-1.0, 1.0, 0.0); Gl.glVertex(-1.0, 0.0, 0.0); Gl.glEnd(); end display = Proc.new { infinite_light = [ 1.0, 1.0, 1.0, 0.0 ]; local_light = [ 1.0, 1.0, 1.0, 1.0 ]; Gl.glClear(Gl::GL_COLOR_BUFFER_BIT | Gl::GL_DEPTH_BUFFER_BIT); Gl.glPushMatrix(); Gl.glTranslate(-1.5, 0.0, 0.0); Gl.glLight(Gl::GL_LIGHT0, Gl::GL_POSITION, infinite_light); drawPlane(); Gl.glPopMatrix(); Gl.glPushMatrix(); Gl.glTranslate(1.5, 0.0, 0.0); Gl.glLight(Gl::GL_LIGHT0, Gl::GL_POSITION, local_light); drawPlane(); Gl.glPopMatrix(); Gl.glFlush(); } myReshape = Proc.new {|w, h| Gl.glViewport(0, 0, w, h); Gl.glMatrixMode(Gl::GL_PROJECTION); Gl.glLoadIdentity(); if (w <= h) Gl.glOrtho(-1.5, 1.5, -1.5*h/w, 1.5*h/w, -10.0, 10.0); else Gl.glOrtho(-1.5*w/h, 1.5*w/h, -1.5, 1.5, -10.0, 10.0); end Gl.glMatrixMode(Gl::GL_MODELVIEW); } # Keyboard handler to exit when ESC is typed keyboard = lambda do |key, x, y| case(key) when ?\e exit(0) end end #/* Main Loop # * Open window with initial window size, title bar, # * RGBA display mode, and handle input events. # */ #int main(int argc, char** argv) #{ Glut.glutInit Glut.glutInitDisplayMode(Glut::GLUT_SINGLE | Glut::GLUT_RGB | Glut::GLUT_DEPTH); Glut.glutInitWindowSize(500, 200); Glut.glutCreateWindow($0); myinit(); Glut.glutReshapeFunc(myReshape); Glut.glutDisplayFunc(display); Glut.glutKeyboardFunc(keyboard); Glut.glutMainLoop(); ruby-opengl-0.60.1.orig/examples/misc/anisotropic.rb0000644000000000000000000001245011377006423021133 0ustar rootroot# # Copyright (C) 2007 Jan Dvorak # # This program is distributed under the terms of the MIT license. # See the included MIT-LICENSE file for the terms of this license. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # # Showcase for anisotropic texture filtering # require 'opengl' include Gl,Glu,Glut # extend Array class with new function class Array def rotate! self << self.shift end end class App @@filters = [[GL_NEAREST,"None"],[GL_LINEAR_MIPMAP_NEAREST,"Bilinear"],[GL_LINEAR_MIPMAP_LINEAR,"Trilinear"]] @@anisotropy = [1,2,4,8,16,32] @@color_tint = ["Off","On"] def checker_texture(size,divide,color_a,color_b) strip_a = color_a * (size/divide) strip_b = color_b * (size/divide) line_strip_a = (strip_a + strip_b) * (size/2) line_strip_b = (strip_b + strip_a) * (size/2) (line_strip_a + line_strip_b) * (divide/2) end def printGlutBitmapFont(string, font, x,y, r,g,b) glDisable(GL_TEXTURE_2D) glColor3f(r, g, b) glRasterPos2i(x, y) string.each_byte do |x| glutBitmapCharacter(font, x) end end def ortho(w,h) glMatrixMode(GL_PROJECTION) glLoadIdentity() gluOrtho2D(0,w,0,h) glScalef(1,-1,1) glTranslatef(0,-h,0) glMatrixMode(GL_MODELVIEW) glLoadIdentity() end def persp(w,h) glMatrixMode(GL_PROJECTION) glLoadIdentity gluPerspective(90,w.to_f/h.to_f,1,100) glMatrixMode(GL_MODELVIEW) glLoadIdentity end def reshape(w,h) @@w,@@h = w,h glViewport(0, 0, w, h) persp(w,h) end def initialize if (not Gl.is_available?("GL_EXT_texture_filter_anisotropic")) puts "This program needs GL_EXT_texture_filter_anisotropic extension" exit end @@w,@@h = glutGet(GLUT_WINDOW_WIDTH),glutGet(GLUT_WINDOW_HEIGHT) @t = glGenTextures(2) # default checkerboard texture glBindTexture(GL_TEXTURE_2D,@t[0]) data = checker_texture(64,4,[1,1,1],[0,0,0]) gluBuild2DMipmaps(GL_TEXTURE_2D,GL_RGBA,64,64,GL_RGB,GL_FLOAT,data.pack("f*")) # second texture with color tinted mipmaps glBindTexture(GL_TEXTURE_2D,@t[1]) data = checker_texture(64,4,[1,1,1],[0,0,0]) glTexImage2D(GL_TEXTURE_2D,0,GL_RGBA,64,64,0,GL_RGB,GL_FLOAT,data.pack("f*")) data = checker_texture(32,4,[1,0,0],[0,0,0]) glTexImage2D(GL_TEXTURE_2D,1,GL_RGBA,32,32,0,GL_RGB,GL_FLOAT,data.pack("f*")) data = checker_texture(16,4,[0,1,0],[0,0,0]) glTexImage2D(GL_TEXTURE_2D,2,GL_RGBA,16,16,0,GL_RGB,GL_FLOAT,data.pack("f*")) data = checker_texture(8,4,[0,0,1],[0,0,0]) glTexImage2D(GL_TEXTURE_2D,3,GL_RGBA,8,8,0,GL_RGB,GL_FLOAT,data.pack("f*")) data = checker_texture(4,4,[1,1,0],[0,0,0]) glTexImage2D(GL_TEXTURE_2D,4,GL_RGBA,4,4,0,GL_RGB,GL_FLOAT,data.pack("f*")) data = checker_texture(2,2,[1,0,1],[0,0,0]) glTexImage2D(GL_TEXTURE_2D,5,GL_RGBA,2,2,0,GL_RGB,GL_FLOAT,data.pack("f*")) data = [0.5,0.5,0.5] # single pixel texture, just average it glTexImage2D(GL_TEXTURE_2D,6,GL_RGBA,1,1,0,GL_RGB,GL_FLOAT,data.pack("f*")) end def display_text ortho(@@w,@@h) printGlutBitmapFont("Texture Filtering ('f'): #{@@filters[0][1]}", GLUT_BITMAP_9_BY_15, 20, 20, 1.0, 1.0, 1.0) printGlutBitmapFont("Anisotropy factor ('a'): #{@@anisotropy[0]}x", GLUT_BITMAP_9_BY_15, 20, 40, 1.0, 1.0, 1.0) printGlutBitmapFont("Colored Mipmaps ('c'): #{@@color_tint[0]}", GLUT_BITMAP_9_BY_15, 20, 60, 1.0, 1.0, 1.0) persp(@@w,@@h) end def display_plane() glEnable(GL_TEXTURE_2D) t_repeat = 16 # x,y,z,u,v quad = [[-4,-1,1, 0,t_repeat],[4,-1,1, t_repeat,t_repeat],[4,1,-8, t_repeat,0],[-4,1,-8, 0,0]] glBegin(GL_QUADS) quad.each do |v| glTexCoord2f(v[3],v[4]) glVertex3f(v[0],v[1],v[2]) end glEnd() glDisable(GL_TEXTURE_2D) end def display glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) persp(@@w,@@h) # move back from scene glTranslatef(0,0,-2) # set anisotropy glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MAX_ANISOTROPY_EXT,@@anisotropy[0]) # set color tint if (@@color_tint[0] == "On") glBindTexture(GL_TEXTURE_2D,@t[1]) else glBindTexture(GL_TEXTURE_2D,@t[0]) end # set filters f = @@filters[0][0] glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,f) # draw scene display_plane() display_text() sleep(0.001) # microsleep to avoid consuming all CPU time glutSwapBuffers() end def idle glutPostRedisplay() end def keyboard(key,x,y) case (key) when ?f @@filters.rotate! when ?a max_anisotropy = glGetIntegerv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT) begin @@anisotropy.rotate! end until @@anisotropy[0]<=max_anisotropy when ?c @@color_tint.rotate! when ?\e # Escape exit(0) end glutPostRedisplay() end end # main glutInit() glutInitDisplayMode(GLUT_RGBA | GLUT_DEPTH | GLUT_DOUBLE ) glutInitWindowPosition(150,50) glutInitWindowSize(500,500) glutCreateWindow($0) app = App.new glutReshapeFunc(app.method(:reshape).to_proc) glutDisplayFunc(app.method(:display).to_proc) glutIdleFunc(app.method(:idle).to_proc) glutKeyboardFunc(app.method(:keyboard).to_proc) glutMainLoop() ruby-opengl-0.60.1.orig/examples/misc/font-glut.rb0000755000000000000000000000176211377006423020527 0ustar rootrootrequire 'opengl' include Gl,Glu,Glut display = Proc.new do glClear(GL_COLOR_BUFFER_BIT) GL.LoadIdentity glRasterPos2d(100,100) "Hello Bitmap".each_byte { |x| glutBitmapCharacter(GLUT_BITMAP_9_BY_15, x) } GL.Translate(100, 250, 0) GL.Scale(0.5, 0.5, 1) "Hello Stroke".each_byte { |x| glutStrokeCharacter(GLUT_STROKE_ROMAN, x) } glutSwapBuffers() end reshape = Proc.new do |w, h| glViewport(0, 0, w, h) glMatrixMode(GL_PROJECTION) glLoadIdentity() glOrtho(0.0, w, 0.0, h, -1.0, 1.0) glMatrixMode(GL_MODELVIEW) end keyboard = Proc.new do |key, x, y| case (key) when ?\e exit(0) end end # Main Loop # Open window with initial window size, title bar, # color index display mode, and handle input events. # glutInit glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB) glutInitWindowSize(500, 500) glutInitWindowPosition(100, 100) glutCreateWindow($0) glutReshapeFunc(reshape) glutDisplayFunc(display) glutKeyboardFunc(keyboard) glutMainLoop ruby-opengl-0.60.1.orig/examples/misc/readpixel.rb0000755000000000000000000000247611377006423020570 0ustar rootrootrequire 'opengl' include Gl,Glu,Glut begin require "RMagick" rescue Exception print "This sample needs RMagick Module.\n" exit end WIDTH = 500 HEIGHT = 500 display = Proc.new do glClear(GL_COLOR_BUFFER_BIT) glBegin(GL_LINES) glVertex(0.5, 0.5) glVertex(-0.5, -0.5) glEnd glFlush() pixels = glReadPixels(0, 0, WIDTH, HEIGHT, GL_RGBA, GL_UNSIGNED_SHORT) image = Magick::Image.new(WIDTH, HEIGHT) image.import_pixels(0, 0, WIDTH, HEIGHT, "RGBA", pixels,Magick::ShortPixel) image.flip! image.write("opengl_window.gif") end reshape = Proc.new do |w, h| glViewport(0, 0, w, h) glMatrixMode(GL_PROJECTION) glLoadIdentity() if (w <= h) gluOrtho2D(-1.0, 1.0, -h.to_f/w.to_f, h.to_f/w.to_f) else gluOrtho2D(w.to_f/h.to_f, w.to_f/h.to_f, -1.0, 1.0) end glMatrixMode(GL_MODELVIEW) glLoadIdentity() end keyboard = Proc.new do |key, x, y| case (key) when ?\e exit(0); end end # Main Loop # Open window with initial window size, title bar, # color index display mode, and handle input events. glutInit glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB | GLUT_ALPHA) glutInitWindowSize(WIDTH, HEIGHT) glutInitWindowPosition(100, 100) glutCreateWindow($0) glutReshapeFunc(reshape) glutDisplayFunc(display) glutKeyboardFunc(keyboard) glutMainLoop ruby-opengl-0.60.1.orig/examples/misc/glfwtest.rb0000644000000000000000000000126211377006423020437 0ustar rootrootrequire 'opengl' require 'glfw' #init Glfw.glfwOpenWindow( 500,500, 0,0,0,0, 32,0, Glfw::GLFW_WINDOW ) # main loop while true if( Glfw.glfwGetWindowParam( Glfw::GLFW_OPENED ) == false || Glfw.glfwGetKey(Glfw::GLFW_KEY_ESC) == Glfw::GLFW_PRESS ) break end Gl.glClear( Gl::GL_COLOR_BUFFER_BIT | Gl::GL_DEPTH_BUFFER_BIT ) Gl.glBegin( Gl::GL_POLYGON ) Gl.glColor3f( 1.0, 0.0, 0.0 ) Gl.glVertex2f( -0.5, -0.5 ) Gl.glColor3f( 0.0, 1.0, 0.0 ) Gl.glVertex2f( -0.5, 0.5 ) Gl.glColor3f( 0.0, 0.0, 1.0 ) Gl.glVertex2f( 0.5, 0.5 ) Gl.glColor3f( 1.0, 0.0, 1.0 ) Gl.glVertex2f( 0.5, -0.5 ) Gl.glEnd Glfw.glfwSwapBuffers() sleep 0.01 # to avoid consuming all CPU power end ruby-opengl-0.60.1.orig/examples/misc/sdltest.rb0000644000000000000000000000127311377006423020264 0ustar rootrootrequire 'opengl' require 'sdl' #init SDL.init(SDL::INIT_VIDEO) SDL.setGLAttr(SDL::GL_DOUBLEBUFFER,1) SDL.setVideoMode(512,512,32,SDL::OPENGL) # main loop while true while event = SDL::Event2.poll case event when SDL::Event2::KeyDown, SDL::Event2::Quit exit end end Gl.glClear( Gl::GL_COLOR_BUFFER_BIT | Gl::GL_DEPTH_BUFFER_BIT ) Gl.glBegin( Gl::GL_POLYGON ) Gl.glColor3f( 1.0, 0.0, 0.0 ) Gl.glVertex2f( -0.5, -0.5 ) Gl.glColor3f( 0.0, 1.0, 0.0 ) Gl.glVertex2f( -0.5, 0.5 ) Gl.glColor3f( 0.0, 0.0, 1.0 ) Gl.glVertex2f( 0.5, 0.5 ) Gl.glColor3f( 1.0, 0.0, 1.0 ) Gl.glVertex2f( 0.5, -0.5 ) Gl.glEnd SDL.GLSwapBuffers() sleep 0.01 # to avoid consuming all CPU power end ruby-opengl-0.60.1.orig/examples/misc/trislam.rb0000644000000000000000000004516711377006423020267 0ustar rootroot#!/usr/bin/env ruby # Purpose: Determine performance curves for various methods of pushing # triangles and quads through the OpenGL pipeline # Copyright (c) 2004-2006, Geoff Broadwell; this script is released # as open source and may be distributed and modified under the terms # of either the Artistic License or the GNU General Public License, # in the same manner as Perl itself. These licenses should have been # distributed to you as part of your Perl distribution, and can be # read using `perldoc perlartistic` and `perldoc perlgpl` respectively. # Conversion to ruby by Jan Dvorak require 'opengl' include Gl,Glu,Glut require 'mathn' require 'OGLBench' $VERSION = '0.1.24-ruby-p1' $test = 0 $run = 0 $done = false $ready = false ### USER CONFIG # Primitive sizes (and therefore counts) are integer divisors of # (A^i * B^j * C^k ...) where good A, B, C, ... are relatively prime; # this number is used for the draw area height and width and defaults to: # 2^4 * 3^2 * 5 = 720 # You may also want to get fewer data points across the same range by # directly using higher powers; for example: # 16 * 9 * 5 = 720 # # my @max_powers = (16 => 1, 9 => 1, 5 => 1); $max_powers = { 2 => 4, 3 => 2, 5 => 1 }.to_a.flatten # Maximum quads along each axis for known slow versus usually fast tests; # chosen to be somewhat reasonable for most common settings of @max_powers # my $max_count_slow = 60; $max_count_slow = 154 $max_count_fast = 154 # Font to use to label graphs $font_style = GLUT_BITMAP_HELVETICA_10 ### MISC GLOBALS $conf = $app = $gl_info = nil $MIN_FRAMES = $MIN_SECONDS = 0 $w = $h = 0 $dls = {} $vas = {} $combos = $slow = $fast = 0 $showing_graph = false $empty_time = $empty_frames = $total = 0 $max = [] $stats = [] $stats_fixed = [] ### CODE def main init() print "Benchmarks:" glutDisplayFunc(method(:cbDraw).to_proc) glutIdleFunc(method(:cbDraw).to_proc) glutKeyboardFunc(method(:cbKeyPressed).to_proc) glutMainLoop() end def init $stdout.sync = true $combos = recurse_combos($max_powers) $combos.sort! $slow = $combos.select { |a| a <= $max_count_slow } $fast = $combos.select { |a| a > $max_count_slow && a <= $max_count_slow } # Choose drawing area size to match counts $h = $w = $combos.last default_conf = { :title => 'Triangle Slammer OpenGL Benchmark', :geometry => "#{$w}x#{$h}", :frames => 10, :seconds => 1, } $conf, $app, $gl_info = OGLBench.basic_init(default_conf) # Reduce indirections in inner loops $MIN_FRAMES, $MIN_SECONDS = $conf[:frames], $conf[:seconds] # Let user know what's going on show_user_message() # Change projection to integer-pixel ortho glMatrixMode(GL_PROJECTION) glOrtho(0, $w, 0, $h, -1, 1) glMatrixMode(GL_MODELVIEW) # Make sure GL state is consistent for VA and DL creation start_frame() # Create vertex arrays and display lists outside timing loop init_vertex_arrays() init_display_lists() # Clean up GL state end_frame() end def recurse_combos(powers) base, max_power, *rest = powers return [1] if powers.size<1 combos = [] (0..max_power).each do |power| multiplier = base ** power recurse_combos(rest).each do |item| combos << (item*multiplier) end end combos end def show_user_message print <<"EOM"; TRISLAM benchmarks several methods of pushing OpenGL primitives, testing each method with various primitive counts and sizes. During the benchmark, the test window will start out black, slowly brightening to white as testing progresses. Once benchmarking is complete, the collected data will be dumped in tabular form. The configuration for this series of tests will be as follows: EOM OGLBench.show_basic_config($conf, $gl_info, $VERSION) puts "standard runs: #{$slow.join(' ')}" puts "extra fast runs: #{$fast.join(' ')}" puts '-' * 79 end def init_vertex_arrays print "Init vertex arrays:" $va_types.keys.sort.each do |type| print " #{type}" ($slow + $fast).each do |count| data = $va_types[type].call(count, $w / count.to_f) va = data.pack("f*") $vas["#{type}_#{count}"] = va end end print ".\n"; end def init_display_lists print "Init display lists:" num_lists = $dl_types.size * ($slow + $fast).size current = glGenLists(num_lists) $dl_types.keys.sort.each do |type| print " #{type}" ($slow + $fast).each do |count| $dls["#{type}_#{count}"] = current glNewList(current, GL_COMPILE) $dl_types[type].call(count, $w / count.to_f) glEndList() current += 1 end end puts "." end def benchmark if ($test >= $tests.size) print ".\n" if (!$done) $done = true return end name,draw,stats,class_ = $tests[$test] counts = class_ == 'single' ? [1] : (class_ == 'slow' ? $slow : $slow + $fast) if ($run == 0) print " #{name}"; # After printing current test name, busy wait for a second # so that the terminal can catch up and not do work while # the GL timing is in progress a = Time.now while 1 > (Time.now - a) do end end count = counts[$run] size = $w / count OGLBench.fade_to_white(($test + ($run.to_f / counts.size)) / $tests.size) run_done = 0 frames = 0 start = Time.now while (run_done==0) start_frame() draw.call(count, size.to_f) end_frame() frames += 1 run_done = 1 if ($MIN_FRAMES <= frames && $MIN_SECONDS <= Time.now - start) end glFinish() end_ = Time.now time = end_ - start $stats << [name,count,time,frames] + stats.call(count,size.to_f) $run += 1 if ($run >= counts.size) $test += 1 $run = 0 end end def cleanup fixup_stats() show_stats() draw_stats() end def start_frame glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) end def end_frame glFinish() end def fixup_stats empty = $stats.shift $empty_time = empty[2] $empty_frames = empty[3] empty_tpf = $empty_time.to_f / $empty_frames $total = ['totl,','avg'] + [0] * 12 $max = ['max','max'] + [0] * 12 $stats.each do |stat| name, count, time, frames, pixpf, prmpf, tpf, vpf = stat # Subtract out empty loop time, and loop if negative result # $time -= $empty_tpf * $frames; if (time <= 0) stat += [0] * 5 next end # Calc "work", the geometric mean of pixels and vertices workpf = Math::sqrt(pixpf * vpf) # Calc fps fps = frames / time # Calc other perf stats pixps = pixpf * fps prmps = prmpf * fps tps = tpf * fps vps = vpf * fps wps = workpf * fps # Add them to stat row stat += [fps, pixps, prmps, tps, vps, wps] # Convert per frame counts to totals (4..7).each { |i| stat[i] *= frames } # Update running totals (2..7).each { |i| $total[i] += stat[i] } # Update running maximums (2..13).each do |i| $max[i] = stat[i] if $max[i] < stat[i] end $stats_fixed << stat end # Calc averages for totals line (8..13).each { |i| $total[i] = $total[i-5] / $total[2].to_f } $ready = true $stats = $stats_fixed end def show_stats basic = ["Name","Cnt","Time"] raw = ["Frms","Mpix","Kprim","Ktri","Kvert"] calc = raw scale = [ 0, 6, 3, 3, 3, ] * 2 header = basic + raw + calc scale.map! {|n| 10 ** n } g_form = "%9s%-*s %s\n" h_form = '%-5s%3s %6s' + ' %5s' * raw.size + ' ' + ' %5s' * calc.size + "\n" format = '%-5s%3s %6.3f' + ' %5d' * raw.size + ' ' + ' %5d' * calc.size + "\n" printf(g_form, '', 6 * 5 + 8, 'MEASURED', 'PER SECOND') printf(h_form, *header) printf(format, "empty", 1, $empty_time, $empty_frames, *([0] * 9)) # ($stats + [$total]).each do |stat| st = stat.clone() (0..scale.size-1).each do |i| st[i + 3] /= scale[i] end printf(format,*st) end end def make_quads_va(count,size) data = [] (0 .. count-1).each do |y| (0 .. count-1).each do |x| data << x * size << y * size + size data << x * size << y * size data << x * size + size << y * size data << x * size + size << y * size + size end end data end def make_tris_va(count,size) data = [] (0 .. count-1).each do |y| (0 .. count-1).each do |x| data << x * size << y * size + size data << x * size << y * size data << x * size + size << y * size + size data << x * size + size << y * size + size data << x * size << y * size data << x * size + size << y * size end end data end def make_qs_va(count,size) data = [] (0 .. count-1).each do |y| (0 .. count).each do |x| data << x * size << y * size + size data << x * size << y * size end end data end def make_ts_va(count,size) data = [] (0 .. count-1).each do |y| (0 .. count).each do |x| data << x * size << y * size + size data << x * size << y * size end end data end def draw_qs(count,size) (0 .. count-1).each do |y| glBegin(GL_QUAD_STRIP) (0 .. count).each do |x| glVertex2f(x * size, y * size + size) glVertex2f(x * size, y * size ) end glEnd() end end def draw_ts(count,size) (0 .. count-1).each do |y| glBegin(GL_TRIANGLE_STRIP) (0 .. count).each do |x| glVertex2f(x * size, y * size + size) glVertex2f(x * size, y * size ) end glEnd() end end def draw_qs_va(count,size) va = $vas["qs_#{count}"] row = 2 * (count + 1) glEnableClientState(GL_VERTEX_ARRAY) glVertexPointer(2, GL_FLOAT, 0, va) (0 .. count-1).each do |y| glDrawArrays(GL_QUAD_STRIP, y * row, row) end glDisableClientState(GL_VERTEX_ARRAY) end def draw_ts_va(count,size) va = $vas["ts_#{count}"] row = 2 * (count + 1) glEnableClientState(GL_VERTEX_ARRAY) glVertexPointer(2, GL_FLOAT, 0, va) (0 .. count-1).each do |y| glDrawArrays(GL_TRIANGLE_STRIP, y * row, row) end glDisableClientState(GL_VERTEX_ARRAY) end def draw_tris(count,size) glBegin(GL_TRIANGLES) (0 .. count-1).each do |y| (0 .. count-1).each do |x| glVertex2f(x * size , y * size + size) glVertex2f(x * size , y * size ) glVertex2f(x * size + size, y * size + size) glVertex2f(x * size + size, y * size + size) glVertex2f(x * size , y * size ) glVertex2f(x * size + size, y * size ) end end glEnd end def stats_tris(count,size) length = size * count area = length * length prims = 2 * count * count tris = prims verts = 3 * prims [area, prims, tris, verts] end def draw_empty(count,size) end def stats_empty(count,size) [0,0,0,0] end def draw_quads(count,size) glBegin(GL_QUADS) (0 .. count-1).each do |y| (0 .. count-1).each do |x| glVertex2f(x * size , y * size + size) glVertex2f(x * size , y * size ) glVertex2f(x * size + size, y * size ) glVertex2f(x * size + size, y * size + size) end end glEnd end def stats_quads(count,size) length = size * count area = length * length prims = count * count tris = 2 * prims verts = 4 * prims [area, prims, tris, verts] end def stats_ts(count,size) length = size * count area = length * length prims = count tris = 2 * count * prims verts = 2 * (count + 1) * prims [area, prims, tris, verts] end def stats_qs(count,size) length = size * count area = length * length prims = count tris = 2 * count * prims verts = 2 * (count + 1) * prims [area, prims, tris, verts] end def draw_ts_dl(count,size) glCallList($dls["ts_#{count}"]); end def draw_qs_dl(count,size) glCallList($dls["qs_#{count}"]); end def draw_tris_va(count,size) va = $vas["t_#{count}"] glVertexPointer(2, GL_FLOAT, 0, va) glEnableClientState(GL_VERTEX_ARRAY) glDrawArrays(GL_TRIANGLES, 0, 6 * count * count) glDisableClientState(GL_VERTEX_ARRAY) end def draw_quads_va(count,size) va = $vas["q_#{count}"] glVertexPointer(2, GL_FLOAT, 0, va) glEnableClientState(GL_VERTEX_ARRAY) glDrawArrays(GL_QUADS, 0, 4 * count * count) glDisableClientState(GL_VERTEX_ARRAY) end def draw_ts_va_dl(count,size) va = $vas["ts_#{count}"] glVertexPointer(2, GL_FLOAT, 0, va) glEnableClientState(GL_VERTEX_ARRAY) glCallList($dls["tsv_#{count}"]) glDisableClientState(GL_VERTEX_ARRAY) end def draw_qs_va_dl(count,size) va = $vas["qs_#{count}"] glVertexPointer(2, GL_FLOAT, 0, va) glEnableClientState(GL_VERTEX_ARRAY) glCallList($dls["qsv_#{count}"]) glDisableClientState(GL_VERTEX_ARRAY) end def draw_stats return if (!$ready) # Graph config x_off = 10 y_off = 10 tick_size = 3 val_space = 50 key_size = 20 x_scale = ($w - 4 * x_off) / (2 * ($fast.last || $slow.last)) key_scale = ($h - 4 * y_off) / (2 * $tests.size) # Get a fresh black frame for graphing glClearColor(0, 0, 0, 1) start_frame() # Use antialiased lines glEnable(GL_BLEND) glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) glEnable(GL_LINE_SMOOTH) glHint(GL_LINE_SMOOTH_HINT, GL_NICEST) # Draw axis ticks glColor3f(1, 1, 1); glBegin(GL_LINES); ([0] + $slow + $fast).each do |count| x_tick = count * x_scale + x_off glVertex2f(x_tick, y_off) glVertex2f(x_tick, y_off - tick_size) glVertex2f(x_tick, y_off + $h / 2) glVertex2f(x_tick, y_off + $h / 2 - tick_size) glVertex2f(x_tick + $w / 2, y_off + $h / 2) glVertex2f(x_tick + $w / 2, y_off + $h / 2 - tick_size) end glEnd x_tick = x_off + 3 val_max = (($h / 2 - 2 * y_off) / val_space).to_i # Work (0..val_max).each do |value| y_tick = value * val_space + y_off glBegin(GL_LINES) glVertex2f(x_off, y_tick) glVertex2f(x_off - tick_size, y_tick) glEnd end # Pixels value = 0 val_max = $max[9] / mag_scale($max[9]) y_scale = ($h - 4 * y_off) / (2 * val_max) val_inc = tick_inc(val_max,5) while (value < val_max) y_tick = (value * y_scale) + y_off glBegin(GL_LINES) glVertex2f(x_off, y_tick + $h / 2) glVertex2f(x_off - tick_size, y_tick + $h / 2) glEnd OGLBench.draw_string($font_style, value.to_s, x_tick, y_tick + $h / 2) if (value!=0) value += val_inc end # Vertices value = 0 val_max = $max[12] / mag_scale($max[12]) y_scale = ($h - 4 * y_off) / (2 * val_max) val_inc = tick_inc(val_max,5) while (value < val_max) y_tick = (value * y_scale) + y_off glBegin(GL_LINES) glVertex2f(x_off + $w / 2, y_tick + $h / 2) glVertex2f(x_off + $w / 2 - tick_size, y_tick + $h / 2) glEnd OGLBench.draw_string($font_style, value.to_s, x_tick + $w / 2, y_tick + $h / 2) if (value!=0) value += val_inc end # Draw axes glBegin(GL_LINE_STRIP) glVertex2f(x_off, $h / 2 - y_off) glVertex2f(x_off, y_off) glVertex2f($w / 2 - x_off, y_off) glEnd glBegin(GL_LINE_STRIP) glVertex2f(x_off, $h - y_off) glVertex2f(x_off, $h / 2 + y_off) glVertex2f($w / 2 - x_off, $h / 2 + y_off) glEnd glBegin(GL_LINE_STRIP) glVertex2f($w / 2 + x_off, $h - y_off) glVertex2f($w / 2 + x_off, $h / 2 + y_off) glVertex2f($w - x_off, $h / 2 + y_off) glEnd # Draw color key (0..$tests.size - 1).each do |num| test = $tests[num] name,color,stipple = [test[0]] + test[-2,2] glEnable(GL_LINE_STIPPLE) glLineStipple(3, stipple) glBegin(GL_LINES) glColor3fv(color) glVertex2f(x_off + $w / 2, y_off + num * key_scale) glVertex2f(x_off + $w / 2 + key_size, y_off + num * key_scale) glEnd() glDisable(GL_LINE_STIPPLE) OGLBench.draw_string($font_style, name, x_off + $w / 2 + key_size * 2, y_off + num * key_scale) end # Draw performance graph lines # Pixels per second draw_one_stat(x_off, y_off + $h / 2, y_off, x_scale, 9) glColor3f(1, 1, 1) OGLBench.draw_string($font_style, mag_char($max[9]) + " Pixels/Sec", $w / 4, $h - 2 * y_off) # Vertices per second draw_one_stat(x_off + $w / 2, y_off + $h / 2, y_off, x_scale, 12) glColor3f(1, 1, 1) OGLBench.draw_string($font_style, mag_char($max[12]) + " Vertices/Sec", 3 * $w / 4, $h - 2 * y_off) # "Work" per second, the geometric mean of pixels and vertices draw_one_stat(x_off, y_off, y_off, x_scale, 13) glColor3f(1, 1, 1) OGLBench.draw_string($font_style, "Work/Sec", $w / 4, $h / 2 - 2 * y_off) # Show our graph end_frame(); $showing_graph = true end def draw_one_stat(x_loc,y_loc,y_off,x_scale,num) max = $max[num] y_scale = ($h - 4 * y_off) / (2 * max) colors = {} $tests.each do |test| colors[test[0]] = test[-2] end stipple = {} $tests.each do |test| stipple[test[0]] = test[-1] end last = '' glEnable(GL_LINE_STIPPLE) glBegin(GL_LINE_STRIP) $stats.each_with_index do |stat,run| name,count, st = stat[0,2] + [stat[num]] if name != last glEnd glLineStipple(3, stipple[name]) glBegin(GL_LINE_STRIP) last = name end glColor3fv(colors[name]) glVertex2f(count * x_scale + x_loc, st * y_scale + y_loc) end glEnd glDisable(GL_LINE_STIPPLE) end def kilo_mag(num) mag = (Math::log(num) / Math::log(10)).to_i (mag / 3) end def mag_char(num) ['','K','M','G','T','P','E','Z','Y'][kilo_mag(num)] end def mag_scale(num) 10 ** (3*kilo_mag(num)) end def tick_inc(max,parts = 5) return (max / parts.to_f) if (max < 1) mag = (Math::log(max) / Math::log(10)).to_i scl = (10 ** (mag - 1)) inc = max / (scl * parts) if (inc > 7.5) inc = 10 elsif (inc > 3.5) inc = 5 elsif (inc > 1.5) inc = 2 else inc = 1 end (inc * scl.to_f) end # State engine def cbDraw if (!$done) benchmark() elsif (!$ready) cleanup() else sleep(1) draw_stats() end end # Keyboard handler def cbKeyPressed(key,x,y) if (key == ?\e or key == ?q) glutDestroyWindow($app) exit(0) end if ($done && key == ?r) draw_stats() end end ### METHODS TO BENCHMARK $va_types = { "q" => method(:make_quads_va), "t" => method(:make_tris_va), "qs" => method(:make_qs_va), "ts" => method(:make_ts_va), } $dl_types = { "qs" => method(:draw_qs), "ts" => method(:draw_ts), "qsv" => method(:draw_qs_va), "tsv" => method(:draw_ts_va), } $tests = [ # Nick Draw Routine Stats Calc Type Graph Color # ["empty",method(:draw_empty), method(:stats_empty),'single',[1 , 1, 1], 0xFFFF], ["t" ,method(:draw_tris), method(:stats_tris) ,'slow', [1 , 0, 0], 0xAAAA], ["q" ,method(:draw_quads), method(:stats_quads),'slow', [1 ,0.5, 0], 0xAAAA], ["ts" ,method(:draw_ts), method(:stats_ts), 'slow', [1 , 1, 0], 0xAAAA], ["qs" ,method(:draw_qs), method(:stats_qs), 'slow', [0 , 1, 0], 0xAAAA], ["tsd" ,method(:draw_ts_dl), method(:stats_ts), 'fast', [0 , 1, 1], 0xAAAA], ["qsd" ,method(:draw_qs_dl), method(:stats_qs), 'fast', [0 , 0, 1], 0xAAAA], ["tv" ,method(:draw_tris_va), method(:stats_tris), 'fast', [0.8, 0, 0], 0xFFFF], ["qv" ,method(:draw_quads_va),method(:stats_quads),'fast', [0.8,0.4, 0], 0xFFFF], ["tsv" ,method(:draw_ts_va), method(:stats_ts), 'fast', [0.8,0.8, 0], 0xFFFF], ["qsv" ,method(:draw_qs_va), method(:stats_qs), 'fast', [0 ,0.8, 0], 0xFFFF], ["tsvd" ,method(:draw_ts_va_dl),method(:stats_ts), 'fast', [0 ,0.8,0.8], 0xFFFF], ["qsvd" ,method(:draw_qs_va_dl),method(:stats_qs), 'fast', [0 , 0,0.8], 0xFFFF], ] # Start from main function () main() ruby-opengl-0.60.1.orig/examples/misc/OGLBench.rb0000644000000000000000000002650111377006423020164 0ustar rootroot#!/usr/bin/env ruby # Purpose: Factor out and clean up common code from OpenGL benchmarks # Copyright (c) 2006, Geoff Broadwell; this module is released # as open source and may be distributed and modified under the terms # of either the Artistic License or the GNU General Public License, # in the same manner as Perl itself. These licenses should have been # distributed to you as part of your Perl distribution, and can be # read using `perldoc perlartistic` and `perldoc perlgpl` respectively. # Conversion to ruby by Jan Dvorak module OGLBench require 'opengl' include Gl,Glu,Glut require 'getoptlong' $VERSION = '0.1.4' # Cached config and state, for simpler API $CACHED = {} # All resolutions listed in landscape orientation, # even for natively portrait devices such as handhelds. # Also, 'q' is annoyingly used as a prefix to mean both # 'quarter' and 'quad'. $KNOWN_RES = { 'qqvga' => [ 160, 120, 'Quarter Quarter VGA' ], 'palm' => [ 160, 160, 'Original Palm OS Devices' ], 'eigthvga' => [ 240, 160, '1/8 VGA' ], 'vcrntsc' => [ 240, 480, 'VCR NTSC' ], 'vcrpal' => [ 240, 576, 'VCR PAL' ], 'qcif' => [ 176, 144, 'Quarter CIF' ], 'gears' => [ 300, 300, 'OpenGL Gears Benchmark' ], 'glxgears' => [ 300, 300, 'OpenGL Gears Benchmark' ], 'cga' => [ 320, 200, 'IBM PC CGA (Color Graphics Adapter)' ], 'atarist16' => [ 320, 200, 'Atari ST 16 Color' ], 'qvga' => [ 320, 240, 'Quarter VGA' ], 'modex' => [ 320, 240, 'VGA Mode X' ], 'pocketpc' => [ 320, 240, 'Common Pocket PCs' ], 'clie' => [ 320, 320, 'Sony Clie (Palm OS)' ], 'vcdntsc' => [ 352, 240, 'VCD (Video CD) NTSC' ], 'vcdpal' => [ 352, 288, 'VCD (Video CD) PAL' ], 'cif' => [ 352, 288, 'CIF (Common Image Format)' ], 'tweakvga' => [ 360, 480, 'Highest 256-color mode for VGA monitors' ], 'svhsntsc' => [ 400, 480, 'S-VHS NTSC' ], 'svhspal' => [ 400, 576, 'S-VHS PAL' ], 'tungsten' => [ 480, 320, 'Tungsten (Palm OS)' ], 'bwmac9' => [ 512, 342, 'Black & White 9" Mac' ], 'maclc' => [ 512, 384, 'Mac LC' ], 'ldntsc' => [ 560, 480, 'Laserdisc NTSC' ], 'ldpal' => [ 560, 576, 'Laserdisc PAL' ], 'atarist4' => [ 640, 200, 'Atari ST 4 Color' ], 'ega' => [ 640, 350, 'IBM PC-AT EGA (Extended Graphics Adapter)' ], 'atarist2' => [ 640, 400, 'Atari ST 2 Color' ], 'qcga' => [ 640, 400, 'Quad CGA' ], 'vga400' => [ 640, 400, 'VGA 400 Line' ], 'pgc' => [ 640, 480, 'Professional Graphics Controller' ], 'mcga' => [ 640, 480, 'IBM PS/2 MultiColor Graphics Adapter' ], 'vga' => [ 640, 480, 'IBM PS/2 VGA (Video Graphics Array)' ], 'edtv1' => [ 640, 480, 'EDTV 1' ], 'edtv2' => [ 704, 480, 'EDTV 2' ], 'hgc' => [ 720, 348, 'Hercules Graphics Controller' ], 'mda' => [ 720, 350, 'IBM PC MDA (Monochrome Display Adapter)' ], 'lisa' => [ 720, 360, 'Apple Lisa' ], 'dv525' => [ 720, 480, 'Digital Video 525/60 (D-1 NTSC, DVD NTSC)' ], 'd1ntsc' => [ 720, 480, 'Digital Video 525/60 (D-1 NTSC, DVD NTSC)' ], 'dvdntsc' => [ 720, 480, 'Digital Video 525/60 (D-1 NTSC, DVD NTSC)' ], 'sp525' => [ 720, 540, 'Digital Video 525/60 (D-1 NTSC Square Pix)' ], 'spd1ntsc' => [ 720, 540, 'Digital Video 525/60 (D-1 NTSC Square Pix)' ], 'dv625' => [ 720, 576, 'Digital Video 625/50 (PAL, DVD PAL)' ], 'dvpal' => [ 720, 576, 'Digital Video 625/50 (PAL, DVD PAL)' ], 'dvdpal' => [ 720, 576, 'Digital Video 625/50 (PAL, DVD PAL)' ], 'ns525' => [ 768, 483, 'Non-Standard DV 525/60' ], 'sp625' => [ 768, 576, 'Square Pixel DV 625/50' ], 'wga' => [ 800, 480, 'Wide VGA' ], 'svga' => [ 800, 600, 'Super VGA' ], 'edtv3' => [ 852, 480, 'EDTV 3' ], 'ws480' => [ 854, 480, 'Wide Screen 480 Line' ], 'ns625' => [ 948, 576, 'Non-Standard DV 625/60' ], 'aacsict' => [ 960, 540, 'AACS Image Constraint Token, Degraded 1080' ], 'ws576' => [ 1024, 576, 'Wide Screen 576 Line' ], '8514' => [ 1024, 768, 'IBM 8514/A' ], '8514a' => [ 1024, 768, 'IBM 8514/A' ], 'evga' => [ 1024, 768, 'VESA Extended VGA' ], 'xga' => [ 1024, 768, 'IBM XGA (eXtended Graphics Array)' ], 'nextcube' => [ 1120, 832, 'NeXT Cube' ], 'apple1mp' => [ 1152, 864, 'Apple "1 Megapixel"' ], 'xga+' => [ 1152, 864, 'XGA+' ], 'olpcmono' => [ 1200, 900, 'One Laptop Per Child Mono Mode (true res)' ], 'olpc' => [ 1200, 900, 'One Laptop Per Child Mono Mode (true res)' ], '720i' => [ 1280, 720, 'HDTV 720 Line Interlaced' ], '720p' => [ 1280, 720, 'HDTV 720 Line Progressive' ], 'hd720' => [ 1280, 720, 'HDTV 720 Line' ], 'xga43' => [ 1280, 960, '4:3 XGA Alternative' ], 'xga960' => [ 1280, 960, '4:3 XGA Alternative' ], 'sxga' => [ 1280, 1024, 'Super XGA' ], 'wxga' => [ 1366, 768, 'Wide XGA' ], 'wxga768' => [ 1366, 768, 'Wide XGA' ], 'wsxga' => [ 1440, 900, 'Wide Super XGA (Low Variant)' ], 'wsxga1' => [ 1440, 900, 'Wide Super XGA (Low Variant)' ], 'wxga+' => [ 1440, 900, 'Wide XGA+' ], 'sxga+' => [ 1440, 1050, 'Super XGA+' ], 'wsxga2' => [ 1600, 1024, 'Wide Super XGA (High Variant)' ], 'uxga' => [ 1600, 1200, 'Ultra XGA' ], 'wsxga+' => [ 1680, 1050, 'Wide Super XGA+' ], 'academy2k' => [ 1828, 1332, 'Digital Film Academy 1.375:1 @ 2K' ], '1080i' => [ 1920, 1080, 'HDTV 1080 Line Interlaced' ], '1080p' => [ 1920, 1080, 'HDTV 1080 Line Progressive' ], 'hd1080' => [ 1920, 1080, 'HDTV 1080 Line' ], 'wuxga' => [ 1920, 1200, 'Wide Ultra XGA' ], 'dc2k1' => [ 1998, 1080, 'Digital Film Digital Cinema 1.85:1 @ 2K ' ], 'dc2k2' => [ 2048, 858, 'Digital Film Digital Cinema 2.39:1 @ 2K ' ], 'eurohd' => [ 2048, 1152, 'European HDTV' ], 'qxga' => [ 2048, 1536, 'Quad XGA' ], 'wqxga' => [ 2560, 1600, 'Wide Quad XGA' ], 'qsxga' => [ 2560, 2048, 'Quad Super XGA' ], 'wqsxga' => [ 3200, 2048, 'Wide Quad Super XGA' ], 'quxga' => [ 3200, 2400, 'Quad Ultra XGA' ], 'academy4k' => [ 3656, 2664, 'Digital Film Academy 1.375:1 @ 4K' ], 'wquxga' => [ 3840, 2400, 'Wide Quad Ultra XGA' ], 'dc4k1' => [ 3996, 2160, 'Digital Film Digital Cinema 1.85:1 @ 4K ' ], 'dc4k2' => [ 4096, 1714, 'Digital Film Digital Cinema 2.39:1 @ 4K ' ], 'hxga' => [ 4096, 3072, 'Hexadecatuple XGA' ], 'whxga' => [ 5120, 3200, 'Wide Hexadecatuple XGA' ], 'hsxga' => [ 5120, 4096, 'Hexadecatuple Super XGA' ], 'whsxga' => [ 6400, 4096, 'Wide Hexadecatuple Super XGA' ], 'huxga' => [ 6400, 4800, 'Hexadecatuple Ultra XGA' ], 'whuxga' => [ 7680, 4800, 'Wide Hexadecatuple Ultra XGA' ], } def OGLBench.w_h_from_geometry(geom) geometry = geom.downcase return $~[1,2] if geometry =~ /^(\d+)x(\d+)$/ dims = $KNOWN_RES[geometry] || [0, 0] dims[0,2] end def OGLBench.show_known_geometries puts "Known geometries:" # convert the hash to array, sort by resolution and iterate $KNOWN_RES.sort {|a,b| a[1][0,2] <=> b[1][0,2] }.each do |row| name, res = row x,y,fullname = res printf "%-10s %4d x %4d %s\n", name, x, y, fullname end end def OGLBench.show_usage(conf = $CACHED[:conf]) usage = conf[:usage] if (not conf[:extra_usage].empty?) conf[:_USAGE_LABEL_GENERAL] = "\nGENERAL OPTIONS:" usage = "#{conf[:usage]}\nOTHER OPTIONS:\n#{conf[:extra_usage]}" else conf[:_USAGE_LABEL_GENERAL] = '' end usage.gsub!(/\$(\w+)/) do conf[$1.to_sym] end print usage end def OGLBench.show_basic_config(conf,gl_info,version) print < Set viewport size via well-known name -k |--known-geometries Show list of known geometry names -h |-?|--help Show this help message USAGE # conf = {:usage => usage, :frames => "150"} # show_usage(conf) # FIXME: $0 ? conf = { :title => 'Ruby-OpenGL Benchmark', :usage => usage, :extra_usage => '', "0".to_sym => $0, :frames => 100, :seconds => 10, :geometry => '300x300', :fullscreen => false, :known => false, :help => false, :booleans => { :fullscreen => :fs, :known => :show_known, :help => :show_help, }, :extra_booleans => {}, } conf.update(extra_conf) if extra_conf opts = GetoptLong.new( [ "--frames", "-f", GetoptLong::REQUIRED_ARGUMENT ], [ "--seconds", "-s", GetoptLong::REQUIRED_ARGUMENT ], [ "--geometry", "-g", GetoptLong::REQUIRED_ARGUMENT ], [ "--fullscreen", "--fs", GetoptLong::NO_ARGUMENT ], [ "--known", "-k","--known-geometries", GetoptLong::NO_ARGUMENT ], [ "--help", "-h", "-?", GetoptLong::NO_ARGUMENT ] ) opts.each do |opt, arg| name = opt.tr('-','') if arg.empty? conf[name.to_sym] = true else conf[name.to_sym] = arg end end friendly_booleans(conf) geometry = conf[:geometry] w,h = w_h_from_geometry(geometry) conf[:width] = w.to_i conf[:height] = h.to_i $stdout.sync = true if (conf[:help]) show_usage(conf) exit(0) end if (conf[:known]) show_known_geometries() exit(0) end app = init_opengl(conf) gl_info = get_gl_info(app) [conf, app, gl_info] end def OGLBench.init_opengl(conf) w,h = conf[:width], conf[:height] raise "Could not determine sane width and height from '#{conf[:geometry]}'.\n" unless w > 0 && h > 0; glutInit() glutInitDisplayMode(GLUT_RGB | GLUT_DEPTH) glutInitWindowSize(w,h) app = glutCreateWindow(conf[:title]) glViewport(0, 0, w, h) glMatrixMode(GL_PROJECTION) glLoadIdentity glMatrixMode(GL_MODELVIEW) glLoadIdentity $CACHED[:conf] = conf $CACHED[:app] = app app end def OGLBench.get_gl_info(app = $CACHED[:app]) gl_info = {} # These values are faked conf = $CACHED[:conf] gl_info[:r] = 8 gl_info[:g] = 8 gl_info[:b] = 8 gl_info[:a] = 0 gl_info[:d] = 24 $CACHED[:gl_info] = gl_info gl_info end def OGLBench.fade_to_white(frac) glColor4f(frac, frac, frac, 1) glClearColor(frac, frac, frac, 1) glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) glFinish end def OGLBench.draw_string(font_style,str,x,y) glRasterPos2i(x,y) str.each_byte do |char| glutBitmapCharacter(font_style, char) end end # def init_bitmap_font # def texture_from_texels end # end module ruby-opengl-0.60.1.orig/examples/OrangeBook/0000755000000000000000000000000011377006423017345 5ustar rootrootruby-opengl-0.60.1.orig/examples/OrangeBook/particle.frag0000644000000000000000000000044111377006423022010 0ustar rootroot// // Fragment shader for rendering a "confetti cannon" // via a partcle system // // Author: Randi Rost // // Copyright (c) 2003-2004: 3Dlabs, Inc. // // See 3Dlabs-License.txt for license information // varying vec4 Color; void main (void) { gl_FragColor = Color; }ruby-opengl-0.60.1.orig/examples/OrangeBook/3Dlabs-License.txt0000644000000000000000000000301711377006423022577 0ustar rootrootCopyright (C) 2002-2005 3Dlabs Inc. Ltd. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. Neither the name of 3Dlabs Inc. Ltd. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ruby-opengl-0.60.1.orig/examples/OrangeBook/brick.frag0000644000000000000000000000146411377006423021305 0ustar rootroot// // Fragment shader for procedural bricks // // Authors: Dave Baldwin, Steve Koren, Randi Rost // based on a shader by Darwyn Peachey // // Copyright (c) 2002-2004 3Dlabs Inc. Ltd. // // See 3Dlabs-License.txt for license information // uniform vec3 BrickColor, MortarColor; uniform vec2 BrickSize; uniform vec2 BrickPct; varying vec2 MCposition; varying float LightIntensity; void main(void) { vec3 color; vec2 position, useBrick; position = MCposition / BrickSize; if (fract(position.y * 0.5) > 0.5) position.x += 0.5; position = fract(position); useBrick = step(position, BrickPct); color = mix(MortarColor, BrickColor, useBrick.x * useBrick.y); color *= LightIntensity; gl_FragColor = vec4 (color, 1.0); }ruby-opengl-0.60.1.orig/examples/OrangeBook/brick.rb0000644000000000000000000002235611377006423020774 0ustar rootroot# Copyright (C) 2002-2005 3Dlabs Inc. Ltd. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # # Redistributions in binary form must reproduce the above # copyright notice, this list of conditions and the following # disclaimer in the documentation and/or other materials provided # with the distribution. # # Neither the name of 3Dlabs Inc. Ltd. nor the names of its # contributors may be used to endorse or promote products derived # from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE # COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. # =========================================================================== # # # The source of the shaders itself are in plain text files. Files ending in # .vert are vertex shaders, and files ending in .frag are fragment shaders. require 'opengl' include Gl,Glu,Glut $rotl = 1 * Math::PI / 180 $last_time = 0 $fXDiff = 206 $fYDiff = 16 $fZDiff = 10 $xLastIncr = 0 $yLastIncr = 0 $fXInertia = -0.5 $fYInertia = 0 $fXInertiaOld = 0 $fYInertiaOld = 0 $fScale = 1.0 $ftime = 0 $xLast = -1 $yLast = -1 $bmModifiers = 0 $rotate = true INERTIA_THRESHOLD = 1.0 INERTIA_FACTOR = 0.5 SCALE_FACTOR = 0.01 SCALE_INCREMENT = 0.5 TIMER_FREQUENCY_MILLIS = 20 $gleModel = [:cube, :teapot,:torus,:sphere] $clearColor = [[0,0,0,1], [0.2,0.2,0.3,1], [0.7,0.7,0.7,1]] def drawCube size = 1.0 scale = 0.2 delta = 0.1 v = [ [ size, size, size * scale + delta ], [ size, size, -size * scale + delta ], [ size, -size, -size * scale ], [ size, -size, size * scale ], [-size, size, size * scale + delta ], [-size, size, -size * scale + delta ], [-size, -size, -size * scale ], [-size, -size, size * scale ] ] cube = [ [ [1,0,0], v[3],v[2],v[1],v[0] ], # normal, vertices [ [-1,0,0], v[6],v[7],v[4],v[5] ], [ [0,0,-1], v[2],v[6],v[5],v[1] ], [ [0,0,1], v[7],v[3],v[0],v[4] ], [ [0,1,0], v[4],v[0],v[1],v[5] ], [ [0,-1,0], v[6],v[2],v[3],v[7] ] ] glBegin(GL_QUADS) cube.each do |side| glNormal3fv(side[0]) glTexCoord2f(1,1) glVertex3fv(side[1]) glTexCoord2f(0,1) glVertex3fv(side[2]) glTexCoord2f(0,0) glVertex3fv(side[3]) glTexCoord2f(1,0) glVertex3fv(side[4]) end glEnd() end def nextClearColor glClearColor($clearColor[0][0], $clearColor[0][1], $clearColor[0][2], $clearColor[0][3]) $clearColor << $clearColor.shift # rotate end play = lambda do this_time = glutGet(GLUT_ELAPSED_TIME) $rotl+=(this_time - $last_time) * -0.001 $last_time = this_time glutPostRedisplay() end display = lambda do glLoadIdentity() glTranslatef(0.0, 0.0, -5.0) glRotatef($fYDiff, 1,0,0) glRotatef($fXDiff, 0,1,0) glRotatef($fZDiff, 0,0,1) glScalef($fScale, $fScale, $fScale) glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) case $gleModel[0] when :teapot : glutSolidTeapot(0.6) when :torus : glutSolidTorus(0.2, 0.6, 64, 64) when :sphere : glutSolidSphere(0.6, 64, 64) when :cube : drawCube() end glFlush() glutSwapBuffers() end key = lambda do |key,x,y| case(key) when ?b nextClearColor() when ?q, ?\e # esc exit(0) when ?t $gleModel << $gleModel.shift # rotate the array when ?\s # space $rotate = !$rotate if ($rotate==false) $fXInertiaOld = $fXInertia $fYInertiaOld = $fYInertia else $fXInertia = $fXInertiaOld $fYInertia = $fYInertiaOld # To prevent confusion, force some rotation if ($fXInertia == 0 && $fYInertia == 0) $fXInertia = -0.5 end end when ?+ $fScale += SCALE_INCREMENT when ?- $fScale -= SCALE_INCREMENT else puts "Keyboard commands:\n" puts "b - Toggle among background clear colors" puts "q, - Quit" puts "t - Toggle among models to render" puts "? - Help" puts " - reset zoom and rotation" puts " or - stop rotation" puts "<+>, <-> or - zoom model" puts " or - rotate model\n" end end reshape = lambda do |w,h| vp = 0.8 aspect = w.to_f/h.to_f glViewport(0, 0, w, h) glMatrixMode(GL_PROJECTION) glLoadIdentity() glFrustum(-vp, vp, -vp / aspect, vp / aspect, 3, 10) glMatrixMode(GL_MODELVIEW) glLoadIdentity() glTranslatef(0.0, 0.0, -5.0) end motion = lambda do |x,y| if ($xLast != -1 || $yLast != -1) $xLastIncr = x - $xLast $yLastIncr = y - $yLast if ($bmModifiers & GLUT_ACTIVE_CTRL != 0) if ($xLast != -1) $fZDiff += $xLastIncr $fScale += $yLastIncr*SCALE_FACTOR end else if ($xLast != -1) $fXDiff += $xLastIncr $fYDiff += $yLastIncr end end end $xLast = x $yLast = y end mouse = lambda do |button,state,x,y| $bmModifiers = glutGetModifiers() if (button == GLUT_LEFT_BUTTON) if (state == GLUT_UP) $xLast = -1 $yLast = -1 if $xLastIncr > INERTIA_THRESHOLD $fXInertia = ($xLastIncr - INERTIA_THRESHOLD)*INERTIA_FACTOR end if -$xLastIncr > INERTIA_THRESHOLD $fXInertia = ($xLastIncr + INERTIA_THRESHOLD)*INERTIA_FACTOR end if $yLastIncr > INERTIA_THRESHOLD $fYInertia = ($yLastIncr - INERTIA_THRESHOLD)*INERTIA_FACTOR end if -$yLastIncr > INERTIA_THRESHOLD $fYInertia = ($yLastIncr + INERTIA_THRESHOLD)*INERTIA_FACTOR end else $fXInertia = 0 $fYInertia = 0 end $xLastIncr = 0 $yLastIncr = 0 end end special = lambda do |key,x,y| case key when GLUT_KEY_HOME: $fXDiff = 0 $fYDiff = 35 $fZDiff = 0 $xLastIncr = 0 $yLastIncr = 0 $fXInertia = -0.5 $fYInertia = 0 $fScale = 1.0 when GLUT_KEY_LEFT: $fXDiff -= 1 when GLUT_KEY_RIGHT: $fXDiff += 1 when GLUT_KEY_UP: $fYDiff -= 1 when GLUT_KEY_DOWN: $fYDiff += 1 end end timer = lambda do |value| $ftime += 0.01 if $rotate $fXDiff += $fXInertia $fYDiff += $fYInertia end glutTimerFunc(TIMER_FREQUENCY_MILLIS , timer, 0) end def getUniLoc(program, name) loc = glGetUniformLocation(program, name) if (loc == -1) puts "No such uniform named #{name}" end return loc end def installBrickShaders(vs_fname,fs_fname) # Create a vertex shader object and a fragment shader object brickVS = glCreateShader(GL_VERTEX_SHADER) brickFS = glCreateShader(GL_FRAGMENT_SHADER) # Load source code strings into shaders glShaderSource(brickVS, File.read(vs_fname)) glShaderSource(brickFS, File.read(fs_fname)) # Compile the brick vertex shader, and print out # the compiler log file. glCompileShader(brickVS) vertCompiled = glGetShaderiv(brickVS, GL_COMPILE_STATUS) puts "Shader InfoLog:\n#{glGetShaderInfoLog(brickVS)}\n" # Compile the brick fragment shader, and print out # the compiler log file. glCompileShader(brickFS) fragCompiled = glGetShaderiv(brickFS, GL_COMPILE_STATUS) puts "Shader InfoLog:\n#{glGetShaderInfoLog(brickFS)}\n" return false if (vertCompiled == 0 || fragCompiled == 0) # Create a program object and attach the two compiled shaders brickProg = glCreateProgram() glAttachShader(brickProg,brickVS) glAttachShader(brickProg,brickFS) # Link the program object and print out the info log glLinkProgram(brickProg) linked = glGetProgramiv(brickProg,GL_LINK_STATUS) puts "Program InfoLog:\n#{glGetProgramInfoLog(brickProg)}\n" return false if linked==0 # Install program object as part of current state glUseProgram(brickProg) # Set up initial uniform values glUniform3f(getUniLoc(brickProg, "BrickColor"), 1.0, 0.3, 0.2) glUniform3f(getUniLoc(brickProg, "MortarColor"), 0.85, 0.86, 0.84) glUniform2f(getUniLoc(brickProg, "BrickSize"), 0.30, 0.15) glUniform2f(getUniLoc(brickProg, "BrickPct"), 0.90, 0.85) glUniform3f(getUniLoc(brickProg, "LightPosition"), 0.0, 0.0, 4.0) return true end # Main glutInit() glutInitDisplayMode( GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE) glutInitWindowPosition(100,100) glutInitWindowSize(500, 500) glutCreateWindow( "3Dlabs Brick Shader") glutIdleFunc(play) glutDisplayFunc(display) glutKeyboardFunc(key) glutReshapeFunc(reshape) glutMotionFunc(motion) glutMouseFunc(mouse) glutSpecialFunc(special) glutTimerFunc(TIMER_FREQUENCY_MILLIS , timer, 0) # Make sure that OpenGL 2.0 is supported by the driver if Gl.is_available?(2.0)==false major,minor,*rest = glGetString(GL_VERSION).split(/\.| /) puts "GL_VERSION major=#{major} minor=#{minor}" puts "Support for OpenGL 2.0 is required for this demo...exiting" exit(1) end glDepthFunc(GL_LESS) glEnable(GL_DEPTH_TEST) nextClearColor() key.call('?', 0, 0) success = installBrickShaders("brick.vert","brick.frag") glutMainLoop() if success == true ruby-opengl-0.60.1.orig/examples/OrangeBook/brick.vert0000644000000000000000000000220311377006423021336 0ustar rootroot// // Vertex shader for procedural bricks // // Authors: Dave Baldwin, Steve Koren, Randi Rost // based on a shader by Darwyn Peachey // // Copyright (c) 2002-2004 3Dlabs Inc. Ltd. // // See 3Dlabs-License.txt for license information // uniform vec3 LightPosition; const float SpecularContribution = 0.3; const float DiffuseContribution = 1.0 - SpecularContribution; varying float LightIntensity; varying vec2 MCposition; void main(void) { vec3 ecPosition = vec3 (gl_ModelViewMatrix * gl_Vertex); vec3 tnorm = normalize(gl_NormalMatrix * gl_Normal); vec3 lightVec = normalize(LightPosition - ecPosition); vec3 reflectVec = reflect(-lightVec, tnorm); vec3 viewVec = normalize(-ecPosition); float diffuse = max(dot(lightVec, tnorm), 0.0); float spec = 0.0; if (diffuse > 0.0) { spec = max(dot(reflectVec, viewVec), 0.0); spec = pow(spec, 16.0); } LightIntensity = DiffuseContribution * diffuse + SpecularContribution * spec; MCposition = gl_Vertex.xy; gl_Position = ftransform(); }ruby-opengl-0.60.1.orig/examples/OrangeBook/particle.vert0000644000000000000000000000163511377006423022057 0ustar rootroot// // Vertex shader for rendering a "confetti cannon" // via a partcle system // // Author: Randi Rost // // Copyright (c) 2003-2004: 3Dlabs, Inc. // // See 3Dlabs-License.txt for license information // uniform float Time; // updated each frame by the application uniform vec4 Background; // constant color equal to background attribute vec3 Velocity; // initial velocity attribute float StartTime; // time at which particle is activated varying vec4 Color; void main(void) { vec4 vert; float t = Time - StartTime; if (t >= 0.0) { vert = gl_Vertex + vec4 (Velocity * t, 0.0); vert.y -= 4.9 * t * t; Color = gl_Color; } else { vert = gl_Vertex; // Initial position Color = Background; // "pre-birth" color } gl_Position = gl_ModelViewProjectionMatrix * vert; }ruby-opengl-0.60.1.orig/examples/OrangeBook/particle.rb0000644000000000000000000002357311377006423021507 0ustar rootroot# # Copyright (C) 2002-2005 3Dlabs Inc. Ltd. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # # Redistributions in binary form must reproduce the above # copyright notice, this list of conditions and the following # disclaimer in the documentation and/or other materials provided # with the distribution. # # Neither the name of 3Dlabs Inc. Ltd. nor the names of its # contributors may be used to endorse or promote products derived # from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE # COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. require 'opengl' include Gl,Glu,Glut $particleTime = 0 # Movement variables $fXDiff = 206 $fYDiff = 16 $fZDiff = 10 $xLastIncr = 0 $yLastIncr = 0 $fXInertia = -0.5 $fYInertia = 0 $fXInertiaOld $fYInertiaOld $fScale = 0.25 $ftime = 0 $xLast = -1 $yLast = -1 $bmModifiers = 0 $rotate = 1 $programObject = 0 $vertexShaderObject = 0 $fragmentShaderObject = 0 # Rotation defines INERTIA_THRESHOLD = 1.0 INERTIA_FACTOR = 0.5 SCALE_FACTOR = 0.01 SCALE_INCREMENT = 0.5 TIMER_FREQUENCY_MILLIS = 20 VELOCITY_ARRAY = 3 START_TIME_ARRAY = 4 $clearColor = [[0,0,0,1], [0.2,0.2,0.3,1], [0.7,0.7,0.7,1]] $arrayWidth = 0, $arrayHeight = 0 $verts = [] $colors = [] $velocities = [] $startTimes = [] def nextClearColor glClearColor($clearColor[0][0], $clearColor[0][1], $clearColor[0][2], $clearColor[0][3]) $clearColor << $clearColor.shift # rotate end def getUniLoc(program, name) loc = glGetUniformLocation(program, name) if (loc == -1) puts "No such uniform named #{name}" end return loc end def updateAnim location = getUniLoc($programObject,"Time") $particleTime += 0.002 if $particleTime > 15.0 $particleTime = 0.0 end glUniform1f(location,$particleTime) end def drawPoints glPointSize(2.0) glVertexPointer(3, GL_FLOAT, 0, $verts) glColorPointer(3, GL_FLOAT, 0, $colors) glVertexAttribPointer(VELOCITY_ARRAY, 3, GL_FLOAT, GL_FALSE, 0, $velocities) glVertexAttribPointer(START_TIME_ARRAY, 1, GL_FLOAT, GL_FALSE, 0, $startTimes) glEnableClientState(GL_VERTEX_ARRAY) glEnableClientState(GL_COLOR_ARRAY) glEnableVertexAttribArray(VELOCITY_ARRAY) glEnableVertexAttribArray(START_TIME_ARRAY) glDrawArrays(GL_POINTS, 0, $arrayWidth * $arrayHeight) glDisableClientState(GL_VERTEX_ARRAY) glDisableClientState(GL_COLOR_ARRAY) glDisableVertexAttribArray(VELOCITY_ARRAY) glDisableVertexAttribArray(START_TIME_ARRAY) end def createPoints(w,h) $verts = [] $colors = [] $velocities = [] $startTimes = [] i = 0.5 / w - 0.5 while (i<0.5) j = 0.5 / h - 0.5 while (j<0.5) $verts << i $verts << 0.0 $verts << j $colors << rand() * 0.5 + 0.5 $colors << rand() * 0.5 + 0.5 $colors << rand() * 0.5 + 0.5 $velocities << rand() + 3.0 $velocities << rand() * 10.0 $velocities << rand() + 3.0 $startTimes << rand() * 10.0 j += 1.0/h end i += 1.0/w end # convert from ruby Array to memory representation of float data that # will be passed as array pointers to GL $verts = $verts.pack("f*") $colors = $colors.pack("f*") $velocities = $velocities.pack("f*") $startTimes = $startTimes.pack("f*") $arrayWidth = w $arrayHeight = h end play = lambda do thisTime = glutGet(GLUT_ELAPSED_TIME) updateAnim() glutPostRedisplay() end display = lambda do glLoadIdentity() glTranslatef(0.0, 0.0, -5.0) glRotatef($fYDiff, 1,0,0) glRotatef($fXDiff, 0,1,0) glRotatef($fZDiff, 0,0,1) glScalef($fScale, $fScale, $fScale) glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) drawPoints() glFlush() glutSwapBuffers() end key = lambda do |key,x,y| $particleTime = 0 case(key) when ?b nextClearColor() when ?q, ?\e # esc exit(0) when ?\s # space $rotate = !$rotate if ($rotate==false) $fXInertiaOld = $fXInertia $fYInertiaOld = $fYInertia else $fXInertia = $fXInertiaOld $fYInertia = $fYInertiaOld # To prevent confusion, force some rotation if ($fXInertia == 0 && $fYInertia == 0) $fXInertia = -0.5 end end when ?+ $fScale += SCALE_INCREMENT when ?- $fScale -= SCALE_INCREMENT else puts "Keyboard commands:\n" puts "b - Toggle among background clear colors" puts "q, - Quit" puts "? - Help" puts " - reset zoom and rotation" puts " or - stop rotation" puts "<+>, <-> or - zoom model" puts " or - rotate model\n" end end reshape = lambda do |w,h| vp = 0.8 aspect = w/h glViewport(0, 0, w, h) glMatrixMode(GL_PROJECTION) glLoadIdentity() glFrustum(-vp, vp, -vp / aspect, vp / aspect, 3, 10.0) glMatrixMode(GL_MODELVIEW) glLoadIdentity() glTranslatef(0.0, 0.0, -5.0) end motion = lambda do |x,y| if ($xLast != -1 || $yLast != -1) $xLastIncr = x - $xLast $yLastIncr = y - $yLast if ($bmModifiers & GLUT_ACTIVE_CTRL != 0) if ($xLast != -1) $fZDiff += $xLastIncr $fScale += $yLastIncr*SCALE_FACTOR end else if ($xLast != -1) $fXDiff += $xLastIncr $fYDiff += $yLastIncr end end end $xLast = x $yLast = y end mouse = lambda do |button,state,x,y| $bmModifiers = glutGetModifiers() if (button == GLUT_LEFT_BUTTON) if (state == GLUT_UP) $xLast = -1 $yLast = -1 if $xLastIncr > INERTIA_THRESHOLD $fXInertia = ($xLastIncr - INERTIA_THRESHOLD)*INERTIA_FACTOR end if -$xLastIncr > INERTIA_THRESHOLD $fXInertia = ($xLastIncr + INERTIA_THRESHOLD)*INERTIA_FACTOR end if $yLastIncr > INERTIA_THRESHOLD $fYInertia = ($yLastIncr - INERTIA_THRESHOLD)*INERTIA_FACTOR end if -$yLastIncr > INERTIA_THRESHOLD $fYInertia = ($yLastIncr + INERTIA_THRESHOLD)*INERTIA_FACTOR end else $fXInertia = 0 $fYInertia = 0 end $xLastIncr = 0 $yLastIncr = 0 end end special = lambda do |key,x,y| case key when GLUT_KEY_HOME: $fXDiff = 206 $fYDiff = 16 $fZDiff = 10 $xLastIncr = 0 $yLastIncr = 0 $fXInertia = -0.5 $fYInertia = 0 $fScale = 0.25 $particleTime = 0 when GLUT_KEY_LEFT: $fXDiff -= 1 when GLUT_KEY_RIGHT: $fXDiff += 1 when GLUT_KEY_UP: $fYDiff -= 1 when GLUT_KEY_DOWN: $fYDiff += 1 end end timer = lambda do |value| $ftime += 0.01 if $rotate $fXDiff += $fXInertia $fYDiff += $fYInertia end glutTimerFunc(TIMER_FREQUENCY_MILLIS , timer, 0) end def installParticleShaders(vs_name,fs_name) # Create a vertex shader object and a fragment shader object $vertexShaderObject = glCreateShader(GL_VERTEX_SHADER) $fragmentShaderObject = glCreateShader(GL_FRAGMENT_SHADER) # Load source code strings into shaders glShaderSource($vertexShaderObject, File.read(vs_name)) glShaderSource($fragmentShaderObject, File.read(fs_name)) # Compile the particle vertex shader, and print out # the compiler log file. glCompileShader($vertexShaderObject) vertCompiled = glGetShaderiv($vertexShaderObject, GL_COMPILE_STATUS) puts "Shader InfoLog:\n#{glGetShaderInfoLog($vertexShaderObject)}\n" # Compile the particle fragment shader, and print out # the compiler log file. glCompileShader($fragmentShaderObject) fragCompiled = glGetShaderiv($fragmentShaderObject, GL_COMPILE_STATUS) puts "Shader InfoLog:\n#{glGetShaderInfoLog($fragmentShaderObject)}\n" return false if (vertCompiled == 0 || fragCompiled == 0) # Create a program object and attach the two compiled shaders $programObject = glCreateProgram() glAttachShader($programObject, $vertexShaderObject) glAttachShader($programObject, $fragmentShaderObject) #Bind generic attribute indices to attribute variable names glBindAttribLocation($programObject, VELOCITY_ARRAY, "Velocity") glBindAttribLocation($programObject, START_TIME_ARRAY, "StartTime"); # Link the program object and print out the info log glLinkProgram($programObject) linked = glGetProgramiv($programObject, GL_LINK_STATUS) puts "Program InfoLog:\n#{glGetProgramInfoLog($programObject)}\n" return false if linked==0 # Install program object as part of current state glUseProgram($programObject) # Set up initial uniform values glUniform4f(getUniLoc($programObject, "Background"), 0.0, 0.0, 0.0, 1.0) glUniform1f(getUniLoc($programObject, "Time"), -5.0) return true end # Main glutInit() glutInitDisplayMode( GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE) glutInitWindowSize(500, 500) glutInitWindowPosition(100,100) window = glutCreateWindow("3Dlabs OpenGL Shading Language Particle System Demo") glutIdleFunc(play) glutDisplayFunc(display) glutKeyboardFunc(key) glutReshapeFunc(reshape) glutMotionFunc(motion) glutMouseFunc(mouse) glutSpecialFunc(special) glutTimerFunc(TIMER_FREQUENCY_MILLIS , timer, 0) # Make sure that OpenGL 2.0 is supported by the driver if Gl.is_available?(2.0)==false major,minor,*rest = glGetString(GL_VERSION).split(/\.| /) puts "GL_VERSION major=#{major} minor=#{minor}" puts "Support for OpenGL 2.0 is required for this demo...exiting" exit(1) end createPoints(100, 100) glDepthFunc(GL_LESS) glEnable(GL_DEPTH_TEST) nextClearColor() key.call('?', 0, 0) success = installParticleShaders("particle.vert", "particle.frag") if (success) glutMainLoop() end ruby-opengl-0.60.1.orig/ext/0000755000000000000000000000000011377006423014301 5ustar rootrootruby-opengl-0.60.1.orig/ext/glut/0000755000000000000000000000000011377006423015254 5ustar rootrootruby-opengl-0.60.1.orig/ext/glut/mkrf_conf.rb0000644000000000000000000000252011377006423017544 0ustar rootroot# extconf.rb for ruby-opengl's glut extension module. # # Copyright (C) 2006 John M. Gabriele # # This program is distributed under the terms of the MIT license. # See the included COPYRIGHT file for the terms of this license. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. require 'rubygems' require 'mkrf' RUBYVER = " -DRUBY_VERSION=" + RUBY_VERSION.split(".").join Mkrf::Generator.new( 'glut' ) do |g| case RUBY_PLATFORM when /darwin/ g.cflags << RUBYVER g.ldshared << ' -framework GLUT -framework OpenGL -framework Cocoa' when /mswin32/ g.cflags << ' -DWIN32' + RUBYVER g.include_library( 'glut32.lib', 'glutSolidTeapot' ) g.include_library( 'glu32.lib', 'gluLookAt' ) g.include_library( 'opengl32.lib', 'glVertex3d' ) else g.cflags << RUBYVER g.include_library( 'glut', 'glutSolidTeapot' ) g.include_library( 'GLU', 'gluLookAt' ) g.include_library( 'GL', 'glVertex3d') end end ruby-opengl-0.60.1.orig/ext/glut/glut.c0000644000000000000000000014044111377006423016377 0ustar rootroot/* * Last edit by previous maintainer: * 2004/03/02 01:13:06, yoshi * * Copyright (C) 1999 - 2005 Yoshi * Copyright (C) 2005 James Adam * Copyright (C) 2006 John M. Gabriele * Copyright (C) 2007 Jan Dvorak * * This program is distributed under the terms of the MIT license. * See the included COPYRIGHT file for the terms of this license. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * */ #include "../common/common.h" static int callId; /* 'call' method id */ /* macros for registering callbacks - most GLUT callback functions are part of specific window state, so the same callback may have different functions for each GLUT window callbacks that are not tied to specific window (idle,timer,menustate) are registered manually */ #define WINDOW_CALLBACK_SETUP(_funcname) \ static VALUE _funcname = Qnil; \ static VALUE \ glut_ ## _funcname(obj,arg1) \ VALUE obj,arg1; \ { \ int win; \ if (!rb_obj_is_kind_of(arg1,rb_cProc) && !NIL_P(arg1)) \ rb_raise(rb_eTypeError, "glut%s:%s",#_funcname, rb_class2name(CLASS_OF(arg1))); \ win = glutGetWindow(); \ if (win == 0) \ rb_raise(rb_eRuntimeError, "glut%s needs current window", #_funcname); \ rb_ary_store(_funcname, win, arg1); \ if(NIL_P(arg1)) \ glut ## _funcname(NULL); \ else \ glut##_funcname(&glut_##_funcname##Callback); \ return Qnil; \ } #define WINDOW_CALLBACK_DEFINE(_funcname) \ rb_define_module_function(module, "glut" # _funcname, glut_ ## _funcname , 1); \ rb_global_variable(&_funcname); \ _funcname = rb_ary_new() #define GLUT_SIMPLE_FUNCTION(_name_) \ static VALUE \ glut_##_name_(obj) \ VALUE obj; \ { \ glut##_name_(); \ return Qnil; \ } /* * GLUT Implementation */ /* GLUT initialization sub-API. */ static VALUE glut_Init( int argc, VALUE * argv, VALUE obj) { int largc; char** largv; VALUE new_argv; VALUE orig_arg; int i; if (rb_scan_args(argc, argv, "01", &orig_arg) == 0) orig_arg = rb_eval_string("[$0] + ARGV"); else Check_Type(orig_arg, T_ARRAY); /* converts commandline parameters from ruby to C, passes them to glutInit and returns the parameters stripped of glut-specific commands ("-display","-geometry" etc.) */ largc = RARRAY_LEN(orig_arg); largv = ALLOCA_N(char*, largc); for (i = 0; i < largc; i++) largv[i] = STR2CSTR(RARRAY_PTR(orig_arg)[i]); glutInit(&largc, largv); new_argv = rb_ary_new2(largc); for (i = 0; i < largc; i++) rb_ary_push(new_argv,rb_str_new2(largv[i])); rb_ary_shift(new_argv); return new_argv; } static VALUE glut_InitDisplayMode(obj,arg1) VALUE obj,arg1; { unsigned int mode; mode = (unsigned int)NUM2INT(arg1); glutInitDisplayMode(mode); return Qnil; } static VALUE glut_InitDisplayString(obj,arg1) VALUE obj,arg1; { Check_Type(arg1,T_STRING); glutInitDisplayString(RSTRING_PTR(arg1)); return Qnil; } static VALUE glut_InitWindowPosition(obj,arg1,arg2) VALUE obj,arg1,arg2; { int x,y; x = NUM2INT(arg1); y = NUM2INT(arg2); glutInitWindowPosition(x,y); return Qnil; } static VALUE glut_InitWindowSize(obj, arg1, arg2) VALUE obj,arg1,arg2; { int width,height; width = NUM2INT(arg1); height = NUM2INT(arg2); glutInitWindowSize(width,height); return Qnil; } GLUT_SIMPLE_FUNCTION(MainLoop) static void GLUTCALLBACK glut_DisplayFuncCallback(void); static void GLUTCALLBACK glut_ReshapeFuncCallback(int,int); static void GLUTCALLBACK glut_KeyboardFuncCallback(unsigned char, int, int); static void GLUTCALLBACK glut_MouseFuncCallback(int, int, int, int); static void GLUTCALLBACK glut_MotionFuncCallback(int, int); static void GLUTCALLBACK glut_PassiveMotionFuncCallback(int, int); static void GLUTCALLBACK glut_EntryFuncCallback(int); static void GLUTCALLBACK glut_VisibilityFuncCallback(int); static void GLUTCALLBACK glut_SpecialFuncCallback(int,int,int); static void GLUTCALLBACK glut_SpaceballMotionFuncCallback(int,int,int); static void GLUTCALLBACK glut_SpaceballRotateFuncCallback(int,int,int); static void GLUTCALLBACK glut_SpaceballButtonFuncCallback(int,int); static void GLUTCALLBACK glut_ButtonBoxFuncCallback(int,int); static void GLUTCALLBACK glut_DialsFuncCallback(int,int); static void GLUTCALLBACK glut_TabletMotionFuncCallback(int,int); static void GLUTCALLBACK glut_TabletButtonFuncCallback(int,int,int,int); static void GLUTCALLBACK glut_OverlayDisplayFuncCallback(void); static void GLUTCALLBACK glut_WindowStatusFuncCallback(int); static void GLUTCALLBACK glut_JoystickFuncCallback(unsigned int,int,int,int); static void GLUTCALLBACK glut_KeyboardUpFuncCallback(unsigned char,int,int); static void GLUTCALLBACK glut_SpecialUpFuncCallback(int,int,int); WINDOW_CALLBACK_SETUP(DisplayFunc) WINDOW_CALLBACK_SETUP(ReshapeFunc) WINDOW_CALLBACK_SETUP(KeyboardFunc) WINDOW_CALLBACK_SETUP(MouseFunc) WINDOW_CALLBACK_SETUP(MotionFunc) WINDOW_CALLBACK_SETUP(PassiveMotionFunc) WINDOW_CALLBACK_SETUP(EntryFunc) WINDOW_CALLBACK_SETUP(VisibilityFunc) WINDOW_CALLBACK_SETUP(SpecialFunc) WINDOW_CALLBACK_SETUP(SpaceballMotionFunc) WINDOW_CALLBACK_SETUP(SpaceballRotateFunc) WINDOW_CALLBACK_SETUP(SpaceballButtonFunc) WINDOW_CALLBACK_SETUP(ButtonBoxFunc) WINDOW_CALLBACK_SETUP(DialsFunc) WINDOW_CALLBACK_SETUP(TabletMotionFunc) WINDOW_CALLBACK_SETUP(TabletButtonFunc) WINDOW_CALLBACK_SETUP(OverlayDisplayFunc) WINDOW_CALLBACK_SETUP(WindowStatusFunc) WINDOW_CALLBACK_SETUP(KeyboardUpFunc) WINDOW_CALLBACK_SETUP(SpecialUpFunc) /* special case, 2 params */ static VALUE JoystickFunc = Qnil; static VALUE glut_JoystickFunc(obj,arg1,arg2) VALUE obj,arg1,arg2; { int win; int pollinterval; if (!rb_obj_is_kind_of(arg1,rb_cProc) && !NIL_P(arg1)) rb_raise(rb_eTypeError, "glutJoystickFunc:%s", rb_class2name(CLASS_OF(arg1))); pollinterval=NUM2INT(arg2); win = glutGetWindow(); if (win == 0) rb_raise(rb_eRuntimeError, "glutJoystickFunc needs current window"); rb_ary_store(JoystickFunc, win, arg1); if (NIL_P(arg1)) glutJoystickFunc(NULL,pollinterval); else glutJoystickFunc(glut_JoystickFuncCallback,pollinterval); return Qnil; } /* GLUT window sub-API. */ static VALUE glut_CreateWindow(argc, argv, obj) int argc; VALUE* argv; VALUE obj; { int ret; VALUE title; rb_scan_args(argc, argv, "01", &title); if (argc == 0) title = rb_eval_string("$0"); Check_Type(title,T_STRING); ret = glutCreateWindow(RSTRING_PTR(title)); return INT2NUM(ret); } static VALUE glut_CreateSubWindow(obj,arg1,arg2,arg3,arg4,arg5) VALUE obj,arg1,arg2,arg3,arg4,arg5; { int win, x, y, width, height; int ret; win = NUM2INT(arg1); x = NUM2INT(arg2); y = NUM2INT(arg3); width = NUM2INT(arg4); height = NUM2INT(arg5); ret = glutCreateSubWindow(win, x, y, width, height); return INT2NUM(ret); } static VALUE glut_DestroyWindow(obj,arg1) VALUE obj,arg1; { int win; win = NUM2INT(arg1); glutDestroyWindow(win); return Qnil; } GLUT_SIMPLE_FUNCTION(PostRedisplay) GLUT_SIMPLE_FUNCTION(SwapBuffers) static VALUE glut_GetWindow(obj) VALUE obj; { int ret; ret = glutGetWindow(); return INT2NUM(ret); } static VALUE glut_SetWindow(obj,arg1) VALUE obj,arg1; { int win; win = NUM2INT(arg1); glutSetWindow(win); return Qnil; } static VALUE glut_SetWindowTitle(obj,arg1) VALUE obj,arg1; { Check_Type(arg1,T_STRING); glutSetWindowTitle(RSTRING_PTR(arg1)); return Qnil; } static VALUE glut_SetIconTitle(obj, arg1) VALUE obj,arg1; { Check_Type(arg1,T_STRING); glutSetIconTitle(RSTRING_PTR(arg1)); return Qnil; } static VALUE glut_PositionWindow(obj,arg1,arg2) VALUE obj,arg1,arg2; { int x,y; x = NUM2INT(arg1); y = NUM2INT(arg2); glutPositionWindow(x,y); return Qnil; } static VALUE glut_ReshapeWindow(obj,arg1,arg2) VALUE obj,arg1,arg2; { int width,height; width = NUM2INT(arg1); height = NUM2INT(arg2); glutReshapeWindow(width, height); return Qnil; } GLUT_SIMPLE_FUNCTION(PopWindow) GLUT_SIMPLE_FUNCTION(PushWindow) GLUT_SIMPLE_FUNCTION(IconifyWindow) GLUT_SIMPLE_FUNCTION(ShowWindow) GLUT_SIMPLE_FUNCTION(HideWindow) GLUT_SIMPLE_FUNCTION(FullScreen) static VALUE glut_SetCursor(obj,arg1) VALUE obj,arg1; { int cursor; cursor = NUM2INT(arg1); glutSetCursor(cursor); return Qnil; } static VALUE glut_WarpPointer(obj,arg1,arg2) VALUE obj,arg1,arg2; { int x,y; x = NUM2INT(arg1); y = NUM2INT(arg2); glutWarpPointer(x,y); return Qnil; } /* GLUT overlay sub-API. */ GLUT_SIMPLE_FUNCTION(EstablishOverlay) GLUT_SIMPLE_FUNCTION(RemoveOverlay) GLUT_SIMPLE_FUNCTION(PostOverlayRedisplay) GLUT_SIMPLE_FUNCTION(ShowOverlay) GLUT_SIMPLE_FUNCTION(HideOverlay) static VALUE glut_UseLayer(obj,arg1) { GLenum layer; layer = (GLenum)NUM2INT(arg1); glutUseLayer(layer); return Qnil; } /* GLUT menu sub-API. */ static VALUE g_menucallback = Qnil; static void GLUTCALLBACK glut_CreateMenuCallback(int value) { VALUE func; int menu; menu = glutGetMenu(); func = rb_ary_entry(g_menucallback,menu); rb_funcall(func, callId, 1, INT2NUM(value)); } static VALUE glut_CreateMenu(obj,arg1) VALUE obj,arg1; { int menu; if (!rb_obj_is_kind_of(arg1,rb_cProc) && !NIL_P(arg1)) rb_raise(rb_eTypeError, "glutCreateMenu:%s", rb_class2name(CLASS_OF(arg1))); if (NIL_P(arg1)) menu = glutCreateMenu(NULL); else menu = glutCreateMenu(glut_CreateMenuCallback); rb_ary_store(g_menucallback,menu,arg1); return INT2FIX(menu); } static VALUE glut_DestroyMenu(obj,arg1) VALUE obj,arg1; { int menu; menu = NUM2INT(arg1); glutDestroyMenu(menu); //rb_hash_aset(g_menucallback, menu, Qnil); //rb_hash_aset(g_menuargs, menu, Qnil); return Qnil; } static VALUE glut_GetMenu(obj) VALUE obj; { int ret; ret = glutGetMenu(); return INT2NUM(ret); } static VALUE glut_SetMenu(obj,arg1) VALUE obj,arg1; { glutSetMenu(NUM2INT(arg1)); return Qnil; } static VALUE glut_AddMenuEntry(obj,arg1,arg2) VALUE obj,arg1,arg2; { Check_Type(arg1,T_STRING); glutAddMenuEntry(RSTRING_PTR(arg1), NUM2INT(arg2)); return Qnil; } static VALUE glut_AddSubMenu(obj,arg1,arg2) VALUE obj,arg1,arg2; { Check_Type(arg1,T_STRING); glutAddSubMenu(RSTRING_PTR(arg1), NUM2INT(arg2)); return Qnil; } static VALUE glut_ChangeToMenuEntry(obj,arg1,arg2,arg3) VALUE obj,arg1,arg2,arg3; { Check_Type(arg2,T_STRING); glutChangeToMenuEntry(NUM2INT(arg1), RSTRING_PTR(arg2), NUM2INT(arg3)); return Qnil; } static VALUE glut_ChangeToSubMenu(obj,arg1,arg2,arg3) VALUE obj,arg1,arg2,arg3; { Check_Type(arg2,T_STRING); glutChangeToSubMenu(NUM2INT(arg1), RSTRING_PTR(arg2), NUM2INT(arg3)); return Qnil; } static VALUE glut_RemoveMenuItem( VALUE obj, VALUE arg1 ) { glutRemoveMenuItem(NUM2INT(arg1)); return Qnil; } static VALUE glut_AttachMenu(obj,arg1) VALUE obj, arg1; { glutAttachMenu(NUM2INT(arg1)); return Qnil; } static VALUE glut_DetachMenu(obj,arg1) VALUE obj, arg1; { glutDetachMenu(NUM2INT(arg1)); return Qnil; } /* GLUT sub-API. */ static void GLUTCALLBACK glut_DisplayFuncCallback(void) { VALUE func; func = rb_ary_entry(DisplayFunc, glutGetWindow()); if (!NIL_P(func)) rb_funcall(func, callId, 0); } static void GLUTCALLBACK glut_ReshapeFuncCallback(width, height) int width, height; { VALUE func; func = rb_ary_entry( ReshapeFunc, glutGetWindow()); if (!NIL_P(func)) rb_funcall(func, callId, 2, INT2FIX(width), INT2FIX(height)); } static void GLUTCALLBACK glut_KeyboardFuncCallback(key, x, y) unsigned char key; int x,y; { VALUE func; func = rb_ary_entry(KeyboardFunc, glutGetWindow()); if (!NIL_P(func)) #if RUBY_VERSION <190 rb_funcall(func, callId, 3, INT2FIX(key), INT2FIX(x), INT2FIX(y)); #else rb_funcall(func, callId, 3, rb_funcall(INT2FIX(key),rb_intern("chr"),0), INT2FIX(x), INT2FIX(y)); #endif } static void GLUTCALLBACK glut_MouseFuncCallback(button, state, x, y) int button, state, x, y; { VALUE func; func = rb_ary_entry(MouseFunc, glutGetWindow()); if (!NIL_P(func)) rb_funcall(func, callId, 4, INT2FIX(button), INT2FIX(state), INT2FIX(x), INT2FIX(y)); } static void GLUTCALLBACK glut_MotionFuncCallback(x, y) int x, y; { VALUE func; func = rb_ary_entry(MotionFunc, glutGetWindow()); if (!NIL_P(func)) rb_funcall(func, callId, 2,INT2FIX(x), INT2FIX(y)); } static void GLUTCALLBACK glut_PassiveMotionFuncCallback(x, y) int x, y; { VALUE func; func = rb_ary_entry(PassiveMotionFunc, glutGetWindow()); if (!NIL_P(func)) rb_funcall(func, callId, 2,INT2FIX(x), INT2FIX(y)); } static void GLUTCALLBACK glut_EntryFuncCallback(state) int state; { VALUE func; func = rb_ary_entry(EntryFunc,glutGetWindow()); if (!NIL_P(func)) rb_funcall(func, callId, 1, INT2NUM(state)); } static void GLUTCALLBACK glut_VisibilityFuncCallback(state) int state; { VALUE func; func = rb_ary_entry(VisibilityFunc, glutGetWindow()); if (!NIL_P(func)) rb_funcall(func, callId, 1, INT2NUM(state)); } static VALUE idle_func = Qnil; static void GLUTCALLBACK glut_IdleFuncCallback(void) { if (!NIL_P(idle_func)) rb_funcall(idle_func, callId, 0); } static VALUE glut_IdleFunc(obj, arg1) VALUE obj,arg1; { if (!rb_obj_is_kind_of(arg1,rb_cProc) && !NIL_P(arg1)) rb_raise(rb_eTypeError, "glutIdleFunc:%s", rb_class2name(CLASS_OF(arg1))); idle_func = arg1; if (NIL_P(arg1)) glutIdleFunc(NULL); else glutIdleFunc(glut_IdleFuncCallback); return Qnil; } static VALUE timer_func = Qnil; static void GLUTCALLBACK glut_TimerFuncCallback(int value) { if (!NIL_P(timer_func)) rb_funcall(timer_func, callId, 1, INT2NUM(value)); } static VALUE glut_TimerFunc(obj, arg1, arg2, arg3) VALUE obj,arg1,arg2,arg3; { unsigned int millis; int value; millis = (unsigned int)NUM2INT(arg1); value = NUM2INT(arg3); if (!rb_obj_is_kind_of(arg2,rb_cProc)) rb_raise(rb_eTypeError, "glutTimerFunc:%s", rb_class2name(CLASS_OF(arg2))); timer_func = arg2; glutTimerFunc(millis, glut_TimerFuncCallback, value); return Qnil; } static VALUE menustate_func = Qnil; static void GLUTCALLBACK glut_MenuStateFuncCallback(int state) { if (!NIL_P(menustate_func)) rb_funcall(menustate_func, callId, 1, INT2NUM(state)); } static VALUE glut_MenuStateFunc(obj, arg1) VALUE obj,arg1; { if (!rb_obj_is_kind_of(arg1,rb_cProc) && !(NIL_P(arg1))) rb_raise(rb_eTypeError, "glutMenuStateFunc:%s", rb_class2name(CLASS_OF(arg1))); menustate_func = arg1; if (NIL_P(arg1)) glutMenuStateFunc(NULL); else glutMenuStateFunc(glut_MenuStateFuncCallback); return Qnil; } static VALUE menustatus_func = Qnil; static void GLUTCALLBACK glut_MenuStatusFuncCallback(int state,int x,int y) { if (!NIL_P(menustatus_func)) rb_funcall(menustatus_func, callId, 3, INT2NUM(state),INT2NUM(x),INT2NUM(y)); } static VALUE glut_MenuStatusFunc(obj, arg1) VALUE obj,arg1; { if (!rb_obj_is_kind_of(arg1,rb_cProc) && !(NIL_P(arg1))) rb_raise(rb_eTypeError, "glutMenuStatusFunc:%s", rb_class2name(CLASS_OF(arg1))); menustatus_func = arg1; if (NIL_P(arg1)) glutMenuStatusFunc(NULL); else glutMenuStatusFunc(glut_MenuStatusFuncCallback); return Qnil; } static void GLUTCALLBACK glut_SpecialFuncCallback(key, x, y) int key, x, y; { VALUE func; func = rb_ary_entry(SpecialFunc, glutGetWindow()); if (!NIL_P(func)) rb_funcall(func, callId, 3,INT2NUM(key), INT2FIX(x), INT2FIX(y)); } static void GLUTCALLBACK glut_SpaceballMotionFuncCallback(x, y, z) int x,y,z; { VALUE func; func = rb_ary_entry(SpaceballMotionFunc, glutGetWindow()); if (!NIL_P(func)) rb_funcall(func, callId, 3,INT2NUM(x), INT2FIX(y), INT2FIX(z)); } static void GLUTCALLBACK glut_SpaceballRotateFuncCallback(x, y, z) int x,y,z; { VALUE func; func = rb_ary_entry(SpaceballRotateFunc, glutGetWindow()); if (!NIL_P(func)) rb_funcall(func, callId, 3,INT2NUM(x), INT2FIX(y), INT2FIX(z)); } static void GLUTCALLBACK glut_SpaceballButtonFuncCallback(button, state) int button, state; { VALUE func; func = rb_ary_entry(SpaceballButtonFunc, glutGetWindow()); if (!NIL_P(func)) rb_funcall(func, callId, 2,INT2NUM(button), INT2NUM(state)); } static void GLUTCALLBACK glut_ButtonBoxFuncCallback(button, state) int button, state; { VALUE func; func = rb_ary_entry(ButtonBoxFunc, glutGetWindow()); if (!NIL_P(func)) rb_funcall(func, callId, 2,INT2NUM(button), INT2NUM(state)); } static void GLUTCALLBACK glut_DialsFuncCallback(dial, value) int dial, value; { VALUE func; func = rb_ary_entry(DialsFunc, glutGetWindow()); if (!NIL_P(func)) rb_funcall(func, callId, 2,INT2NUM(dial), INT2NUM(value)); } static void GLUTCALLBACK glut_TabletMotionFuncCallback(x, y) int x, y; { VALUE func; func = rb_ary_entry(TabletMotionFunc, glutGetWindow()); if (!NIL_P(func)) rb_funcall(func, callId, 2,INT2NUM(x), INT2NUM(y)); } static void GLUTCALLBACK glut_TabletButtonFuncCallback(button, state, x, y) int button, state, x, y; { VALUE func; func = rb_ary_entry(TabletButtonFunc, glutGetWindow()); if (!NIL_P(func)) rb_funcall(func, 4, INT2NUM(button), INT2NUM(state), INT2NUM(x), INT2NUM(y)); } static void GLUTCALLBACK glut_OverlayDisplayFuncCallback() { VALUE func; func = rb_ary_entry(OverlayDisplayFunc, glutGetWindow()); if (!NIL_P(func)) rb_funcall(func, callId, 0); } static void GLUTCALLBACK glut_WindowStatusFuncCallback(state) int state; { VALUE func; func = rb_ary_entry(WindowStatusFunc, glutGetWindow()); if (!NIL_P(func)) rb_funcall(func, callId, 1, INT2NUM(state)); } static void GLUTCALLBACK glut_JoystickFuncCallback(buttonMask,x,y,z) unsigned int buttonMask; int x,y,z; { VALUE func; func = rb_ary_entry(JoystickFunc, glutGetWindow()); if (!NIL_P(func)) rb_funcall(func, callId, 4, INT2NUM(buttonMask),INT2NUM(x),INT2NUM(y),INT2NUM(z)); } static void GLUTCALLBACK glut_KeyboardUpFuncCallback(key,x,y) unsigned char key; int x,y; { VALUE func; func = rb_ary_entry(KeyboardUpFunc, glutGetWindow()); if (!NIL_P(func)) rb_funcall(func, callId, 3, INT2NUM(key),INT2NUM(x),INT2NUM(y)); } static void GLUTCALLBACK glut_SpecialUpFuncCallback(key,x,y) int key; int x,y; { VALUE func; func = rb_ary_entry(SpecialUpFunc, glutGetWindow()); if (!NIL_P(func)) rb_funcall(func, callId, 3, INT2NUM(key),INT2NUM(x),INT2NUM(y)); } /* GLUT color index sub-API. */ static VALUE glut_SetColor(obj,arg1,arg2,arg3,arg4) VALUE obj,arg1,arg2,arg3,arg4; { int set; GLfloat red; GLfloat green; GLfloat blue; set = NUM2INT(arg1); red = (GLfloat)NUM2DBL(arg2); green = (GLfloat)NUM2DBL(arg3); blue = (GLfloat)NUM2DBL(arg4); glutSetColor(set, red, green, blue); return Qnil; } static VALUE glut_GetColor(obj,arg1,arg2) VALUE obj,arg1,arg2; { int ndx; int component; GLfloat ret; ndx = NUM2INT(arg1); component = NUM2INT(arg2); ret = (GLfloat)glutGetColor(ndx, component); return rb_float_new(ret); } static VALUE glut_CopyColormap(obj,arg1) VALUE obj,arg1; { int win; win = NUM2INT(arg1); glutCopyColormap(win); return Qnil; } /* GLUT state retrieval sub-API. */ static VALUE glut_Get(obj,arg1) VALUE obj,arg1; { GLenum type; int ret; type = (GLenum)NUM2INT(arg1); ret = glutGet(type); return INT2NUM(ret); } static VALUE glut_DeviceGet(obj,arg1) VALUE obj,arg1; { GLenum type; int ret; type = (GLenum)NUM2INT(arg1); ret = glutDeviceGet(type); return INT2NUM(ret); } /* GLUT extension support sub-API */ static VALUE glut_ExtensionSupported(obj,arg1) VALUE obj,arg1; { int ret; Check_Type(arg1,T_STRING); ret = glutExtensionSupported(RSTRING_PTR(arg1)); return INT2NUM(ret); } static VALUE glut_GetModifiers(obj) VALUE obj; { int ret; ret = glutGetModifiers(); return INT2NUM(ret); } static VALUE glut_LayerGet(obj,arg1) VALUE obj,arg1; { GLenum type; int ret; type = (GLenum)NUM2INT(arg1); ret = glutLayerGet(type); return INT2NUM(ret); } /* GLUT font sub-API */ /* Some glut implementations define font enums as addresses of local functions which are then called by glut internally. This may lead to crashes or bus errors on some platforms, so to be safe we hardcode the values passed to/from ruby */ static inline void * bitmap_font_map(int f) { switch (f) { case 0: return (void *)GLUT_BITMAP_9_BY_15; case 1: return (void *)GLUT_BITMAP_8_BY_13; case 2: return (void *)GLUT_BITMAP_TIMES_ROMAN_10; case 3: return (void *)GLUT_BITMAP_TIMES_ROMAN_24; case 4: return (void *)GLUT_BITMAP_HELVETICA_10; case 5: return (void *)GLUT_BITMAP_HELVETICA_12; case 6: return (void *)GLUT_BITMAP_HELVETICA_18; default: rb_raise(rb_eArgError, "Unsupported font"); } return (void *) 0; /* not reached */ } static inline void * stroke_font_map(int f) { switch (f) { case 7: return (void *)GLUT_STROKE_ROMAN; case 8: return (void *)GLUT_STROKE_MONO_ROMAN; default: rb_raise(rb_eArgError, "Unsupported font"); } return (void *) 0; /* not reached */ } static VALUE glut_BitmapCharacter(obj,arg1,arg2) VALUE obj,arg1,arg2; { int character; int font; font = NUM2INT(arg1); character = NUM2INT(arg2); glutBitmapCharacter(bitmap_font_map(font),character); return Qnil; } static VALUE glut_BitmapWidth(obj,arg1,arg2) VALUE obj,arg1,arg2; { int font; int character; int ret; font = NUM2INT(arg1); character = NUM2INT(arg2); ret = glutBitmapWidth(bitmap_font_map(font), character); return INT2NUM(ret); } static VALUE glut_StrokeCharacter(obj,arg1,arg2) VALUE obj,arg1,arg2; { int font; int character; font = NUM2INT(arg1); character = NUM2INT(arg2); glutStrokeCharacter(stroke_font_map(font), character); return Qnil; } static VALUE glut_StrokeWidth(obj,arg1,arg2) VALUE obj,arg1,arg2; { int font; int character; int ret; font = NUM2INT(arg1); character = NUM2INT(arg2); ret = glutStrokeWidth(stroke_font_map(font), character); return INT2NUM(ret); } static VALUE glut_BitmapLength(obj,arg1,arg2) VALUE obj,arg1,arg2; { int font; int ret; Check_Type(arg2,T_STRING); font = NUM2INT(arg1); ret = glutBitmapLength(bitmap_font_map(font), (const unsigned char*)RSTRING_PTR(arg2)); return INT2NUM(ret); } static VALUE glut_StrokeLength(obj,arg1,arg2) VALUE obj,arg1,arg2; { int font; int ret; Check_Type(arg2,T_STRING); font = NUM2INT(arg1); ret = glutStrokeLength(stroke_font_map(font), (const unsigned char*)RSTRING_PTR(arg2)); return INT2NUM(ret); } /* GLUT pre-built models sub-API */ static VALUE glut_WireSphere(obj,arg1,arg2,arg3) VALUE obj,arg1,arg2,arg3; { GLdouble radius; GLint slices; GLint stacks; radius = (GLdouble)NUM2DBL(arg1); slices = (GLint)NUM2INT(arg2); stacks = (GLint)NUM2INT(arg3); glutWireSphere(radius, slices, stacks); return Qnil; } static VALUE glut_SolidSphere(obj,arg1,arg2,arg3) VALUE obj,arg1,arg2,arg3; { GLdouble radius; GLint slices; GLint stacks; radius = (GLdouble)NUM2DBL(arg1); slices = (GLint)NUM2INT(arg2); stacks = (GLint)NUM2INT(arg3); glutSolidSphere(radius, slices, stacks); return Qnil; } static VALUE glut_WireCone(obj,arg1,arg2,arg3,arg4) VALUE obj,arg1,arg2,arg3,arg4; { GLdouble base; GLdouble height; GLint slices; GLint stacks; base = (GLdouble)NUM2DBL(arg1); height = (GLdouble)NUM2DBL(arg2); slices = (GLint)NUM2INT(arg3); stacks = (GLint)NUM2INT(arg4); glutWireCone(base, height, slices, stacks); return Qnil; } static VALUE glut_SolidCone(obj,arg1,arg2,arg3,arg4) VALUE obj,arg1,arg2,arg3,arg4; { GLdouble base; GLdouble height; GLint slices; GLint stacks; base = (GLdouble)NUM2DBL(arg1); height = (GLdouble)NUM2DBL(arg2); slices = (GLint)NUM2INT(arg3); stacks = (GLint)NUM2INT(arg4); glutSolidCone(base, height, slices, stacks); return Qnil; } static VALUE glut_WireCube(obj,arg1) VALUE obj,arg1; { GLdouble size; size = (GLdouble)NUM2DBL(arg1); glutWireCube(size); return Qnil; } static VALUE glut_SolidCube(obj,arg1) VALUE obj,arg1; { GLdouble size; size = (GLdouble)NUM2DBL(arg1); glutSolidCube(size); return Qnil; } static VALUE glut_WireTorus(obj,arg1,arg2,arg3,arg4) VALUE obj,arg1,arg2,arg3,arg4; { GLdouble innerRadius; GLdouble outerRadius; GLint sides; GLint rings; innerRadius = (GLdouble)NUM2DBL(arg1); outerRadius = (GLdouble)NUM2DBL(arg2); sides = (GLint)NUM2INT(arg3); rings = (GLint)NUM2INT(arg4); glutWireTorus(innerRadius, outerRadius, sides, rings); return Qnil; } static VALUE glut_SolidTorus(obj,arg1,arg2,arg3,arg4) VALUE obj,arg1,arg2,arg3,arg4; { GLdouble innerRadius; GLdouble outerRadius; GLint sides; GLint rings; innerRadius = (GLdouble)NUM2DBL(arg1); outerRadius = (GLdouble)NUM2DBL(arg2); sides = (GLint)NUM2INT(arg3); rings = (GLint)NUM2INT(arg4); glutSolidTorus(innerRadius, outerRadius, sides, rings); return Qnil; } GLUT_SIMPLE_FUNCTION(WireDodecahedron) GLUT_SIMPLE_FUNCTION(SolidDodecahedron) GLUT_SIMPLE_FUNCTION(WireOctahedron) GLUT_SIMPLE_FUNCTION(SolidOctahedron) GLUT_SIMPLE_FUNCTION(WireTetrahedron) GLUT_SIMPLE_FUNCTION(SolidTetrahedron) GLUT_SIMPLE_FUNCTION(WireIcosahedron) GLUT_SIMPLE_FUNCTION(SolidIcosahedron) static VALUE glut_WireTeapot(obj,arg1) VALUE obj,arg1; { GLdouble size; size = (GLdouble)NUM2DBL(arg1); glutWireTeapot(size); return Qnil; } static VALUE glut_SolidTeapot(obj,arg1) VALUE obj,arg1; { GLdouble size; size = (GLdouble)NUM2DBL(arg1); glutSolidTeapot(size); return Qnil; } /* GLUT video resize sub-API. */ static VALUE glut_VideoResizeGet(obj,arg1) VALUE obj,arg1; { GLenum param; int ret; param = (GLenum)NUM2INT(arg1); ret = glutVideoResizeGet(param); return INT2NUM(ret); } GLUT_SIMPLE_FUNCTION(SetupVideoResizing) GLUT_SIMPLE_FUNCTION(StopVideoResizing) static VALUE glut_VideoResize(obj,arg1,arg2,arg3,arg4) VALUE obj,arg1,arg2,arg3,arg4; { int x; int y; int width; int height; x = NUM2INT(arg1); y = NUM2INT(arg2); width = NUM2INT(arg3); height = NUM2INT(arg4); glutVideoResize(x,y, width, height); return Qnil; } static VALUE glut_VideoPan(obj,arg1,arg2,arg3,arg4) VALUE obj,arg1,arg2,arg3,arg4; { int x; int y; int width; int height; x = NUM2INT(arg1); y = NUM2INT(arg2); width = NUM2INT(arg3); height = NUM2INT(arg4); glutVideoPan(x,y, width, height); return Qnil; } /* GLUT debugging sub-API. */ GLUT_SIMPLE_FUNCTION(ReportErrors) static VALUE glut_GameModeString(obj,arg1) VALUE obj,arg1; { Check_Type(arg1,T_STRING); glutGameModeString((const char*)RSTRING_PTR(arg1)); return Qnil; } GLUT_SIMPLE_FUNCTION(EnterGameMode) GLUT_SIMPLE_FUNCTION(LeaveGameMode) GLUT_SIMPLE_FUNCTION(ForceJoystickFunc) static VALUE glut_GameModeGet(obj,arg1) VALUE obj,arg1; { GLenum info; int i; info = (GLenum)NUM2INT(arg1); i = glutGameModeGet(info); return INT2NUM(i); } static VALUE glut_SetKeyRepeat(obj,arg1) VALUE obj,arg1; { GLenum repeatMode; repeatMode = (int) NUM2INT(arg1); glutSetKeyRepeat(repeatMode); return Qnil; } static VALUE glut_IgnoreKeyRepeat(obj,arg1) VALUE obj,arg1; { GLenum ignore; ignore = (int) NUM2INT(arg1); glutIgnoreKeyRepeat(ignore); return Qnil; } static VALUE glut_PostWindowOverlayRedisplay(obj,arg1) VALUE obj,arg1; { int win; win = (int) NUM2INT(arg1); glutPostWindowOverlayRedisplay(win); return Qnil; } static VALUE glut_PostWindowRedisplay(obj,arg1) VALUE obj,arg1; { int win; win = (int) NUM2INT(arg1); glutPostWindowRedisplay(win); return Qnil; } static VALUE module; DLLEXPORT void Init_glut() { module = rb_define_module("Glut"); rb_global_variable( &g_menucallback ); g_menucallback = rb_ary_new(); rb_define_module_function(module, "glutInit", glut_Init, -1); rb_define_module_function(module, "glutInitDisplayMode", glut_InitDisplayMode, 1); rb_define_module_function(module, "glutInitDisplayString", glut_InitDisplayString, 1); rb_define_module_function(module, "glutInitWindowPosition", glut_InitWindowPosition, 2); rb_define_module_function(module, "glutInitWindowSize", glut_InitWindowSize, 2); rb_define_module_function(module, "glutMainLoop", glut_MainLoop, 0); rb_define_module_function(module, "glutCheckLoop", glut_MainLoop, 0); rb_define_module_function(module, "glutGameModeString", glut_GameModeString, 1); rb_define_module_function(module, "glutEnterGameMode", glut_EnterGameMode, 0); rb_define_module_function(module, "glutLeaveGameMode", glut_LeaveGameMode, 0); rb_define_module_function(module, "glutCreateWindow", glut_CreateWindow, -1); rb_define_module_function(module, "glutCreateSubWindow", glut_CreateSubWindow, 5); rb_define_module_function(module, "glutDestroyWindow", glut_DestroyWindow, 1); rb_define_module_function(module, "glutPostRedisplay", glut_PostRedisplay, 0); rb_define_module_function(module, "glutSwapBuffers", glut_SwapBuffers, 0); rb_define_module_function(module, "glutGetWindow", glut_GetWindow, 0); rb_define_module_function(module, "glutSetWindow", glut_SetWindow, 1); rb_define_module_function(module, "glutSetWindowTitle", glut_SetWindowTitle, 1); rb_define_module_function(module, "glutSetIconTitle", glut_SetIconTitle, 1); rb_define_module_function(module, "glutPositionWindow", glut_PositionWindow, 2); rb_define_module_function(module, "glutReshapeWindow", glut_ReshapeWindow, 2); rb_define_module_function(module, "glutPopWindow", glut_PopWindow, 0); rb_define_module_function(module, "glutPushWindow", glut_PushWindow, 0); rb_define_module_function(module, "glutIconifyWindow", glut_IconifyWindow, 0); rb_define_module_function(module, "glutShowWindow", glut_ShowWindow, 0); rb_define_module_function(module, "glutHideWindow", glut_HideWindow, 0); rb_define_module_function(module, "glutFullScreen", glut_FullScreen, 0); rb_define_module_function(module, "glutSetCursor", glut_SetCursor, 1); rb_define_module_function(module, "glutWarpPointer", glut_WarpPointer, 2); rb_define_module_function(module, "glutEstablishOverlay", glut_EstablishOverlay, 0); rb_define_module_function(module, "glutRemoveOverlay", glut_RemoveOverlay, 0); rb_define_module_function(module, "glutUseLayer", glut_UseLayer, 1); rb_define_module_function(module, "glutPostOverlayRedisplay", glut_PostOverlayRedisplay, 0); rb_define_module_function(module, "glutShowOverlay", glut_ShowOverlay, 0); rb_define_module_function(module, "glutHideOverlay", glut_HideOverlay, 0); rb_define_module_function(module, "glutCreateMenu", glut_CreateMenu, 1); rb_define_module_function(module, "glutDestroyMenu", glut_DestroyMenu, 1); rb_define_module_function(module, "glutGetMenu", glut_GetMenu, 0); rb_define_module_function(module, "glutSetMenu", glut_SetMenu, 1); rb_define_module_function(module, "glutAddMenuEntry", glut_AddMenuEntry, 2); rb_define_module_function(module, "glutAddSubMenu", glut_AddSubMenu, 2); rb_define_module_function(module, "glutChangeToMenuEntry", glut_ChangeToMenuEntry, 3); rb_define_module_function(module, "glutChangeToSubMenu", glut_ChangeToSubMenu, 3); rb_define_module_function(module, "glutRemoveMenuItem", glut_RemoveMenuItem, 1); rb_define_module_function(module, "glutAttachMenu", glut_AttachMenu, 1); rb_define_module_function(module, "glutDetachMenu", glut_DetachMenu, 1); rb_define_module_function(module, "glutSetColor", glut_SetColor, 4); rb_define_module_function(module, "glutGetColor", glut_GetColor, 2); rb_define_module_function(module, "glutCopyColormap", glut_CopyColormap, 1); rb_define_module_function(module, "glutGet", glut_Get, 1); rb_define_module_function(module, "glutDeviceGet", glut_DeviceGet, 1); rb_define_module_function(module, "glutExtensionSupported", glut_ExtensionSupported, 1); rb_define_module_function(module, "glutGetModifiers", glut_GetModifiers, 0); rb_define_module_function(module, "glutLayerGet", glut_LayerGet, 1); rb_define_module_function(module, "glutBitmapCharacter", glut_BitmapCharacter, 2); rb_define_module_function(module, "glutBitmapWidth", glut_BitmapWidth, 2); rb_define_module_function(module, "glutStrokeCharacter", glut_StrokeCharacter, 2); rb_define_module_function(module, "glutStrokeWidth", glut_StrokeWidth, 2); rb_define_module_function(module, "glutBitmapLength", glut_BitmapLength, 2); rb_define_module_function(module, "glutStrokeLength", glut_StrokeLength, 2); rb_define_module_function(module, "glutWireSphere", glut_WireSphere, 3); rb_define_module_function(module, "glutSolidSphere", glut_SolidSphere, 3); rb_define_module_function(module, "glutWireCone", glut_WireCone, 4); rb_define_module_function(module, "glutSolidCone", glut_SolidCone, 4); rb_define_module_function(module, "glutWireCube", glut_WireCube, 1); rb_define_module_function(module, "glutSolidCube", glut_SolidCube, 1); rb_define_module_function(module, "glutWireTorus", glut_WireTorus, 4); rb_define_module_function(module, "glutSolidTorus", glut_SolidTorus, 4); rb_define_module_function(module, "glutWireDodecahedron", glut_WireDodecahedron, 0); rb_define_module_function(module, "glutSolidDodecahedron", glut_SolidDodecahedron, 0); rb_define_module_function(module, "glutWireTeapot", glut_WireTeapot, 1); rb_define_module_function(module, "glutSolidTeapot", glut_SolidTeapot, 1); rb_define_module_function(module, "glutWireOctahedron", glut_WireOctahedron, 0); rb_define_module_function(module, "glutSolidOctahedron", glut_SolidOctahedron, 0); rb_define_module_function(module, "glutWireTetrahedron", glut_WireTetrahedron, 0); rb_define_module_function(module, "glutSolidTetrahedron", glut_SolidTetrahedron, 0); rb_define_module_function(module, "glutWireIcosahedron", glut_WireIcosahedron, 0); rb_define_module_function(module, "glutSolidIcosahedron", glut_SolidIcosahedron, 0); rb_define_module_function(module, "glutVideoResizeGet", glut_VideoResizeGet, 1); rb_define_module_function(module, "glutSetupVideoResizing", glut_SetupVideoResizing, 0); rb_define_module_function(module, "glutStopVideoResizing", glut_StopVideoResizing, 0); rb_define_module_function(module, "glutVideoResize", glut_VideoResize, 4); rb_define_module_function(module, "glutVideoPan", glut_VideoPan, 4); rb_define_module_function(module, "glutReportErrors", glut_ReportErrors, 0); rb_define_module_function(module, "glutIdleFunc", glut_IdleFunc, 1); rb_define_module_function(module, "glutTimerFunc", glut_TimerFunc, 3); rb_define_module_function(module, "glutMenuStateFunc", glut_MenuStateFunc, 1); rb_define_module_function(module, "glutMenuStatusFunc", glut_MenuStatusFunc, 1); rb_define_module_function(module, "glutForceJoystickFunc", glut_ForceJoystickFunc, 0); rb_define_module_function(module, "glutGameModeGet", glut_GameModeGet, 1); rb_define_module_function(module, "glutSetKeyRepeat", glut_SetKeyRepeat, 1); rb_define_module_function(module, "glutIgnoreKeyRepeat", glut_IgnoreKeyRepeat, 1); rb_define_module_function(module, "glutPostWindowOverlayRedisplay", glut_PostWindowOverlayRedisplay, 1); rb_define_module_function(module, "glutPostWindowRedisplay", glut_PostWindowRedisplay, 1); rb_define_const(module, "GLUT_API_VERSION", INT2NUM(GLUT_API_VERSION)); rb_define_const(module, "GLUT_XLIB_IMPLEMENTATION", INT2NUM(GLUT_XLIB_IMPLEMENTATION)); rb_define_const(module, "GLUT_RGB", INT2NUM(GLUT_RGB)); rb_define_const(module, "GLUT_RGBA", INT2NUM(GLUT_RGBA)); rb_define_const(module, "GLUT_INDEX", INT2NUM(GLUT_INDEX)); rb_define_const(module, "GLUT_SINGLE", INT2NUM(GLUT_SINGLE)); rb_define_const(module, "GLUT_DOUBLE", INT2NUM(GLUT_DOUBLE)); rb_define_const(module, "GLUT_ACCUM", INT2NUM(GLUT_ACCUM)); rb_define_const(module, "GLUT_ALPHA", INT2NUM(GLUT_ALPHA)); rb_define_const(module, "GLUT_DEPTH", INT2NUM(GLUT_DEPTH)); rb_define_const(module, "GLUT_STENCIL", INT2NUM(GLUT_STENCIL)); rb_define_const(module, "GLUT_MULTISAMPLE", INT2NUM(GLUT_MULTISAMPLE)); rb_define_const(module, "GLUT_STEREO", INT2NUM(GLUT_STEREO)); rb_define_const(module, "GLUT_LUMINANCE", INT2NUM(GLUT_LUMINANCE)); rb_define_const(module, "GLUT_LEFT_BUTTON", INT2NUM(GLUT_LEFT_BUTTON)); rb_define_const(module, "GLUT_MIDDLE_BUTTON", INT2NUM(GLUT_MIDDLE_BUTTON)); rb_define_const(module, "GLUT_RIGHT_BUTTON", INT2NUM(GLUT_RIGHT_BUTTON)); rb_define_const(module, "GLUT_DOWN", INT2NUM(GLUT_DOWN)); rb_define_const(module, "GLUT_UP", INT2NUM(GLUT_UP)); rb_define_const(module, "GLUT_KEY_F1", INT2NUM(GLUT_KEY_F1)); rb_define_const(module, "GLUT_KEY_F2", INT2NUM(GLUT_KEY_F2)); rb_define_const(module, "GLUT_KEY_F3", INT2NUM(GLUT_KEY_F3)); rb_define_const(module, "GLUT_KEY_F4", INT2NUM(GLUT_KEY_F4)); rb_define_const(module, "GLUT_KEY_F5", INT2NUM(GLUT_KEY_F5)); rb_define_const(module, "GLUT_KEY_F6", INT2NUM(GLUT_KEY_F6)); rb_define_const(module, "GLUT_KEY_F7", INT2NUM(GLUT_KEY_F7)); rb_define_const(module, "GLUT_KEY_F8", INT2NUM(GLUT_KEY_F8)); rb_define_const(module, "GLUT_KEY_F9", INT2NUM(GLUT_KEY_F9)); rb_define_const(module, "GLUT_KEY_F10", INT2NUM(GLUT_KEY_F10)); rb_define_const(module, "GLUT_KEY_F11", INT2NUM(GLUT_KEY_F11)); rb_define_const(module, "GLUT_KEY_F12", INT2NUM(GLUT_KEY_F12)); rb_define_const(module, "GLUT_KEY_LEFT", INT2NUM(GLUT_KEY_LEFT)); rb_define_const(module, "GLUT_KEY_UP", INT2NUM(GLUT_KEY_UP)); rb_define_const(module, "GLUT_KEY_RIGHT", INT2NUM(GLUT_KEY_RIGHT)); rb_define_const(module, "GLUT_KEY_DOWN", INT2NUM(GLUT_KEY_DOWN)); rb_define_const(module, "GLUT_KEY_PAGE_UP", INT2NUM(GLUT_KEY_PAGE_UP)); rb_define_const(module, "GLUT_KEY_PAGE_DOWN", INT2NUM(GLUT_KEY_PAGE_DOWN)); rb_define_const(module, "GLUT_KEY_HOME", INT2NUM(GLUT_KEY_HOME)); rb_define_const(module, "GLUT_KEY_END", INT2NUM(GLUT_KEY_END)); rb_define_const(module, "GLUT_KEY_INSERT", INT2NUM(GLUT_KEY_INSERT)); rb_define_const(module, "GLUT_LEFT", INT2NUM(GLUT_LEFT)); rb_define_const(module, "GLUT_ENTERED", INT2NUM(GLUT_ENTERED)); rb_define_const(module, "GLUT_MENU_NOT_IN_USE", INT2NUM(GLUT_MENU_NOT_IN_USE)); rb_define_const(module, "GLUT_MENU_IN_USE", INT2NUM(GLUT_MENU_IN_USE)); rb_define_const(module, "GLUT_NOT_VISIBLE", INT2NUM(GLUT_NOT_VISIBLE)); rb_define_const(module, "GLUT_VISIBLE", INT2NUM(GLUT_VISIBLE)); rb_define_const(module, "GLUT_HIDDEN", INT2NUM(GLUT_HIDDEN)); rb_define_const(module, "GLUT_FULLY_RETAINED", INT2NUM(GLUT_FULLY_RETAINED)); rb_define_const(module, "GLUT_PARTIALLY_RETAINED", INT2NUM(GLUT_PARTIALLY_RETAINED)); rb_define_const(module, "GLUT_FULLY_COVERED", INT2NUM(GLUT_FULLY_COVERED)); rb_define_const(module, "GLUT_RED", INT2NUM(GLUT_RED)); rb_define_const(module, "GLUT_GREEN", INT2NUM(GLUT_GREEN)); rb_define_const(module, "GLUT_BLUE", INT2NUM(GLUT_BLUE)); rb_define_const(module, "GLUT_WINDOW_X", INT2NUM(GLUT_WINDOW_X)); rb_define_const(module, "GLUT_WINDOW_Y", INT2NUM(GLUT_WINDOW_Y)); rb_define_const(module, "GLUT_WINDOW_WIDTH", INT2NUM(GLUT_WINDOW_WIDTH)); rb_define_const(module, "GLUT_WINDOW_HEIGHT", INT2NUM(GLUT_WINDOW_HEIGHT)); rb_define_const(module, "GLUT_WINDOW_BUFFER_SIZE", INT2NUM(GLUT_WINDOW_BUFFER_SIZE)); rb_define_const(module, "GLUT_WINDOW_STENCIL_SIZE", INT2NUM(GLUT_WINDOW_STENCIL_SIZE)); rb_define_const(module, "GLUT_WINDOW_DEPTH_SIZE", INT2NUM(GLUT_WINDOW_DEPTH_SIZE)); rb_define_const(module, "GLUT_WINDOW_RED_SIZE", INT2NUM(GLUT_WINDOW_RED_SIZE)); rb_define_const(module, "GLUT_WINDOW_GREEN_SIZE", INT2NUM(GLUT_WINDOW_GREEN_SIZE)); rb_define_const(module, "GLUT_WINDOW_BLUE_SIZE", INT2NUM(GLUT_WINDOW_BLUE_SIZE)); rb_define_const(module, "GLUT_WINDOW_ALPHA_SIZE", INT2NUM(GLUT_WINDOW_ALPHA_SIZE)); rb_define_const(module, "GLUT_WINDOW_ACCUM_RED_SIZE", INT2NUM(GLUT_WINDOW_ACCUM_RED_SIZE)); rb_define_const(module, "GLUT_WINDOW_ACCUM_GREEN_SIZE", INT2NUM(GLUT_WINDOW_ACCUM_GREEN_SIZE)); rb_define_const(module, "GLUT_WINDOW_ACCUM_BLUE_SIZE", INT2NUM(GLUT_WINDOW_ACCUM_BLUE_SIZE)); rb_define_const(module, "GLUT_WINDOW_ACCUM_ALPHA_SIZE", INT2NUM(GLUT_WINDOW_ACCUM_ALPHA_SIZE)); rb_define_const(module, "GLUT_WINDOW_DOUBLEBUFFER", INT2NUM(GLUT_WINDOW_DOUBLEBUFFER)); rb_define_const(module, "GLUT_WINDOW_RGBA", INT2NUM(GLUT_WINDOW_RGBA)); rb_define_const(module, "GLUT_WINDOW_PARENT", INT2NUM(GLUT_WINDOW_PARENT)); rb_define_const(module, "GLUT_WINDOW_NUM_CHILDREN", INT2NUM(GLUT_WINDOW_NUM_CHILDREN)); rb_define_const(module, "GLUT_WINDOW_COLORMAP_SIZE", INT2NUM(GLUT_WINDOW_COLORMAP_SIZE)); rb_define_const(module, "GLUT_WINDOW_NUM_SAMPLES", INT2NUM(GLUT_WINDOW_NUM_SAMPLES)); rb_define_const(module, "GLUT_WINDOW_STEREO", INT2NUM(GLUT_WINDOW_STEREO)); rb_define_const(module, "GLUT_WINDOW_CURSOR", INT2NUM(GLUT_WINDOW_CURSOR)); rb_define_const(module, "GLUT_SCREEN_WIDTH", INT2NUM(GLUT_SCREEN_WIDTH)); rb_define_const(module, "GLUT_SCREEN_HEIGHT", INT2NUM(GLUT_SCREEN_HEIGHT)); rb_define_const(module, "GLUT_SCREEN_WIDTH_MM", INT2NUM(GLUT_SCREEN_WIDTH_MM)); rb_define_const(module, "GLUT_SCREEN_HEIGHT_MM", INT2NUM(GLUT_SCREEN_HEIGHT_MM)); rb_define_const(module, "GLUT_MENU_NUM_ITEMS", INT2NUM(GLUT_MENU_NUM_ITEMS)); rb_define_const(module, "GLUT_DISPLAY_MODE_POSSIBLE", INT2NUM(GLUT_DISPLAY_MODE_POSSIBLE)); rb_define_const(module, "GLUT_INIT_WINDOW_X", INT2NUM(GLUT_INIT_WINDOW_X)); rb_define_const(module, "GLUT_INIT_WINDOW_Y", INT2NUM(GLUT_INIT_WINDOW_Y)); rb_define_const(module, "GLUT_INIT_WINDOW_WIDTH", INT2NUM(GLUT_INIT_WINDOW_WIDTH)); rb_define_const(module, "GLUT_INIT_WINDOW_HEIGHT", INT2NUM(GLUT_INIT_WINDOW_HEIGHT)); rb_define_const(module, "GLUT_INIT_DISPLAY_MODE", INT2NUM(GLUT_INIT_DISPLAY_MODE)); rb_define_const(module, "GLUT_ELAPSED_TIME", INT2NUM(GLUT_ELAPSED_TIME)); rb_define_const(module, "GLUT_HAS_KEYBOARD", INT2NUM(GLUT_HAS_KEYBOARD)); rb_define_const(module, "GLUT_HAS_MOUSE", INT2NUM(GLUT_HAS_MOUSE)); rb_define_const(module, "GLUT_HAS_SPACEBALL", INT2NUM(GLUT_HAS_SPACEBALL)); rb_define_const(module, "GLUT_HAS_DIAL_AND_BUTTON_BOX", INT2NUM(GLUT_HAS_DIAL_AND_BUTTON_BOX)); rb_define_const(module, "GLUT_HAS_TABLET", INT2NUM(GLUT_HAS_TABLET)); rb_define_const(module, "GLUT_NUM_MOUSE_BUTTONS", INT2NUM(GLUT_NUM_MOUSE_BUTTONS)); rb_define_const(module, "GLUT_NUM_SPACEBALL_BUTTONS", INT2NUM(GLUT_NUM_SPACEBALL_BUTTONS)); rb_define_const(module, "GLUT_NUM_BUTTON_BOX_BUTTONS", INT2NUM(GLUT_NUM_BUTTON_BOX_BUTTONS)); rb_define_const(module, "GLUT_NUM_DIALS", INT2NUM(GLUT_NUM_DIALS)); rb_define_const(module, "GLUT_NUM_TABLET_BUTTONS", INT2NUM(GLUT_NUM_TABLET_BUTTONS)); rb_define_const(module, "GLUT_OVERLAY_POSSIBLE", INT2NUM(GLUT_OVERLAY_POSSIBLE)); rb_define_const(module, "GLUT_LAYER_IN_USE", INT2NUM(GLUT_LAYER_IN_USE)); rb_define_const(module, "GLUT_HAS_OVERLAY", INT2NUM(GLUT_HAS_OVERLAY)); rb_define_const(module, "GLUT_TRANSPARENT_INDEX", INT2NUM(GLUT_TRANSPARENT_INDEX)); rb_define_const(module, "GLUT_NORMAL_DAMAGED", INT2NUM(GLUT_NORMAL_DAMAGED)); rb_define_const(module, "GLUT_OVERLAY_DAMAGED", INT2NUM(GLUT_OVERLAY_DAMAGED)); rb_define_const(module, "GLUT_VIDEO_RESIZE_POSSIBLE", INT2NUM(GLUT_VIDEO_RESIZE_POSSIBLE)); rb_define_const(module, "GLUT_VIDEO_RESIZE_IN_USE", INT2NUM(GLUT_VIDEO_RESIZE_IN_USE)); rb_define_const(module, "GLUT_VIDEO_RESIZE_X_DELTA", INT2NUM(GLUT_VIDEO_RESIZE_X_DELTA)); rb_define_const(module, "GLUT_VIDEO_RESIZE_Y_DELTA", INT2NUM(GLUT_VIDEO_RESIZE_Y_DELTA)); rb_define_const(module, "GLUT_VIDEO_RESIZE_WIDTH_DELTA", INT2NUM(GLUT_VIDEO_RESIZE_WIDTH_DELTA)); rb_define_const(module, "GLUT_VIDEO_RESIZE_HEIGHT_DELTA", INT2NUM(GLUT_VIDEO_RESIZE_HEIGHT_DELTA)); rb_define_const(module, "GLUT_VIDEO_RESIZE_X", INT2NUM(GLUT_VIDEO_RESIZE_X)); rb_define_const(module, "GLUT_VIDEO_RESIZE_Y", INT2NUM(GLUT_VIDEO_RESIZE_Y)); rb_define_const(module, "GLUT_VIDEO_RESIZE_WIDTH", INT2NUM(GLUT_VIDEO_RESIZE_WIDTH)); rb_define_const(module, "GLUT_VIDEO_RESIZE_HEIGHT", INT2NUM(GLUT_VIDEO_RESIZE_HEIGHT)); rb_define_const(module, "GLUT_NORMAL", INT2NUM(GLUT_NORMAL)); rb_define_const(module, "GLUT_OVERLAY", INT2NUM(GLUT_OVERLAY)); rb_define_const(module, "GLUT_ACTIVE_SHIFT", INT2NUM(GLUT_ACTIVE_SHIFT)); rb_define_const(module, "GLUT_ACTIVE_CTRL", INT2NUM(GLUT_ACTIVE_CTRL)); rb_define_const(module, "GLUT_ACTIVE_ALT", INT2NUM(GLUT_ACTIVE_ALT)); rb_define_const(module, "GLUT_CURSOR_RIGHT_ARROW", INT2NUM(GLUT_CURSOR_RIGHT_ARROW)); rb_define_const(module, "GLUT_CURSOR_LEFT_ARROW", INT2NUM(GLUT_CURSOR_LEFT_ARROW)); rb_define_const(module, "GLUT_CURSOR_INFO", INT2NUM(GLUT_CURSOR_INFO)); rb_define_const(module, "GLUT_CURSOR_DESTROY", INT2NUM(GLUT_CURSOR_DESTROY)); rb_define_const(module, "GLUT_CURSOR_HELP", INT2NUM(GLUT_CURSOR_HELP)); rb_define_const(module, "GLUT_CURSOR_CYCLE", INT2NUM(GLUT_CURSOR_CYCLE)); rb_define_const(module, "GLUT_CURSOR_SPRAY", INT2NUM(GLUT_CURSOR_SPRAY)); rb_define_const(module, "GLUT_CURSOR_WAIT", INT2NUM(GLUT_CURSOR_WAIT)); rb_define_const(module, "GLUT_CURSOR_TEXT", INT2NUM(GLUT_CURSOR_TEXT)); rb_define_const(module, "GLUT_CURSOR_CROSSHAIR", INT2NUM(GLUT_CURSOR_CROSSHAIR)); rb_define_const(module, "GLUT_CURSOR_UP_DOWN", INT2NUM(GLUT_CURSOR_UP_DOWN)); rb_define_const(module, "GLUT_CURSOR_LEFT_RIGHT", INT2NUM(GLUT_CURSOR_LEFT_RIGHT)); rb_define_const(module, "GLUT_CURSOR_TOP_SIDE", INT2NUM(GLUT_CURSOR_TOP_SIDE)); rb_define_const(module, "GLUT_CURSOR_BOTTOM_SIDE", INT2NUM(GLUT_CURSOR_BOTTOM_SIDE)); rb_define_const(module, "GLUT_CURSOR_LEFT_SIDE", INT2NUM(GLUT_CURSOR_LEFT_SIDE)); rb_define_const(module, "GLUT_CURSOR_RIGHT_SIDE", INT2NUM(GLUT_CURSOR_RIGHT_SIDE)); rb_define_const(module, "GLUT_CURSOR_TOP_LEFT_CORNER", INT2NUM(GLUT_CURSOR_TOP_LEFT_CORNER)); rb_define_const(module, "GLUT_CURSOR_TOP_RIGHT_CORNER", INT2NUM(GLUT_CURSOR_TOP_RIGHT_CORNER)); rb_define_const(module, "GLUT_CURSOR_BOTTOM_RIGHT_CORNER", INT2NUM(GLUT_CURSOR_BOTTOM_RIGHT_CORNER)); rb_define_const(module, "GLUT_CURSOR_BOTTOM_LEFT_CORNER", INT2NUM(GLUT_CURSOR_BOTTOM_LEFT_CORNER)); rb_define_const(module, "GLUT_CURSOR_INHERIT", INT2NUM(GLUT_CURSOR_INHERIT)); rb_define_const(module, "GLUT_CURSOR_NONE", INT2NUM(GLUT_CURSOR_NONE)); rb_define_const(module, "GLUT_CURSOR_FULL_CROSSHAIR", INT2NUM(GLUT_CURSOR_FULL_CROSSHAIR)); /* hardcoded, see bitmap_font_map for explanation */ rb_define_const(module, "GLUT_BITMAP_9_BY_15", INT2NUM(0)); rb_define_const(module, "GLUT_BITMAP_8_BY_13", INT2NUM(1)); rb_define_const(module, "GLUT_BITMAP_TIMES_ROMAN_10", INT2NUM(2)); rb_define_const(module, "GLUT_BITMAP_TIMES_ROMAN_24", INT2NUM(3)); rb_define_const(module, "GLUT_BITMAP_HELVETICA_10", INT2NUM(4)); rb_define_const(module, "GLUT_BITMAP_HELVETICA_12", INT2NUM(5)); rb_define_const(module, "GLUT_BITMAP_HELVETICA_18", INT2NUM(6)); rb_define_const(module, "GLUT_STROKE_ROMAN", INT2NUM(7)); rb_define_const(module, "GLUT_STROKE_MONO_ROMAN", INT2NUM(8)); rb_define_const(module, "GLUT_WINDOW_FORMAT_ID", INT2NUM(GLUT_WINDOW_FORMAT_ID)); rb_define_const(module, "GLUT_DEVICE_IGNORE_KEY_REPEAT", INT2NUM(GLUT_DEVICE_IGNORE_KEY_REPEAT)); rb_define_const(module, "GLUT_DEVICE_KEY_REPEAT", INT2NUM(GLUT_DEVICE_KEY_REPEAT)); rb_define_const(module, "GLUT_HAS_JOYSTICK", INT2NUM(GLUT_HAS_JOYSTICK)); rb_define_const(module, "GLUT_OWNS_JOYSTICK", INT2NUM(GLUT_OWNS_JOYSTICK)); rb_define_const(module, "GLUT_JOYSTICK_BUTTONS", INT2NUM(GLUT_JOYSTICK_BUTTONS)); rb_define_const(module, "GLUT_JOYSTICK_AXES", INT2NUM(GLUT_JOYSTICK_AXES)); rb_define_const(module, "GLUT_JOYSTICK_POLL_RATE", INT2NUM(GLUT_JOYSTICK_POLL_RATE)); rb_define_const(module, "GLUT_KEY_REPEAT_OFF", INT2NUM(GLUT_KEY_REPEAT_OFF)); rb_define_const(module, "GLUT_KEY_REPEAT_ON", INT2NUM(GLUT_KEY_REPEAT_ON)); rb_define_const(module, "GLUT_KEY_REPEAT_DEFAULT", INT2NUM(GLUT_KEY_REPEAT_DEFAULT)); rb_define_const(module, "GLUT_JOYSTICK_BUTTON_A", INT2NUM(GLUT_JOYSTICK_BUTTON_A)); rb_define_const(module, "GLUT_JOYSTICK_BUTTON_B", INT2NUM(GLUT_JOYSTICK_BUTTON_B)); rb_define_const(module, "GLUT_JOYSTICK_BUTTON_C", INT2NUM(GLUT_JOYSTICK_BUTTON_C)); rb_define_const(module, "GLUT_JOYSTICK_BUTTON_D", INT2NUM(GLUT_JOYSTICK_BUTTON_D)); rb_define_const(module, "GLUT_GAME_MODE_ACTIVE", INT2NUM(GLUT_GAME_MODE_ACTIVE)); rb_define_const(module, "GLUT_GAME_MODE_POSSIBLE", INT2NUM(GLUT_GAME_MODE_POSSIBLE)); rb_define_const(module, "GLUT_GAME_MODE_WIDTH", INT2NUM(GLUT_GAME_MODE_WIDTH)); rb_define_const(module, "GLUT_GAME_MODE_HEIGHT", INT2NUM(GLUT_GAME_MODE_HEIGHT)); rb_define_const(module, "GLUT_GAME_MODE_PIXEL_DEPTH", INT2NUM(GLUT_GAME_MODE_PIXEL_DEPTH)); rb_define_const(module, "GLUT_GAME_MODE_REFRESH_RATE", INT2NUM(GLUT_GAME_MODE_REFRESH_RATE)); rb_define_const(module, "GLUT_GAME_MODE_DISPLAY_CHANGED", INT2NUM(GLUT_GAME_MODE_DISPLAY_CHANGED)); callId = rb_intern("call"); WINDOW_CALLBACK_DEFINE(DisplayFunc); WINDOW_CALLBACK_DEFINE(ReshapeFunc); WINDOW_CALLBACK_DEFINE(KeyboardFunc); WINDOW_CALLBACK_DEFINE(MouseFunc); WINDOW_CALLBACK_DEFINE(MotionFunc); WINDOW_CALLBACK_DEFINE(PassiveMotionFunc); WINDOW_CALLBACK_DEFINE(EntryFunc); WINDOW_CALLBACK_DEFINE(VisibilityFunc); WINDOW_CALLBACK_DEFINE(SpecialFunc); WINDOW_CALLBACK_DEFINE(SpaceballMotionFunc); WINDOW_CALLBACK_DEFINE(SpaceballRotateFunc); WINDOW_CALLBACK_DEFINE(SpaceballButtonFunc); WINDOW_CALLBACK_DEFINE(ButtonBoxFunc); WINDOW_CALLBACK_DEFINE(DialsFunc); WINDOW_CALLBACK_DEFINE(TabletMotionFunc); WINDOW_CALLBACK_DEFINE(TabletButtonFunc); WINDOW_CALLBACK_DEFINE(OverlayDisplayFunc); WINDOW_CALLBACK_DEFINE(WindowStatusFunc); WINDOW_CALLBACK_DEFINE(KeyboardUpFunc); WINDOW_CALLBACK_DEFINE(SpecialUpFunc); /* special case, 2 params */ rb_define_module_function(module, "glutJoystickFunc",glut_JoystickFunc , 2); rb_global_variable(&JoystickFunc); JoystickFunc = rb_ary_new(); rb_gc_register_address(&idle_func); rb_gc_register_address(&timer_func); rb_gc_register_address(&menustate_func); } ruby-opengl-0.60.1.orig/ext/gl/0000755000000000000000000000000011377006423014703 5ustar rootrootruby-opengl-0.60.1.orig/ext/gl/gl-1.4.c0000644000000000000000000003113211377006423015751 0ustar rootroot/* * Copyright (C) 2007 Jan Dvorak * * This program is distributed under the terms of the MIT license. * See the included MIT-LICENSE file for the terms of this license. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "../common/common.h" /* OpenGL 1.4 functions */ GL_FUNC_LOAD_4(BlendFuncSeparate,GLvoid, GLenum,GLenum,GLenum,GLenum, "1.4") GL_FUNC_LOAD_1(FogCoordf,GLvoid, GLfloat, "1.4") GL_FUNC_LOAD_1(FogCoordd,GLvoid, GLdouble, "1.4") GL_FUNC_LOAD_2(PointParameteri,GLvoid, GLenum,GLint, "1.4") GL_FUNC_LOAD_2(PointParameterf,GLvoid, GLenum,GLfloat, "1.4") GL_FUNC_LOAD_3(SecondaryColor3b,GLvoid, GLbyte,GLbyte,GLbyte, "1.4") GL_FUNC_LOAD_3(SecondaryColor3d,GLvoid, GLdouble,GLdouble,GLdouble, "1.4") GL_FUNC_LOAD_3(SecondaryColor3f,GLvoid, GLfloat,GLfloat,GLfloat, "1.4") GL_FUNC_LOAD_3(SecondaryColor3i,GLvoid, GLint,GLint,GLint, "1.4") GL_FUNC_LOAD_3(SecondaryColor3s,GLvoid, GLshort,GLshort,GLshort, "1.4") GL_FUNC_LOAD_3(SecondaryColor3ub,GLvoid, GLubyte,GLubyte,GLubyte, "1.4") GL_FUNC_LOAD_3(SecondaryColor3ui,GLvoid, GLuint,GLuint,GLuint, "1.4") GL_FUNC_LOAD_3(SecondaryColor3us,GLvoid, GLushort,GLushort,GLushort, "1.4") GL_FUNC_LOAD_2(WindowPos2d,GLvoid, GLdouble,GLdouble, "1.4") GL_FUNC_LOAD_2(WindowPos2f,GLvoid, GLfloat,GLfloat, "1.4") GL_FUNC_LOAD_2(WindowPos2i,GLvoid, GLint,GLint, "1.4") GL_FUNC_LOAD_2(WindowPos2s,GLvoid, GLshort,GLshort, "1.4") GL_FUNC_LOAD_3(WindowPos3d,GLvoid, GLdouble,GLdouble,GLdouble, "1.4") GL_FUNC_LOAD_3(WindowPos3f,GLvoid, GLfloat,GLfloat,GLfloat, "1.4") GL_FUNC_LOAD_3(WindowPos3i,GLvoid, GLint,GLint,GLint, "1.4") GL_FUNC_LOAD_3(WindowPos3s,GLvoid, GLshort,GLshort,GLshort, "1.4") static void (APIENTRY * fptr_glFogCoordfv)(GLfloat *); static VALUE gl_FogCoordfv(obj,arg1) VALUE obj,arg1; { GLfloat coord; LOAD_GL_FUNC(glFogCoordfv,"1.4") Check_Type(arg1,T_ARRAY); ary2cflt(arg1,&coord,1); fptr_glFogCoordfv(&coord); CHECK_GLERROR return Qnil; } static void (APIENTRY * fptr_glFogCoorddv)(GLdouble *); static VALUE gl_FogCoorddv(obj,arg1) VALUE obj,arg1; { GLdouble coord; LOAD_GL_FUNC(glFogCoorddv,"1.4") Check_Type(arg1,T_ARRAY); ary2cdbl(arg1,&coord,1); fptr_glFogCoorddv(&coord); CHECK_GLERROR return Qnil; } extern VALUE g_FogCoord_ptr; static void (APIENTRY * fptr_glFogCoordPointer)(GLenum,GLsizei,const GLvoid *); static VALUE gl_FogCoordPointer(obj,arg1,arg2,arg3) VALUE obj,arg1,arg2,arg3; { GLenum type; GLsizei stride; LOAD_GL_FUNC(glFogCoordPointer,"1.4") type = (GLenum)NUM2INT(arg1); stride = (GLsizei)NUM2UINT(arg2); if (CheckBufferBinding(GL_ARRAY_BUFFER_BINDING)) { g_FogCoord_ptr = arg3; fptr_glFogCoordPointer(type, stride, (const GLvoid*)NUM2INT(arg3)); } else { VALUE data; data = pack_array_or_pass_string(GL_UNSIGNED_BYTE,arg3); rb_str_freeze(data); g_FogCoord_ptr = data; fptr_glFogCoordPointer(type, stride, (const GLvoid*)RSTRING_PTR(data)); } CHECK_GLERROR return Qnil; } static void (APIENTRY * fptr_glMultiDrawArrays)(GLenum,GLint*,GLsizei*,GLsizei); static VALUE gl_MultiDrawArrays(obj,arg1,arg2,arg3) VALUE obj,arg1,arg2,arg3; { GLenum mode; GLint *ary1; GLsizei *ary2; int len1,len2; LOAD_GL_FUNC(glMultiDrawArrays,"1.4") len1 = RARRAY_LEN(arg2); len2 = RARRAY_LEN(arg3); if (len1!=len2) rb_raise(rb_eArgError, "Passed arrays must have same length"); mode = (GLenum)NUM2INT(arg1); ary1 = ALLOC_N(GLint,len1); ary2 = ALLOC_N(GLsizei,len2); ary2cint(arg2,ary1,len1); ary2cint(arg3,ary2,len2); fptr_glMultiDrawArrays(mode,ary1,ary2,len1); xfree(ary1); xfree(ary2); CHECK_GLERROR return Qnil; } static void (APIENTRY * fptr_glMultiDrawElements)(GLenum,const GLsizei *,GLenum,GLvoid **,GLsizei); static VALUE gl_MultiDrawElements(argc,argv,obj) int argc; VALUE *argv; VALUE obj; { GLenum mode; GLenum type; GLsizei *counts; GLvoid **indices; GLint size; RArray *ary; int i; VALUE args[4]; LOAD_GL_FUNC(glMultiDrawElements,"1.4") switch (rb_scan_args(argc, argv, "31", &args[0], &args[1], &args[2],&args[3])) { default: case 3: if (CheckBufferBinding(GL_ELEMENT_ARRAY_BUFFER_BINDING)) rb_raise(rb_eArgError, "Element array buffer bound, but offsets array missing"); mode = (GLenum)NUM2INT(args[0]); type = (GLenum)NUM2INT(args[1]); Check_Type(args[2],T_ARRAY); ary = RARRAY(args[2]); size = RARRAY_LEN(ary); counts = ALLOC_N(GLsizei,size); indices = ALLOC_N(GLvoid*,size); for (i=0;i * * This program is distributed under the terms of the MIT license. * See the included MIT-LICENSE file for the terms of this license. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "../common/common.h" /* OpenGL ATI extensions */ /* #277 GL_ATI_draw_buffers */ static void (APIENTRY * fptr_glDrawBuffersATI)(GLsizei,const GLenum *); static VALUE gl_DrawBuffersATI(VALUE obj,VALUE arg1) { GLsizei size; GLenum *buffers; LOAD_GL_FUNC(glDrawBuffersATI,"GL_ATI_draw_buffers") Check_Type(arg1,T_ARRAY); size = RARRAY_LEN(arg1); buffers = ALLOC_N(GLenum,size); ary2cuint(arg1,buffers,size); fptr_glDrawBuffersATI(size,buffers); xfree(buffers); CHECK_GLERROR return Qnil; } void gl_init_functions_ext_ati(VALUE module) { /* #277 GL_ATI_draw_buffers */ rb_define_module_function(module, "glDrawBuffersATI", gl_DrawBuffersATI, 1); } ruby-opengl-0.60.1.orig/ext/gl/gl-ext-ext.c0000644000000000000000000010745611377006423017062 0ustar rootroot/* * Copyright (C) 2007 Jan Dvorak * * This program is distributed under the terms of the MIT license. * See the included MIT-LICENSE file for the terms of this license. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "../common/common.h" /* OpenGL EXT extensions */ /* Those are extensions that are not blessed by ARB committee but were created or agreed upon by multiple vendors */ /* #2 - GL_EXT_blend_color */ GL_FUNC_LOAD_4(BlendColorEXT,GLvoid, GLclampf,GLclampf,GLclampf,GLclampf, "GL_EXT_blend_color") /* #3 - GL_EXT_polygon_offset */ GL_FUNC_LOAD_2(PolygonOffsetEXT,GLvoid, GLfloat,GLfloat, "GL_EXT_polygon_offset") /* #20 - GL_EXT_texture_object */ GL_FUNC_GENOBJECTS_LOAD(GenTexturesEXT,"GL_EXT_texture_object") GL_FUNC_DELETEOBJECTS_LOAD(DeleteTexturesEXT,"GL_EXT_texture_object") GL_FUNC_LOAD_2(BindTextureEXT,GLvoid, GLenum,GLint, "GL_EXT_texture_object") static void (APIENTRY * fptr_glPrioritizeTexturesEXT)(GLsizei,const GLuint *,const GLclampf *); static VALUE gl_PrioritizeTexturesEXT(obj,arg1,arg2) VALUE obj,arg1,arg2; { GLuint *textures; GLclampf *priorities; GLsizei size; LOAD_GL_FUNC(glPrioritizeTexturesEXT,"GL_EXT_texture_object") Check_Type(arg1,T_ARRAY); Check_Type(arg2,T_ARRAY); if ((size = RARRAY_LEN(arg1)) != RARRAY_LEN(arg2)) rb_raise(rb_eArgError, "passed arrays must have the same length"); textures = ALLOC_N(GLuint,size); priorities = ALLOC_N(GLclampf,size); ary2cuint(arg1,textures,size); ary2cflt(arg2,priorities,size); fptr_glPrioritizeTexturesEXT(size,textures,priorities); xfree(textures); xfree(priorities); CHECK_GLERROR return Qnil; } static GLboolean (APIENTRY * fptr_glAreTexturesResidentEXT)(GLsizei,const GLuint *,GLboolean *); static VALUE gl_AreTexturesResidentEXT(obj,arg1) VALUE obj,arg1; { GLuint *textures; GLboolean *residences; GLsizei size; GLboolean r; VALUE retary; VALUE ary; int i; LOAD_GL_FUNC(glAreTexturesResidentEXT,"GL_EXT_texture_object") ary = rb_Array(arg1); size = RARRAY_LEN(ary); textures = ALLOC_N(GLuint,size); residences = ALLOC_N(GLboolean,size); ary2cuint(ary,textures,size); r = fptr_glAreTexturesResidentEXT(size,textures,residences); retary = rb_ary_new2(size); if (r==GL_TRUE) { /* all are resident */ for(i=0;i_MAX_VERTEX_ATTRIBS) rb_raise(rb_eArgError, "Index too large, maximum allowed value '%i'",_MAX_VERTEX_ATTRIBS); if (CheckBufferBinding(GL_ARRAY_BUFFER_BINDING)) { g_VertexAttrib_ptr[index] = arg5; fptr_glVertexAttribIPointerEXT(index,size,type,stride,(GLvoid *)NUM2INT(arg5)); } else { VALUE data; data = pack_array_or_pass_string(type,arg5); rb_str_freeze(data); g_VertexAttrib_ptr[index] = data; fptr_glVertexAttribIPointerEXT(index,size,type,stride,(GLvoid *)RSTRING_PTR(data)); } CHECK_GLERROR return Qnil; } GL_FUNC_LOAD_2(Uniform1uiEXT,GLvoid, GLint,GLuint, "GL_EXT_gpu_shader4") GL_FUNC_LOAD_3(Uniform2uiEXT,GLvoid, GLint,GLuint,GLuint, "GL_EXT_gpu_shader4") GL_FUNC_LOAD_4(Uniform3uiEXT,GLvoid, GLint,GLuint,GLuint,GLuint, "GL_EXT_gpu_shader4") GL_FUNC_LOAD_5(Uniform4uiEXT,GLvoid, GLint,GLuint,GLuint,GLuint,GLuint, "GL_EXT_gpu_shader4") #define GLUNIFORM_VFUNC(_name_,_type_,_conv_,_size_) \ static void (APIENTRY * fptr_gl##_name_)(GLint,GLsizei,const _type_ *); \ static VALUE \ gl_##_name_(obj,arg1,arg2) \ VALUE obj,arg1,arg2; \ { \ GLint location; \ GLsizei count; \ _type_ *value; \ LOAD_GL_FUNC(gl##_name_,"GL_EXT_gpu_shader4") \ Check_Type(arg2,T_ARRAY); \ count = RARRAY_LEN(arg2); \ if (count<=0 || (count % _size_) != 0) \ rb_raise(rb_eArgError, "Parameter array size must be multiplication of %i",_size_); \ location = (GLint)NUM2INT(arg1); \ value = ALLOC_N(_type_,count); \ _conv_(arg2,value,count); \ fptr_gl##_name_(location,count / _size_,value); \ xfree(value); \ CHECK_GLERROR \ return Qnil; \ } GLUNIFORM_VFUNC(Uniform1uivEXT,GLuint,ary2cuint,1) GLUNIFORM_VFUNC(Uniform2uivEXT,GLuint,ary2cuint,2) GLUNIFORM_VFUNC(Uniform3uivEXT,GLuint,ary2cuint,3) GLUNIFORM_VFUNC(Uniform4uivEXT,GLuint,ary2cuint,4) #undef GLUNIFORM_VFUNC static void (APIENTRY * fptr_glGetActiveUniformARB)(GLuint,GLuint,GLsizei,GLsizei*,GLint*,GLenum*,GLchar*); #define GETUNIFORM_FUNC(_name_,_type_) \ static void (APIENTRY * fptr_gl##_name_)(GLuint,GLint,_type_ *); \ static VALUE \ gl_##_name_(obj,arg1,arg2) \ VALUE obj,arg1,arg2; \ { \ GLuint program; \ GLint location; \ _type_ params[16]; \ GLint unused = 0; \ GLenum uniform_type = 0; \ GLint uniform_size = 0; \ \ LOAD_GL_FUNC(gl##_name_,"GL_EXT_gpu_shader4") \ LOAD_GL_FUNC(glGetActiveUniformARB,"GL_ARB_shader_objects") \ program = (GLuint)NUM2UINT(arg1); \ location = (GLint)NUM2INT(arg2); \ \ fptr_glGetActiveUniformARB(program,location,0,NULL,&unused,&uniform_type,NULL); \ CHECK_GLERROR \ if (uniform_type==0) \ rb_raise(rb_eTypeError, "Can't determine the uniform's type"); \ \ uniform_size = get_uniform_size(uniform_type); \ \ memset(params,0,16*sizeof(_type_)); \ fptr_gl##_name_(program,location,params); \ RET_ARRAY_OR_SINGLE(uniform_size,RETCONV_##_type_,params) \ } GETUNIFORM_FUNC(GetUniformuivEXT,GLuint) #undef GETUNIFORM_FUNC static void (APIENTRY * fptr_glBindFragDataLocationEXT)(GLuint,GLuint,const GLchar *); static VALUE gl_BindFragDataLocationEXT(VALUE obj,VALUE arg1,VALUE arg2,VALUE arg3) { LOAD_GL_FUNC(glBindFragDataLocationEXT,"GL_EXT_gpu_shader4") Check_Type(arg3,T_STRING); fptr_glBindFragDataLocationEXT(NUM2UINT(arg1),NUM2UINT(arg2),RSTRING_PTR(arg3)); CHECK_GLERROR return Qnil; } static GLint (APIENTRY * fptr_glGetFragDataLocationEXT)(GLuint,const GLchar *); static VALUE gl_GetFragDataLocationEXT(VALUE obj,VALUE arg1,VALUE arg2) { GLint ret; LOAD_GL_FUNC(glGetFragDataLocationEXT,"GL_EXT_gpu_shader4") Check_Type(arg2,T_STRING); ret = fptr_glGetFragDataLocationEXT(NUM2UINT(arg1),RSTRING_PTR(arg2)); CHECK_GLERROR return INT2NUM(ret); } /* #327 - GL_EXT_draw_instanced */ GL_FUNC_LOAD_4(DrawArraysInstancedEXT,GLvoid, GLenum,GLint,GLsizei,GLsizei, "GL_EXT_draw_instanced") static void (APIENTRY * fptr_glDrawElementsInstancedEXT)(GLenum,GLsizei,GLenum,const GLvoid *,GLsizei); static VALUE gl_DrawElementsInstancedEXT(obj,arg1,arg2,arg3,arg4,arg5) VALUE obj,arg1,arg2,arg3,arg4,arg5; { GLenum mode; GLsizei count; GLenum type; GLsizei primcount; LOAD_GL_FUNC(glDrawElementsInstancedEXT,"GL_EXT_draw_instanced") mode = (GLenum)NUM2INT(arg1); count = (GLsizei)NUM2UINT(arg2); type = (GLenum)NUM2INT(arg3); primcount = (GLsizei)NUM2INT(arg5); if (CheckBufferBinding(GL_ELEMENT_ARRAY_BUFFER_BINDING)) { fptr_glDrawElementsInstancedEXT(mode, count, type, (const GLvoid*)NUM2INT(arg4), primcount); } else { VALUE data; data = pack_array_or_pass_string(type,arg4); fptr_glDrawElementsInstancedEXT(mode, count, type, (const GLvoid*)RSTRING_PTR(data), primcount); } CHECK_GLERROR return Qnil; } /* #330 - GL_EXT_texture_buffer_object */ GL_FUNC_LOAD_3(TexBufferEXT,GLvoid, GLenum,GLenum,GLenum, "GL_EXT_texture_buffer_object") /* #343 - GL_EXT_texture_integer */ GL_FUNC_LOAD_4(ClearColorIiEXT,GLvoid, GLint,GLint,GLint,GLint, "GL_EXT_texture_integer") GL_FUNC_LOAD_4(ClearColorIuiEXT,GLvoid, GLuint,GLuint,GLuint,GLuint, "GL_EXT_texture_integer") #define TEXPARAMETER_VFUNC(_name_,_type_,_conv_) \ static void (APIENTRY * fptr_gl##_name_)(GLenum,GLenum,_type_ *); \ static VALUE \ gl_##_name_(obj,arg1,arg2,arg3) \ VALUE obj,arg1,arg2,arg3; \ { \ GLenum target; \ GLenum pname; \ _type_ params[4] = {0,0,0,0}; \ LOAD_GL_FUNC(gl##_name_,"GL_EXT_texture_integer") \ target = (GLenum)NUM2UINT(arg1); \ pname = (GLenum)NUM2UINT(arg2); \ Check_Type(arg3,T_ARRAY); \ _conv_(arg3,params,4); \ fptr_gl##_name_(target,pname,params); \ CHECK_GLERROR \ return Qnil; \ } TEXPARAMETER_VFUNC(TexParameterIivEXT,GLint,ary2cint) TEXPARAMETER_VFUNC(TexParameterIuivEXT,GLuint,ary2cuint) #undef TEXPARAMETER_VFUNC #define GETTEXPARAMETER_VFUNC(_name_,_type_,_conv_) \ static void (APIENTRY * fptr_gl##_name_)(GLenum,GLenum,_type_ *); \ static VALUE \ gl_##_name_(obj,arg1,arg2) \ VALUE obj,arg1,arg2; \ { \ GLenum target; \ GLenum pname; \ _type_ params[4] = {0,0,0,0}; \ int size; \ LOAD_GL_FUNC(gl##_name_,"GL_EXT_texture_integer") \ target = (GLenum)NUM2INT(arg1); \ pname = (GLenum)NUM2INT(arg2); \ switch(pname) { \ case GL_TEXTURE_BORDER_COLOR: \ case GL_TEXTURE_BORDER_VALUES_NV: \ case GL_POST_TEXTURE_FILTER_BIAS_SGIX: \ case GL_POST_TEXTURE_FILTER_SCALE_SGIX: \ size = 4; \ break; \ default: \ size = 1; \ break; \ } \ fptr_gl##_name_(target,pname,params); \ RET_ARRAY_OR_SINGLE_BOOL(size,_conv_,pname,params) \ } GETTEXPARAMETER_VFUNC(GetTexParameterIivEXT,GLint,cond_GLBOOL2RUBY) GETTEXPARAMETER_VFUNC(GetTexParameterIuivEXT,GLuint,cond_GLBOOL2RUBY_U) #undef GETTEXPARAMETER_VFUNC void gl_init_functions_ext_ext(VALUE module) { /* #2 - GL_EXT_blend_color */ rb_define_module_function(module, "glBlendColorEXT", gl_BlendColorEXT, 4); /* #3 - GL_EXT_polygon_offset */ rb_define_module_function(module, "glPolygonOffsetEXT", gl_PolygonOffsetEXT, 2); /* #20 - GL_EXT_texture_object */ rb_define_module_function(module, "glGenTexturesEXT", gl_GenTexturesEXT, 1); rb_define_module_function(module, "glDeleteTexturesEXT", gl_DeleteTexturesEXT, 1); rb_define_module_function(module, "glBindTextureEXT", gl_BindTextureEXT, 2); rb_define_module_function(module, "glPrioritizeTexturesEXT", gl_PrioritizeTexturesEXT, 2); rb_define_module_function(module, "glAreTexturesResidentEXT", gl_AreTexturesResidentEXT, 1); rb_define_module_function(module, "glIsTextureEXT", gl_IsTextureEXT, 1); /* #37 - GL_EXT_blend_minmax */ rb_define_module_function(module, "glBlendEquationEXT", gl_BlendEquationEXT, 1); /* #54 - GL_EXT_point_parameters */ rb_define_module_function(module, "glPointParameterfEXT", gl_PointParameterfEXT, 2); rb_define_module_function(module, "glPointParameterfvEXT", gl_PointParameterfvEXT, 2); /* #97 - GL_EXT_compiled_vertex_array */ rb_define_module_function(module, "glLockArraysEXT", gl_LockArraysEXT, 2); rb_define_module_function(module, "glUnlockArraysEXT", gl_UnlockArraysEXT, 0); /* #112 - GL_EXT_draw_range_elements */ rb_define_module_function(module, "glDrawRangeElementsEXT", gl_DrawRangeElementsEXT, 6); /* #145 - GL_EXT_secondary_color */ rb_define_module_function(module, "glSecondaryColor3bEXT", gl_SecondaryColor3bEXT, 3); rb_define_module_function(module, "glSecondaryColor3dEXT", gl_SecondaryColor3dEXT, 3); rb_define_module_function(module, "glSecondaryColor3fEXT", gl_SecondaryColor3fEXT, 3); rb_define_module_function(module, "glSecondaryColor3iEXT", gl_SecondaryColor3iEXT, 3); rb_define_module_function(module, "glSecondaryColor3sEXT", gl_SecondaryColor3sEXT, 3); rb_define_module_function(module, "glSecondaryColor3ubEXT", gl_SecondaryColor3ubEXT, 3); rb_define_module_function(module, "glSecondaryColor3uiEXT", gl_SecondaryColor3uiEXT, 3); rb_define_module_function(module, "glSecondaryColor3usEXT", gl_SecondaryColor3usEXT, 3); rb_define_module_function(module, "glSecondaryColor3bvEXT", gl_SecondaryColor3bvEXT, 1); rb_define_module_function(module, "glSecondaryColor3dvEXT", gl_SecondaryColor3dvEXT, 1); rb_define_module_function(module, "glSecondaryColor3fvEXT", gl_SecondaryColor3fvEXT, 1); rb_define_module_function(module, "glSecondaryColor3ivEXT", gl_SecondaryColor3ivEXT, 1); rb_define_module_function(module, "glSecondaryColor3svEXT", gl_SecondaryColor3svEXT, 1); rb_define_module_function(module, "glSecondaryColor3ubvEXT", gl_SecondaryColor3ubvEXT, 1); rb_define_module_function(module, "glSecondaryColor3uivEXT", gl_SecondaryColor3uivEXT, 1); rb_define_module_function(module, "glSecondaryColor3usvEXT", gl_SecondaryColor3usvEXT, 1); rb_define_module_function(module, "glSecondaryColorPointerEXT", gl_SecondaryColorPointerEXT, 4); /* #148 - GL_EXT_multi_draw_arrays */ rb_define_module_function(module, "glMultiDrawArraysEXT", gl_MultiDrawArraysEXT, 3); rb_define_module_function(module, "glMultiDrawElementsEXT", gl_MultiDrawElementsEXT, -1); /* #149 - GL_EXT_fog_coord */ rb_define_module_function(module, "glFogCoordfEXT", gl_FogCoordfEXT, 1); rb_define_module_function(module, "glFogCoorddEXT", gl_FogCoorddEXT, 1); rb_define_module_function(module, "glFogCoordfvEXT", gl_FogCoordfvEXT, 1); rb_define_module_function(module, "glFogCoorddvEXT", gl_FogCoorddvEXT, 1); rb_define_module_function(module, "glFogCoordPointerEXT", gl_FogCoordPointerEXT, 3); /* #173 - GL_EXT_blend_func_separate */ rb_define_module_function(module, "glBlendFuncSeparateEXT", gl_BlendFuncSeparateEXT, 4); /* #268 - GL_EXT_stencil_two_side */ rb_define_module_function(module, "glActiveStencilFaceEXT", gl_ActiveStencilFaceEXT, 1); /* #297 - GL_EXT_depth_bounds_test */ rb_define_module_function(module, "glDepthBoundsEXT", gl_DepthBoundsEXT, 2); /* #299 - GL_EXT_blend_equation_separate */ rb_define_module_function(module, "glBlendEquationSeparateEXT", gl_BlendEquationSeparateEXT, 2); /* #310 - GL_EXT_framebuffer_object */ rb_define_module_function(module, "glIsRenderbufferEXT", gl_IsRenderbufferEXT, 1); rb_define_module_function(module, "glBindRenderbufferEXT", gl_BindRenderbufferEXT, 2); rb_define_module_function(module, "glDeleteRenderbuffersEXT", gl_DeleteRenderbuffersEXT, 1); rb_define_module_function(module, "glGenRenderbuffersEXT", gl_GenRenderbuffersEXT, 1); rb_define_module_function(module, "glRenderbufferStorageEXT", gl_RenderbufferStorageEXT, 4); rb_define_module_function(module, "glGetRenderbufferParameterivEXT", gl_GetRenderbufferParameterivEXT, 2); rb_define_module_function(module, "glIsFramebufferEXT", gl_IsFramebufferEXT, 1); rb_define_module_function(module, "glBindFramebufferEXT", gl_BindFramebufferEXT, 2); rb_define_module_function(module, "glDeleteFramebuffersEXT", gl_DeleteFramebuffersEXT, 1); rb_define_module_function(module, "glGenFramebuffersEXT", gl_GenFramebuffersEXT, 1); rb_define_module_function(module, "glCheckFramebufferStatusEXT", gl_CheckFramebufferStatusEXT, 1); rb_define_module_function(module, "glFramebufferTexture1DEXT", gl_FramebufferTexture1DEXT, 5); rb_define_module_function(module, "glFramebufferTexture2DEXT", gl_FramebufferTexture2DEXT, 5); rb_define_module_function(module, "glFramebufferTexture3DEXT", gl_FramebufferTexture3DEXT, 6); rb_define_module_function(module, "glFramebufferRenderbufferEXT", gl_FramebufferRenderbufferEXT, 4); rb_define_module_function(module, "glGetFramebufferAttachmentParameterivEXT", gl_GetFramebufferAttachmentParameterivEXT, 3); rb_define_module_function(module, "glGenerateMipmapEXT", gl_GenerateMipmapEXT, 1); /* #314 - GL_EXT_stencil_clear_tag */ rb_define_module_function(module, "glStencilClearTagEXT", gl_StencilClearTagEXT, 2); /* #316 - GL_EXT_framebuffer_blit */ rb_define_module_function(module, "glBlitFramebufferEXT", gl_BlitFramebufferEXT, 10); /* #317 - GL_EXT_framebuffer_multisample */ rb_define_module_function(module, "glRenderbufferStorageMultisampleEXT", gl_RenderbufferStorageMultisampleEXT, 5); /* #319 - GL_EXT_timer_query */ rb_define_module_function(module, "glGetQueryObjecti64vEXT", gl_GetQueryObjecti64vEXT, 2); rb_define_module_function(module, "glGetQueryObjectui64vEXT", gl_GetQueryObjectui64vEXT, 2); /* #320 - GL_EXT_gpu_program_parameters */ rb_define_module_function(module, "glProgramEnvParameters4fvEXT", gl_ProgramEnvParameters4fvEXT, 3); rb_define_module_function(module, "glProgramLocalParameters4fvEXT", gl_ProgramLocalParameters4fvEXT, 3); /* #324 - GL_EXT_geometry_shader4 */ rb_define_module_function(module, "glProgramParameteriEXT", gl_ProgramParameteriEXT, 3); /* #326 - GL_EXT_gpu_shader4 */ rb_define_module_function(module, "glVertexAttribI1iEXT", gl_VertexAttribI1iEXT, 2); rb_define_module_function(module, "glVertexAttribI2iEXT", gl_VertexAttribI2iEXT, 3); rb_define_module_function(module, "glVertexAttribI3iEXT", gl_VertexAttribI3iEXT, 4); rb_define_module_function(module, "glVertexAttribI4iEXT", gl_VertexAttribI4iEXT, 5); rb_define_module_function(module, "glVertexAttribI1uiEXT", gl_VertexAttribI1uiEXT, 2); rb_define_module_function(module, "glVertexAttribI2uiEXT", gl_VertexAttribI2uiEXT, 3); rb_define_module_function(module, "glVertexAttribI3uiEXT", gl_VertexAttribI3uiEXT, 4); rb_define_module_function(module, "glVertexAttribI4uiEXT", gl_VertexAttribI4uiEXT, 5); rb_define_module_function(module, "glVertexAttribI1ivEXT", gl_VertexAttribI1ivEXT, 2); rb_define_module_function(module, "glVertexAttribI2ivEXT", gl_VertexAttribI2ivEXT, 2); rb_define_module_function(module, "glVertexAttribI3ivEXT", gl_VertexAttribI3ivEXT, 2); rb_define_module_function(module, "glVertexAttribI4ivEXT", gl_VertexAttribI4ivEXT, 2); rb_define_module_function(module, "glVertexAttribI1uivEXT", gl_VertexAttribI1uivEXT, 2); rb_define_module_function(module, "glVertexAttribI2uivEXT", gl_VertexAttribI2uivEXT, 2); rb_define_module_function(module, "glVertexAttribI3uivEXT", gl_VertexAttribI3uivEXT, 2); rb_define_module_function(module, "glVertexAttribI4uivEXT", gl_VertexAttribI4uivEXT, 2); rb_define_module_function(module, "glVertexAttribI4bvEXT", gl_VertexAttribI4bvEXT, 2); rb_define_module_function(module, "glVertexAttribI4svEXT", gl_VertexAttribI4svEXT, 2); rb_define_module_function(module, "glVertexAttribI4ubvEXT", gl_VertexAttribI4ubvEXT, 2); rb_define_module_function(module, "glVertexAttribI4usvEXT", gl_VertexAttribI4usvEXT, 2); rb_define_module_function(module, "glVertexAttribIPointerEXT", gl_VertexAttribIPointerEXT, 5); rb_define_module_function(module, "glGetVertexAttribIivEXT", gl_GetVertexAttribIivEXT, 2); rb_define_module_function(module, "glGetVertexAttribIuivEXT", gl_GetVertexAttribIuivEXT, 2); rb_define_module_function(module, "glUniform1uiEXT", gl_Uniform1uiEXT, 2); rb_define_module_function(module, "glUniform2uiEXT", gl_Uniform2uiEXT, 3); rb_define_module_function(module, "glUniform3uiEXT", gl_Uniform3uiEXT, 4); rb_define_module_function(module, "glUniform4uiEXT", gl_Uniform4uiEXT, 5); rb_define_module_function(module, "glUniform1uivEXT", gl_Uniform1uivEXT, 2); rb_define_module_function(module, "glUniform2uivEXT", gl_Uniform2uivEXT, 2); rb_define_module_function(module, "glUniform3uivEXT", gl_Uniform3uivEXT, 2); rb_define_module_function(module, "glUniform4uivEXT", gl_Uniform4uivEXT, 2); rb_define_module_function(module, "glGetUniformuivEXT", gl_GetUniformuivEXT, 2); rb_define_module_function(module, "glBindFragDataLocationEXT", gl_BindFragDataLocationEXT, 3); rb_define_module_function(module, "glGetFragDataLocationEXT", gl_GetFragDataLocationEXT, 2); /* #327 - GL_EXT_draw_instanced */ rb_define_module_function(module, "glDrawArraysInstancedEXT", gl_DrawArraysInstancedEXT, 4); rb_define_module_function(module, "glDrawElementsInstancedEXT", gl_DrawElementsInstancedEXT, 5); /* #330 - GL_EXT_texture_buffer_object */ rb_define_module_function(module, "glTexBufferEXT", gl_TexBufferEXT, 3); /* #343 - GL_EXT_texture_integer */ rb_define_module_function(module, "glClearColorIiEXT", gl_ClearColorIiEXT, 4); rb_define_module_function(module, "glClearColorIuiEXT", gl_ClearColorIuiEXT, 4); rb_define_module_function(module, "glTexParameterIivEXT", gl_TexParameterIivEXT, 3); rb_define_module_function(module, "glTexParameterIuivEXT", gl_TexParameterIuivEXT, 3); rb_define_module_function(module, "glGetTexParameterIivEXT", gl_GetTexParameterIivEXT, 2); rb_define_module_function(module, "glGetTexParameterIuivEXT", gl_GetTexParameterIuivEXT, 2); } ruby-opengl-0.60.1.orig/ext/gl/gl-2.0.c0000644000000000000000000006145211377006423015756 0ustar rootroot/* * Copyright (C) 2007 Jan Dvorak * * This program is distributed under the terms of the MIT license. * See the included MIT-LICENSE file for the terms of this license. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "../common/common.h" GL_FUNC_LOAD_2(BlendEquationSeparate,GLvoid, GLenum,GLenum, "2.0") GL_FUNC_LOAD_4(StencilOpSeparate,GLvoid, GLenum,GLenum,GLenum,GLenum, "2.0") GL_FUNC_LOAD_2(AttachShader,GLvoid, GLuint,GLuint, "2.0") GL_FUNC_LOAD_1(CompileShader,GLvoid, GLuint, "2.0") GL_FUNC_LOAD_1(DeleteProgram,GLvoid, GLuint, "2.0") GL_FUNC_LOAD_1(DeleteShader,GLvoid, GLuint, "2.0") GL_FUNC_LOAD_2(DetachShader,GLvoid, GLuint,GLuint, "2.0") GL_FUNC_LOAD_1(DisableVertexAttribArray,GLvoid, GLuint, "2.0") GL_FUNC_LOAD_1(EnableVertexAttribArray,GLvoid, GLuint, "2.0") GL_FUNC_LOAD_1(LinkProgram,GLvoid, GLuint, "2.0") GL_FUNC_LOAD_1(UseProgram,GLvoid, GLuint, "2.0") GL_FUNC_LOAD_1(ValidateProgram,GLvoid, GLuint, "2.0") GL_FUNC_LOAD_4(StencilFuncSeparate,GLvoid, GLenum,GLenum,GLint,GLuint, "2.0") GL_FUNC_LOAD_2(StencilMaskSeparate,GLvoid, GLenum,GLuint, "2.0") GL_FUNC_LOAD_0(CreateProgram,GLuint, "2.0") GL_FUNC_LOAD_1(CreateShader,GLuint, GLenum, "2.0") GL_FUNC_LOAD_1(IsProgram,GLboolean, GLuint, "2.0") GL_FUNC_LOAD_1(IsShader,GLboolean, GLuint, "2.0") GL_FUNC_LOAD_2(Uniform1f,GLvoid, GLint,GLfloat, "2.0") GL_FUNC_LOAD_2(Uniform1i,GLvoid, GLint,GLint, "2.0") GL_FUNC_LOAD_3(Uniform2f,GLvoid, GLint,GLfloat,GLfloat, "2.0") GL_FUNC_LOAD_3(Uniform2i,GLvoid, GLint,GLint,GLint, "2.0") GL_FUNC_LOAD_4(Uniform3f,GLvoid, GLint,GLfloat,GLfloat,GLfloat, "2.0") GL_FUNC_LOAD_4(Uniform3i,GLvoid, GLint,GLint,GLint,GLint, "2.0") GL_FUNC_LOAD_5(Uniform4f,GLvoid, GLint,GLfloat,GLfloat,GLfloat,GLfloat, "2.0") GL_FUNC_LOAD_5(Uniform4i,GLvoid, GLint,GLint,GLint,GLint,GLint, "2.0") GL_FUNC_LOAD_2(VertexAttrib1d,GLvoid, GLuint,GLdouble, "2.0") GL_FUNC_LOAD_2(VertexAttrib1f,GLvoid, GLuint,GLfloat, "2.0") GL_FUNC_LOAD_2(VertexAttrib1s,GLvoid, GLuint,GLshort, "2.0") GL_FUNC_LOAD_3(VertexAttrib2d,GLvoid, GLuint,GLdouble,GLdouble, "2.0") GL_FUNC_LOAD_3(VertexAttrib2f,GLvoid, GLuint,GLfloat,GLfloat, "2.0") GL_FUNC_LOAD_3(VertexAttrib2s,GLvoid, GLuint,GLshort,GLshort, "2.0") GL_FUNC_LOAD_4(VertexAttrib3d,GLvoid, GLuint,GLdouble,GLdouble,GLdouble, "2.0") GL_FUNC_LOAD_4(VertexAttrib3f,GLvoid, GLuint,GLfloat,GLfloat,GLfloat, "2.0") GL_FUNC_LOAD_4(VertexAttrib3s,GLvoid, GLuint,GLshort,GLshort,GLshort, "2.0") GL_FUNC_LOAD_5(VertexAttrib4d,GLvoid, GLuint,GLdouble,GLdouble,GLdouble,GLdouble, "2.0") GL_FUNC_LOAD_5(VertexAttrib4f,GLvoid, GLuint,GLfloat,GLfloat,GLfloat,GLfloat, "2.0") GL_FUNC_LOAD_5(VertexAttrib4s,GLvoid, GLuint,GLshort,GLshort,GLshort,GLshort, "2.0") GL_FUNC_LOAD_5(VertexAttrib4Nub,GLvoid, GLuint,GLubyte,GLubyte,GLubyte,GLubyte, "2.0") static void (APIENTRY * fptr_glDrawBuffers)(GLsizei,GLenum *); static VALUE gl_DrawBuffers(obj,arg1) VALUE obj,arg1; { GLsizei size; GLenum *buffers; LOAD_GL_FUNC(glDrawBuffers,"2.0") Check_Type(arg1,T_ARRAY); size = RARRAY_LEN(arg1); buffers = ALLOC_N(GLenum,size); ary2cuint(arg1,buffers,size); fptr_glDrawBuffers(size,buffers); xfree(buffers); CHECK_GLERROR return Qnil; } static void (APIENTRY * fptr_glBindAttribLocation)(GLuint,GLuint,GLchar *); static VALUE gl_BindAttribLocation(obj,arg1,arg2,arg3) VALUE obj,arg1,arg2,arg3; { GLuint program; GLuint index; LOAD_GL_FUNC(glBindAttribLocation,"2.0") program = (GLuint)NUM2UINT(arg1); index = (GLuint)NUM2UINT(arg2); Check_Type(arg3, T_STRING); fptr_glBindAttribLocation(program,index,RSTRING_PTR(arg3)); CHECK_GLERROR return Qnil; } static void (APIENTRY * fptr_glGetProgramiv)(GLuint,GLenum,GLint *); static VALUE gl_GetProgramiv(obj,arg1,arg2) VALUE obj,arg1,arg2; { GLuint program; GLenum pname; GLint params = 0; LOAD_GL_FUNC(glGetProgramiv,"2.0") program = (GLuint)NUM2UINT(arg1); pname = (GLenum)NUM2INT(arg2); fptr_glGetProgramiv(program,pname,¶ms); CHECK_GLERROR return cond_GLBOOL2RUBY(pname,params); } static void (APIENTRY * fptr_glGetActiveAttrib)(GLuint,GLuint,GLsizei,GLsizei *,GLint *,GLenum *,GLchar *); static VALUE gl_GetActiveAttrib(obj,arg1,arg2) VALUE obj,arg1,arg2; { GLuint program; GLuint index; GLsizei max_size = 0; GLsizei written = 0; GLint attrib_size = 0; GLenum attrib_type = 0; VALUE buffer; VALUE retary; LOAD_GL_FUNC(glGetActiveAttrib,"2.0") LOAD_GL_FUNC(glGetProgramiv,"2.0") program = (GLuint)NUM2UINT(arg1); index = (GLuint)NUM2UINT(arg2); fptr_glGetProgramiv(program,GL_ACTIVE_ATTRIBUTE_MAX_LENGTH,&max_size); CHECK_GLERROR if (max_size==0) rb_raise(rb_eTypeError, "Can't determine maximum attribute name length"); buffer = allocate_buffer_with_string(max_size-1); fptr_glGetActiveAttrib(program,index,max_size,&written,&attrib_size,&attrib_type,RSTRING_PTR(buffer)); retary = rb_ary_new2(3); rb_ary_push(retary, INT2NUM(attrib_size)); rb_ary_push(retary, INT2NUM(attrib_type)); rb_ary_push(retary, buffer); CHECK_GLERROR return retary; } static void (APIENTRY * fptr_glGetActiveUniform)(GLuint,GLuint,GLsizei,GLsizei*,GLint*,GLenum*,GLchar*); static VALUE gl_GetActiveUniform(obj,arg1,arg2) VALUE obj,arg1,arg2; { GLuint program; GLuint index; GLsizei max_size = 0; GLsizei written = 0; GLint uniform_size = 0; GLenum uniform_type = 0; VALUE buffer; VALUE retary; LOAD_GL_FUNC(glGetActiveUniform,"2.0") LOAD_GL_FUNC(glGetProgramiv,"2.0") program = (GLuint)NUM2UINT(arg1); index = (GLuint)NUM2UINT(arg2); fptr_glGetProgramiv(program,GL_ACTIVE_UNIFORM_MAX_LENGTH,&max_size); CHECK_GLERROR if (max_size==0) rb_raise(rb_eTypeError, "Can't determine maximum uniform name length"); buffer = allocate_buffer_with_string(max_size-1); fptr_glGetActiveUniform(program,index,max_size,&written,&uniform_size,&uniform_type,RSTRING_PTR(buffer)); retary = rb_ary_new2(3); rb_ary_push(retary, INT2NUM(uniform_size)); rb_ary_push(retary, INT2NUM(uniform_type)); rb_ary_push(retary, buffer); CHECK_GLERROR return retary; } static void (APIENTRY * fptr_glGetAttachedShaders)(GLuint,GLsizei,GLsizei *,GLuint *); static VALUE gl_GetAttachedShaders(obj,arg1) VALUE obj,arg1; { GLuint program; GLint shaders_num = 0; GLuint *shaders; GLsizei count = 0; LOAD_GL_FUNC(glGetAttachedShaders,"2.0") LOAD_GL_FUNC(glGetProgramiv,"2.0") program = (GLuint)NUM2UINT(arg1); fptr_glGetProgramiv(program,GL_ATTACHED_SHADERS,&shaders_num); CHECK_GLERROR if (shaders_num<=0) return Qnil; shaders = ALLOC_N(GLuint,shaders_num); fptr_glGetAttachedShaders(program,shaders_num,&count,shaders); RET_ARRAY_OR_SINGLE_FREE(count,RETCONV_GLuint,shaders) } static GLint (APIENTRY * fptr_glGetAttribLocation)(GLuint, GLchar *); static VALUE gl_GetAttribLocation(obj,arg1,arg2) VALUE obj,arg1,arg2; { GLuint program; GLint ret; LOAD_GL_FUNC(glGetAttribLocation,"2.0") program=(GLuint)NUM2UINT(arg1); Check_Type(arg2,T_STRING); ret = fptr_glGetAttribLocation(program,RSTRING_PTR(arg2)); CHECK_GLERROR return INT2NUM(ret); } static void (APIENTRY * fptr_glGetProgramInfoLog)(GLuint,GLsizei,GLsizei *,GLchar *); static VALUE gl_GetProgramInfoLog(obj,arg1) VALUE obj,arg1; { GLuint program; GLint max_size = 0; GLsizei ret_length = 0; VALUE buffer; LOAD_GL_FUNC(glGetProgramInfoLog,"2.0") LOAD_GL_FUNC(glGetProgramiv,"2.0") program = (GLuint)NUM2UINT(arg1); fptr_glGetProgramiv(program,GL_INFO_LOG_LENGTH,&max_size); CHECK_GLERROR if (max_size<=0) return rb_str_new2(""); buffer = allocate_buffer_with_string(max_size); fptr_glGetProgramInfoLog(program,max_size,&ret_length,RSTRING_PTR(buffer)); CHECK_GLERROR return buffer; } static void (APIENTRY * fptr_glGetShaderiv)(GLuint,GLenum,GLint *); static VALUE gl_GetShaderiv(obj,arg1,arg2) VALUE obj,arg1,arg2; { GLuint program; GLenum pname; GLint params = 0; LOAD_GL_FUNC(glGetShaderiv,"2.0") program = (GLuint)NUM2UINT(arg1); pname = (GLenum)NUM2INT(arg2); fptr_glGetShaderiv(program,pname,¶ms); CHECK_GLERROR return cond_GLBOOL2RUBY(pname,params); } static void (APIENTRY * fptr_glGetShaderInfoLog)(GLuint,GLsizei,GLsizei *,GLchar *); static VALUE gl_GetShaderInfoLog(obj,arg1) VALUE obj,arg1; { GLuint program; GLint max_size = 0; GLsizei ret_length = 0; VALUE ret_buffer; GLchar *buffer; LOAD_GL_FUNC(glGetShaderInfoLog,"2.0") LOAD_GL_FUNC(glGetShaderiv,"2.0") program = (GLuint)NUM2UINT(arg1); fptr_glGetShaderiv(program,GL_INFO_LOG_LENGTH,&max_size); CHECK_GLERROR if (max_size<=0) return rb_str_new2(""); buffer = ALLOC_N(GLchar,max_size+1); memset(buffer,0,sizeof(GLchar) * (max_size+1)); fptr_glGetShaderInfoLog(program,max_size,&ret_length,buffer); ret_buffer = rb_str_new(buffer, ret_length); xfree(buffer); CHECK_GLERROR return ret_buffer; } static void (APIENTRY * fptr_glGetShaderSource)(GLuint,GLsizei,GLsizei *,GLchar *); static VALUE gl_GetShaderSource(obj,arg1) VALUE obj,arg1; { GLuint shader; GLint max_size = 0; GLsizei ret_length = 0; VALUE buffer; LOAD_GL_FUNC(glGetShaderSource,"2.0") LOAD_GL_FUNC(glGetShaderiv,"2.0") shader = (GLuint)NUM2UINT(arg1); fptr_glGetShaderiv(shader,GL_SHADER_SOURCE_LENGTH,&max_size); CHECK_GLERROR if (max_size==0) rb_raise(rb_eTypeError, "Can't determine maximum shader source length"); buffer = allocate_buffer_with_string(max_size-1); fptr_glGetShaderSource(shader,max_size,&ret_length,RSTRING_PTR(buffer)); CHECK_GLERROR return buffer; } static GLint (APIENTRY * fptr_glGetUniformLocation)(GLuint,const GLchar*); static VALUE gl_GetUniformLocation(obj,arg1,arg2) VALUE obj,arg1,arg2; { GLuint program; GLint ret; LOAD_GL_FUNC(glGetUniformLocation,"2.0") program=(GLuint)NUM2UINT(arg1); Check_Type(arg2,T_STRING); ret = fptr_glGetUniformLocation(program,RSTRING_PTR(arg2)); CHECK_GLERROR return INT2NUM(ret); } #define GETUNIFORM_FUNC(_name_,_type_) \ static void (APIENTRY * fptr_gl##_name_)(GLuint,GLint,_type_ *); \ static VALUE \ gl_##_name_(obj,arg1,arg2) \ VALUE obj,arg1,arg2; \ { \ GLuint program; \ GLint location; \ _type_ params[16]; \ GLint unused = 0; \ GLenum uniform_type = 0; \ GLint uniform_size = 0; \ \ LOAD_GL_FUNC(gl##_name_,"2.0") \ LOAD_GL_FUNC(glGetActiveUniform,"2.0") \ program = (GLuint)NUM2UINT(arg1); \ location = (GLint)NUM2INT(arg2); \ \ fptr_glGetActiveUniform(program,location,0,NULL,&unused,&uniform_type,NULL); \ CHECK_GLERROR \ if (uniform_type==0) \ rb_raise(rb_eTypeError, "Can't determine the uniform's type"); \ \ uniform_size = get_uniform_size(uniform_type); \ \ memset(params,0,16*sizeof(_type_)); \ fptr_gl##_name_(program,location,params); \ RET_ARRAY_OR_SINGLE(uniform_size,RETCONV_##_type_,params) \ } GETUNIFORM_FUNC(GetUniformfv,GLfloat) GETUNIFORM_FUNC(GetUniformiv,GLint) #undef GETUNIFORM_FUNC #define GETVERTEXATTRIB_FUNC(_name_,_type_) \ static void (APIENTRY * fptr_gl##_name_)(GLuint,GLenum,_type_ *); \ static VALUE \ gl_##_name_(obj,arg1,arg2) \ VALUE obj,arg1,arg2; \ { \ GLuint index; \ GLenum pname; \ _type_ params[4] = {0,0,0,0}; \ GLint size; \ LOAD_GL_FUNC(gl##_name_,"2.0") \ index = (GLuint)NUM2UINT(arg1); \ pname = (GLenum)NUM2INT(arg2); \ if (pname==GL_CURRENT_VERTEX_ATTRIB) \ size = 4; \ else \ size = 1; \ fptr_gl##_name_(index,pname,params); \ RET_ARRAY_OR_SINGLE(size,RETCONV_##_type_,params) \ } GETVERTEXATTRIB_FUNC(GetVertexAttribdv,GLdouble) GETVERTEXATTRIB_FUNC(GetVertexAttribfv,GLfloat) //GETVERTEXATTRIB_FUNC(GetVertexAttribiv,GLint,cond_GLBOOL2RUBY) #undef GETVERTEXATTRIB_FUNC static void (APIENTRY * fptr_glGetVertexAttribiv)(GLuint,GLenum,GLint *); static VALUE gl_GetVertexAttribiv(obj,arg1,arg2) VALUE obj,arg1,arg2; { GLuint index; GLenum pname; GLint params[4] = {0,0,0,0}; GLint size; LOAD_GL_FUNC(glGetVertexAttribiv,"2.0") index = (GLuint)NUM2UINT(arg1); pname = (GLenum)NUM2INT(arg2); if (pname==GL_CURRENT_VERTEX_ATTRIB) size = 4; else size = 1; fptr_glGetVertexAttribiv(index,pname,params); RET_ARRAY_OR_SINGLE_BOOL(size,cond_GLBOOL2RUBY,pname,params) } VALUE g_VertexAttrib_ptr[_MAX_VERTEX_ATTRIBS]; static void (APIENTRY * fptr_glGetVertexAttribPointerv)(GLuint,GLenum,GLvoid **); static VALUE gl_GetVertexAttribPointerv(obj,arg1) VALUE obj,arg1; { GLuint index; LOAD_GL_FUNC(glGetVertexAttribPointerv,"2.0") index =(GLuint) NUM2INT(arg1); if (index>_MAX_VERTEX_ATTRIBS) rb_raise(rb_eArgError, "Index too large, maximum allowed value '%i'",_MAX_VERTEX_ATTRIBS); return g_VertexAttrib_ptr[index]; } static void (APIENTRY * fptr_glShaderSource)(GLuint,GLsizei,GLchar**,GLint *); static VALUE gl_ShaderSource(obj,arg1,arg2) VALUE obj,arg1,arg2; { GLuint shader; GLint length; GLchar *str; LOAD_GL_FUNC(glShaderSource,"2.0") shader = (GLuint)NUM2UINT(arg1); Check_Type(arg2,T_STRING); str = RSTRING_PTR(arg2); length = RSTRING_LEN(arg2); fptr_glShaderSource(shader,1,&str,&length); CHECK_GLERROR return Qnil; } #define UNIFORM_FUNC_V(_name_,_type_,_conv_,_size_) \ static void (APIENTRY * fptr_gl##_name_)(GLint,GLsizei,_type_ *); \ static VALUE \ gl_##_name_(obj,arg1,arg2) \ VALUE obj,arg1,arg2; \ { \ GLint location; \ GLsizei count; \ _type_ *value; \ LOAD_GL_FUNC(gl##_name_,"2.0") \ Check_Type(arg2,T_ARRAY); \ count = RARRAY_LEN(arg2); \ if (count<=0 || (count % _size_) != 0) \ rb_raise(rb_eArgError, "Parameter array size must be multiplication of %i",_size_); \ location = (GLint)NUM2INT(arg1); \ value = ALLOC_N(_type_,count); \ _conv_(arg2,value,count); \ fptr_gl##_name_(location,count / _size_,value); \ xfree(value); \ CHECK_GLERROR \ return Qnil; \ } UNIFORM_FUNC_V(Uniform1fv,GLfloat,ary2cflt,1) UNIFORM_FUNC_V(Uniform1iv,GLint,ary2cint,1) UNIFORM_FUNC_V(Uniform2fv,GLfloat,ary2cflt,2) UNIFORM_FUNC_V(Uniform2iv,GLint,ary2cint,2) UNIFORM_FUNC_V(Uniform3fv,GLfloat,ary2cflt,3) UNIFORM_FUNC_V(Uniform3iv,GLint,ary2cint,3) UNIFORM_FUNC_V(Uniform4fv,GLfloat,ary2cflt,4) UNIFORM_FUNC_V(Uniform4iv,GLint,ary2cint,4) #undef UNIFORM_FUNC_V #define UNIFORMMATRIX_FUNC(_name_,_size_) \ static void (APIENTRY * fptr_gl##_name_)(GLint,GLsizei,GLboolean,GLfloat *); \ static VALUE \ gl_##_name_(obj,arg1,arg2,arg3) \ VALUE obj,arg1,arg2,arg3; \ { \ GLint location; \ GLsizei count; \ GLboolean transpose; \ GLfloat *value; \ LOAD_GL_FUNC(gl##_name_,"2.0") \ location = (GLint)NUM2INT(arg1); \ count = RARRAY_LEN(rb_funcall(rb_Array(arg3),rb_intern("flatten"),0)); \ transpose = (GLboolean)NUM2INT(arg2); \ value = ALLOC_N(GLfloat, count); \ ary2cmatfloatcount(arg3,value,_size_,_size_); \ fptr_gl##_name_(location,count / (_size_*_size_),transpose,value); \ xfree(value); \ CHECK_GLERROR \ return Qnil; \ } UNIFORMMATRIX_FUNC(UniformMatrix2fv,2) UNIFORMMATRIX_FUNC(UniformMatrix3fv,3) UNIFORMMATRIX_FUNC(UniformMatrix4fv,4) #undef UNIFORMMATRIX_FUNC #define VERTEXATTRIB_FUNC_V(_name_,_type_,_conv_,_size_) \ static void (APIENTRY * fptr_gl##_name_)(GLuint,_type_ *); \ static VALUE \ gl_##_name_(obj,arg1,arg2) \ VALUE obj,arg1,arg2; \ { \ GLuint index; \ _type_ v[_size_]; \ LOAD_GL_FUNC(gl##_name_,"2.0") \ index = (GLuint)NUM2UINT(arg1); \ _conv_(arg2,v,_size_); \ fptr_gl##_name_(index,v); \ CHECK_GLERROR \ return Qnil; \ } VERTEXATTRIB_FUNC_V(VertexAttrib4Nbv,GLbyte,ary2cbyte,4) VERTEXATTRIB_FUNC_V(VertexAttrib4Niv,GLint,ary2cint,4) VERTEXATTRIB_FUNC_V(VertexAttrib4Nsv,GLshort,ary2cshort,4) VERTEXATTRIB_FUNC_V(VertexAttrib4Nubv,GLubyte,ary2cubyte,4) VERTEXATTRIB_FUNC_V(VertexAttrib4Nuiv,GLuint,ary2cuint,4) VERTEXATTRIB_FUNC_V(VertexAttrib4Nusv,GLushort,ary2cushort,4) VERTEXATTRIB_FUNC_V(VertexAttrib4uiv,GLuint,ary2cuint,4) VERTEXATTRIB_FUNC_V(VertexAttrib4ubv,GLubyte,ary2cubyte,4) VERTEXATTRIB_FUNC_V(VertexAttrib4usv,GLushort,ary2cushort,4) VERTEXATTRIB_FUNC_V(VertexAttrib4bv,GLbyte,ary2cbyte,4) VERTEXATTRIB_FUNC_V(VertexAttrib4iv,GLint,ary2cint,4) VERTEXATTRIB_FUNC_V(VertexAttrib4dv,GLdouble,ary2cdbl,4) VERTEXATTRIB_FUNC_V(VertexAttrib4fv,GLfloat,ary2cflt,4) VERTEXATTRIB_FUNC_V(VertexAttrib4sv,GLshort,ary2cshort,4) VERTEXATTRIB_FUNC_V(VertexAttrib3dv,GLdouble,ary2cdbl,3) VERTEXATTRIB_FUNC_V(VertexAttrib3fv,GLfloat,ary2cflt,3) VERTEXATTRIB_FUNC_V(VertexAttrib3sv,GLshort,ary2cshort,3) VERTEXATTRIB_FUNC_V(VertexAttrib2dv,GLdouble,ary2cdbl,2) VERTEXATTRIB_FUNC_V(VertexAttrib2fv,GLfloat,ary2cflt,2) VERTEXATTRIB_FUNC_V(VertexAttrib2sv,GLshort,ary2cshort,2) VERTEXATTRIB_FUNC_V(VertexAttrib1dv,GLdouble,ary2cdbl,1) VERTEXATTRIB_FUNC_V(VertexAttrib1fv,GLfloat,ary2cflt,1) VERTEXATTRIB_FUNC_V(VertexAttrib1sv,GLshort,ary2cshort,1) #undef VERTEXATTRIB_FUNC_V static void (APIENTRY * fptr_glVertexAttribPointer)(GLuint,GLint,GLenum,GLboolean,GLsizei,GLvoid *); static VALUE gl_VertexAttribPointer(obj,arg1,arg2,arg3,arg4,arg5,arg6) VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6; { GLuint index; GLuint size; GLenum type; GLboolean normalized; GLsizei stride; LOAD_GL_FUNC(glVertexAttribPointer,"2.0") index = (GLuint)NUM2UINT(arg1); size = (GLuint)NUM2UINT(arg2); type = (GLenum)NUM2INT(arg3); normalized = (GLboolean)NUM2INT(arg4); stride = (GLsizei)NUM2UINT(arg5); if (index>_MAX_VERTEX_ATTRIBS) rb_raise(rb_eArgError, "Index too large, maximum allowed value '%i'",_MAX_VERTEX_ATTRIBS); if (CheckBufferBinding(GL_ARRAY_BUFFER_BINDING)) { g_VertexAttrib_ptr[index] = arg6; fptr_glVertexAttribPointer(index,size,type,normalized,stride,(GLvoid *)NUM2INT(arg6)); } else { VALUE data; data = pack_array_or_pass_string(type,arg6); rb_str_freeze(data); g_VertexAttrib_ptr[index] = data; fptr_glVertexAttribPointer(index,size,type,normalized,stride,(GLvoid *)RSTRING_PTR(data)); } CHECK_GLERROR return Qnil; } void gl_init_functions_2_0(VALUE module) { rb_define_module_function(module, "glBlendEquationSeparate", gl_BlendEquationSeparate, 2); rb_define_module_function(module, "glDrawBuffers", gl_DrawBuffers, 1); rb_define_module_function(module, "glStencilOpSeparate", gl_StencilOpSeparate, 4); rb_define_module_function(module, "glStencilFuncSeparate", gl_StencilFuncSeparate, 4); rb_define_module_function(module, "glStencilMaskSeparate", gl_StencilMaskSeparate, 2); rb_define_module_function(module, "glAttachShader", gl_AttachShader, 2); rb_define_module_function(module, "glBindAttribLocation", gl_BindAttribLocation, 3); rb_define_module_function(module, "glCompileShader", gl_CompileShader, 1); rb_define_module_function(module, "glCreateProgram", gl_CreateProgram, 0); rb_define_module_function(module, "glCreateShader", gl_CreateShader, 1); rb_define_module_function(module, "glDeleteProgram", gl_DeleteProgram, 1); rb_define_module_function(module, "glDeleteShader", gl_DeleteShader, 1); rb_define_module_function(module, "glDetachShader", gl_DetachShader, 2); rb_define_module_function(module, "glDisableVertexAttribArray", gl_DisableVertexAttribArray, 1); rb_define_module_function(module, "glEnableVertexAttribArray", gl_EnableVertexAttribArray, 1); rb_define_module_function(module, "glGetActiveAttrib", gl_GetActiveAttrib, 2); rb_define_module_function(module, "glGetActiveUniform", gl_GetActiveUniform, 2); rb_define_module_function(module, "glGetAttachedShaders", gl_GetAttachedShaders, 1); rb_define_module_function(module, "glGetAttribLocation", gl_GetAttribLocation, 2); rb_define_module_function(module, "glGetProgramiv", gl_GetProgramiv, 2); rb_define_module_function(module, "glGetProgramInfoLog", gl_GetProgramInfoLog, 1); rb_define_module_function(module, "glGetShaderiv", gl_GetShaderiv, 2); rb_define_module_function(module, "glGetShaderInfoLog", gl_GetShaderInfoLog, 1); rb_define_module_function(module, "glGetShaderSource", gl_GetShaderSource, 1); rb_define_module_function(module, "glGetUniformLocation", gl_GetUniformLocation, 2); rb_define_module_function(module, "glGetUniformfv", gl_GetUniformfv, 2); rb_define_module_function(module, "glGetUniformiv", gl_GetUniformiv, 2); rb_define_module_function(module, "glGetVertexAttribdv", gl_GetVertexAttribdv, 2); rb_define_module_function(module, "glGetVertexAttribfv", gl_GetVertexAttribfv, 2); rb_define_module_function(module, "glGetVertexAttribiv", gl_GetVertexAttribiv, 2); rb_define_module_function(module, "glGetVertexAttribPointerv", gl_GetVertexAttribPointerv, 1); rb_define_module_function(module, "glIsProgram", gl_IsProgram, 1); rb_define_module_function(module, "glIsShader", gl_IsShader, 1); rb_define_module_function(module, "glLinkProgram", gl_LinkProgram, 1); rb_define_module_function(module, "glShaderSource", gl_ShaderSource, 2); rb_define_module_function(module, "glUseProgram", gl_UseProgram, 1); rb_define_module_function(module, "glUniform1f", gl_Uniform1f, 2); rb_define_module_function(module, "glUniform2f", gl_Uniform2f, 3); rb_define_module_function(module, "glUniform3f", gl_Uniform3f, 4); rb_define_module_function(module, "glUniform4f", gl_Uniform4f, 5); rb_define_module_function(module, "glUniform1i", gl_Uniform1i, 2); rb_define_module_function(module, "glUniform2i", gl_Uniform2i, 3); rb_define_module_function(module, "glUniform3i", gl_Uniform3i, 4); rb_define_module_function(module, "glUniform4i", gl_Uniform4i, 5); rb_define_module_function(module, "glUniform1fv", gl_Uniform1fv, 2); rb_define_module_function(module, "glUniform2fv", gl_Uniform2fv, 2); rb_define_module_function(module, "glUniform3fv", gl_Uniform3fv, 2); rb_define_module_function(module, "glUniform4fv", gl_Uniform4fv, 2); rb_define_module_function(module, "glUniform1iv", gl_Uniform1iv, 2); rb_define_module_function(module, "glUniform2iv", gl_Uniform2iv, 2); rb_define_module_function(module, "glUniform3iv", gl_Uniform3iv, 2); rb_define_module_function(module, "glUniform4iv", gl_Uniform4iv, 2); rb_define_module_function(module, "glUniformMatrix2fv", gl_UniformMatrix2fv, 3); rb_define_module_function(module, "glUniformMatrix3fv", gl_UniformMatrix3fv, 3); rb_define_module_function(module, "glUniformMatrix4fv", gl_UniformMatrix4fv, 3); rb_define_module_function(module, "glValidateProgram", gl_ValidateProgram, 1); rb_define_module_function(module, "glVertexAttrib1d", gl_VertexAttrib1d, 2); rb_define_module_function(module, "glVertexAttrib1f", gl_VertexAttrib1f, 2); rb_define_module_function(module, "glVertexAttrib1s", gl_VertexAttrib1s, 2); rb_define_module_function(module, "glVertexAttrib2d", gl_VertexAttrib2d, 3); rb_define_module_function(module, "glVertexAttrib2f", gl_VertexAttrib2f, 3); rb_define_module_function(module, "glVertexAttrib2s", gl_VertexAttrib2s, 3); rb_define_module_function(module, "glVertexAttrib3d", gl_VertexAttrib3d, 4); rb_define_module_function(module, "glVertexAttrib3f", gl_VertexAttrib3f, 4); rb_define_module_function(module, "glVertexAttrib3s", gl_VertexAttrib3s, 4); rb_define_module_function(module, "glVertexAttrib4Nbv", gl_VertexAttrib4Nbv, 2); rb_define_module_function(module, "glVertexAttrib4Niv", gl_VertexAttrib4Niv, 2); rb_define_module_function(module, "glVertexAttrib4Nsv", gl_VertexAttrib4Nsv, 2); rb_define_module_function(module, "glVertexAttrib4Nub", gl_VertexAttrib4Nub, 5); rb_define_module_function(module, "glVertexAttrib4Nubv", gl_VertexAttrib4Nubv, 2); rb_define_module_function(module, "glVertexAttrib4Nuiv", gl_VertexAttrib4Nuiv, 2); rb_define_module_function(module, "glVertexAttrib4Nusv", gl_VertexAttrib4Nusv, 2); rb_define_module_function(module, "glVertexAttrib4bv", gl_VertexAttrib4bv, 2); rb_define_module_function(module, "glVertexAttrib4d", gl_VertexAttrib4d, 5); rb_define_module_function(module, "glVertexAttrib4f", gl_VertexAttrib4f, 5); rb_define_module_function(module, "glVertexAttrib4iv", gl_VertexAttrib4iv, 2); rb_define_module_function(module, "glVertexAttrib4s", gl_VertexAttrib4s, 5); rb_define_module_function(module, "glVertexAttrib4ubv", gl_VertexAttrib4ubv, 2); rb_define_module_function(module, "glVertexAttrib4uiv", gl_VertexAttrib4uiv, 2); rb_define_module_function(module, "glVertexAttrib4usv", gl_VertexAttrib4usv, 2); rb_define_module_function(module, "glVertexAttrib1dv", gl_VertexAttrib1dv, 2); rb_define_module_function(module, "glVertexAttrib1fv", gl_VertexAttrib1fv, 2); rb_define_module_function(module, "glVertexAttrib1sv", gl_VertexAttrib1sv, 2); rb_define_module_function(module, "glVertexAttrib2dv", gl_VertexAttrib2dv, 2); rb_define_module_function(module, "glVertexAttrib2fv", gl_VertexAttrib2fv, 2); rb_define_module_function(module, "glVertexAttrib2sv", gl_VertexAttrib2sv, 2); rb_define_module_function(module, "glVertexAttrib3dv", gl_VertexAttrib3dv, 2); rb_define_module_function(module, "glVertexAttrib3fv", gl_VertexAttrib3fv, 2); rb_define_module_function(module, "glVertexAttrib3sv", gl_VertexAttrib3sv, 2); rb_define_module_function(module, "glVertexAttrib4dv", gl_VertexAttrib4dv, 2); rb_define_module_function(module, "glVertexAttrib4fv", gl_VertexAttrib4fv, 2); rb_define_module_function(module, "glVertexAttrib4sv", gl_VertexAttrib4sv, 2); rb_define_module_function(module, "glVertexAttribPointer", gl_VertexAttribPointer, 6); { int i; for (i=0;i<_MAX_VERTEX_ATTRIBS;i++) rb_global_variable(&g_VertexAttrib_ptr[i]); } } ruby-opengl-0.60.1.orig/ext/gl/mkrf_conf.rb0000644000000000000000000000220611377006423017174 0ustar rootroot# extconf.rb for ruby-opengl's gl extension module. # # Copyright (C) 2006 John M. Gabriele # # This program is distributed under the terms of the MIT license. # See the included COPYRIGHT file for the terms of this license. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. require 'rubygems' require 'mkrf' require 'rbconfig' RUBYVER = " -DRUBY_VERSION=" + RUBY_VERSION.split(".").join Mkrf::Generator.new( 'gl' ) do |g| case RUBY_PLATFORM when /darwin/ g.cflags << RUBYVER g.ldshared << ' -framework OpenGL' when /mswin32/ g.cflags << ' -DWIN32' + RUBYVER g.include_library( 'opengl32.lib', 'glVertex3d') else g.cflags << ' -Wall' + RUBYVER g.include_library( 'GL', 'glVertex3d') end end ruby-opengl-0.60.1.orig/ext/gl/gl-ext-nv.c0000644000000000000000000007621711377006423016705 0ustar rootroot/* * Copyright (C) 2007 Jan Dvorak * * This program is distributed under the terms of the MIT license. * See the included MIT-LICENSE file for the terms of this license. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "../common/common.h" /* OpenGL NVIDIA extensions */ /* #222 GL_NV_fence */ GL_FUNC_GENOBJECTS_LOAD(GenFencesNV,"GL_NV_fence") GL_FUNC_DELETEOBJECTS_LOAD(DeleteFencesNV,"GL_NV_fence") GL_FUNC_LOAD_2(SetFenceNV,GLvoid, GLuint,GLenum, "GL_NV_fence") GL_FUNC_LOAD_1(TestFenceNV,GLboolean, GLuint,"GL_NV_fence") GL_FUNC_LOAD_1(IsFenceNV,GLboolean, GLuint,"GL_NV_fence") GL_FUNC_LOAD_1(FinishFenceNV,GLvoid, GLuint,"GL_NV_fence") static void (APIENTRY * fptr_glGetFenceivNV)(GLuint,GLenum,GLint *); static VALUE gl_GetFenceivNV(VALUE obj,VALUE arg1,VALUE arg2) { GLint ret = 0; LOAD_GL_FUNC(glGetFenceivNV,"GL_NV_fence") fptr_glGetFenceivNV(NUM2INT(arg1),NUM2INT(arg2),&ret); CHECK_GLERROR return cond_GLBOOL2RUBY(NUM2INT(arg2),ret); } /* #233 GL_NV_vertex_program */ static void (APIENTRY * fptr_glLoadProgramNV)(GLenum,GLuint,GLsizei,const GLubyte *); static VALUE gl_LoadProgramNV(VALUE obj,VALUE arg1,VALUE arg2,VALUE arg3) { LOAD_GL_FUNC(glLoadProgramNV,"GL_NV_vertex_program") Check_Type(arg3,T_STRING); fptr_glLoadProgramNV(NUM2INT(arg1),NUM2UINT(arg2),RSTRING_LEN(arg3),(GLubyte *)RSTRING_PTR(arg3)); CHECK_GLERROR return Qnil; } static void (APIENTRY * fptr_glGetProgramivNV)(GLuint,GLenum,GLint *); static VALUE gl_GetProgramivNV(VALUE obj,VALUE arg1,VALUE arg2) { GLint ret = 0; LOAD_GL_FUNC(glGetProgramivNV,"GL_NV_vertex_program") fptr_glGetProgramivNV(NUM2INT(arg1),NUM2INT(arg2),&ret); CHECK_GLERROR return cond_GLBOOL2RUBY(NUM2INT(arg2),ret); } static void (APIENTRY * fptr_glGetProgramStringNV)(GLuint,GLenum,void *string); static VALUE gl_GetProgramStringNV(VALUE obj,VALUE arg1,VALUE arg2) { GLsizei len = 0; char *buffer; VALUE ret_buffer; LOAD_GL_FUNC(glGetProgramStringNV,"GL_NV_vertex_program") LOAD_GL_FUNC(glGetProgramivNV,"GL_NV_vertex_program") fptr_glGetProgramivNV(NUM2INT(arg1),GL_PROGRAM_LENGTH_NV,&len); CHECK_GLERROR if (len<=0) return rb_str_new2(""); buffer = ALLOC_N(GLchar,len+1); memset(buffer,0,sizeof(GLchar) * (len+1)); fptr_glGetProgramStringNV(NUM2INT(arg1),NUM2INT(arg2),buffer); ret_buffer = rb_str_new2(buffer); xfree(buffer); CHECK_GLERROR return ret_buffer; } GL_FUNC_LOAD_2(BindProgramNV,GLvoid, GLenum,GLuint,"GL_NV_vertex_program") GL_FUNC_LOAD_1(IsProgramNV,GLboolean, GLuint,"GL_NV_vertex_program") GL_FUNC_GENOBJECTS_LOAD(GenProgramsNV,"GL_NV_vertex_program") GL_FUNC_DELETEOBJECTS_LOAD(DeleteProgramsNV,"GL_NV_vertex_program") static void (APIENTRY * fptr_glExecuteProgramNV)(GLenum,GLuint,const GLfloat *); static VALUE gl_ExecuteProgramNV(VALUE obj,VALUE arg1,VALUE arg2,VALUE arg3) { GLfloat params[4] = {0,0,0,0}; LOAD_GL_FUNC(glExecuteProgramNV,"GL_NV_vertex_program") ary2cflt(arg3,params,4); fptr_glExecuteProgramNV(NUM2UINT(arg1),NUM2UINT(arg2),params); CHECK_GLERROR return Qnil; } extern VALUE g_VertexAttrib_ptr[]; static void (APIENTRY * fptr_glVertexAttribPointerNV)(GLuint,GLint,GLenum,GLsizei,const GLvoid *); static VALUE gl_VertexAttribPointerNV(VALUE obj,VALUE arg1,VALUE arg2,VALUE arg3,VALUE arg4,VALUE arg5) { GLuint index; GLuint size; GLenum type; GLsizei stride; LOAD_GL_FUNC(glVertexAttribPointerNV,"GL_NV_vertex_program") index = (GLuint)NUM2UINT(arg1); size = (GLuint)NUM2UINT(arg2); type = (GLenum)NUM2INT(arg3); stride = (GLsizei)NUM2UINT(arg4); if (index>_MAX_VERTEX_ATTRIBS) rb_raise(rb_eArgError, "Index too large, maximum allowed value '%i'",_MAX_VERTEX_ATTRIBS); if (CheckBufferBinding(GL_ARRAY_BUFFER_BINDING)) { g_VertexAttrib_ptr[index] = arg5; fptr_glVertexAttribPointerNV(index,size,type,stride,(GLvoid *)NUM2INT(arg5)); } else { VALUE data; data = pack_array_or_pass_string(type,arg5); rb_str_freeze(data); g_VertexAttrib_ptr[index] = data; fptr_glVertexAttribPointerNV(index,size,type,stride,(GLvoid *)RSTRING_PTR(data)); } CHECK_GLERROR return Qnil; } static void (APIENTRY * fptr_glGetVertexAttribPointervNV)(GLuint,GLenum,GLvoid **); static VALUE gl_GetVertexAttribPointervNV(obj,arg1) VALUE obj,arg1; { GLuint index; LOAD_GL_FUNC(glGetVertexAttribPointervNV,"GL_NV_vertex_program") index =(GLuint) NUM2INT(arg1); if (index>_MAX_VERTEX_ATTRIBS) rb_raise(rb_eArgError, "Index too large, maximum allowed value '%i'",_MAX_VERTEX_ATTRIBS); return g_VertexAttrib_ptr[index]; } GL_FUNC_LOAD_6(ProgramParameter4dNV,GLvoid, GLenum,GLuint,GLdouble,GLdouble,GLdouble,GLdouble, "GL_NV_vertex_program") GL_FUNC_LOAD_6(ProgramParameter4fNV,GLvoid, GLenum,GLuint,GLfloat,GLfloat,GLfloat,GLfloat, "GL_NV_vertex_program") #define PROGRAMPARAM_FUNC_V(_name_,_type_,_conv_,_extension_) \ static void (APIENTRY * fptr_gl##_name_)(GLenum,GLuint,const _type_ *); \ static VALUE \ gl_##_name_(obj,arg1,arg2,arg3) \ VALUE obj,arg1,arg2,arg3; \ { \ _type_ cary[4]; \ LOAD_GL_FUNC(gl##_name_,_extension_) \ _conv_(arg3,cary,4); \ fptr_gl##_name_(NUM2UINT(arg1),NUM2UINT(arg2),cary); \ CHECK_GLERROR \ return Qnil; \ } PROGRAMPARAM_FUNC_V(ProgramParameter4dvNV,GLdouble,ary2cdbl,"GL_NV_vertex_program") PROGRAMPARAM_FUNC_V(ProgramParameter4fvNV,GLfloat,ary2cflt,"GL_NV_vertex_program") #define GETPROGRAMPARAM_FUNC(_name_,_type_,_extension_) \ static void (APIENTRY * fptr_gl##_name_)(GLenum,GLuint,GLenum,_type_ *); \ static VALUE \ gl_##_name_(obj,arg1,arg2,arg3) \ VALUE obj,arg1,arg2,arg3; \ { \ _type_ cary[4] = {0.0,0.0,0.0,0.0}; \ LOAD_GL_FUNC(gl##_name_,_extension_) \ fptr_gl##_name_(NUM2UINT(arg1),NUM2UINT(arg2),NUM2UINT(arg3),cary); \ RET_ARRAY_OR_SINGLE(4,RETCONV_##_type_,cary) \ } GETPROGRAMPARAM_FUNC(GetProgramParameterdvNV,GLdouble,"GL_NV_vertex_program") GETPROGRAMPARAM_FUNC(GetProgramParameterfvNV,GLfloat,"GL_NV_vertex_program") #undef GETPROGRAMPARAM_FUNC #define PROGRAMPARAM_MULTI_FUNC_V(_name_,_type_,_conv_,_extension_) \ static void (APIENTRY * fptr_gl##_name_)(GLenum,GLuint,GLuint,const _type_ *); \ static VALUE \ gl_##_name_(obj,arg1,arg2,arg3) \ VALUE obj,arg1,arg2,arg3; \ { \ _type_ *cary; \ int len; \ LOAD_GL_FUNC(gl##_name_,_extension_) \ len = RARRAY_LEN(rb_Array(arg3)); \ if (len<=0 || (len % 4) != 0) \ rb_raise(rb_eArgError, "Parameter array size must be multiplication of 4"); \ cary = ALLOC_N(_type_,len); \ _conv_(arg3,cary,len); \ fptr_gl##_name_(NUM2UINT(arg1),NUM2UINT(arg2),len / 4, cary); \ xfree(cary); \ CHECK_GLERROR \ return Qnil; \ } PROGRAMPARAM_MULTI_FUNC_V(ProgramParameters4dvNV,GLdouble,ary2cdbl,"GL_NV_vertex_program") PROGRAMPARAM_MULTI_FUNC_V(ProgramParameters4fvNV,GLfloat,ary2cflt,"GL_NV_vertex_program") GL_FUNC_LOAD_2(VertexAttrib1dNV,GLvoid, GLuint,GLdouble, "GL_NV_vertex_program") GL_FUNC_LOAD_2(VertexAttrib1fNV,GLvoid, GLuint,GLfloat, "GL_NV_vertex_program") GL_FUNC_LOAD_2(VertexAttrib1sNV,GLvoid, GLuint,GLshort, "GL_NV_vertex_program") GL_FUNC_LOAD_3(VertexAttrib2dNV,GLvoid, GLuint,GLdouble,GLdouble, "GL_NV_vertex_program") GL_FUNC_LOAD_3(VertexAttrib2fNV,GLvoid, GLuint,GLfloat,GLfloat, "GL_NV_vertex_program") GL_FUNC_LOAD_3(VertexAttrib2sNV,GLvoid, GLuint,GLshort,GLshort, "GL_NV_vertex_program") GL_FUNC_LOAD_4(VertexAttrib3dNV,GLvoid, GLuint,GLdouble,GLdouble,GLdouble, "GL_NV_vertex_program") GL_FUNC_LOAD_4(VertexAttrib3fNV,GLvoid, GLuint,GLfloat,GLfloat,GLfloat, "GL_NV_vertex_program") GL_FUNC_LOAD_4(VertexAttrib3sNV,GLvoid, GLuint,GLshort,GLshort,GLshort, "GL_NV_vertex_program") GL_FUNC_LOAD_5(VertexAttrib4dNV,GLvoid, GLuint,GLdouble,GLdouble,GLdouble,GLdouble, "GL_NV_vertex_program") GL_FUNC_LOAD_5(VertexAttrib4fNV,GLvoid, GLuint,GLfloat,GLfloat,GLfloat,GLfloat, "GL_NV_vertex_program") GL_FUNC_LOAD_5(VertexAttrib4sNV,GLvoid, GLuint,GLshort,GLshort,GLshort,GLshort, "GL_NV_vertex_program") GL_FUNC_LOAD_5(VertexAttrib4ubNV,GLvoid, GLuint,GLubyte,GLubyte,GLubyte,GLubyte, "GL_NV_vertex_program") #define VERTEXATTRIB_FUNC_V(_name_,_type_,_conv_,_size_,_extension_) \ static void (APIENTRY * fptr_gl##_name_)(GLuint,_type_ *); \ static VALUE \ gl_##_name_(obj,arg1,arg2) \ VALUE obj,arg1,arg2; \ { \ GLuint index; \ _type_ v[_size_]; \ LOAD_GL_FUNC(gl##_name_,_extension_) \ index = (GLuint)NUM2UINT(arg1); \ _conv_(arg2,v,_size_); \ fptr_gl##_name_(index,v); \ CHECK_GLERROR \ return Qnil; \ } VERTEXATTRIB_FUNC_V(VertexAttrib4ubvNV,GLubyte,ary2cubyte,4,"GL_NV_vertex_program") VERTEXATTRIB_FUNC_V(VertexAttrib4dvNV,GLdouble,ary2cdbl,4,"GL_NV_vertex_program") VERTEXATTRIB_FUNC_V(VertexAttrib4fvNV,GLfloat,ary2cflt,4,"GL_NV_vertex_program") VERTEXATTRIB_FUNC_V(VertexAttrib4svNV,GLshort,ary2cshort,4,"GL_NV_vertex_program") VERTEXATTRIB_FUNC_V(VertexAttrib3dvNV,GLdouble,ary2cdbl,3,"GL_NV_vertex_program") VERTEXATTRIB_FUNC_V(VertexAttrib3fvNV,GLfloat,ary2cflt,3,"GL_NV_vertex_program") VERTEXATTRIB_FUNC_V(VertexAttrib3svNV,GLshort,ary2cshort,3,"GL_NV_vertex_program") VERTEXATTRIB_FUNC_V(VertexAttrib2dvNV,GLdouble,ary2cdbl,2,"GL_NV_vertex_program") VERTEXATTRIB_FUNC_V(VertexAttrib2fvNV,GLfloat,ary2cflt,2,"GL_NV_vertex_program") VERTEXATTRIB_FUNC_V(VertexAttrib2svNV,GLshort,ary2cshort,2,"GL_NV_vertex_program") VERTEXATTRIB_FUNC_V(VertexAttrib1dvNV,GLdouble,ary2cdbl,1,"GL_NV_vertex_program") VERTEXATTRIB_FUNC_V(VertexAttrib1fvNV,GLfloat,ary2cflt,1,"GL_NV_vertex_program") VERTEXATTRIB_FUNC_V(VertexAttrib1svNV,GLshort,ary2cshort,1,"GL_NV_vertex_program") #undef VERTEXATTRIB_FUNC_V #define VERTEXATTRIB_MULTI_FUNC_V(_name_,_type_,_conv_,_size_,_extension_) \ static void (APIENTRY * fptr_gl##_name_)(GLuint,GLsizei,_type_ *); \ static VALUE \ gl_##_name_(obj,arg1,arg2) \ VALUE obj,arg1,arg2; \ { \ GLuint index; \ _type_ *cary; \ int len; \ LOAD_GL_FUNC(gl##_name_,_extension_) \ len = RARRAY_LEN(rb_Array(arg2)); \ if (len<=0 || (len % _size_) != 0) \ rb_raise(rb_eArgError, "Parameter array size must be multiplication of %i",_size_); \ cary = ALLOC_N(_type_,len); \ index = (GLuint)NUM2UINT(arg1); \ _conv_(arg2,cary,len); \ fptr_gl##_name_(index,len / _size_,cary); \ xfree(cary); \ CHECK_GLERROR \ return Qnil; \ } VERTEXATTRIB_MULTI_FUNC_V(VertexAttribs4ubvNV,GLubyte,ary2cubyte,4,"GL_NV_vertex_program") VERTEXATTRIB_MULTI_FUNC_V(VertexAttribs4dvNV,GLdouble,ary2cdbl,4,"GL_NV_vertex_program") VERTEXATTRIB_MULTI_FUNC_V(VertexAttribs4fvNV,GLfloat,ary2cflt,4,"GL_NV_vertex_program") VERTEXATTRIB_MULTI_FUNC_V(VertexAttribs4svNV,GLshort,ary2cshort,4,"GL_NV_vertex_program") VERTEXATTRIB_MULTI_FUNC_V(VertexAttribs3dvNV,GLdouble,ary2cdbl,3,"GL_NV_vertex_program") VERTEXATTRIB_MULTI_FUNC_V(VertexAttribs3fvNV,GLfloat,ary2cflt,3,"GL_NV_vertex_program") VERTEXATTRIB_MULTI_FUNC_V(VertexAttribs3svNV,GLshort,ary2cshort,3,"GL_NV_vertex_program") VERTEXATTRIB_MULTI_FUNC_V(VertexAttribs2dvNV,GLdouble,ary2cdbl,2,"GL_NV_vertex_program") VERTEXATTRIB_MULTI_FUNC_V(VertexAttribs2fvNV,GLfloat,ary2cflt,2,"GL_NV_vertex_program") VERTEXATTRIB_MULTI_FUNC_V(VertexAttribs2svNV,GLshort,ary2cshort,2,"GL_NV_vertex_program") VERTEXATTRIB_MULTI_FUNC_V(VertexAttribs1dvNV,GLdouble,ary2cdbl,1,"GL_NV_vertex_program") VERTEXATTRIB_MULTI_FUNC_V(VertexAttribs1fvNV,GLfloat,ary2cflt,1,"GL_NV_vertex_program") VERTEXATTRIB_MULTI_FUNC_V(VertexAttribs1svNV,GLshort,ary2cshort,1,"GL_NV_vertex_program") #undef VERTEXATTRIB_MULTI_FUNC_V #define GETVERTEXATTRIB_FUNC(_name_,_type_,_extension_) \ static void (APIENTRY * fptr_gl##_name_)(GLuint,GLenum,_type_ *); \ static VALUE \ gl_##_name_(obj,arg1,arg2) \ VALUE obj,arg1,arg2; \ { \ GLuint index; \ GLenum pname; \ _type_ params[4] = {0,0,0,0}; \ GLint size; \ LOAD_GL_FUNC(gl##_name_,_extension_) \ index = (GLuint)NUM2UINT(arg1); \ pname = (GLenum)NUM2INT(arg2); \ if (pname==GL_CURRENT_ATTRIB_NV) \ size = 4; \ else \ size = 1; \ fptr_gl##_name_(index,pname,params); \ RET_ARRAY_OR_SINGLE(size,RETCONV_##_type_,params) \ } GETVERTEXATTRIB_FUNC(GetVertexAttribdvNV,GLdouble,"GL_NV_vertex_program") GETVERTEXATTRIB_FUNC(GetVertexAttribfvNV,GLfloat,"GL_NV_vertex_program") #undef GETVERTEXATTRIB_FUNC static void (APIENTRY * fptr_glGetVertexAttribivNV)(GLuint,GLenum,GLint *); static VALUE gl_GetVertexAttribivNV(obj,arg1,arg2) VALUE obj,arg1,arg2; { GLuint index; GLenum pname; GLint params[4] = {0,0,0,0}; GLint size; LOAD_GL_FUNC(glGetVertexAttribivNV,"GL_NV_vertex_program") index = (GLuint)NUM2UINT(arg1); pname = (GLenum)NUM2INT(arg2); if (pname==GL_CURRENT_VERTEX_ATTRIB) size = 4; else size = 1; fptr_glGetVertexAttribivNV(index,pname,params); RET_ARRAY_OR_SINGLE_BOOL(size,cond_GLBOOL2RUBY,pname,params) \ } GL_FUNC_LOAD_4(TrackMatrixNV,GLvoid, GLenum,GLuint,GLenum,GLenum, "GL_NV_vertex_program") static void (APIENTRY * fptr_glGetTrackMatrixivNV)(GLenum,GLuint,GLenum,GLint *); static VALUE gl_GetTrackMatrixivNV(VALUE obj,VALUE arg1,VALUE arg2,VALUE arg3) { GLint ret = 0; LOAD_GL_FUNC(glGetTrackMatrixivNV,"GL_NV_vertex_program") fptr_glGetTrackMatrixivNV(NUM2UINT(arg1),NUM2UINT(arg2),NUM2UINT(arg3),&ret); CHECK_GLERROR return INT2NUM(ret); } static void (APIENTRY * fptr_glRequestResidentProgramsNV)(GLsizei, GLuint *); static VALUE gl_RequestResidentProgramsNV(VALUE obj,VALUE arg1) { LOAD_GL_FUNC(glRequestResidentProgramsNV,"GL_NV_vertex_program") if (TYPE(arg1)==T_ARRAY) { GLsizei n; GLuint *programs; n = RARRAY_LEN(arg1); programs = ALLOC_N(GLuint,n); ary2cuint(arg1,programs,n); fptr_glRequestResidentProgramsNV( n, programs); xfree(programs); } else { GLuint program; program = NUM2INT(arg1); fptr_glRequestResidentProgramsNV( 1, &program); } CHECK_GLERROR return Qnil; } static GLboolean (APIENTRY * fptr_glAreProgramsResidentNV)(GLsizei, const GLuint *, GLboolean *); static VALUE gl_AreProgramsResidentNV(VALUE obj,VALUE arg1) { GLuint *programs; GLboolean *residences; GLsizei size; GLboolean r; VALUE retary; VALUE ary; int i; LOAD_GL_FUNC(glAreProgramsResidentNV,"GL_NV_vertex_program") ary = rb_Array(arg1); size = RARRAY_LEN(ary); programs = ALLOC_N(GLuint,size); residences = ALLOC_N(GLboolean,size); ary2cuint(ary,programs,size); r = fptr_glAreProgramsResidentNV(size,programs,residences); retary = rb_ary_new2(size); if (r==GL_TRUE) { /* all are resident */ for(i=0;i * * This program is distributed under the terms of the MIT license. * See the included MIT-LICENSE file for the terms of this license. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "../common/common.h" /* OpenGL ARB extensions */ /* #3 GL_ARB_transpose_matrix */ #define TRANSPOSEMATRIX_FUNC(_name_,_type_,_conv_) \ static void (APIENTRY * fptr_gl##_name_)(const _type_[]); \ static VALUE \ gl_##_name_(obj,arg1) \ VALUE obj,arg1; \ { \ _type_ m[4*4]; \ LOAD_GL_FUNC(gl##_name_,"GL_ARB_transpose_matrix") \ _conv_(arg1, m, 4, 4); \ fptr_gl##_name_(m); \ CHECK_GLERROR \ return Qnil; \ } TRANSPOSEMATRIX_FUNC(LoadTransposeMatrixfARB,GLfloat,ary2cmatfloat) TRANSPOSEMATRIX_FUNC(LoadTransposeMatrixdARB,GLdouble,ary2cmatdouble) TRANSPOSEMATRIX_FUNC(MultTransposeMatrixfARB,GLfloat,ary2cmatfloat) TRANSPOSEMATRIX_FUNC(MultTransposeMatrixdARB,GLdouble,ary2cmatdouble) #undef TRANSPOSEMATRIX_FUNC /* #5 GL_ARB_multisample */ GL_FUNC_LOAD_2(SampleCoverageARB,GLvoid, GLclampf,GLboolean, "GL_ARB_multisample") /* #14 GL_ARB_point_parameters */ GL_FUNC_LOAD_2(PointParameterfARB,GLvoid, GLenum,GLfloat, "GL_ARB_point_parameters") static void (APIENTRY * fptr_glPointParameterfvARB)(GLenum,GLfloat *); static VALUE gl_PointParameterfvARB(VALUE obj,VALUE arg1,VALUE arg2) { GLfloat params[3] = {0.0,0.0,0.0}; GLenum pname; GLint size; LOAD_GL_FUNC(glPointParameterfvARB,"GL_ARB_point_parameters") pname = NUM2UINT(arg1); Check_Type(arg2,T_ARRAY); if (pname==GL_POINT_DISTANCE_ATTENUATION) size = 3; else size = 1; ary2cflt(arg2,params,size); fptr_glPointParameterfvARB(pname,params); CHECK_GLERROR return Qnil; } /* #25 GL_ARB_window_pos */ GL_FUNC_LOAD_2(WindowPos2dARB,GLvoid, GLdouble,GLdouble, "GL_ARB_window_pos") GL_FUNC_LOAD_2(WindowPos2fARB,GLvoid, GLfloat,GLfloat, "GL_ARB_window_pos") GL_FUNC_LOAD_2(WindowPos2iARB,GLvoid, GLint,GLint, "GL_ARB_window_pos") GL_FUNC_LOAD_2(WindowPos2sARB,GLvoid, GLshort,GLshort, "GL_ARB_window_pos") GL_FUNC_LOAD_3(WindowPos3dARB,GLvoid, GLdouble,GLdouble,GLdouble, "GL_ARB_window_pos") GL_FUNC_LOAD_3(WindowPos3fARB,GLvoid, GLfloat,GLfloat,GLfloat, "GL_ARB_window_pos") GL_FUNC_LOAD_3(WindowPos3iARB,GLvoid, GLint,GLint,GLint, "GL_ARB_window_pos") GL_FUNC_LOAD_3(WindowPos3sARB,GLvoid, GLshort,GLshort,GLshort, "GL_ARB_window_pos") #define WINDOWPOSFUNCV(_name_,_type_,_conv_,_size_,_ext_) \ static void (APIENTRY * fptr_gl##_name_)(const _type_ *); \ static VALUE gl_##_name_(VALUE obj,VALUE arg1) \ { \ _type_ cary[_size_]; \ LOAD_GL_FUNC(gl##_name_,_ext_) \ Check_Type(arg1,T_ARRAY); \ if (RARRAY_LEN(arg1) != _size_) \ rb_raise(rb_eArgError, "Incorrect array length - must have '%i' elements.",_size_); \ _conv_(arg1,cary,_size_); \ fptr_gl##_name_(cary); \ CHECK_GLERROR \ return Qnil; \ } WINDOWPOSFUNCV(WindowPos2dvARB,GLdouble,ary2cdbl,2,"GL_ARB_window_pos") WINDOWPOSFUNCV(WindowPos2fvARB,GLfloat,ary2cflt,2,"GL_ARB_window_pos") WINDOWPOSFUNCV(WindowPos2ivARB,GLint,ary2cint,2,"GL_ARB_window_pos") WINDOWPOSFUNCV(WindowPos2svARB,GLshort,ary2cshort,2,"GL_ARB_window_pos") WINDOWPOSFUNCV(WindowPos3dvARB,GLdouble,ary2cdbl,3,"GL_ARB_window_pos") WINDOWPOSFUNCV(WindowPos3fvARB,GLfloat,ary2cflt,3,"GL_ARB_window_pos") WINDOWPOSFUNCV(WindowPos3ivARB,GLint,ary2cint,3,"GL_ARB_window_pos") WINDOWPOSFUNCV(WindowPos3svARB,GLshort,ary2cshort,3,"GL_ARB_window_pos") #undef WINDOWPOSFUNCV /* #26 GL_ARB_vertex_program */ static void (APIENTRY * fptr_glProgramStringARB)(GLenum,GLenum,GLsizei,const void *); static VALUE gl_ProgramStringARB(VALUE obj,VALUE arg1,VALUE arg2,VALUE arg3) { LOAD_GL_FUNC(glProgramStringARB,"GL_ARB_vertex_program") Check_Type(arg3,T_STRING); fptr_glProgramStringARB(NUM2INT(arg1),NUM2INT(arg2),RSTRING_LEN(arg3),RSTRING_PTR(arg3)); CHECK_GLERROR return Qnil; } static void (APIENTRY * fptr_glGetProgramivARB)(GLenum,GLenum,GLint *); static VALUE gl_GetProgramivARB(VALUE obj,VALUE arg1,VALUE arg2) { GLint ret = 0; LOAD_GL_FUNC(glGetProgramivARB,"GL_ARB_vertex_program") fptr_glGetProgramivARB(NUM2INT(arg1),NUM2INT(arg2),&ret); CHECK_GLERROR return cond_GLBOOL2RUBY(NUM2INT(arg2),ret); } static void (APIENTRY * fptr_glGetProgramStringARB)(GLenum,GLenum,void *string); static VALUE gl_GetProgramStringARB(VALUE obj,VALUE arg1,VALUE arg2) { GLsizei len = 0; char *buffer; VALUE ret_buffer; LOAD_GL_FUNC(glGetProgramStringARB,"GL_ARB_vertex_program") LOAD_GL_FUNC(glGetProgramivARB,"GL_ARB_vertex_program") fptr_glGetProgramivARB(NUM2INT(arg1),GL_PROGRAM_LENGTH_ARB,&len); CHECK_GLERROR if (len<=0) return rb_str_new2(""); buffer = ALLOC_N(GLchar,len+1); memset(buffer,0,sizeof(GLchar) * (len+1)); fptr_glGetProgramStringARB(NUM2INT(arg1),NUM2INT(arg2),buffer); ret_buffer = rb_str_new2(buffer); xfree(buffer); CHECK_GLERROR return ret_buffer; } GL_FUNC_GENOBJECTS_LOAD(GenProgramsARB,"GL_ARB_vertex_program") GL_FUNC_DELETEOBJECTS_LOAD(DeleteProgramsARB,"GL_ARB_vertex_program") GL_FUNC_LOAD_2(BindProgramARB,GLvoid, GLenum,GLuint, "GL_ARB_vertex_program") GL_FUNC_LOAD_1(IsProgramARB,GLboolean, GLuint, "GL_ARB_vertex_program") GL_FUNC_LOAD_1(EnableVertexAttribArrayARB,GLvoid, GLuint, "GL_ARB_vertex_program") GL_FUNC_LOAD_1(DisableVertexAttribArrayARB,GLvoid, GLuint, "GL_ARB_vertex_program") extern VALUE g_VertexAttrib_ptr[]; static void (APIENTRY * fptr_glVertexAttribPointerARB)(GLuint,GLint,GLenum,GLboolean,GLsizei,const GLvoid *); static VALUE gl_VertexAttribPointerARB(VALUE obj,VALUE arg1,VALUE arg2,VALUE arg3,VALUE arg4,VALUE arg5,VALUE arg6) { GLuint index; GLuint size; GLenum type; GLboolean normalized; GLsizei stride; LOAD_GL_FUNC(glVertexAttribPointerARB,"GL_ARB_vertex_program") index = (GLuint)NUM2UINT(arg1); size = (GLuint)NUM2UINT(arg2); type = (GLenum)NUM2INT(arg3); normalized = (GLboolean)NUM2INT(arg4); stride = (GLsizei)NUM2UINT(arg5); if (index>_MAX_VERTEX_ATTRIBS) rb_raise(rb_eArgError, "Index too large, maximum allowed value '%i'",_MAX_VERTEX_ATTRIBS); if (CheckBufferBinding(GL_ARRAY_BUFFER_BINDING)) { g_VertexAttrib_ptr[index] = arg6; fptr_glVertexAttribPointerARB(index,size,type,normalized,stride,(GLvoid *)NUM2INT(arg6)); } else { VALUE data; data = pack_array_or_pass_string(type,arg6); rb_str_freeze(data); g_VertexAttrib_ptr[index] = data; fptr_glVertexAttribPointerARB(index,size,type,normalized,stride,(GLvoid *)RSTRING_PTR(data)); } CHECK_GLERROR return Qnil; } static void (APIENTRY * fptr_glGetVertexAttribPointervARB)(GLuint,GLenum,GLvoid **); static VALUE gl_GetVertexAttribPointervARB(obj,arg1) VALUE obj,arg1; { GLuint index; LOAD_GL_FUNC(glGetVertexAttribPointervARB,"GL_ARB_vertex_program") index =(GLuint) NUM2INT(arg1); if (index>_MAX_VERTEX_ATTRIBS) rb_raise(rb_eArgError, "Index too large, maximum allowed value '%i'",_MAX_VERTEX_ATTRIBS); return g_VertexAttrib_ptr[index]; } GL_FUNC_LOAD_6(ProgramEnvParameter4dARB,GLvoid, GLenum,GLuint,GLdouble,GLdouble,GLdouble,GLdouble, "GL_ARB_vertex_program") GL_FUNC_LOAD_6(ProgramEnvParameter4fARB,GLvoid, GLenum,GLuint,GLfloat,GLfloat,GLfloat,GLfloat, "GL_ARB_vertex_program") GL_FUNC_LOAD_6(ProgramLocalParameter4dARB,GLvoid, GLenum,GLuint,GLdouble,GLdouble,GLdouble,GLdouble, "GL_ARB_vertex_program") GL_FUNC_LOAD_6(ProgramLocalParameter4fARB,GLvoid, GLenum,GLuint,GLfloat,GLfloat,GLfloat,GLfloat, "GL_ARB_vertex_program") #define PROGRAMPARAM_FUNC_V(_name_,_type_,_conv_,_extension_) \ static void (APIENTRY * fptr_gl##_name_)(GLenum,GLuint,const _type_ *); \ static VALUE \ gl_##_name_(obj,arg1,arg2,arg3) \ VALUE obj,arg1,arg2,arg3; \ { \ _type_ cary[4]; \ LOAD_GL_FUNC(gl##_name_,_extension_) \ _conv_(arg3,cary,4); \ fptr_gl##_name_(NUM2UINT(arg1),NUM2UINT(arg2),cary); \ CHECK_GLERROR \ return Qnil; \ } PROGRAMPARAM_FUNC_V(ProgramEnvParameter4dvARB,GLdouble,ary2cdbl,"GL_ARB_vertex_program") PROGRAMPARAM_FUNC_V(ProgramEnvParameter4fvARB,GLfloat,ary2cflt,"GL_ARB_vertex_program") PROGRAMPARAM_FUNC_V(ProgramLocalParameter4dvARB,GLdouble,ary2cdbl,"GL_ARB_vertex_program") PROGRAMPARAM_FUNC_V(ProgramLocalParameter4fvARB,GLfloat,ary2cflt,"GL_ARB_vertex_program") #undef PROGRAMPARAM_FUNC_V #define GETPROGRAMPARAM_FUNC(_name_,_type_,_extension_) \ static void (APIENTRY * fptr_gl##_name_)(GLenum,GLuint,_type_ *); \ static VALUE \ gl_##_name_(obj,arg1,arg2) \ VALUE obj,arg1,arg2; \ { \ _type_ cary[4] = {0.0,0.0,0.0,0.0}; \ LOAD_GL_FUNC(gl##_name_,_extension_) \ fptr_gl##_name_(NUM2UINT(arg1),NUM2UINT(arg2),cary); \ RET_ARRAY_OR_SINGLE(4,RETCONV_##_type_,cary) \ } GETPROGRAMPARAM_FUNC(GetProgramEnvParameterdvARB,GLdouble,"GL_ARB_vertex_program") GETPROGRAMPARAM_FUNC(GetProgramEnvParameterfvARB,GLfloat,"GL_ARB_vertex_program") GETPROGRAMPARAM_FUNC(GetProgramLocalParameterdvARB,GLdouble,"GL_ARB_vertex_program") GETPROGRAMPARAM_FUNC(GetProgramLocalParameterfvARB,GLfloat,"GL_ARB_vertex_program") #undef GETPROGRAMPARAM_FUNC GL_FUNC_LOAD_2(VertexAttrib1dARB,GLvoid, GLuint,GLdouble, "GL_ARB_vertex_program") GL_FUNC_LOAD_2(VertexAttrib1fARB,GLvoid, GLuint,GLfloat, "GL_ARB_vertex_program") GL_FUNC_LOAD_2(VertexAttrib1sARB,GLvoid, GLuint,GLshort, "GL_ARB_vertex_program") GL_FUNC_LOAD_3(VertexAttrib2dARB,GLvoid, GLuint,GLdouble,GLdouble, "GL_ARB_vertex_program") GL_FUNC_LOAD_3(VertexAttrib2fARB,GLvoid, GLuint,GLfloat,GLfloat, "GL_ARB_vertex_program") GL_FUNC_LOAD_3(VertexAttrib2sARB,GLvoid, GLuint,GLshort,GLshort, "GL_ARB_vertex_program") GL_FUNC_LOAD_4(VertexAttrib3dARB,GLvoid, GLuint,GLdouble,GLdouble,GLdouble, "GL_ARB_vertex_program") GL_FUNC_LOAD_4(VertexAttrib3fARB,GLvoid, GLuint,GLfloat,GLfloat,GLfloat, "GL_ARB_vertex_program") GL_FUNC_LOAD_4(VertexAttrib3sARB,GLvoid, GLuint,GLshort,GLshort,GLshort, "GL_ARB_vertex_program") GL_FUNC_LOAD_5(VertexAttrib4dARB,GLvoid, GLuint,GLdouble,GLdouble,GLdouble,GLdouble, "GL_ARB_vertex_program") GL_FUNC_LOAD_5(VertexAttrib4fARB,GLvoid, GLuint,GLfloat,GLfloat,GLfloat,GLfloat, "GL_ARB_vertex_program") GL_FUNC_LOAD_5(VertexAttrib4sARB,GLvoid, GLuint,GLshort,GLshort,GLshort,GLshort, "GL_ARB_vertex_program") GL_FUNC_LOAD_5(VertexAttrib4NubARB,GLvoid, GLuint,GLubyte,GLubyte,GLubyte,GLubyte, "GL_ARB_vertex_program") #define VERTEXATTRIB_FUNC_V(_name_,_type_,_conv_,_size_,_extension_) \ static void (APIENTRY * fptr_gl##_name_)(GLuint,_type_ *); \ static VALUE \ gl_##_name_(obj,arg1,arg2) \ VALUE obj,arg1,arg2; \ { \ GLuint index; \ _type_ v[_size_]; \ LOAD_GL_FUNC(gl##_name_,_extension_) \ index = (GLuint)NUM2UINT(arg1); \ _conv_(arg2,v,_size_); \ fptr_gl##_name_(index,v); \ CHECK_GLERROR \ return Qnil; \ } VERTEXATTRIB_FUNC_V(VertexAttrib4NbvARB,GLbyte,ary2cbyte,4,"GL_ARB_vertex_program") VERTEXATTRIB_FUNC_V(VertexAttrib4NivARB,GLint,ary2cint,4,"GL_ARB_vertex_program") VERTEXATTRIB_FUNC_V(VertexAttrib4NsvARB,GLshort,ary2cshort,4,"GL_ARB_vertex_program") VERTEXATTRIB_FUNC_V(VertexAttrib4NubvARB,GLubyte,ary2cubyte,4,"GL_ARB_vertex_program") VERTEXATTRIB_FUNC_V(VertexAttrib4NuivARB,GLuint,ary2cuint,4,"GL_ARB_vertex_program") VERTEXATTRIB_FUNC_V(VertexAttrib4NusvARB,GLushort,ary2cushort,4,"GL_ARB_vertex_program") VERTEXATTRIB_FUNC_V(VertexAttrib4uivARB,GLuint,ary2cuint,4,"GL_ARB_vertex_program") VERTEXATTRIB_FUNC_V(VertexAttrib4ubvARB,GLubyte,ary2cubyte,4,"GL_ARB_vertex_program") VERTEXATTRIB_FUNC_V(VertexAttrib4usvARB,GLushort,ary2cushort,4,"GL_ARB_vertex_program") VERTEXATTRIB_FUNC_V(VertexAttrib4bvARB,GLbyte,ary2cbyte,4,"GL_ARB_vertex_program") VERTEXATTRIB_FUNC_V(VertexAttrib4ivARB,GLint,ary2cint,4,"GL_ARB_vertex_program") VERTEXATTRIB_FUNC_V(VertexAttrib4dvARB,GLdouble,ary2cdbl,4,"GL_ARB_vertex_program") VERTEXATTRIB_FUNC_V(VertexAttrib4fvARB,GLfloat,ary2cflt,4,"GL_ARB_vertex_program") VERTEXATTRIB_FUNC_V(VertexAttrib4svARB,GLshort,ary2cshort,4,"GL_ARB_vertex_program") VERTEXATTRIB_FUNC_V(VertexAttrib3dvARB,GLdouble,ary2cdbl,3,"GL_ARB_vertex_program") VERTEXATTRIB_FUNC_V(VertexAttrib3fvARB,GLfloat,ary2cflt,3,"GL_ARB_vertex_program") VERTEXATTRIB_FUNC_V(VertexAttrib3svARB,GLshort,ary2cshort,3,"GL_ARB_vertex_program") VERTEXATTRIB_FUNC_V(VertexAttrib2dvARB,GLdouble,ary2cdbl,2,"GL_ARB_vertex_program") VERTEXATTRIB_FUNC_V(VertexAttrib2fvARB,GLfloat,ary2cflt,2,"GL_ARB_vertex_program") VERTEXATTRIB_FUNC_V(VertexAttrib2svARB,GLshort,ary2cshort,2,"GL_ARB_vertex_program") VERTEXATTRIB_FUNC_V(VertexAttrib1dvARB,GLdouble,ary2cdbl,1,"GL_ARB_vertex_program") VERTEXATTRIB_FUNC_V(VertexAttrib1fvARB,GLfloat,ary2cflt,1,"GL_ARB_vertex_program") VERTEXATTRIB_FUNC_V(VertexAttrib1svARB,GLshort,ary2cshort,1,"GL_ARB_vertex_program") #undef VERTEXATTRIB_FUNC_V #define GETVERTEXATTRIB_FUNC(_name_,_type_,_extension_) \ static void (APIENTRY * fptr_gl##_name_)(GLuint,GLenum,_type_ *); \ static VALUE \ gl_##_name_(obj,arg1,arg2) \ VALUE obj,arg1,arg2; \ { \ GLuint index; \ GLenum pname; \ _type_ params[4] = {0,0,0,0}; \ GLint size; \ LOAD_GL_FUNC(gl##_name_,_extension_) \ index = (GLuint)NUM2UINT(arg1); \ pname = (GLenum)NUM2INT(arg2); \ if (pname==GL_CURRENT_VERTEX_ATTRIB_ARB) \ size = 4; \ else \ size = 1; \ fptr_gl##_name_(index,pname,params); \ RET_ARRAY_OR_SINGLE(size,RETCONV_##_type_,params) \ } GETVERTEXATTRIB_FUNC(GetVertexAttribdvARB,GLdouble,"GL_ARB_vertex_program") GETVERTEXATTRIB_FUNC(GetVertexAttribfvARB,GLfloat,"GL_ARB_vertex_program") //GETVERTEXATTRIB_FUNC(GetVertexAttribivARB,GLint,INT2NUM,"GL_ARB_vertex_program") #undef GETVERTEXATTRIB_FUNC static void (APIENTRY * fptr_glGetVertexAttribivARB)(GLuint,GLenum,GLint *); static VALUE gl_GetVertexAttribivARB(obj,arg1,arg2) VALUE obj,arg1,arg2; { GLuint index; GLenum pname; GLint params[4] = {0,0,0,0}; GLint size; LOAD_GL_FUNC(glGetVertexAttribivARB,"GL_ARB_vertex_program") index = (GLuint)NUM2UINT(arg1); pname = (GLenum)NUM2INT(arg2); if (pname==GL_CURRENT_VERTEX_ATTRIB) size = 4; else size = 1; fptr_glGetVertexAttribivARB(index,pname,params); RET_ARRAY_OR_SINGLE_BOOL(size,cond_GLBOOL2RUBY,pname,params) } /* #29 GL_ARB_occlusion_query */ GL_FUNC_GENOBJECTS_LOAD(GenQueriesARB,"GL_ARB_occlusion_query") GL_FUNC_DELETEOBJECTS_LOAD(DeleteQueriesARB,"GL_ARB_occlusion_query") GL_FUNC_LOAD_1(IsQueryARB,GLboolean, GLuint, "GL_ARB_occlusion_query") GL_FUNC_LOAD_2(BeginQueryARB,GLvoid, GLuint,GLuint, "GL_ARB_occlusion_query") GL_FUNC_LOAD_1(EndQueryARB,GLvoid, GLenum, "GL_ARB_occlusion_query") #define GETQUERY_FUNC(_name_,_type_,_conv_) \ static void (APIENTRY * fptr_gl##_name_)(GLuint,GLenum,_type_ *); \ static VALUE gl_##_name_(VALUE obj,VALUE arg1,VALUE arg2) \ { \ _type_ ret = 0; \ LOAD_GL_FUNC(gl##_name_,"GL_ARB_occlusion_query") \ fptr_gl##_name_(NUM2INT(arg1),NUM2INT(arg2),&ret); \ CHECK_GLERROR \ return _conv_(NUM2INT(arg2),ret); \ } GETQUERY_FUNC(GetQueryivARB,GLint,cond_GLBOOL2RUBY) GETQUERY_FUNC(GetQueryObjectivARB,GLint,cond_GLBOOL2RUBY) GETQUERY_FUNC(GetQueryObjectuivARB,GLuint,cond_GLBOOL2RUBY_U) #undef GETQUERY_FUNC /* #30 GL_ARB_shader_objects */ GL_FUNC_LOAD_1(DeleteObjectARB,GLvoid, GLuint, "GL_ARB_shader_objects") GL_FUNC_LOAD_2(DetachObjectARB,GLvoid, GLuint,GLuint, "GL_ARB_shader_objects") GL_FUNC_LOAD_1(CompileShaderARB,GLvoid, GLuint, "GL_ARB_shader_objects") GL_FUNC_LOAD_2(AttachObjectARB,GLvoid, GLuint,GLuint, "GL_ARB_shader_objects") GL_FUNC_LOAD_1(LinkProgramARB,GLvoid, GLuint, "GL_ARB_shader_objects") GL_FUNC_LOAD_1(UseProgramObjectARB,GLvoid, GLuint, "GL_ARB_shader_objects") GL_FUNC_LOAD_1(ValidateProgramARB,GLvoid, GLuint, "GL_ARB_shader_objects") GL_FUNC_LOAD_1(GetHandleARB,GLuint, GLenum, "GL_ARB_shader_objects") GL_FUNC_LOAD_1(CreateShaderObjectARB,GLuint, GLenum, "GL_ARB_shader_objects") GL_FUNC_LOAD_0(CreateProgramObjectARB,GLuint, "GL_ARB_shader_objects") static void (APIENTRY * fptr_glShaderSourceARB)(GLuint,GLsizei,GLchar**,GLint *); static VALUE gl_ShaderSourceARB(obj,arg1,arg2) VALUE obj,arg1,arg2; { GLuint shader; GLint length; GLchar *str; LOAD_GL_FUNC(glShaderSourceARB,"GL_ARB_shader_objects") shader = (GLuint)NUM2UINT(arg1); Check_Type(arg2,T_STRING); str = RSTRING_PTR(arg2); length = RSTRING_LEN(arg2); fptr_glShaderSourceARB(shader,1,&str,&length); CHECK_GLERROR return Qnil; } GL_FUNC_LOAD_2(Uniform1fARB,GLvoid, GLint,GLfloat, "GL_ARB_shader_objects") GL_FUNC_LOAD_3(Uniform2fARB,GLvoid, GLint,GLfloat,GLfloat, "GL_ARB_shader_objects") GL_FUNC_LOAD_4(Uniform3fARB,GLvoid, GLint,GLfloat,GLfloat,GLfloat, "GL_ARB_shader_objects") GL_FUNC_LOAD_5(Uniform4fARB,GLvoid, GLint,GLfloat,GLfloat,GLfloat,GLfloat, "GL_ARB_shader_objects") GL_FUNC_LOAD_2(Uniform1iARB,GLvoid, GLint,GLint, "GL_ARB_shader_objects") GL_FUNC_LOAD_3(Uniform2iARB,GLvoid, GLint,GLint,GLint, "GL_ARB_shader_objects") GL_FUNC_LOAD_4(Uniform3iARB,GLvoid, GLint,GLint,GLint,GLint, "GL_ARB_shader_objects") GL_FUNC_LOAD_5(Uniform4iARB,GLvoid, GLint,GLint,GLint,GLint,GLint, "GL_ARB_shader_objects") #define GLUNIFORM_VFUNC(_name_,_type_,_conv_,_size_) \ static void (APIENTRY * fptr_gl##_name_)(GLint,GLsizei,const _type_ *); \ static VALUE \ gl_##_name_(obj,arg1,arg2) \ VALUE obj,arg1,arg2; \ { \ GLint location; \ GLsizei count; \ _type_ *value; \ LOAD_GL_FUNC(gl##_name_,"GL_ARB_shader_objects") \ Check_Type(arg2,T_ARRAY); \ count = RARRAY_LEN(arg2); \ if (count<=0 || (count % _size_) != 0) \ rb_raise(rb_eArgError, "Parameter array size must be multiplication of %i",_size_); \ location = (GLint)NUM2INT(arg1); \ value = ALLOC_N(_type_,count); \ _conv_(arg2,value,count); \ fptr_gl##_name_(location,count / _size_,value); \ xfree(value); \ CHECK_GLERROR \ return Qnil; \ } GLUNIFORM_VFUNC(Uniform1fvARB,GLfloat,ary2cflt,1) GLUNIFORM_VFUNC(Uniform2fvARB,GLfloat,ary2cflt,2) GLUNIFORM_VFUNC(Uniform3fvARB,GLfloat,ary2cflt,3) GLUNIFORM_VFUNC(Uniform4fvARB,GLfloat,ary2cflt,4) GLUNIFORM_VFUNC(Uniform1ivARB,GLint,ary2cint,1) GLUNIFORM_VFUNC(Uniform2ivARB,GLint,ary2cint,2) GLUNIFORM_VFUNC(Uniform3ivARB,GLint,ary2cint,3) GLUNIFORM_VFUNC(Uniform4ivARB,GLint,ary2cint,4) #undef GLUNIFORM_VFUNC #define UNIFORMMATRIX_FUNC(_name_,_size_) \ static void (APIENTRY * fptr_gl##_name_)(GLint,GLsizei,GLboolean,GLfloat *); \ static VALUE \ gl_##_name_(obj,arg1,arg2,arg3) \ VALUE obj,arg1,arg2,arg3; \ { \ GLint location; \ GLsizei count; \ GLboolean transpose; \ GLfloat *value; \ LOAD_GL_FUNC(gl##_name_,"GL_ARB_shader_objects") \ location = (GLint)NUM2INT(arg1); \ count = RARRAY_LEN(rb_funcall(rb_Array(arg3),rb_intern("flatten"),0)); \ transpose = (GLboolean)NUM2INT(arg2); \ value = ALLOC_N(GLfloat, count); \ ary2cmatfloatcount(arg3,value,_size_,_size_); \ fptr_gl##_name_(location,count / (_size_*_size_),transpose,value); \ xfree(value); \ CHECK_GLERROR \ return Qnil; \ } UNIFORMMATRIX_FUNC(UniformMatrix2fvARB,2) UNIFORMMATRIX_FUNC(UniformMatrix3fvARB,3) UNIFORMMATRIX_FUNC(UniformMatrix4fvARB,4) #undef UNIFORMMATRIX_FUNC #define GETOBJECTPARAMETER_FUNC(_name_,_type_,_conv_) \ static void (APIENTRY * fptr_gl##_name_)(GLuint,GLenum,_type_ *); \ static VALUE \ gl_##_name_(obj,arg1,arg2) \ VALUE obj,arg1,arg2; \ { \ GLuint program; \ GLenum pname; \ _type_ params = 0; \ LOAD_GL_FUNC(gl##_name_,"GL_ARB_shader_objects") \ program = (GLuint)NUM2UINT(arg1); \ pname = (GLenum)NUM2INT(arg2); \ fptr_gl##_name_(program,pname,¶ms); \ CHECK_GLERROR \ return _conv_(pname,params); \ } GETOBJECTPARAMETER_FUNC(GetObjectParameterivARB,GLint,cond_GLBOOL2RUBY) GETOBJECTPARAMETER_FUNC(GetObjectParameterfvARB,GLfloat,cond_GLBOOL2RUBY_F) #undef GETOBJECTPARAMETER_FUNC static void (APIENTRY * fptr_glGetInfoLogARB)(GLuint,GLsizei,GLsizei *,GLchar *); static VALUE gl_GetInfoLogARB(obj,arg1) VALUE obj,arg1; { GLuint program; GLint max_size = 0; GLsizei ret_length = 0; VALUE buffer; LOAD_GL_FUNC(glGetInfoLogARB,"GL_ARB_shader_objects") LOAD_GL_FUNC(glGetObjectParameterivARB,"GL_ARB_shader_objects") program = (GLuint)NUM2UINT(arg1); fptr_glGetObjectParameterivARB(program,GL_OBJECT_INFO_LOG_LENGTH_ARB,&max_size); CHECK_GLERROR if (max_size<=0) return rb_str_new2(""); buffer = allocate_buffer_with_string(max_size); fptr_glGetInfoLogARB(program,max_size,&ret_length,RSTRING_PTR(buffer)); CHECK_GLERROR return buffer; } static void (APIENTRY * fptr_glGetShaderSourceARB)(GLuint,GLsizei,GLsizei *,GLchar *); static VALUE gl_GetShaderSourceARB(obj,arg1) VALUE obj,arg1; { GLuint shader; GLint max_size = 0; GLsizei ret_length = 0; VALUE buffer; LOAD_GL_FUNC(glGetShaderSourceARB,"GL_ARB_shader_objects") LOAD_GL_FUNC(glGetObjectParameterivARB,"GL_ARB_shader_objects") shader = (GLuint)NUM2UINT(arg1); fptr_glGetObjectParameterivARB(shader,GL_OBJECT_SHADER_SOURCE_LENGTH_ARB,&max_size); CHECK_GLERROR if (max_size==0) rb_raise(rb_eTypeError, "Can't determine maximum shader source length"); buffer = allocate_buffer_with_string(max_size-1); fptr_glGetShaderSourceARB(shader,max_size,&ret_length,RSTRING_PTR(buffer)); CHECK_GLERROR return buffer; } static void (APIENTRY * fptr_glGetActiveUniformARB)(GLuint,GLuint,GLsizei,GLsizei*,GLint*,GLenum*,GLchar*); static VALUE gl_GetActiveUniformARB(obj,arg1,arg2) VALUE obj,arg1,arg2; { GLuint program; GLuint index; GLsizei max_size = 0; GLsizei written = 0; GLint uniform_size = 0; GLenum uniform_type = 0; VALUE buffer; VALUE retary; LOAD_GL_FUNC(glGetActiveUniformARB,"GL_ARB_shader_objects") LOAD_GL_FUNC(glGetObjectParameterivARB,"GL_EXT_sahder_objects") program = (GLuint)NUM2UINT(arg1); index = (GLuint)NUM2UINT(arg2); fptr_glGetObjectParameterivARB(program,GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB,&max_size); CHECK_GLERROR if (max_size==0) rb_raise(rb_eTypeError, "Can't determine maximum uniform name length"); buffer = allocate_buffer_with_string(max_size-1); fptr_glGetActiveUniformARB(program,index,max_size,&written,&uniform_size,&uniform_type,RSTRING_PTR(buffer)); retary = rb_ary_new2(3); rb_ary_push(retary, INT2NUM(uniform_size)); rb_ary_push(retary, INT2NUM(uniform_type)); rb_ary_push(retary, buffer); CHECK_GLERROR return retary; } #define GETUNIFORM_FUNC(_name_,_type_) \ static void (APIENTRY * fptr_gl##_name_)(GLuint,GLint,_type_ *); \ static VALUE \ gl_##_name_(obj,arg1,arg2) \ VALUE obj,arg1,arg2; \ { \ GLuint program; \ GLint location; \ _type_ params[16]; \ GLint unused = 0; \ GLenum uniform_type = 0; \ GLint uniform_size = 0; \ \ LOAD_GL_FUNC(gl##_name_,"GL_ARB_shader_objects") \ LOAD_GL_FUNC(glGetActiveUniformARB,"GL_ARB_shader_objects") \ program = (GLuint)NUM2UINT(arg1); \ location = (GLint)NUM2INT(arg2); \ \ fptr_glGetActiveUniformARB(program,location,0,NULL,&unused,&uniform_type,NULL); \ CHECK_GLERROR \ if (uniform_type==0) \ rb_raise(rb_eTypeError, "Can't determine the uniform's type"); \ \ uniform_size = get_uniform_size(uniform_type); \ \ memset(params,0,16*sizeof(_type_)); \ fptr_gl##_name_(program,location,params); \ RET_ARRAY_OR_SINGLE(uniform_size,RETCONV_##_type_,params) \ } GETUNIFORM_FUNC(GetUniformfvARB,GLfloat) GETUNIFORM_FUNC(GetUniformivARB,GLint) #undef GETUNIFORM_FUNC static GLint (APIENTRY * fptr_glGetUniformLocationARB)(GLuint,const GLchar*); static VALUE gl_GetUniformLocationARB(obj,arg1,arg2) VALUE obj,arg1,arg2; { GLuint program; GLint ret; LOAD_GL_FUNC(glGetUniformLocationARB,"GL_ARB_shader_objects") program=(GLuint)NUM2UINT(arg1); Check_Type(arg2,T_STRING); ret = fptr_glGetUniformLocationARB(program,RSTRING_PTR(arg2)); CHECK_GLERROR return INT2NUM(ret); } static void (APIENTRY * fptr_glGetAttachedObjectsARB)(GLuint,GLsizei,GLsizei *,GLuint *); static VALUE gl_GetAttachedObjectsARB(obj,arg1) VALUE obj,arg1; { GLuint program; GLint shaders_num = 0; GLuint *shaders; GLsizei count = 0; LOAD_GL_FUNC(glGetAttachedObjectsARB,"GL_ARB_shader_objects") LOAD_GL_FUNC(glGetObjectParameterivARB,"GL_ARB_shader_objects") program = (GLuint)NUM2UINT(arg1); fptr_glGetObjectParameterivARB(program,GL_OBJECT_ATTACHED_OBJECTS_ARB,&shaders_num); CHECK_GLERROR if (shaders_num<=0) return Qnil; shaders = ALLOC_N(GLuint,shaders_num); fptr_glGetAttachedObjectsARB(program,shaders_num,&count,shaders); RET_ARRAY_OR_SINGLE_FREE(count,RETCONV_GLuint,shaders) } /* #31 GL_ARB_vertex_shader */ static void (APIENTRY * fptr_glBindAttribLocationARB)(GLuint,GLuint,GLchar *); static VALUE gl_BindAttribLocationARB(obj,arg1,arg2,arg3) VALUE obj,arg1,arg2,arg3; { GLuint program; GLuint index; LOAD_GL_FUNC(glBindAttribLocationARB,"GL_ARB_vertex_shader") program = (GLuint)NUM2UINT(arg1); index = (GLuint)NUM2UINT(arg2); Check_Type(arg3, T_STRING); fptr_glBindAttribLocationARB(program,index,RSTRING_PTR(arg3)); CHECK_GLERROR return Qnil; } static void (APIENTRY * fptr_glGetActiveAttribARB)(GLuint,GLuint,GLsizei,GLsizei *,GLint *,GLenum *,GLchar *); static VALUE gl_GetActiveAttribARB(obj,arg1,arg2) VALUE obj,arg1,arg2; { GLuint program; GLuint index; GLsizei max_size = 0; GLsizei written = 0; GLint attrib_size = 0; GLenum attrib_type = 0; VALUE buffer; VALUE retary; LOAD_GL_FUNC(glGetActiveAttribARB,"GL_ARB_vertex_shader") LOAD_GL_FUNC(glGetObjectParameterivARB,"GL_ARB_vertex_shader") program = (GLuint)NUM2UINT(arg1); index = (GLuint)NUM2UINT(arg2); fptr_glGetObjectParameterivARB(program,GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB,&max_size); CHECK_GLERROR if (max_size==0) rb_raise(rb_eTypeError, "Can't determine maximum attribute name length"); buffer = allocate_buffer_with_string(max_size-1); fptr_glGetActiveAttribARB(program,index,max_size,&written,&attrib_size,&attrib_type,RSTRING_PTR(buffer)); retary = rb_ary_new2(3); rb_ary_push(retary, INT2NUM(attrib_size)); rb_ary_push(retary, INT2NUM(attrib_type)); rb_ary_push(retary, buffer); CHECK_GLERROR return retary; } static GLint (APIENTRY * fptr_glGetAttribLocationARB)(GLuint,const GLchar*); static VALUE gl_GetAttribLocationARB(obj,arg1,arg2) VALUE obj,arg1,arg2; { GLuint program; GLint ret; LOAD_GL_FUNC(glGetAttribLocationARB,"GL_ARB_shader_objects") program=(GLuint)NUM2UINT(arg1); Check_Type(arg2,T_STRING); ret = fptr_glGetAttribLocationARB(program,RSTRING_PTR(arg2)); CHECK_GLERROR return INT2NUM(ret); } /* #39 GL_ARB_color_buffer_float */ GL_FUNC_LOAD_2(ClampColorARB,GLvoid, GLenum,GLenum, "GL_ARB_color_buffer_float") void gl_init_functions_ext_arb(VALUE module) { /* #3 GL_ARB_transpose_matrix */ rb_define_module_function(module, "glLoadTransposeMatrixfARB", gl_LoadTransposeMatrixfARB, 1); rb_define_module_function(module, "glLoadTransposeMatrixdARB", gl_LoadTransposeMatrixdARB, 1); rb_define_module_function(module, "glMultTransposeMatrixfARB", gl_MultTransposeMatrixfARB, 1); rb_define_module_function(module, "glMultTransposeMatrixdARB", gl_MultTransposeMatrixdARB, 1); /* #5 GL_ARB_multisample */ rb_define_module_function(module, "glSampleCoverageARB", gl_SampleCoverageARB, 2); /* #14 GL_ARB_point_parameters */ rb_define_module_function(module, "glPointParameterfARB", gl_PointParameterfARB, 2); rb_define_module_function(module, "glPointParameterfvARB", gl_PointParameterfvARB, 2); /* #26 GL_ARB_window_pos */ rb_define_module_function(module, "glWindowPos2dARB", gl_WindowPos2dARB, 2); rb_define_module_function(module, "glWindowPos2fARB", gl_WindowPos2fARB, 2); rb_define_module_function(module, "glWindowPos2iARB", gl_WindowPos2iARB, 2); rb_define_module_function(module, "glWindowPos2sARB", gl_WindowPos2sARB, 2); rb_define_module_function(module, "glWindowPos3dARB", gl_WindowPos3dARB, 3); rb_define_module_function(module, "glWindowPos3fARB", gl_WindowPos3fARB, 3); rb_define_module_function(module, "glWindowPos3iARB", gl_WindowPos3iARB, 3); rb_define_module_function(module, "glWindowPos3sARB", gl_WindowPos3sARB, 3); rb_define_module_function(module, "glWindowPos2dvARB", gl_WindowPos2dvARB, 1); rb_define_module_function(module, "glWindowPos2fvARB", gl_WindowPos2fvARB, 1); rb_define_module_function(module, "glWindowPos2ivARB", gl_WindowPos2ivARB, 1); rb_define_module_function(module, "glWindowPos2svARB", gl_WindowPos2svARB, 1); rb_define_module_function(module, "glWindowPos3dvARB", gl_WindowPos3dvARB, 1); rb_define_module_function(module, "glWindowPos3fvARB", gl_WindowPos3fvARB, 1); rb_define_module_function(module, "glWindowPos3ivARB", gl_WindowPos3ivARB, 1); rb_define_module_function(module, "glWindowPos3svARB", gl_WindowPos3svARB, 1); /* #26 GL_ARB_vertex_program */ rb_define_module_function(module, "glProgramStringARB", gl_ProgramStringARB, 3); rb_define_module_function(module, "glGetProgramStringARB", gl_GetProgramStringARB, 2); rb_define_module_function(module, "glGetProgramivARB", gl_GetProgramivARB, 2); rb_define_module_function(module, "glBindProgramARB", gl_BindProgramARB, 2); rb_define_module_function(module, "glGenProgramsARB", gl_GenProgramsARB, 1); rb_define_module_function(module, "glDeleteProgramsARB", gl_DeleteProgramsARB, 1); rb_define_module_function(module, "glIsProgramARB", gl_IsProgramARB, 1); rb_define_module_function(module, "glEnableVertexAttribArrayARB", gl_EnableVertexAttribArrayARB, 1); rb_define_module_function(module, "glDisableVertexAttribArrayARB", gl_DisableVertexAttribArrayARB, 1); rb_define_module_function(module, "glVertexAttribPointerARB", gl_VertexAttribPointerARB, 6); rb_define_module_function(module, "glGetVertexAttribPointervARB", gl_GetVertexAttribPointervARB, 1); rb_define_module_function(module, "glProgramEnvParameter4dARB", gl_ProgramEnvParameter4dARB, 6); rb_define_module_function(module, "glProgramEnvParameter4fARB", gl_ProgramEnvParameter4fARB, 6); rb_define_module_function(module, "glProgramLocalParameter4dARB", gl_ProgramLocalParameter4dARB, 6); rb_define_module_function(module, "glProgramLocalParameter4fARB", gl_ProgramLocalParameter4fARB, 6); rb_define_module_function(module, "glProgramEnvParameter4dvARB", gl_ProgramEnvParameter4dvARB, 3); rb_define_module_function(module, "glProgramEnvParameter4fvARB", gl_ProgramEnvParameter4fvARB, 3); rb_define_module_function(module, "glProgramLocalParameter4dvARB", gl_ProgramLocalParameter4dvARB, 3); rb_define_module_function(module, "glProgramLocalParameter4fvARB", gl_ProgramLocalParameter4fvARB, 3); rb_define_module_function(module, "glGetProgramEnvParameterdvARB", gl_GetProgramEnvParameterdvARB, 2); rb_define_module_function(module, "glGetProgramEnvParameterfvARB", gl_GetProgramEnvParameterfvARB, 2); rb_define_module_function(module, "glGetProgramLocalParameterdvARB", gl_GetProgramLocalParameterdvARB, 2); rb_define_module_function(module, "glGetProgramLocalParameterfvARB", gl_GetProgramLocalParameterfvARB, 2); rb_define_module_function(module, "glVertexAttrib1dARB", gl_VertexAttrib1dARB, 2); rb_define_module_function(module, "glVertexAttrib1fARB", gl_VertexAttrib1fARB, 2); rb_define_module_function(module, "glVertexAttrib1sARB", gl_VertexAttrib1sARB, 2); rb_define_module_function(module, "glVertexAttrib2dARB", gl_VertexAttrib2dARB, 3); rb_define_module_function(module, "glVertexAttrib2fARB", gl_VertexAttrib2fARB, 3); rb_define_module_function(module, "glVertexAttrib2sARB", gl_VertexAttrib2sARB, 3); rb_define_module_function(module, "glVertexAttrib3dARB", gl_VertexAttrib3dARB, 4); rb_define_module_function(module, "glVertexAttrib3fARB", gl_VertexAttrib3fARB, 4); rb_define_module_function(module, "glVertexAttrib3sARB", gl_VertexAttrib3sARB, 4); rb_define_module_function(module, "glVertexAttrib4NbvARB", gl_VertexAttrib4NbvARB, 2); rb_define_module_function(module, "glVertexAttrib4NivARB", gl_VertexAttrib4NivARB, 2); rb_define_module_function(module, "glVertexAttrib4NsvARB", gl_VertexAttrib4NsvARB, 2); rb_define_module_function(module, "glVertexAttrib4NubARB", gl_VertexAttrib4NubARB, 5); rb_define_module_function(module, "glVertexAttrib4NubvARB", gl_VertexAttrib4NubvARB, 2); rb_define_module_function(module, "glVertexAttrib4NuivARB", gl_VertexAttrib4NuivARB, 2); rb_define_module_function(module, "glVertexAttrib4NusvARB", gl_VertexAttrib4NusvARB, 2); rb_define_module_function(module, "glVertexAttrib4bvARB", gl_VertexAttrib4bvARB, 2); rb_define_module_function(module, "glVertexAttrib4dARB", gl_VertexAttrib4dARB, 5); rb_define_module_function(module, "glVertexAttrib4fARB", gl_VertexAttrib4fARB, 5); rb_define_module_function(module, "glVertexAttrib4ivARB", gl_VertexAttrib4ivARB, 2); rb_define_module_function(module, "glVertexAttrib4sARB", gl_VertexAttrib4sARB, 5); rb_define_module_function(module, "glVertexAttrib4ubvARB", gl_VertexAttrib4ubvARB, 2); rb_define_module_function(module, "glVertexAttrib4uivARB", gl_VertexAttrib4uivARB, 2); rb_define_module_function(module, "glVertexAttrib4usvARB", gl_VertexAttrib4usvARB, 2); rb_define_module_function(module, "glVertexAttrib1dvARB", gl_VertexAttrib1dvARB, 2); rb_define_module_function(module, "glVertexAttrib1fvARB", gl_VertexAttrib1fvARB, 2); rb_define_module_function(module, "glVertexAttrib1svARB", gl_VertexAttrib1svARB, 2); rb_define_module_function(module, "glVertexAttrib2dvARB", gl_VertexAttrib2dvARB, 2); rb_define_module_function(module, "glVertexAttrib2fvARB", gl_VertexAttrib2fvARB, 2); rb_define_module_function(module, "glVertexAttrib2svARB", gl_VertexAttrib2svARB, 2); rb_define_module_function(module, "glVertexAttrib3dvARB", gl_VertexAttrib3dvARB, 2); rb_define_module_function(module, "glVertexAttrib3fvARB", gl_VertexAttrib3fvARB, 2); rb_define_module_function(module, "glVertexAttrib3svARB", gl_VertexAttrib3svARB, 2); rb_define_module_function(module, "glVertexAttrib4dvARB", gl_VertexAttrib4dvARB, 2); rb_define_module_function(module, "glVertexAttrib4fvARB", gl_VertexAttrib4fvARB, 2); rb_define_module_function(module, "glVertexAttrib4svARB", gl_VertexAttrib4svARB, 2); rb_define_module_function(module, "glGetVertexAttribdvARB", gl_GetVertexAttribdvARB, 2); rb_define_module_function(module, "glGetVertexAttribfvARB", gl_GetVertexAttribfvARB, 2); rb_define_module_function(module, "glGetVertexAttribivARB", gl_GetVertexAttribivARB, 2); /* #29 GL_ARB_occlusion_query */ rb_define_module_function(module, "glGenQueriesARB", gl_GenQueriesARB, 1); rb_define_module_function(module, "glDeleteQueriesARB", gl_DeleteQueriesARB, 1); rb_define_module_function(module, "glIsQueryARB", gl_IsQueryARB, 1); rb_define_module_function(module, "glBeginQueryARB", gl_BeginQueryARB, 2); rb_define_module_function(module, "glEndQueryARB", gl_EndQueryARB, 1); rb_define_module_function(module, "glGetQueryivARB", gl_GetQueryivARB, 2); rb_define_module_function(module, "glGetQueryObjectivARB", gl_GetQueryObjectivARB, 2); rb_define_module_function(module, "glGetQueryObjectuivARB", gl_GetQueryObjectuivARB, 2); /* #30 GL_ARB_shader_objects */ rb_define_module_function(module, "glDeleteObjectARB", gl_DeleteObjectARB, 1); rb_define_module_function(module, "glGetHandleARB", gl_GetHandleARB, 1); rb_define_module_function(module, "glDetachObjectARB", gl_DetachObjectARB, 2); rb_define_module_function(module, "glCreateShaderObjectARB", gl_CreateShaderObjectARB, 1); rb_define_module_function(module, "glShaderSourceARB", gl_ShaderSourceARB, 2); rb_define_module_function(module, "glCompileShaderARB", gl_CompileShaderARB, 1); rb_define_module_function(module, "glCreateProgramObjectARB", gl_CreateProgramObjectARB, 0); rb_define_module_function(module, "glAttachObjectARB", gl_AttachObjectARB, 2); rb_define_module_function(module, "glLinkProgramARB", gl_LinkProgramARB, 1); rb_define_module_function(module, "glUseProgramObjectARB", gl_UseProgramObjectARB, 1); rb_define_module_function(module, "glValidateProgramARB", gl_ValidateProgramARB, 1); rb_define_module_function(module, "glUniform1fARB", gl_Uniform1fARB, 2); rb_define_module_function(module, "glUniform2fARB", gl_Uniform2fARB, 3); rb_define_module_function(module, "glUniform3fARB", gl_Uniform3fARB, 4); rb_define_module_function(module, "glUniform4fARB", gl_Uniform4fARB, 5); rb_define_module_function(module, "glUniform1iARB", gl_Uniform1iARB, 2); rb_define_module_function(module, "glUniform2iARB", gl_Uniform2iARB, 3); rb_define_module_function(module, "glUniform3iARB", gl_Uniform3iARB, 4); rb_define_module_function(module, "glUniform4iARB", gl_Uniform4iARB, 5); rb_define_module_function(module, "glUniform1fvARB", gl_Uniform1fvARB, 2); rb_define_module_function(module, "glUniform2fvARB", gl_Uniform2fvARB, 2); rb_define_module_function(module, "glUniform3fvARB", gl_Uniform3fvARB, 2); rb_define_module_function(module, "glUniform4fvARB", gl_Uniform4fvARB, 2); rb_define_module_function(module, "glUniform1ivARB", gl_Uniform1ivARB, 2); rb_define_module_function(module, "glUniform2ivARB", gl_Uniform2ivARB, 2); rb_define_module_function(module, "glUniform3ivARB", gl_Uniform3ivARB, 2); rb_define_module_function(module, "glUniform4ivARB", gl_Uniform4ivARB, 2); rb_define_module_function(module, "glUniformMatrix2fvARB", gl_UniformMatrix2fvARB, 3); rb_define_module_function(module, "glUniformMatrix3fvARB", gl_UniformMatrix3fvARB, 3); rb_define_module_function(module, "glUniformMatrix4fvARB", gl_UniformMatrix4fvARB, 3); rb_define_module_function(module, "glGetObjectParameterfvARB", gl_GetObjectParameterfvARB, 2); rb_define_module_function(module, "glGetObjectParameterivARB", gl_GetObjectParameterivARB, 2); rb_define_module_function(module, "glGetInfoLogARB", gl_GetInfoLogARB, 1); rb_define_module_function(module, "glGetShaderSourceARB", gl_GetShaderSourceARB, 1); rb_define_module_function(module, "glGetAttachedObjectsARB", gl_GetAttachedObjectsARB, 1); rb_define_module_function(module, "glGetUniformLocationARB", gl_GetUniformLocationARB, 2); rb_define_module_function(module, "glGetActiveUniformARB", gl_GetActiveUniformARB, 2); rb_define_module_function(module, "glGetUniformfvARB", gl_GetUniformfvARB, 2); rb_define_module_function(module, "glGetUniformivARB", gl_GetUniformivARB, 2); /* #31 GL_ARB_vertex_shader */ rb_define_module_function(module, "glBindAttribLocationARB", gl_BindAttribLocationARB, 3); rb_define_module_function(module, "glGetActiveAttribARB", gl_GetActiveAttribARB, 2); rb_define_module_function(module, "glGetAttribLocationARB", gl_GetAttribLocationARB, 2); /* #39 GL_ARB_color_buffer_float */ rb_define_module_function(module, "glClampColorARB", gl_ClampColorARB, 2); } ruby-opengl-0.60.1.orig/ext/gl/gl.c0000644000000000000000000001356311377006423015461 0ustar rootroot/* * Copyright (C) 1999 - 2005 Yoshi * Copyright (C) 2006 John M. Gabriele * Copyright (C) 2007 Jan Dvorak * * This program is distributed under the terms of the MIT license. * See the included MIT-LICENSE file for the terms of this license. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "../common/common.h" static VALUE module; void gl_init_enums(VALUE); void gl_init_functions_1_0__1_1(VALUE); void gl_init_functions_1_2(VALUE); void gl_init_functions_1_3(VALUE); void gl_init_functions_1_4(VALUE); void gl_init_functions_1_5(VALUE); void gl_init_functions_2_0(VALUE); void gl_init_functions_2_1(VALUE); void gl_init_functions_ext_3dfx(VALUE); void gl_init_functions_ext_arb(VALUE); void gl_init_functions_ext_ati(VALUE); void gl_init_functions_ext_ext(VALUE); void gl_init_functions_ext_gremedy(VALUE); void gl_init_functions_ext_nv(VALUE); static int opengl_version[2]; /* major, minor */ static char *opengl_extensions = NULL; /* Returns current OpenGL version as major, minor or 0,0 if * unknown (context not yet initialised etc.) The version is * cached for subsequent calls. */ const int *GetOpenglVersion(void) { if (opengl_version[0]==0) { /* not cached, query */ const char *vstr = (const char *) glGetString(GL_VERSION); CHECK_GLERROR if (vstr) sscanf( vstr, "%d.%d", &opengl_version[0], &opengl_version[1] ); } return opengl_version; } /* Checks if OpenGL version is at least the same or higher than * major.minor */ GLboolean CheckOpenglVersion(int major, int minor) { const int *version; version = GetOpenglVersion(); if (version[0]>major || (version[0]==major && version[1] >=minor)) return GL_TRUE; else return GL_FALSE; } /* Returns supported OpenGL extensions as char* or NULL * if unknown (context not yet initialised etc.) The list is * cached for subsequent calls. */ const char *GetOpenglExtensions(void) { if (opengl_extensions == NULL) { const char *estr = (const char *) glGetString(GL_EXTENSIONS); CHECK_GLERROR if (estr) { int len = strlen(estr); opengl_extensions = ALLOC_N(GLchar,len+1+1); /* terminating null and added space */ strcpy(opengl_extensions,estr); opengl_extensions[len] = ' '; /* add space char for easy searchs */ opengl_extensions[len+1] = '\0'; } } return opengl_extensions; } /* Checks if extension is supported by the current OpenGL implementation */ GLboolean CheckExtension(const char *name) { const char *extensions; char *name_tmp; int name_len; GLboolean res; extensions = GetOpenglExtensions(); if(extensions==NULL) return GL_FALSE; /* add trailing space */ name_len = strlen(name); name_tmp = ALLOC_N(GLchar,name_len+1+1); /* terminating null and added space */ strcpy(name_tmp,name); name_tmp[name_len] = ' '; /* add space char for search */ name_tmp[name_len+1] = '\0'; if (strstr(extensions,name_tmp)) res = GL_TRUE; else res = GL_FALSE; xfree(name_tmp); return res; } /* wrapper for CheckOpenglVersion and CheckExtension, also used by macros */ GLboolean CheckVersionExtension(const char *name) { if (name && name[0] && name[0]>='0' && name[0]<='9') { /* GL version query */ int major,minor; if (sscanf( name, "%d.%d", &major, &minor ) != 2) return GL_FALSE; return (CheckOpenglVersion(major,minor)); } else { return (CheckExtension(name)); } } /* Checks if given OpenGL version or extension is available */ static VALUE IsAvailable(obj,arg1) VALUE obj,arg1; { char *name = NULL; VALUE s; GLboolean res; s = rb_funcall(arg1, rb_intern("to_s"),0); name = RSTRING_PTR(s); res = CheckVersionExtension(name); return GLBOOL2RUBY(res); } /* Checks whether non-zero buffer of type $buffer is bound * - this affects several functions that pass data from/to OpenGL. */ GLint CheckBufferBinding(GLint buffer) { GLint result = 0; /* check if the buffer functionality is supported */ switch(buffer) { case GL_ARRAY_BUFFER_BINDING: case GL_ELEMENT_ARRAY_BUFFER_BINDING: if (!CheckOpenglVersion(1,5)) return 0; break; case GL_PIXEL_PACK_BUFFER_BINDING: case GL_PIXEL_UNPACK_BUFFER_BINDING: if (!CheckOpenglVersion(2,1)) return 0; break; default: rb_raise(rb_eRuntimeError,"Internal Error: buffer type '%i' does not exist", buffer); break; } glGetIntegerv(buffer,&result); CHECK_GLERROR return result; } DLLEXPORT void Init_gl() { VALUE VERSION = rb_str_new2("0.60"); module = rb_define_module("Gl"); rb_define_const(module, "BINDINGS_VERSION", VERSION); rb_define_const(module, "RUBY_OPENGL_VERSION", VERSION); gl_init_error(module); gl_init_enums(module); gl_init_functions_1_0__1_1(module); gl_init_functions_1_2(module); gl_init_functions_1_3(module); gl_init_functions_1_4(module); gl_init_functions_1_5(module); gl_init_functions_2_0(module); gl_init_functions_2_1(module); gl_init_functions_ext_3dfx(module); gl_init_functions_ext_arb(module); gl_init_functions_ext_ati(module); gl_init_functions_ext_ext(module); gl_init_functions_ext_gremedy(module); gl_init_functions_ext_nv(module); rb_define_module_function(module, "is_available?", IsAvailable, 1); rb_define_module_function(module, "is_supported?", IsAvailable, 1); rb_define_module_function(module, "extension_available?", IsAvailable, 1); rb_define_module_function(module, "extension_supported?", IsAvailable, 1); rb_define_module_function(module, "version_available?", IsAvailable, 1); rb_define_module_function(module, "version_supported?", IsAvailable, 1); } ruby-opengl-0.60.1.orig/ext/gl/gl-2.1.c0000644000000000000000000000423211377006423015750 0ustar rootroot/* * Copyright (C) 2007 Jan Dvorak * * This program is distributed under the terms of the MIT license. * See the included MIT-LICENSE file for the terms of this license. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "../common/common.h" #define UNIFORMMATRIX_FUNC(_x_,_y_) \ static void (APIENTRY * fptr_glUniformMatrix##_x_##x##_y_##fv)(GLint,GLsizei,GLboolean,GLfloat *); \ static VALUE \ gl_UniformMatrix##_x_##x##_y_##fv(obj,arg1,arg2,arg3) \ VALUE obj,arg1,arg2,arg3; \ { \ GLint location; \ GLsizei count; \ GLboolean transpose; \ GLfloat *value; \ LOAD_GL_FUNC(glUniformMatrix##_x_##x##_y_##fv,"2.1") \ location = (GLint)NUM2INT(arg1); \ count = RARRAY_LEN(rb_funcall(rb_Array(arg3),rb_intern("flatten"),0)); \ transpose = (GLboolean)NUM2INT(arg2); \ value = ALLOC_N(GLfloat, count); \ ary2cmatfloatcount(arg3,value, _x_, _y_); \ fptr_glUniformMatrix##_x_##x##_y_##fv(location,count /(_x_ * _y_),transpose,value); \ xfree(value); \ CHECK_GLERROR \ return Qnil; \ } UNIFORMMATRIX_FUNC(2,3) UNIFORMMATRIX_FUNC(3,2) UNIFORMMATRIX_FUNC(2,4) UNIFORMMATRIX_FUNC(4,2) UNIFORMMATRIX_FUNC(3,4) UNIFORMMATRIX_FUNC(4,3) #undef UNIFORMMATRIX_FUNC void gl_init_functions_2_1(VALUE module) { rb_define_module_function(module, "glUniformMatrix2x3fv", gl_UniformMatrix2x3fv, 3); rb_define_module_function(module, "glUniformMatrix3x2fv", gl_UniformMatrix3x2fv, 3); rb_define_module_function(module, "glUniformMatrix2x4fv", gl_UniformMatrix2x4fv, 3); rb_define_module_function(module, "glUniformMatrix4x2fv", gl_UniformMatrix4x2fv, 3); rb_define_module_function(module, "glUniformMatrix3x4fv", gl_UniformMatrix3x4fv, 3); rb_define_module_function(module, "glUniformMatrix4x3fv", gl_UniformMatrix4x3fv, 3); } ruby-opengl-0.60.1.orig/ext/gl/gl-1.0-1.1.c0000644000000000000000000025423111377006423016251 0ustar rootroot/* * Copyright (C) 1999 - 2005 Yoshi * Copyright (C) 2006 John M. Gabriele * Copyright (C) 2007 Jan Dvorak * * This program is distributed under the terms of the MIT license. * See the included MIT-LICENSE file for the terms of this license. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "../common/common.h" #ifndef MAX #define MAX(a, b) (((a) > (b)) ? (a) : (b)) #endif /* OpenGL 1.0 + 1.1 functions */ GL_FUNC_STATIC_2(Accum,GLvoid, GLenum,GLfloat) GL_FUNC_STATIC_2(AlphaFunc,GLvoid, GLenum,GLclampf) GL_FUNC_STATIC_1(ArrayElement,GLvoid, GLint) GL_FUNC_STATIC_2(BindTexture,GLvoid, GLenum,GLuint) GL_FUNC_STATIC_2(BlendFunc,GLvoid, GLenum,GLenum) GL_FUNC_STATIC_1(CallList,GLvoid, GLuint) GL_FUNC_STATIC_1(Clear,GLvoid, GLbitfield) GL_FUNC_STATIC_4(ClearAccum,GLvoid, GLfloat,GLfloat,GLfloat,GLfloat) GL_FUNC_STATIC_4(ClearColor,GLvoid, GLfloat,GLfloat,GLfloat,GLfloat) GL_FUNC_STATIC_1(ClearDepth,GLvoid, GLclampd) GL_FUNC_STATIC_1(ClearIndex,GLvoid, GLfloat) GL_FUNC_STATIC_1(ClearStencil,GLvoid, GLint) GL_FUNC_STATIC_3(Color3b,GLvoid, GLbyte,GLbyte,GLbyte) GL_FUNC_STATIC_3(Color3d,GLvoid, GLdouble,GLdouble,GLdouble) GL_FUNC_STATIC_3(Color3f,GLvoid, GLfloat,GLfloat,GLfloat) GL_FUNC_STATIC_3(Color3i,GLvoid, GLint,GLint,GLint) GL_FUNC_STATIC_3(Color3s,GLvoid, GLshort,GLshort,GLshort) GL_FUNC_STATIC_3(Color3ub,GLvoid, GLubyte,GLubyte,GLubyte) GL_FUNC_STATIC_3(Color3ui,GLvoid, GLuint,GLuint,GLuint) GL_FUNC_STATIC_3(Color3us,GLvoid, GLushort,GLushort,GLushort) GL_FUNC_STATIC_4(Color4b,GLvoid, GLbyte,GLbyte,GLbyte,GLbyte) GL_FUNC_STATIC_4(Color4d,GLvoid, GLdouble,GLdouble,GLdouble,GLdouble) GL_FUNC_STATIC_4(Color4f,GLvoid, GLfloat,GLfloat,GLfloat,GLfloat) GL_FUNC_STATIC_4(Color4i,GLvoid, GLint,GLint,GLint,GLint) GL_FUNC_STATIC_4(Color4s,GLvoid, GLshort,GLshort,GLshort,GLshort) GL_FUNC_STATIC_4(Color4ub,GLvoid, GLubyte,GLubyte,GLubyte,GLubyte) GL_FUNC_STATIC_4(Color4ui,GLvoid, GLuint,GLuint,GLuint,GLuint) GL_FUNC_STATIC_4(Color4us,GLvoid, GLushort,GLushort,GLushort,GLushort) GL_FUNC_STATIC_4(ColorMask,GLvoid, GLboolean,GLboolean,GLboolean,GLboolean) GL_FUNC_STATIC_2(ColorMaterial,GLvoid, GLenum,GLenum) GL_FUNC_STATIC_5(CopyPixels,GLvoid, GLint,GLint,GLsizei,GLsizei,GLenum) GL_FUNC_STATIC_7(CopyTexImage1D,GLvoid, GLenum,GLint,GLenum,GLint,GLint,GLsizei,GLint) GL_FUNC_STATIC_8(CopyTexImage2D,GLvoid, GLenum,GLint,GLenum,GLint,GLint,GLsizei,GLsizei,GLint) GL_FUNC_STATIC_6(CopyTexSubImage1D,GLvoid, GLenum,GLint,GLint,GLint,GLint,GLsizei) GL_FUNC_STATIC_8(CopyTexSubImage2D,GLvoid, GLenum,GLint,GLint,GLint,GLint,GLint,GLsizei,GLsizei) GL_FUNC_STATIC_1(CullFace,GLvoid, GLenum) GL_FUNC_STATIC_2(DeleteLists,GLvoid, GLuint,GLuint) GL_FUNC_STATIC_1(DepthFunc,GLvoid, GLenum) GL_FUNC_STATIC_1(DepthMask,GLvoid, GLboolean) GL_FUNC_STATIC_2(DepthRange,GLvoid, GLclampd,GLclampd) GL_FUNC_STATIC_1(Disable,GLvoid, GLenum) GL_FUNC_STATIC_1(DisableClientState,GLvoid, GLenum) GL_FUNC_STATIC_3(DrawArrays,GLvoid, GLenum,GLint,GLsizei) GL_FUNC_STATIC_1(DrawBuffer,GLvoid, GLenum) GL_FUNC_STATIC_1(EdgeFlag,GLvoid, GLboolean) GL_FUNC_STATIC_1(Enable,GLvoid, GLenum) GL_FUNC_STATIC_1(EnableClientState,GLvoid, GLenum) GL_FUNC_STATIC_0(EndList,GLvoid) GL_FUNC_STATIC_1(EvalCoord1d,GLvoid, GLdouble) GL_FUNC_STATIC_1(EvalCoord1f,GLvoid, GLfloat) GL_FUNC_STATIC_2(EvalCoord2d,GLvoid, GLdouble,GLdouble) GL_FUNC_STATIC_2(EvalCoord2f,GLvoid, GLfloat,GLfloat) GL_FUNC_STATIC_3(EvalMesh1,GLvoid, GLenum,GLint,GLint) GL_FUNC_STATIC_5(EvalMesh2,GLvoid, GLenum,GLint,GLint,GLint,GLint) GL_FUNC_STATIC_1(EvalPoint1,GLvoid, GLint) GL_FUNC_STATIC_2(EvalPoint2,GLvoid, GLint,GLint) GL_FUNC_STATIC_0(Finish,GLvoid) GL_FUNC_STATIC_0(Flush,GLvoid) GL_FUNC_STATIC_2(Fogi,GLvoid, GLenum,GLint) GL_FUNC_STATIC_2(Fogf,GLvoid, GLenum,GLfloat) GL_FUNC_STATIC_1(FrontFace,GLvoid, GLenum) GL_FUNC_STATIC_6(Frustum,GLvoid, GLdouble,GLdouble,GLdouble,GLdouble,GLdouble,GLdouble) GL_FUNC_STATIC_1(GenLists,GLuint, GLsizei) GL_FUNC_STATIC_0(GetError,GLenum) GL_FUNC_STATIC_2(Hint,GLvoid, GLenum,GLenum) GL_FUNC_STATIC_1(Indexd,GLvoid, GLdouble) GL_FUNC_STATIC_1(Indexf,GLvoid, GLfloat) GL_FUNC_STATIC_1(Indexi,GLvoid, GLint) GL_FUNC_STATIC_1(IndexMask,GLvoid, GLuint) GL_FUNC_STATIC_1(Indexs,GLvoid, GLshort) GL_FUNC_STATIC_1(Indexub,GLvoid, GLubyte) GL_FUNC_STATIC_0(InitNames,GLvoid) GL_FUNC_STATIC_1(IsEnabled,GLboolean, GLenum) GL_FUNC_STATIC_1(IsList,GLboolean, GLuint) GL_FUNC_STATIC_1(IsTexture,GLboolean, GLuint) GL_FUNC_STATIC_2(LightModelf,GLvoid, GLenum,GLfloat) GL_FUNC_STATIC_2(LightModeli,GLvoid, GLenum,GLint) GL_FUNC_STATIC_3(Lightf,GLvoid, GLenum,GLenum,GLfloat) GL_FUNC_STATIC_3(Lighti,GLvoid, GLenum,GLenum,GLint) GL_FUNC_STATIC_2(LineStipple,GLvoid, GLint,GLushort) GL_FUNC_STATIC_1(LineWidth,GLvoid, GLfloat) GL_FUNC_STATIC_1(ListBase,GLvoid, GLuint) GL_FUNC_STATIC_0(LoadIdentity,GLvoid) GL_FUNC_STATIC_1(LoadName,GLvoid, GLuint) GL_FUNC_STATIC_1(LogicOp,GLvoid, GLenum) GL_FUNC_STATIC_3(MapGrid1d,GLvoid, GLint,GLdouble,GLdouble) GL_FUNC_STATIC_3(MapGrid1f,GLvoid, GLint,GLfloat,GLfloat) GL_FUNC_STATIC_6(MapGrid2d,GLvoid, GLint,GLdouble,GLdouble,GLint,GLdouble,GLdouble) GL_FUNC_STATIC_6(MapGrid2f,GLvoid, GLint,GLfloat,GLfloat,GLint,GLfloat,GLfloat) GL_FUNC_STATIC_3(Materialf,GLvoid, GLenum,GLenum,GLfloat) GL_FUNC_STATIC_3(Materiali,GLvoid, GLenum,GLenum,GLint) GL_FUNC_STATIC_1(MatrixMode,GLvoid, GLenum) GL_FUNC_STATIC_2(NewList,GLvoid, GLuint,GLenum) GL_FUNC_STATIC_3(Normal3b,GLvoid, GLbyte,GLbyte,GLbyte) GL_FUNC_STATIC_3(Normal3d,GLvoid, GLdouble,GLdouble,GLdouble) GL_FUNC_STATIC_3(Normal3f,GLvoid, GLfloat,GLfloat,GLfloat) GL_FUNC_STATIC_3(Normal3i,GLvoid, GLint,GLint,GLint) GL_FUNC_STATIC_3(Normal3s,GLvoid, GLshort,GLshort,GLshort) GL_FUNC_STATIC_6(Ortho,GLvoid, GLdouble,GLdouble,GLdouble,GLdouble,GLdouble,GLdouble) GL_FUNC_STATIC_1(PassThrough,GLvoid, GLfloat) GL_FUNC_STATIC_2(PixelStoref,GLvoid, GLenum,GLfloat) GL_FUNC_STATIC_2(PixelStorei,GLvoid, GLenum,GLint) GL_FUNC_STATIC_2(PixelTransferf,GLvoid, GLenum,GLfloat) GL_FUNC_STATIC_2(PixelTransferi,GLvoid, GLenum,GLint) GL_FUNC_STATIC_2(PixelZoom,GLvoid, GLfloat,GLfloat) GL_FUNC_STATIC_1(PointSize,GLvoid, GLfloat) GL_FUNC_STATIC_2(PolygonMode,GLvoid, GLenum,GLenum) GL_FUNC_STATIC_2(PolygonOffset,GLvoid, GLfloat,GLfloat) GL_FUNC_STATIC_0(PopAttrib,GLvoid) GL_FUNC_STATIC_0(PopClientAttrib,GLvoid) GL_FUNC_STATIC_0(PopMatrix,GLvoid) GL_FUNC_STATIC_0(PopName,GLvoid) GL_FUNC_STATIC_1(PushAttrib,GLvoid, GLbitfield) GL_FUNC_STATIC_1(PushClientAttrib,GLvoid, GLbitfield) GL_FUNC_STATIC_0(PushMatrix,GLvoid) GL_FUNC_STATIC_1(PushName,GLvoid, GLuint) GL_FUNC_STATIC_2(RasterPos2d,GLvoid, GLdouble,GLdouble) GL_FUNC_STATIC_2(RasterPos2f,GLvoid, GLfloat,GLfloat) GL_FUNC_STATIC_2(RasterPos2i,GLvoid, GLint,GLint) GL_FUNC_STATIC_2(RasterPos2s,GLvoid, GLshort,GLshort) GL_FUNC_STATIC_3(RasterPos3d,GLvoid, GLdouble,GLdouble,GLdouble) GL_FUNC_STATIC_3(RasterPos3f,GLvoid, GLfloat,GLfloat,GLfloat) GL_FUNC_STATIC_3(RasterPos3i,GLvoid, GLint,GLint,GLint) GL_FUNC_STATIC_3(RasterPos3s,GLvoid, GLshort,GLshort,GLshort) GL_FUNC_STATIC_4(RasterPos4d,GLvoid, GLdouble,GLdouble,GLdouble,GLdouble) GL_FUNC_STATIC_4(RasterPos4f,GLvoid, GLfloat,GLfloat,GLfloat,GLfloat) GL_FUNC_STATIC_4(RasterPos4i,GLvoid, GLint,GLint,GLint,GLint) GL_FUNC_STATIC_4(RasterPos4s,GLvoid, GLshort,GLshort,GLshort,GLshort) GL_FUNC_STATIC_1(ReadBuffer,GLvoid, GLenum) GL_FUNC_STATIC_4(Rectd,GLvoid, GLdouble,GLdouble,GLdouble,GLdouble) GL_FUNC_STATIC_4(Rectf,GLvoid, GLfloat,GLfloat,GLfloat,GLfloat) GL_FUNC_STATIC_4(Recti,GLvoid, GLint,GLint,GLint,GLint) GL_FUNC_STATIC_4(Rects,GLvoid, GLshort,GLshort,GLshort,GLshort) GL_FUNC_STATIC_1(RenderMode,GLint, GLenum) GL_FUNC_STATIC_4(Rotated,GLvoid, GLdouble,GLdouble,GLdouble,GLdouble) GL_FUNC_STATIC_4(Rotatef,GLvoid, GLfloat,GLfloat,GLfloat,GLfloat) GL_FUNC_STATIC_3(Scaled,GLvoid, GLdouble,GLdouble,GLdouble) GL_FUNC_STATIC_3(Scalef,GLvoid, GLdouble,GLdouble,GLdouble) GL_FUNC_STATIC_4(Scissor,GLvoid, GLint,GLint,GLint,GLint) GL_FUNC_STATIC_1(ShadeModel,GLvoid, GLenum) GL_FUNC_STATIC_3(StencilFunc,GLvoid, GLenum,GLint,GLuint) GL_FUNC_STATIC_1(StencilMask,GLvoid, GLuint) GL_FUNC_STATIC_3(StencilOp,GLvoid, GLenum,GLenum,GLenum) GL_FUNC_STATIC_1(TexCoord1d,GLvoid, GLdouble) GL_FUNC_STATIC_1(TexCoord1f,GLvoid, GLfloat) GL_FUNC_STATIC_1(TexCoord1i,GLvoid, GLint) GL_FUNC_STATIC_1(TexCoord1s,GLvoid, GLshort) GL_FUNC_STATIC_2(TexCoord2d,GLvoid, GLdouble,GLdouble) GL_FUNC_STATIC_2(TexCoord2f,GLvoid, GLfloat,GLfloat) GL_FUNC_STATIC_2(TexCoord2i,GLvoid, GLint,GLint) GL_FUNC_STATIC_2(TexCoord2s,GLvoid, GLshort,GLshort) GL_FUNC_STATIC_3(TexCoord3d,GLvoid, GLdouble,GLdouble,GLdouble) GL_FUNC_STATIC_3(TexCoord3f,GLvoid, GLfloat,GLfloat,GLfloat) GL_FUNC_STATIC_3(TexCoord3i,GLvoid, GLint,GLint,GLint) GL_FUNC_STATIC_3(TexCoord3s,GLvoid, GLshort,GLshort,GLshort) GL_FUNC_STATIC_4(TexCoord4d,GLvoid, GLdouble,GLdouble,GLdouble,GLdouble) GL_FUNC_STATIC_4(TexCoord4f,GLvoid, GLfloat,GLfloat,GLfloat,GLfloat) GL_FUNC_STATIC_4(TexCoord4i,GLvoid, GLint,GLint,GLint,GLint) GL_FUNC_STATIC_4(TexCoord4s,GLvoid, GLshort,GLshort,GLshort,GLshort) GL_FUNC_STATIC_3(TexEnvf,GLvoid, GLenum,GLenum,GLfloat) GL_FUNC_STATIC_3(TexEnvi,GLvoid, GLenum,GLenum,GLint) GL_FUNC_STATIC_3(TexGend,GLvoid, GLenum,GLenum,GLdouble) GL_FUNC_STATIC_3(TexGenf,GLvoid, GLenum,GLenum,GLfloat) GL_FUNC_STATIC_3(TexGeni,GLvoid, GLenum,GLenum,GLint) GL_FUNC_STATIC_3(TexParameterf,GLvoid, GLenum,GLenum,GLfloat) GL_FUNC_STATIC_3(TexParameteri,GLvoid, GLenum,GLenum,GLint) GL_FUNC_STATIC_3(Translated,GLvoid, GLdouble,GLdouble,GLdouble) GL_FUNC_STATIC_3(Translatef,GLvoid, GLdouble,GLdouble,GLdouble) GL_FUNC_STATIC_2(Vertex2d,GLvoid, GLdouble,GLdouble) GL_FUNC_STATIC_2(Vertex2f,GLvoid, GLfloat,GLfloat) GL_FUNC_STATIC_2(Vertex2i,GLvoid, GLint,GLint) GL_FUNC_STATIC_2(Vertex2s,GLvoid, GLshort,GLshort) GL_FUNC_STATIC_3(Vertex3d,GLvoid, GLdouble,GLdouble,GLdouble) GL_FUNC_STATIC_3(Vertex3f,GLvoid, GLfloat,GLfloat,GLfloat) GL_FUNC_STATIC_3(Vertex3i,GLvoid, GLint,GLint,GLint) GL_FUNC_STATIC_3(Vertex3s,GLvoid, GLshort,GLshort,GLshort) GL_FUNC_STATIC_4(Vertex4d,GLvoid, GLdouble,GLdouble,GLdouble,GLdouble) GL_FUNC_STATIC_4(Vertex4f,GLvoid, GLfloat,GLfloat,GLfloat,GLfloat) GL_FUNC_STATIC_4(Vertex4i,GLvoid, GLint,GLint,GLint,GLint) GL_FUNC_STATIC_4(Vertex4s,GLvoid, GLshort,GLshort,GLshort,GLshort) GL_FUNC_STATIC_4(Viewport,GLvoid, GLuint,GLuint,GLuint,GLuint) VALUE inside_begin_end = Qfalse; static VALUE gl_Begin(obj,arg1) VALUE obj,arg1; { glBegin(CONV_GLenum(arg1)); inside_begin_end = Qtrue; return Qnil; } static VALUE gl_End(obj) VALUE obj; { inside_begin_end = Qfalse; glEnd(); CHECK_GLERROR return Qnil; } static VALUE gl_CallLists(obj,arg1,arg2) VALUE obj,arg1,arg2; { GLsizei n; GLenum type; VALUE lists; type = CONV_GLenum(arg1); lists = pack_array_or_pass_string(type,arg2); n = RSTRING_LEN(lists) / gltype_glformat_unit_size(type,1); glCallLists(n, type, RSTRING_PTR(lists)); CHECK_GLERROR return Qnil; } static VALUE gl_Bitmap(obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7) VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7; { GLsizei width; GLsizei height; GLfloat xorig; GLfloat yorig; GLfloat xmove; GLfloat ymove; width = (GLsizei)NUM2UINT(arg1); height = (GLsizei)NUM2UINT(arg2); xorig = (GLfloat)NUM2DBL(arg3); yorig = (GLfloat)NUM2DBL(arg4); xmove = (GLfloat)NUM2DBL(arg5); ymove = (GLfloat)NUM2DBL(arg6); if (CheckBufferBinding(GL_PIXEL_UNPACK_BUFFER_BINDING)) { glBitmap(width, height, xorig, yorig, xmove, ymove, (GLvoid *)NUM2INT(arg7)); } else { VALUE data; data = pack_array_or_pass_string(GL_UNSIGNED_BYTE,arg7); if ((RSTRING_LEN(data)*8) < (width * height)) rb_raise(rb_eArgError, "string length:%li", RSTRING_LEN(data)); glBitmap(width, height, xorig, yorig, xmove, ymove, (const GLubyte *)RSTRING_PTR(data)); } CHECK_GLERROR return Qnil; } static VALUE gl_EdgeFlagv(obj,arg1) VALUE obj,arg1; { GLboolean flag[1] = { GL_FALSE }; Check_Type(arg1,T_ARRAY); ary2cboolean(arg1,flag,1); glEdgeFlagv(flag); CHECK_GLERROR return Qnil; } static VALUE gl_Indexdv(obj,arg1) VALUE obj,arg1; { GLdouble c[1] = {0.0}; Check_Type(arg1,T_ARRAY); ary2cdbl(arg1,c,1); glIndexdv(c); CHECK_GLERROR return Qnil; } static VALUE gl_Indexfv(obj,arg1) VALUE obj,arg1; { GLfloat c[1] = {0.0}; Check_Type(arg1,T_ARRAY); ary2cflt(arg1,c,1); glIndexfv(c); CHECK_GLERROR return Qnil; } static VALUE gl_Indexiv(obj,arg1) VALUE obj,arg1; { GLint c[1] = {0.0}; Check_Type(arg1,T_ARRAY); ary2cint(arg1,c,1); glIndexiv(c); CHECK_GLERROR return Qnil; } static VALUE gl_Indexsv(obj,arg1) VALUE obj,arg1; { GLshort c[1] = {0}; Check_Type(arg1,T_ARRAY); ary2cshort(arg1,c,1); glIndexsv(c); CHECK_GLERROR return Qnil; } static VALUE gl_ClipPlane(obj,arg1,arg2) VALUE obj,arg1,arg2; { GLenum plane; GLdouble equation[4]; plane = (GLenum)NUM2INT(arg1); Check_Type(arg2,T_ARRAY); ary2cdbl(arg2, equation, 4); glClipPlane(plane,equation); CHECK_GLERROR return Qnil; } static VALUE gl_Fogfv(obj,arg1,arg2) VALUE obj,arg1,arg2; { GLenum pname; GLfloat params[4] = {0.0,0.0,0.0,0.0}; pname = (GLenum)NUM2INT(arg1); Check_Type(arg2,T_ARRAY); ary2cflt(arg2,params,4); glFogfv(pname,params); CHECK_GLERROR return Qnil; } static VALUE gl_Fogiv(obj,arg1,arg2) VALUE obj,arg1,arg2; { GLenum pname; GLint params[4] = {0,0,0,0}; pname = (GLenum)NUM2INT(arg1); Check_Type(arg2,T_ARRAY); ary2cint(arg2,params,4); glFogiv(pname,params); CHECK_GLERROR return Qnil; } static VALUE gl_Lightfv(obj,arg1,arg2,arg3) VALUE obj,arg1,arg2,arg3; { GLenum light; GLenum pname; GLfloat params[4] = {0.0,0.0,0.0,0.0}; light = (GLenum)NUM2INT(arg1); pname = (GLenum)NUM2INT(arg2); Check_Type(arg3,T_ARRAY); ary2cflt(arg3,params,4); glLightfv(light,pname,params); CHECK_GLERROR return Qnil; } static VALUE gl_Lightiv(obj,arg1,arg2,arg3) VALUE obj,arg1,arg2,arg3; { GLenum light; GLenum pname; GLint params[4]={0,0,0,0}; light = (GLenum)NUM2INT(arg1); pname = (GLenum)NUM2INT(arg2); Check_Type(arg3,T_ARRAY); ary2cint(arg3,params,4); glLightiv(light,pname,params); CHECK_GLERROR return Qnil; } static VALUE gl_LightModelfv(obj,arg1,arg2) VALUE obj,arg1,arg2; { GLenum pname; GLfloat params[4] = {0.0,0.0,0.0,0.0}; pname = (GLenum)NUM2INT(arg1); Check_Type(arg2,T_ARRAY); ary2cflt(arg2,params,4); glLightModelfv(pname,params); CHECK_GLERROR return Qnil; } static VALUE gl_LightModeliv(obj,arg1,arg2) VALUE obj,arg1,arg2; { GLenum pname; GLint params[4] = {0,0,0,0}; pname = (GLenum)NUM2INT(arg1); Check_Type(arg2,T_ARRAY); ary2cint(arg2,params,4); glLightModeliv(pname,params); CHECK_GLERROR return Qnil; } static VALUE gl_Materialfv(obj,arg1,arg2,arg3) VALUE obj,arg1,arg2,arg3; { GLenum face; GLenum pname; GLfloat params[4] = {0.0,0.0,0.0,0.0}; face = (GLenum)NUM2INT(arg1); pname = (GLenum)NUM2INT(arg2); Check_Type(arg3,T_ARRAY); ary2cflt(arg3,params,4); glMaterialfv(face,pname,params); CHECK_GLERROR return Qnil; } static VALUE gl_Materialiv(obj,arg1,arg2,arg3) VALUE obj,arg1,arg2,arg3; { GLenum face; GLenum pname; GLint params[4] = {0,0,0,0}; face = (GLenum)NUM2INT(arg1); pname = (GLenum)NUM2INT(arg2); Check_Type(arg3,T_ARRAY); ary2cint(arg3,params,4); glMaterialiv(face,pname,params); CHECK_GLERROR return Qnil; } static VALUE gl_PolygonStipple(obj,arg1) VALUE obj,arg1; { if (CheckBufferBinding(GL_PIXEL_UNPACK_BUFFER_BINDING)) { glPolygonStipple((GLvoid *)NUM2INT(arg1)); } else { VALUE data; data = pack_array_or_pass_string(GL_UNSIGNED_BYTE,arg1); if (RSTRING_LEN(data) < 128) rb_raise(rb_eArgError, "string length:%li", RSTRING_LEN(data)); glPolygonStipple((GLubyte *)RSTRING_PTR(data)); } CHECK_GLERROR return Qnil; } static VALUE gl_TexParameterfv(obj,arg1,arg2,arg3) VALUE obj,arg1,arg2,arg3; { GLenum target; GLenum pname; GLfloat params[4] = {0.0,0.0,0.0,0.0}; target = (GLenum)NUM2INT(arg1); pname = (GLenum)NUM2INT(arg2); Check_Type(arg3,T_ARRAY); ary2cflt(arg3,params,4); glTexParameterfv(target,pname,params); CHECK_GLERROR return Qnil; } static VALUE gl_TexParameteriv(obj,arg1,arg2,arg3) VALUE obj,arg1,arg2,arg3; { GLenum target; GLenum pname; GLint params[4] = {0,0,0,0}; target = (GLenum)NUM2INT(arg1); pname = (GLenum)NUM2INT(arg2); Check_Type(arg3,T_ARRAY); ary2cint(arg3,params,4); glTexParameteriv(target,pname,params); CHECK_GLERROR return Qnil; } static VALUE gl_TexImage1D(obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8) VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8; { GLenum target; GLint level; GLint components; GLsizei width; GLint border; GLenum format; GLenum type; const char *pixels; target = (GLenum)NUM2INT(arg1); level = (GLint)NUM2INT(arg2); components = (GLint)NUM2INT(arg3); width = (GLsizei)NUM2UINT(arg4); border = (GLint)NUM2INT(arg5); format = (GLenum)NUM2INT(arg6); type = (GLenum)NUM2INT(arg7); if (CheckBufferBinding(GL_PIXEL_UNPACK_BUFFER_BINDING)) { glTexImage1D(target,level,components,width,border,format,type,(GLvoid *)NUM2INT(arg8)); CHECK_GLERROR return Qnil; } if (target == GL_PROXY_TEXTURE_1D || NIL_P(arg8)) { /* proxy texture, no data read */ pixels = NULL; } else { VALUE data; data = pack_array_or_pass_string(type,arg8); CheckDataSize(type,format,width,data); pixels = RSTRING_PTR(data); } glTexImage1D(target,level,components,width,border,format,type,pixels); CHECK_GLERROR return Qnil; } static VALUE gl_TexImage2D(obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9) VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9; { GLenum target; GLint level; GLint components; GLsizei width; GLsizei height; GLint border; GLenum format; GLenum type; const char *pixels; target = (GLenum)NUM2INT(arg1); level = (GLint)NUM2INT(arg2); components = (GLint)NUM2INT(arg3); width = (GLsizei)NUM2UINT(arg4); height = (GLsizei)NUM2UINT(arg5); border = (GLint)NUM2INT(arg6); format = (GLenum)NUM2INT(arg7); type = (GLenum)NUM2INT(arg8); if (CheckBufferBinding(GL_PIXEL_UNPACK_BUFFER_BINDING)) { glTexImage2D(target,level,components,width,height,border,format,type,(GLvoid *)NUM2INT(arg9)); CHECK_GLERROR return Qnil; } if (target == GL_PROXY_TEXTURE_2D || target == GL_PROXY_TEXTURE_1D_ARRAY_EXT || target == GL_PROXY_TEXTURE_CUBE_MAP || NIL_P(arg9)) { /* proxy texture, no data read */ pixels = NULL; } else { VALUE data; data = pack_array_or_pass_string(type,arg9); CheckDataSize(type,format,width*height,data); pixels = RSTRING_PTR(data); } glTexImage2D(target,level,components,width,height,border,format,type,pixels); CHECK_GLERROR return Qnil; } static VALUE gl_TexEnvfv(obj,arg1,arg2,arg3) VALUE obj,arg1,arg2,arg3; { GLenum target; GLenum pname; GLfloat params[4] = {0.0,0.0,0.0,0.0}; target = (GLenum)NUM2INT(arg1); pname = (GLenum)NUM2INT(arg2); Check_Type(arg3,T_ARRAY); ary2cflt(arg3,params,4); glTexEnvfv(target,pname,params); CHECK_GLERROR return Qnil; } static VALUE gl_TexEnviv(obj,arg1,arg2,arg3) VALUE obj,arg1,arg2,arg3; { GLenum target; GLenum pname; GLint params[4] = {0,0,0,0}; target = (GLenum)NUM2INT(arg1); pname = (GLenum)NUM2INT(arg2); Check_Type(arg3,T_ARRAY); ary2cint(arg3,params,4); glTexEnviv(target,pname,params); CHECK_GLERROR return Qnil; } static VALUE gl_TexGendv(obj,arg1,arg2,arg3) VALUE obj,arg1,arg2,arg3; { GLenum coord; GLenum pname; GLdouble params[4] = {0.0,0.0,0.0,0.0}; coord = (GLenum)NUM2INT(arg1); pname = (GLenum)NUM2INT(arg2); Check_Type(arg3,T_ARRAY); ary2cdbl(arg3,params,4); glTexGendv(coord,pname,params); CHECK_GLERROR return Qnil; } static VALUE gl_TexGenfv(obj,arg1,arg2,arg3) VALUE obj,arg1,arg2,arg3; { GLenum coord; GLenum pname; GLfloat params[4] = {0.0,0.0,0.0,0.0}; coord = (GLenum)NUM2INT(arg1); pname = (GLenum)NUM2INT(arg2); Check_Type(arg3,T_ARRAY); ary2cflt(arg3,params,4); glTexGenfv(coord,pname,params); CHECK_GLERROR return Qnil; } static VALUE gl_TexGeniv(obj,arg1,arg2,arg3) VALUE obj,arg1,arg2,arg3; { GLenum coord; GLenum pname; GLint params[4] = {0,0,0,0}; coord = (GLenum)NUM2INT(arg1); pname = (GLenum)NUM2INT(arg2); Check_Type(arg3,T_ARRAY); ary2cint(arg3,params,4); glTexGeniv(coord,pname,params); CHECK_GLERROR return Qnil; } static VALUE g_current_feed_buffer; static VALUE gl_FeedbackBuffer(obj,arg1,arg2) VALUE obj,arg1,arg2; { GLsizei size; GLenum type; size = (GLsizei)NUM2UINT(arg1); type = (GLenum)NUM2INT(arg2); g_current_feed_buffer = allocate_buffer_with_string(sizeof(GLfloat)*size); rb_str_freeze(g_current_feed_buffer); glFeedbackBuffer(size, type, (GLfloat*)RSTRING_PTR(g_current_feed_buffer)); CHECK_GLERROR return g_current_feed_buffer; } static VALUE g_current_sel_buffer; static VALUE gl_SelectBuffer(obj,arg1) VALUE obj,arg1; { GLsizei size; size = (GLsizei)NUM2UINT(arg1); g_current_sel_buffer = allocate_buffer_with_string(sizeof(GLuint)*size); rb_str_freeze(g_current_sel_buffer); glSelectBuffer(size, (GLuint*)RSTRING_PTR(g_current_sel_buffer)); CHECK_GLERROR return g_current_sel_buffer; } static VALUE gl_Map1d(obj,arg1,arg2,arg3,arg4,arg5,arg6) VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6; { GLenum target; GLdouble u1; GLdouble u2; GLint stride; GLint order; GLdouble *points; VALUE work_ary; target = (GLenum)NUM2INT(arg1); u1 = (GLdouble)NUM2DBL(arg2); u2 = (GLdouble)NUM2DBL(arg3); stride = (GLint)NUM2INT(arg4); order = (GLint)NUM2INT(arg5); points = ALLOC_N(GLdouble, order*stride); work_ary = rb_funcall(arg6,rb_intern("flatten"),0); ary2cdbl(work_ary, points, order*stride); glMap1d(target, u1, u2, stride, order, points); xfree(points); CHECK_GLERROR return Qnil; } static VALUE gl_Map1f(obj,arg1,arg2,arg3,arg4,arg5,arg6) VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6; { GLenum target; GLfloat u1; GLfloat u2; GLint stride; GLint order; GLfloat *points; VALUE work_ary; target = (GLenum)NUM2INT(arg1); u1 = (GLfloat)NUM2DBL(arg2); u2 = (GLfloat)NUM2DBL(arg3); stride = (GLint)NUM2INT(arg4); order = (GLint)NUM2INT(arg5); points = ALLOC_N(GLfloat, order*stride); work_ary = rb_funcall(arg6,rb_intern("flatten"),0); ary2cflt(work_ary, points, order*stride); glMap1f(target, u1, u2, stride, order, points); xfree(points); CHECK_GLERROR return Qnil; } static VALUE gl_Map2d(obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10) VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10; { GLenum target; GLdouble u1; GLdouble u2; GLint ustride; GLint uorder; GLdouble v1; GLdouble v2; GLint vstride; GLint vorder; GLdouble *points; VALUE work_ary; target = (GLenum)NUM2INT(arg1); u1 = (GLdouble)NUM2INT(arg2); u2 = (GLdouble)NUM2INT(arg3); ustride = (GLint)NUM2INT(arg4); uorder = (GLint)NUM2INT(arg5); v1 = (GLdouble)NUM2INT(arg6); v2 = (GLdouble)NUM2INT(arg7); vstride = (GLint)NUM2INT(arg8); vorder = (GLint)NUM2INT(arg9); points = ALLOC_N(GLdouble, MAX(ustride*uorder, vstride*vorder)); work_ary = rb_funcall(arg10,rb_intern("flatten"),0); ary2cdbl(work_ary, points, MAX(ustride*uorder, vstride*vorder)); glMap2d(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points); xfree(points); CHECK_GLERROR return Qnil; } static VALUE gl_Map2f(obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10) VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10; { GLenum target; GLfloat u1; GLfloat u2; GLint ustride; GLint uorder; GLfloat v1; GLfloat v2; GLint vstride; GLint vorder; GLfloat *points; VALUE work_ary; target = (GLenum)NUM2INT(arg1); u1 = (GLfloat)NUM2INT(arg2); u2 = (GLfloat)NUM2INT(arg3); ustride = (GLint)NUM2INT(arg4); uorder = (GLint)NUM2INT(arg5); v1 = (GLfloat)NUM2INT(arg6); v2 = (GLfloat)NUM2INT(arg7); vstride = (GLint)NUM2INT(arg8); vorder = (GLint)NUM2INT(arg9); points = ALLOC_N(GLfloat, MAX(ustride*uorder, vstride*vorder)); work_ary = rb_funcall(arg10,rb_intern("flatten"),0); ary2cflt(work_ary, points, MAX(ustride*uorder, vstride*vorder)); glMap2f(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points); xfree(points); CHECK_GLERROR return Qnil; } static VALUE gl_EvalCoord1dv(obj,arg1) VALUE obj,arg1; { GLdouble params[1] = {0.0}; Check_Type(arg1,T_ARRAY); ary2cdbl(arg1,params,1); glEvalCoord1dv(params); CHECK_GLERROR return Qnil; } static VALUE gl_EvalCoord1fv(obj,arg1) VALUE obj,arg1; { GLfloat params[1] = {0.0}; Check_Type(arg1,T_ARRAY); ary2cflt(arg1,params,1); glEvalCoord1fv(params); CHECK_GLERROR return Qnil; } static VALUE gl_EvalCoord2dv(obj,arg1) VALUE obj,arg1; { GLdouble params[2] = {0.0,0.0}; Check_Type(arg1,T_ARRAY); ary2cdbl(arg1,params,2); glEvalCoord2dv(params); CHECK_GLERROR return Qnil; } static VALUE gl_EvalCoord2fv(obj,arg1) VALUE obj,arg1; { GLfloat params[2] = {0.0,0.0}; Check_Type(arg1,T_ARRAY); ary2cflt(arg1,params,2); glEvalCoord2fv(params); CHECK_GLERROR return Qnil; } #define GLPIXELMAP_FUNC(_type_,_vartype_,_convert_) \ static VALUE \ gl_PixelMap##_type_##v(argc,argv,obj) \ int argc; \ VALUE *argv; \ VALUE obj; \ { \ GLenum map; \ _vartype_ *values; \ GLsizei size; \ VALUE args[4]; \ switch(rb_scan_args(argc, argv, "21", &args[0], &args[1], &args[2])) { \ default: \ case 2: \ if (CheckBufferBinding(GL_PIXEL_UNPACK_BUFFER_BINDING)) \ rb_raise(rb_eArgError, "Pixel unpack buffer bound, but offset argument missing"); \ map = (GLenum)NUM2INT(args[0]); \ Check_Type(args[1],T_ARRAY); \ size = RARRAY_LEN(args[1]); \ values = ALLOC_N(_vartype_,size); \ _convert_(args[1],values,size); \ glPixelMap##_type_##v(map,size,values); \ xfree(values); \ break; \ case 3: \ if (!CheckBufferBinding(GL_PIXEL_UNPACK_BUFFER_BINDING)) \ rb_raise(rb_eArgError, "Pixel unpack buffer not bound"); \ map = (GLenum)NUM2INT(args[0]); \ size = (GLsizei)NUM2INT(args[1]); \ glPixelMap##_type_##v(map,size,(GLvoid *)NUM2INT(args[2])); \ break; \ } \ CHECK_GLERROR \ return Qnil; \ } GLPIXELMAP_FUNC(f,GLfloat,ary2cflt) GLPIXELMAP_FUNC(ui,GLuint,ary2cuint) GLPIXELMAP_FUNC(us,GLushort,ary2cushort) #undef GLPIXELMAP_FUNC static VALUE gl_ReadPixels(argc,argv,obj) int argc; VALUE *argv; VALUE obj; { GLint x; GLint y; GLsizei width; GLsizei height; int format; int type; VALUE pixels; VALUE args[7]; int numargs; numargs = rb_scan_args(argc, argv, "61", &args[0], &args[1], &args[2], &args[3], &args[4], &args[5], &args[6]); x = (GLint)NUM2INT(args[0]); y = (GLint)NUM2INT(args[1]); width = (GLsizei)NUM2UINT(args[2]); height = (GLsizei)NUM2UINT(args[3]); format = NUM2INT(args[4]); type = NUM2INT(args[5]); switch(numargs) { default: case 6: if (CheckBufferBinding(GL_PIXEL_PACK_BUFFER_BINDING)) rb_raise(rb_eArgError, "Pixel pack buffer bound, but offset argument missing"); pixels = allocate_buffer_with_string(GetDataSize(type,format,width*height)); FORCE_PIXEL_STORE_MODE glReadPixels(x,y,width,height,format,type,(GLvoid*)RSTRING_PTR(pixels)); RESTORE_PIXEL_STORE_MODE CHECK_GLERROR return pixels; break; case 7: if (!CheckBufferBinding(GL_PIXEL_PACK_BUFFER_BINDING)) rb_raise(rb_eArgError, "Pixel pack buffer not bound"); FORCE_PIXEL_STORE_MODE glReadPixels(x,y,width,height,format,type,(GLvoid*)NUM2INT(args[6])); RESTORE_PIXEL_STORE_MODE CHECK_GLERROR return Qnil; break; } } static VALUE gl_DrawPixels(obj,arg1,arg2,arg3,arg4,arg5) VALUE obj,arg1,arg2,arg3,arg4,arg5; { GLsizei width; GLsizei height; GLenum format; GLenum type; const char *pixels; width = (GLsizei)NUM2UINT(arg1); height = (GLsizei)NUM2UINT(arg2); format = (GLenum)NUM2INT(arg3); type = (GLenum)NUM2INT(arg4); if (CheckBufferBinding(GL_PIXEL_UNPACK_BUFFER_BINDING)) { glDrawPixels(width,height,format,type,(GLvoid *)NUM2INT(arg5)); } else { VALUE data; data = pack_array_or_pass_string(type,arg5); CheckDataSize(type,format,width*height,data); pixels = RSTRING_PTR(data); glDrawPixels(width,height,format,type,pixels); } CHECK_GLERROR return Qnil; } static VALUE gl_GetClipPlane(obj,arg1) VALUE obj,arg1; { GLenum plane; GLdouble equation[4] = {0.0,0.0,0.0,0.0}; VALUE retary; int i; plane = (GLenum)NUM2INT(arg1); glGetClipPlane(plane,equation); retary = rb_ary_new2(4); for(i=0;i<4;i++) rb_ary_push(retary, rb_float_new(equation[i])); CHECK_GLERROR return retary; } #define GLGET_FUNC(_name_,_type_,_conv_) \ static VALUE \ gl_Get##_name_##v(obj,arg1) \ VALUE obj,arg1; \ { \ GLenum pname; \ int nitems; \ VALUE ary, ary2; \ int i,j; \ _type_ items[64]; \ pname = NUM2INT(arg1); \ switch(pname) { \ case GL_ACCUM_CLEAR_VALUE: \ case GL_BLEND_COLOR: \ case GL_COLOR_CLEAR_VALUE: \ case GL_COLOR_WRITEMASK: \ case GL_CURRENT_COLOR: \ case GL_CURRENT_RASTER_COLOR: \ case GL_CURRENT_RASTER_POSITION: \ case GL_CURRENT_RASTER_SECONDARY_COLOR: \ case GL_CURRENT_RASTER_TEXTURE_COORDS: \ case GL_CURRENT_TEXTURE_COORDS: \ case GL_FOG_COLOR: \ case GL_LIGHT_MODEL_AMBIENT: \ case GL_MAP2_GRID_DOMAIN: \ case GL_CURRENT_SECONDARY_COLOR: \ case GL_SCISSOR_BOX: \ case GL_TEXTURE_ENV_COLOR: \ case GL_VIEWPORT: \ case GL_REFERENCE_PLANE_EQUATION_SGIX: \ case GL_FOG_OFFSET_VALUE_SGIX: \ case GL_TEXTURE_ENV_BIAS_SGIX: \ case GL_CULL_VERTEX_OBJECT_POSITION_EXT: \ case GL_CULL_VERTEX_EYE_POSITION_EXT: \ case GL_FRAGMENT_LIGHT_MODEL_AMBIENT_SGIX: \ case GL_CONSTANT_COLOR0_NV: \ case GL_CONSTANT_COLOR1_NV: \ case GL_TEXTURE_COLOR_WRITEMASK_SGIS: \ case GL_FLOAT_CLEAR_COLOR_VALUE_NV: \ case GL_RGBA_SIGNED_COMPONENTS_EXT: \ nitems = 4; \ break; \ case GL_CURRENT_NORMAL: \ case GL_POINT_DISTANCE_ATTENUATION: \ case GL_SPRITE_AXIS_SGIX: \ case GL_SPRITE_TRANSLATION_SGIX: \ case GL_CURRENT_RASTER_NORMAL_SGIX: \ case GL_CURRENT_TANGENT_EXT: \ case GL_CURRENT_BINORMAL_EXT: \ nitems = 3; \ break; \ case GL_DEPTH_RANGE: \ case GL_LINE_WIDTH_RANGE: \ case GL_MAP1_GRID_DOMAIN: \ case GL_MAP2_GRID_SEGMENTS: \ case GL_MAX_VIEWPORT_DIMS: \ case GL_POINT_SIZE_RANGE: \ case GL_POLYGON_MODE: \ case GL_ALIASED_LINE_WIDTH_RANGE: \ case GL_ALIASED_POINT_SIZE_RANGE: \ case GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX: \ case GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX: \ case GL_FOG_FUNC_SGIS: \ case GL_DEPTH_BOUNDS_EXT: \ nitems = 2; \ break; \ case GL_MODELVIEW_MATRIX: \ case GL_PROJECTION_MATRIX: \ case GL_TEXTURE_MATRIX: \ case GL_COLOR_MATRIX: \ case GL_TRANSPOSE_MODELVIEW_MATRIX: \ case GL_TRANSPOSE_PROJECTION_MATRIX: \ case GL_TRANSPOSE_TEXTURE_MATRIX: \ case GL_TRANSPOSE_COLOR_MATRIX: \ case GL_TRANSPOSE_CURRENT_MATRIX_ARB: \ case GL_MODELVIEW0_ARB: \ case GL_MODELVIEW1_ARB: \ case GL_MODELVIEW2_ARB: \ case GL_MODELVIEW3_ARB: \ case GL_MODELVIEW4_ARB: \ case GL_MODELVIEW5_ARB: \ case GL_MODELVIEW6_ARB: \ case GL_MODELVIEW7_ARB: \ case GL_MODELVIEW8_ARB: \ case GL_MODELVIEW9_ARB: \ case GL_MODELVIEW10_ARB: \ case GL_MODELVIEW11_ARB: \ case GL_MODELVIEW12_ARB: \ case GL_MODELVIEW13_ARB: \ case GL_MODELVIEW14_ARB: \ case GL_MODELVIEW15_ARB: \ case GL_MODELVIEW16_ARB: \ case GL_MODELVIEW17_ARB: \ case GL_MODELVIEW18_ARB: \ case GL_MODELVIEW19_ARB: \ case GL_MODELVIEW20_ARB: \ case GL_MODELVIEW21_ARB: \ case GL_MODELVIEW22_ARB: \ case GL_MODELVIEW23_ARB: \ case GL_MODELVIEW24_ARB: \ case GL_MODELVIEW25_ARB: \ case GL_MODELVIEW26_ARB: \ case GL_MODELVIEW27_ARB: \ case GL_MODELVIEW28_ARB: \ case GL_MODELVIEW29_ARB: \ case GL_MODELVIEW30_ARB: \ case GL_MODELVIEW31_ARB: \ case GL_MATRIX_PALETTE_ARB: \ case GL_PIXEL_TRANSFORM_2D_MATRIX_EXT: \ case GL_MODELVIEW1_MATRIX_EXT: \ case GL_CURRENT_MATRIX_NV: \ glGet##_name_##v(pname, items); \ ary = rb_ary_new2(4); \ for (i = 0; i < 4; i++) { \ ary2 = rb_ary_new2(4); \ rb_ary_push(ary, ary2); \ for (j = 0; j < 4; j++) \ rb_ary_push(ary2, _conv_(items[i*4+j])); \ } \ CHECK_GLERROR \ return ary; \ case GL_POLYGON_STIPPLE: \ glGet##_name_##v(pname, items); \ CHECK_GLERROR \ return rb_str_new((const char*)items, 32); \ case GL_COMPRESSED_TEXTURE_FORMATS: \ glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &nitems); \ CHECK_GLERROR \ if (nitems<=0||nitems>64) \ return INT2NUM(0); \ break; \ default: /* size=1 */ \ glGet##_name_##v(pname, items); \ CHECK_GLERROR \ return _conv_(items[0]); \ } \ glGet##_name_##v(pname, items); \ ary = rb_ary_new2(nitems); \ for (i = 0; i < nitems; i++) \ rb_ary_push(ary, _conv_(items[i])); \ CHECK_GLERROR \ return ary; \ } GLGET_FUNC(Double,GLdouble,rb_float_new) GLGET_FUNC(Float,GLfloat,rb_float_new) GLGET_FUNC(Integer,GLint,INT2NUM) GLGET_FUNC(Boolean,GLboolean,GLBOOL2RUBY) #undef GLGET_FUNC static VALUE gl_GetLightfv(obj,arg1,arg2) VALUE obj,arg1,arg2; { GLenum light; GLenum pname; GLsizei size; GLfloat params[4] = {0.0,0.0,0.0,0.0}; light = (GLenum)NUM2INT(arg1); pname = (GLenum)NUM2INT(arg2); switch(pname) { case GL_AMBIENT: case GL_DIFFUSE: case GL_SPECULAR: case GL_POSITION: size = 4; break; case GL_SPOT_DIRECTION: size = 3; break; case GL_CONSTANT_ATTENUATION: case GL_LINEAR_ATTENUATION: case GL_QUADRATIC_ATTENUATION: case GL_SPOT_EXPONENT: case GL_SPOT_CUTOFF: size = 1; break; default: rb_raise(rb_eArgError, "unknown pname:%d",pname); break; /* not reached */ } glGetLightfv(light,pname,params); RET_ARRAY_OR_SINGLE(size,rb_float_new,params) } static VALUE gl_GetLightiv(obj,arg1,arg2) VALUE obj,arg1,arg2; { GLenum light; GLenum pname; GLsizei size; GLint params[4] = {0,0,0,0}; light = (GLenum)NUM2INT(arg1); pname = (GLenum)NUM2INT(arg2); switch(pname) { case GL_AMBIENT: case GL_DIFFUSE: case GL_SPECULAR: case GL_POSITION: size = 4; break; case GL_SPOT_DIRECTION: size = 3; break; case GL_CONSTANT_ATTENUATION: case GL_LINEAR_ATTENUATION: case GL_QUADRATIC_ATTENUATION: case GL_SPOT_EXPONENT: case GL_SPOT_CUTOFF: size = 1; break; default: rb_raise(rb_eArgError, "unknown pname:%d",pname); break; /* not reached */ } glGetLightiv(light,pname,params); RET_ARRAY_OR_SINGLE(size,INT2NUM,params) } #define GETMAP_FUNC(_name_,_type_) \ static VALUE \ gl_##_name_(obj,arg1,arg2) \ VALUE obj,arg1,arg2; \ { \ GLenum target; \ GLenum query; \ int dims; \ int pointsize; \ int size=0; \ _type_ *points; \ GLint order[2] = {0,0}; /* for GL_COEFF, [order] or [uorder,vorder] (MAP1/MAP2) */ \ target = (GLenum)NUM2INT(arg1); \ query = (GLenum)NUM2INT(arg2); \ switch(target) { \ case GL_MAP1_INDEX: \ case GL_MAP1_TEXTURE_COORD_1: dims=1; pointsize=1; break; \ case GL_MAP1_TEXTURE_COORD_2: dims=1; pointsize=2; break; \ case GL_MAP1_VERTEX_3: \ case GL_MAP1_NORMAL: \ case GL_MAP1_TEXTURE_COORD_3: dims=1; pointsize=3; break; \ case GL_MAP1_COLOR_4: \ case GL_MAP1_TEXTURE_COORD_4: \ case GL_MAP1_VERTEX_4: dims=1; pointsize=4; break; \ case GL_MAP2_INDEX: \ case GL_MAP2_TEXTURE_COORD_1: dims=2; pointsize=1; break; \ case GL_MAP2_TEXTURE_COORD_2: dims=2; pointsize=2; break; \ case GL_MAP2_VERTEX_3: \ case GL_MAP2_NORMAL: \ case GL_MAP2_TEXTURE_COORD_3: dims=2; pointsize=3; break; \ case GL_MAP2_COLOR_4: \ case GL_MAP2_TEXTURE_COORD_4: \ case GL_MAP2_VERTEX_4: dims=2; pointsize=4; break; \ default: \ rb_raise(rb_eArgError, "unknown target:%d",target); \ break; /* not reached */ \ } \ switch(query) { \ case GL_ORDER: size = dims; break; \ case GL_DOMAIN: size = dims*2; break; \ case GL_COEFF: \ glGetMapiv(target,GL_ORDER,order); \ CHECK_GLERROR \ if (dims==1) \ size = order[0] * pointsize; \ else \ size = (order[0]*order[1]) * pointsize; \ break; \ default: \ rb_raise(rb_eArgError, "unknown target:%d",target); \ break; /* not reached */ \ } \ points = ALLOC_N(_type_,size); \ gl##_name_(target,query,points); \ \ RET_ARRAY_OR_SINGLE_FREE(size,RETCONV_##_type_,points) \ } GETMAP_FUNC(GetMapdv,GLdouble) GETMAP_FUNC(GetMapfv,GLfloat) GETMAP_FUNC(GetMapiv,GLint) #undef GETMAP_FUNC static VALUE gl_GetMaterialfv(obj,arg1,arg2) VALUE obj,arg1,arg2; { GLenum face; GLenum pname; GLfloat params[4] = {0.0,0.0,0.0,0.0}; int size; face = (GLenum)NUM2INT(arg1); pname = (GLenum)NUM2INT(arg2); switch(pname) { case GL_AMBIENT: case GL_DIFFUSE: case GL_SPECULAR: case GL_EMISSION: size = 4; break; case GL_COLOR_INDEXES: size = 3; break; case GL_SHININESS: size = 1; break; default: rb_raise(rb_eArgError, "unknown pname:%d",pname); break; /* not reached */ } glGetMaterialfv(face,pname,params); RET_ARRAY_OR_SINGLE(size,rb_float_new,params) } static VALUE gl_GetMaterialiv(obj,arg1,arg2) VALUE obj,arg1,arg2; { GLenum face; GLenum pname; GLint params[4] = {0,0,0,0}; int size; face = (GLenum)NUM2INT(arg1); pname = (GLenum)NUM2INT(arg2); switch(pname) { case GL_AMBIENT: case GL_DIFFUSE: case GL_SPECULAR: case GL_EMISSION: size = 4; break; case GL_COLOR_INDEXES: size = 3; break; case GL_SHININESS: size = 1; break; default: rb_raise(rb_eArgError, "unknown pname:%d",pname); break; /* not reached */ } glGetMaterialiv(face,pname,params); RET_ARRAY_OR_SINGLE(size,INT2NUM,params) } #define GLGETPIXELMAP_FUNC(_type_,_vartype_,_convert_) \ static VALUE \ gl_GetPixelMap##_type_##v(argc,argv,obj) \ int argc; \ VALUE *argv; \ VALUE obj; \ { \ GLenum map; \ GLenum map_size; \ GLint size = 0; \ _vartype_ *values; \ VALUE args[2]; \ switch (rb_scan_args(argc, argv, "11", &args[0], &args[1])) { \ default: \ case 1: \ if (CheckBufferBinding(GL_PIXEL_PACK_BUFFER_BINDING)) \ rb_raise(rb_eArgError, "Pixel pack buffer bound, but offset argument missing"); \ \ map = (GLenum)NUM2INT(args[0]); \ switch(map) { \ case GL_PIXEL_MAP_I_TO_I: map_size=GL_PIXEL_MAP_I_TO_I_SIZE; break; \ case GL_PIXEL_MAP_S_TO_S: map_size=GL_PIXEL_MAP_S_TO_S_SIZE; break; \ case GL_PIXEL_MAP_I_TO_R: map_size=GL_PIXEL_MAP_I_TO_R_SIZE; break; \ case GL_PIXEL_MAP_I_TO_G: map_size=GL_PIXEL_MAP_I_TO_G_SIZE; break; \ case GL_PIXEL_MAP_I_TO_B: map_size=GL_PIXEL_MAP_I_TO_B_SIZE; break; \ case GL_PIXEL_MAP_I_TO_A: map_size=GL_PIXEL_MAP_I_TO_A_SIZE; break; \ case GL_PIXEL_MAP_R_TO_R: map_size=GL_PIXEL_MAP_R_TO_R_SIZE; break; \ case GL_PIXEL_MAP_G_TO_G: map_size=GL_PIXEL_MAP_G_TO_G_SIZE; break; \ case GL_PIXEL_MAP_B_TO_B: map_size=GL_PIXEL_MAP_B_TO_B_SIZE; break; \ case GL_PIXEL_MAP_A_TO_A: map_size=GL_PIXEL_MAP_A_TO_A_SIZE; break; \ default: \ rb_raise(rb_eArgError, "unknown map:%d",map); \ break; \ } \ glGetIntegerv(map_size,&size); \ CHECK_GLERROR \ values = ALLOC_N(_vartype_,size); \ glGetPixelMap##_type_##v(map,values); \ RET_ARRAY_OR_SINGLE_FREE(size,_convert_,values) \ break; \ case 2: \ if (!CheckBufferBinding(GL_PIXEL_PACK_BUFFER_BINDING)) \ rb_raise(rb_eArgError, "Pixel pack buffer not bound"); \ \ map = (GLenum)NUM2INT(args[0]); \ glGetPixelMap##_type_##v(map,(GLvoid*)NUM2INT(args[1])); \ CHECK_GLERROR \ return Qnil; \ } \ } GLGETPIXELMAP_FUNC(f,GLfloat,rb_float_new) GLGETPIXELMAP_FUNC(ui,GLuint,INT2NUM) GLGETPIXELMAP_FUNC(us,GLushort,INT2NUM) #undef GLGETPIXELMAP_FUNC static VALUE gl_GetPolygonStipple(argc,argv,obj) int argc; VALUE *argv; VALUE obj; { VALUE args[1]; GLubyte mask[128]; switch(rb_scan_args(argc, argv, "01", &args[0])) { default: case 0: if (CheckBufferBinding(GL_PIXEL_PACK_BUFFER_BINDING)) rb_raise(rb_eArgError, "Pixel pack buffer bound, but offset argument missing"); memset(mask, 0x0, sizeof(GLubyte)*128); FORCE_PIXEL_STORE_MODE glGetPolygonStipple(mask); RESTORE_PIXEL_STORE_MODE CHECK_GLERROR return rb_str_new((const char*)mask, 128); case 1: if (!CheckBufferBinding(GL_PIXEL_PACK_BUFFER_BINDING)) rb_raise(rb_eArgError, "Pixel pack buffer not bound"); glGetPolygonStipple((GLvoid *)NUM2INT(args[0])); CHECK_GLERROR return Qnil; } } static VALUE gl_GetString(obj,arg1) VALUE obj,arg1; { GLenum name; const GLubyte *ret; name = (GLenum)NUM2INT(arg1); ret = glGetString(name); CHECK_GLERROR return rb_str_new2((const char*)ret); } #define GETTEXENVFUNC(_name_,_type_) \ static VALUE \ gl_##_name_(obj,arg1,arg2) \ VALUE obj,arg1,arg2; \ { \ GLenum target; \ GLenum pname; \ _type_ params[4] = {0.0,0.0,0.0,0.0}; \ int size; \ target = (GLenum)NUM2INT(arg1); \ pname = (GLenum)NUM2INT(arg2); \ switch(pname) { \ case GL_TEXTURE_ENV_COLOR: \ case GL_TEXTURE_ENV_BIAS_SGIX: \ case GL_CULL_MODES_NV: \ case GL_OFFSET_TEXTURE_MATRIX_NV: \ size = 4; \ break; \ case GL_CONST_EYE_NV: \ size = 3; \ break; \ default: \ size = 1; \ break; \ } \ gl##_name_(target,pname,params); \ RET_ARRAY_OR_SINGLE(size,RETCONV_##_type_,params) \ } GETTEXENVFUNC(GetTexEnvfv,GLfloat) GETTEXENVFUNC(GetTexEnviv,GLint) #undef GETTEXENVFUNC #define GETTEXGENFUNC(_name_,_type_) \ static VALUE \ gl_##_name_(obj,arg1,arg2) \ VALUE obj,arg1,arg2; \ { \ GLenum coord; \ GLenum pname; \ _type_ params[4] = {0.0,0.0,0.0,0.0}; \ int size; \ coord = (GLenum)NUM2INT(arg1); \ pname = (GLenum)NUM2INT(arg2); \ switch(pname) { \ case GL_OBJECT_PLANE: \ case GL_EYE_PLANE: \ size = 4; \ break; \ default: \ size = 1; \ break; \ } \ gl##_name_(coord,pname,params); \ RET_ARRAY_OR_SINGLE(size,RETCONV_##_type_,params) \ } GETTEXGENFUNC(GetTexGendv,GLdouble) GETTEXGENFUNC(GetTexGenfv,GLfloat) GETTEXGENFUNC(GetTexGeniv,GLint) #undef GETTEXGENFUNC static VALUE gl_GetTexImage(argc,argv,obj) int argc; VALUE *argv; VALUE obj; { GLenum tex; GLint lod; GLenum format; GLenum type; GLint width = 0; GLint height = 0; GLint depth = 0; GLint size4d = 0; GLint size; VALUE pixels; VALUE args[5]; int numargs; numargs = rb_scan_args(argc, argv, "41", &args[0], &args[1], &args[2], &args[3], &args[4]); tex = (GLenum)NUM2INT(args[0]); lod = (GLint)NUM2INT(args[1]); format = (GLenum)NUM2INT(args[2]); type = (GLenum)NUM2INT(args[3]); switch(numargs) { default: case 4: if (CheckBufferBinding(GL_PIXEL_PACK_BUFFER_BINDING)) rb_raise(rb_eArgError, "Pixel pack buffer bound, but offset argument missing"); size = 1; switch(tex) { case GL_TEXTURE_4D_SGIS: glGetTexLevelParameteriv(tex,lod,GL_TEXTURE_4DSIZE_SGIS,&size4d); size *= size4d; /* fall through */ case GL_TEXTURE_3D: case GL_TEXTURE_1D_STACK_MESAX: case GL_TEXTURE_2D_STACK_MESAX: glGetTexLevelParameteriv(tex,lod,GL_TEXTURE_DEPTH,&depth); size *= depth; /* fall through */ case GL_TEXTURE_2D: case GL_TEXTURE_CUBE_MAP_POSITIVE_X: case GL_TEXTURE_CUBE_MAP_POSITIVE_Y: case GL_TEXTURE_CUBE_MAP_POSITIVE_Z: case GL_TEXTURE_CUBE_MAP_NEGATIVE_X: case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: case GL_TEXTURE_RECTANGLE_ARB: case GL_DETAIL_TEXTURE_2D_SGIS: glGetTexLevelParameteriv(tex,lod,GL_TEXTURE_HEIGHT,&height); size *= height; /* fall through */ case GL_TEXTURE_1D: glGetTexLevelParameteriv(tex,lod,GL_TEXTURE_WIDTH,&width); size *= width; break; default: rb_raise(rb_eArgError, "Target type not supported"); } CHECK_GLERROR pixels = allocate_buffer_with_string(GetDataSize(type,format,size)); FORCE_PIXEL_STORE_MODE glGetTexImage(tex,lod,format,type,(GLvoid*)RSTRING_PTR(pixels)); RESTORE_PIXEL_STORE_MODE CHECK_GLERROR return pixels; break; case 5: if (!CheckBufferBinding(GL_PIXEL_PACK_BUFFER_BINDING)) rb_raise(rb_eArgError, "Pixel pack buffer not bound"); FORCE_PIXEL_STORE_MODE glGetTexImage(tex,lod,format,type,(GLvoid*)NUM2INT(args[4])); RESTORE_PIXEL_STORE_MODE CHECK_GLERROR return Qnil; } } static VALUE gl_GetTexParameterfv(obj,arg1,arg2) VALUE obj,arg1,arg2; { GLenum target; GLenum pname; GLfloat params[4] = {0.0,0.0,0.0,0.0}; int size; target = (GLenum)NUM2INT(arg1); pname = (GLenum)NUM2INT(arg2); switch(pname) { case GL_TEXTURE_BORDER_COLOR: case GL_TEXTURE_BORDER_VALUES_NV: case GL_POST_TEXTURE_FILTER_BIAS_SGIX: case GL_POST_TEXTURE_FILTER_SCALE_SGIX: size = 4; break; default: size = 1; break; } glGetTexParameterfv(target,pname,params); RET_ARRAY_OR_SINGLE(size,RETCONV_GLfloat,params) } static VALUE gl_GetTexParameteriv(obj,arg1,arg2) VALUE obj,arg1,arg2; { GLenum target; GLenum pname; GLint params[4] = {0,0,0,0}; int size; target = (GLenum)NUM2INT(arg1); pname = (GLenum)NUM2INT(arg2); switch(pname) { case GL_TEXTURE_BORDER_COLOR: case GL_TEXTURE_BORDER_VALUES_NV: case GL_POST_TEXTURE_FILTER_BIAS_SGIX: case GL_POST_TEXTURE_FILTER_SCALE_SGIX: size = 4; break; default: size = 1; break; } glGetTexParameteriv(target,pname,params); RET_ARRAY_OR_SINGLE_BOOL(size,cond_GLBOOL2RUBY,pname,params) } static VALUE gl_GetTexLevelParameterfv(obj,arg1,arg2,arg3) VALUE obj,arg1,arg2,arg3; { GLenum target; GLint level; GLenum pname; GLfloat params = 0.0; target = (GLenum)NUM2INT(arg1); level = (GLint)NUM2INT(arg2); pname = (GLenum)NUM2INT(arg3); glGetTexLevelParameterfv(target,level,pname,¶ms); CHECK_GLERROR return RETCONV_GLfloat(params); } static VALUE gl_GetTexLevelParameteriv(obj,arg1,arg2,arg3) VALUE obj,arg1,arg2,arg3; { GLenum target; GLint level; GLenum pname; GLint params = 0; target = (GLenum)NUM2INT(arg1); level = (GLint)NUM2INT(arg2); pname = (GLenum)NUM2INT(arg3); glGetTexLevelParameteriv(target,level,pname,¶ms); CHECK_GLERROR return cond_GLBOOL2RUBY(pname,params); } static VALUE gl_LoadMatrixf(obj,arg1) VALUE obj,arg1; { GLfloat m[4*4]; ary2cmatfloat(arg1, m, 4, 4); glLoadMatrixf(m); CHECK_GLERROR return Qnil; } static VALUE gl_LoadMatrixd(obj,arg1) VALUE obj,arg1; { GLdouble m[4*4]; ary2cmatdouble(arg1, m, 4, 4); glLoadMatrixd(m); CHECK_GLERROR return Qnil; } static VALUE gl_MultMatrixf(obj,arg1) VALUE obj,arg1; { GLfloat m[4*4]; ary2cmatfloat(arg1, m, 4, 4); glMultMatrixf(m); CHECK_GLERROR return Qnil; } static VALUE gl_MultMatrixd(obj,arg1) VALUE obj,arg1; { GLdouble m[4*4]; ary2cmatdouble(arg1, m, 4, 4); glMultMatrixd(m); CHECK_GLERROR return Qnil; } static VALUE g_Vertex_ptr; static VALUE g_Normal_ptr; static VALUE g_Color_ptr; static VALUE g_Index_ptr; static VALUE g_TexCoord_ptr; static VALUE g_EdgeFlag_ptr; VALUE g_FogCoord_ptr; /* OpenGL 1.4 */ VALUE g_SecondaryColor_ptr; /* OpenGL 1.4 */ #define POINTER_FUNC(_func_) \ static VALUE \ gl_##_func_##Pointer(obj, arg1, arg2, arg3, arg4) \ VALUE obj, arg1, arg2, arg3, arg4; \ { \ GLint size; \ GLenum type; \ GLsizei stride; \ size = (GLint)NUM2INT(arg1); \ type = (GLenum)NUM2INT(arg2); \ stride = (GLsizei)NUM2UINT(arg3); \ if (CheckBufferBinding(GL_ARRAY_BUFFER_BINDING)) { \ g_##_func_##_ptr = arg4; \ gl##_func_##Pointer(size, type, stride, (const GLvoid*)NUM2INT(arg4)); \ } else { \ VALUE data; \ data = pack_array_or_pass_string(type,arg4); \ rb_str_freeze(data); \ g_##_func_##_ptr = data; \ gl##_func_##Pointer(size, type, stride, (const GLvoid*)RSTRING_PTR(data)); \ } \ CHECK_GLERROR \ return Qnil; \ } POINTER_FUNC(Vertex) POINTER_FUNC(Color) POINTER_FUNC(TexCoord) #undef POINTER_FUNC static VALUE gl_DrawElements(obj,arg1,arg2,arg3,arg4) VALUE obj,arg1,arg2,arg3,arg4; { GLenum mode; GLsizei count; GLenum type; mode = (GLenum)NUM2INT(arg1); count = (GLsizei)NUM2UINT(arg2); type = (GLenum)NUM2INT(arg3); if (CheckBufferBinding(GL_ELEMENT_ARRAY_BUFFER_BINDING)) { glDrawElements(mode, count, type, (const GLvoid*)NUM2INT(arg4)); } else { VALUE data; data = pack_array_or_pass_string(type,arg4); glDrawElements(mode, count, type, (const GLvoid*)RSTRING_PTR(data)); } CHECK_GLERROR return Qnil; } static VALUE gl_EdgeFlagPointer(obj,arg1,arg2) VALUE obj,arg1,arg2; { GLsizei stride; stride = (GLsizei)NUM2UINT(arg1); if (CheckBufferBinding(GL_ARRAY_BUFFER_BINDING)) { g_EdgeFlag_ptr = arg2; glEdgeFlagPointer(stride, (const GLboolean*) NUM2INT(arg2)); } else { VALUE data; data = pack_array_or_pass_string(GL_UNSIGNED_BYTE,arg2); rb_str_freeze(data); g_EdgeFlag_ptr = data; glEdgeFlagPointer(stride, (const GLboolean*)RSTRING_PTR(data)); } CHECK_GLERROR return Qnil; } static VALUE gl_GetPointerv(obj,arg1) VALUE obj,arg1; { GLenum pname; pname = (GLenum)NUM2INT(arg1); switch (pname) { case GL_VERTEX_ARRAY_POINTER: return g_Vertex_ptr; case GL_NORMAL_ARRAY_POINTER: return g_Normal_ptr; case GL_COLOR_ARRAY_POINTER: return g_Color_ptr; case GL_INDEX_ARRAY_POINTER: return g_Index_ptr; case GL_TEXTURE_COORD_ARRAY_POINTER: return g_TexCoord_ptr; case GL_EDGE_FLAG_ARRAY_POINTER: return g_EdgeFlag_ptr; case GL_FOG_COORD_ARRAY_POINTER: return g_FogCoord_ptr; case GL_SECONDARY_COLOR_ARRAY_POINTER: return g_SecondaryColor_ptr; case GL_FEEDBACK_BUFFER_POINTER: return g_current_feed_buffer; case GL_SELECTION_BUFFER_POINTER: return g_current_sel_buffer; default: rb_raise(rb_eArgError, "Invalid pname %d",pname); break; /* not reached */ } return Qnil; } static VALUE gl_IndexPointer(obj,arg1,arg2,arg3) VALUE obj,arg1,arg2,arg3; { GLenum type; GLsizei stride; type = (GLenum)NUM2INT(arg1); stride = (GLsizei)NUM2UINT(arg2); if (CheckBufferBinding(GL_ARRAY_BUFFER_BINDING)) { g_Index_ptr = arg3; glIndexPointer(type, stride, (const GLvoid*)NUM2INT(arg3)); } else { VALUE data; data = pack_array_or_pass_string(type,arg3); g_Index_ptr = data; glIndexPointer(type, stride, (const GLvoid*)RSTRING_PTR(data)); } CHECK_GLERROR return Qnil; } static VALUE gl_InterleavedArrays(obj,arg1,arg2,arg3) VALUE obj,arg1,arg2,arg3; { GLenum format; GLsizei stride; VALUE data; format = (GLenum)NUM2INT(arg1); stride = (GLsizei)NUM2UINT(arg2); /* FIXME: add support for GL_C4UB_V2F,GL_C4UB_V3F, GL_T2F_C4UB_V3 */ data = pack_array_or_pass_string(GL_FLOAT,arg3); rb_str_freeze(data); glInterleavedArrays(format, stride, (const GLvoid*)RSTRING_PTR(data)); CHECK_GLERROR return Qnil; } static VALUE gl_NormalPointer(obj,arg1,arg2,arg3) VALUE obj,arg1,arg2,arg3; { GLenum type; GLsizei stride; type = (GLenum)NUM2INT(arg1); stride = (GLsizei)NUM2UINT(arg2); if (CheckBufferBinding(GL_ARRAY_BUFFER_BINDING)) { g_Normal_ptr = arg3; glNormalPointer(type, stride, (const GLvoid*)NUM2INT(arg3)); } else { VALUE data; data = pack_array_or_pass_string(type,arg3); rb_str_freeze(data); g_Normal_ptr = data; glNormalPointer(type, stride, (const GLvoid*)RSTRING_PTR(data)); } CHECK_GLERROR return Qnil; } static VALUE gl_TexSubImage1D(obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7) VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7; { GLenum target; GLint level; GLint xoffset; GLsizei width; GLenum format; GLenum type; VALUE data; target = (GLenum)NUM2INT(arg1); level = (GLint)NUM2INT(arg2); xoffset = (GLint)NUM2INT(arg3); width = (GLsizei)NUM2UINT(arg4); format = (GLenum)NUM2INT(arg5); type = (GLenum)NUM2INT(arg6); if (CheckBufferBinding(GL_PIXEL_UNPACK_BUFFER_BINDING)) { glTexSubImage1D(target,level,xoffset,width,format,type,(GLvoid *)NUM2INT(arg7)); CHECK_GLERROR return Qnil; } data = pack_array_or_pass_string(type,arg7); CheckDataSize(type,format,width,data); glTexSubImage1D(target,level,xoffset,width,format,type,RSTRING_PTR(data)); CHECK_GLERROR return Qnil; } static VALUE gl_TexSubImage2D(obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9) VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9; { GLenum target; GLint level; GLint xoffset; GLint yoffset; GLsizei width; GLsizei height; GLenum format; GLenum type; VALUE data; target = (GLenum)NUM2INT(arg1); level = (GLint)NUM2INT(arg2); xoffset = (GLint)NUM2INT(arg3); yoffset = (GLint)NUM2INT(arg4); width = (GLsizei)NUM2UINT(arg5); height = (GLsizei)NUM2UINT(arg6); format = (GLenum)NUM2INT(arg7); type = (GLenum)NUM2INT(arg8); if (CheckBufferBinding(GL_PIXEL_UNPACK_BUFFER_BINDING)) { glTexSubImage2D(target,level,xoffset,yoffset,width,height,format,type,(GLvoid *)NUM2INT(arg9)); CHECK_GLERROR return Qnil; } data = pack_array_or_pass_string(type,arg9); CheckDataSize(type,format,width*height,data); glTexSubImage2D(target,level,xoffset,yoffset,width,height,format,type,RSTRING_PTR(data)); CHECK_GLERROR return Qnil; } static VALUE gl_AreTexturesResident(obj,arg1) VALUE obj,arg1; { GLuint *textures; GLboolean *residences; GLsizei size; GLboolean r; VALUE retary; VALUE ary; int i; ary = rb_Array(arg1); size = RARRAY_LEN(ary); textures = ALLOC_N(GLuint,size); residences = ALLOC_N(GLboolean,size); ary2cuint(ary,textures,size); r = glAreTexturesResident(size,textures,residences); retary = rb_ary_new2(size); if (r==GL_TRUE) { /* all are resident */ for(i=0;i * * This program is distributed under the terms of the MIT license. * See the included MIT-LICENSE file for the terms of this license. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "../common/common.h" /* OpenGL 1.5 functions */ GL_FUNC_LOAD_1(EndQuery,GLvoid, GLenum, "1.5") GL_FUNC_LOAD_1(IsQuery,GLboolean, GLuint, "1.5") GL_FUNC_LOAD_2(BeginQuery,GLvoid, GLenum,GLuint, "1.5") GL_FUNC_LOAD_2(BindBuffer,GLvoid, GLenum,GLuint, "1.5") GL_FUNC_LOAD_1(IsBuffer,GLboolean, GLuint, "1.5") GL_FUNC_GENOBJECTS_LOAD(GenQueries,"1.5") GL_FUNC_DELETEOBJECTS_LOAD(DeleteQueries,"1.5") GL_FUNC_GENOBJECTS_LOAD(GenBuffers,"1.5") GL_FUNC_DELETEOBJECTS_LOAD(DeleteBuffers,"1.5") static void (APIENTRY * fptr_glGetQueryiv)(GLenum,GLenum,GLint *); static VALUE gl_GetQueryiv(obj,arg1,arg2) VALUE obj,arg1,arg2; { GLenum target; GLenum pname; GLint params = 0; LOAD_GL_FUNC(glGetQueryiv,"1.5") target = (GLenum)NUM2INT(arg1); pname = (GLenum)NUM2INT(arg2); fptr_glGetQueryiv(target,pname,¶ms); CHECK_GLERROR return RETCONV_GLint(params); } static void (APIENTRY * fptr_glGetQueryObjectiv)(GLuint,GLenum,GLint *); static VALUE gl_GetQueryObjectiv(obj,arg1,arg2) VALUE obj,arg1,arg2; { GLuint id; GLenum pname; GLint params = 0; LOAD_GL_FUNC(glGetQueryObjectiv,"1.5") id = (GLuint)NUM2UINT(arg1); pname = (GLenum)NUM2INT(arg2); fptr_glGetQueryObjectiv(id,pname,¶ms); CHECK_GLERROR return cond_GLBOOL2RUBY(pname,params); } static void (APIENTRY * fptr_glGetQueryObjectuiv)(GLuint,GLenum,GLuint *); static VALUE gl_GetQueryObjectuiv(obj,arg1,arg2) VALUE obj,arg1,arg2; { GLuint id; GLenum pname; GLuint params = 0; LOAD_GL_FUNC(glGetQueryObjectuiv,"1.5") id = (GLuint)NUM2UINT(arg1); pname = (GLenum)NUM2INT(arg2); fptr_glGetQueryObjectuiv(id,pname,¶ms); CHECK_GLERROR return cond_GLBOOL2RUBY_U(pname,params); } static void (APIENTRY * fptr_glBufferData)(GLenum,GLsizeiptr,GLvoid *,GLenum); static VALUE gl_BufferData(obj,arg1,arg2,arg3,arg4) VALUE obj,arg1,arg2,arg3,arg4; { GLenum target; GLsizeiptr size; GLenum usage; LOAD_GL_FUNC(glBufferData,"1.5") target = (GLenum)NUM2INT(arg1); size = (GLsizeiptr)NUM2INT(arg2); usage = (GLenum)NUM2INT(arg4); if (TYPE(arg3) == T_STRING) { fptr_glBufferData(target,size,(GLvoid *)RSTRING_PTR(arg3),usage); } else if (NIL_P(arg3)) { fptr_glBufferData(target,size,NULL,usage); } else { Check_Type(arg3,T_STRING); /* force exception */ } CHECK_GLERROR return Qnil; } static void (APIENTRY * fptr_glBufferSubData)(GLenum,GLintptr,GLsizeiptr,GLvoid *); static VALUE gl_BufferSubData(obj,arg1,arg2,arg3,arg4) VALUE obj,arg1,arg2,arg3,arg4; { GLenum target; GLintptr offset; GLsizeiptr size; LOAD_GL_FUNC(glBufferSubData,"1.5") target = (GLenum)NUM2INT(arg1); offset = (GLintptr)NUM2INT(arg2); size = (GLsizeiptr)NUM2INT(arg3); Check_Type(arg4,T_STRING); fptr_glBufferSubData(target,offset,size,(GLvoid *)RSTRING_PTR(arg4)); CHECK_GLERROR return Qnil; } static void (APIENTRY * fptr_glGetBufferSubData)(GLenum,GLintptr,GLsizeiptr,GLvoid *); static VALUE gl_GetBufferSubData(obj,arg1,arg2,arg3) VALUE obj,arg1,arg2,arg3; { GLenum target; GLintptr offset; GLsizeiptr size; VALUE data; LOAD_GL_FUNC(glGetBufferSubData,"1.5") target = (GLenum)NUM2INT(arg1); offset = (GLintptr)NUM2INT(arg2); size = (GLsizeiptr)NUM2INT(arg3); data = allocate_buffer_with_string(size); fptr_glGetBufferSubData(target,offset,size,(GLvoid *)RSTRING_PTR(data)); CHECK_GLERROR return data; } static void (APIENTRY * fptr_glGetBufferParameteriv)(GLenum,GLenum,GLint *); static VALUE gl_GetBufferParameteriv(obj,arg1,arg2) VALUE obj,arg1,arg2; { GLenum target; GLenum value; GLint data = 0; LOAD_GL_FUNC(glGetBufferParameteriv,"1.5") target = (GLenum)NUM2INT(arg1); value = (GLenum)NUM2INT(arg2); fptr_glGetBufferParameteriv(target,value,&data); CHECK_GLERROR return cond_GLBOOL2RUBY(value,data); } static GLvoid * (APIENTRY * fptr_glMapBuffer)(GLenum,GLenum); static VALUE gl_MapBuffer(obj,arg1,arg2) VALUE obj,arg1,arg2; { GLenum target; GLenum access; GLint size = 0; VALUE data; GLvoid *buffer_ptr = NULL; LOAD_GL_FUNC(glMapBuffer,"1.5") LOAD_GL_FUNC(glGetBufferParameteriv,"1.5") target = (GLenum)NUM2INT(arg1); access = (GLenum)NUM2INT(arg2); fptr_glGetBufferParameteriv(target,GL_BUFFER_SIZE,&size); CHECK_GLERROR buffer_ptr = fptr_glMapBuffer(target,access); CHECK_GLERROR if (buffer_ptr==NULL || size<=0) return Qnil; data = allocate_buffer_with_string(size); memcpy(RSTRING_PTR(data), buffer_ptr, size); return data; } static GLboolean (APIENTRY * fptr_glUnmapBuffer)(GLenum); static VALUE gl_UnmapBuffer(obj,arg1) VALUE obj,arg1; { GLenum target; GLboolean ret; LOAD_GL_FUNC(glUnmapBuffer,"1.5") target = (GLenum)NUM2INT(arg1); ret = fptr_glUnmapBuffer(target); CHECK_GLERROR return GLBOOL2RUBY(ret); } static void (APIENTRY * fptr_glGetBufferPointerv)(GLenum,GLenum,GLvoid **); static VALUE gl_GetBufferPointerv(obj,arg1,arg2,arg3) VALUE obj,arg1,arg2,arg3; { LOAD_GL_FUNC(glGetBufferPointerv,"1.5") rb_raise(rb_eArgError, "glGetBufferPointerv not implemented"); CHECK_GLERROR return Qnil; } void gl_init_functions_1_5(VALUE module) { rb_define_module_function(module, "glGenQueries", gl_GenQueries, 1); rb_define_module_function(module, "glDeleteQueries", gl_DeleteQueries, 1); rb_define_module_function(module, "glIsQuery", gl_IsQuery, 1); rb_define_module_function(module, "glBeginQuery", gl_BeginQuery, 2); rb_define_module_function(module, "glEndQuery", gl_EndQuery, 1); rb_define_module_function(module, "glGetQueryiv", gl_GetQueryiv, 2); rb_define_module_function(module, "glGetQueryObjectiv", gl_GetQueryObjectiv, 2); rb_define_module_function(module, "glGetQueryObjectuiv", gl_GetQueryObjectuiv, 2); rb_define_module_function(module, "glBindBuffer", gl_BindBuffer, 2); rb_define_module_function(module, "glDeleteBuffers", gl_DeleteBuffers, 1); rb_define_module_function(module, "glGenBuffers", gl_GenBuffers, 1); rb_define_module_function(module, "glIsBuffer", gl_IsBuffer, 1); rb_define_module_function(module, "glBufferData", gl_BufferData, 4); rb_define_module_function(module, "glBufferSubData", gl_BufferSubData, 4); rb_define_module_function(module, "glGetBufferSubData", gl_GetBufferSubData, 3); rb_define_module_function(module, "glMapBuffer", gl_MapBuffer, 2); rb_define_module_function(module, "glUnmapBuffer", gl_UnmapBuffer, 1); rb_define_module_function(module, "glGetBufferParameteriv", gl_GetBufferParameteriv, 2); rb_define_module_function(module, "glGetBufferPointerv", gl_GetBufferPointerv, 3); } ruby-opengl-0.60.1.orig/ext/gl/gl-ext-gremedy.c0000644000000000000000000000300511377006423017677 0ustar rootroot/* * Copyright (C) 2007 Jan Dvorak * * This program is distributed under the terms of the MIT license. * See the included MIT-LICENSE file for the terms of this license. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "../common/common.h" /* Graphic Remedy extensions */ /* #311 GL_GREMEDY_string_marker */ static void (APIENTRY * fptr_glStringMarkerGREMEDY)(GLsizei,const void *); static VALUE gl_StringMarkerGREMEDY(VALUE obj,VALUE arg1) { LOAD_GL_FUNC(glStringMarkerGREMEDY,"GL_GREMEDY_string_marker") Check_Type(arg1,T_STRING); fptr_glStringMarkerGREMEDY(RSTRING_LEN(arg1),RSTRING_PTR(arg1)); CHECK_GLERROR return Qnil; } /* #345 GL_GREMEDY_frame_terminator */ GL_FUNC_LOAD_0(FrameTerminatorGREMEDY,GLvoid, "GL_GREMEDY_frame_terminator") void gl_init_functions_ext_gremedy(VALUE module) { /* #311 GL_GREMEDY_string_marker */ rb_define_module_function(module, "glStringMarkerGREMEDY", gl_StringMarkerGREMEDY, 1); /* #345 GL_GREMEDY_frame_terminator */ rb_define_module_function(module, "glFrameTerminatorGREMEDY", gl_FrameTerminatorGREMEDY, 0); } ruby-opengl-0.60.1.orig/ext/gl/gl-1.2.c0000644000000000000000000006373411377006423015764 0ustar rootroot/* * Copyright (C) 1999 - 2005 Yoshi * Copyright (C) 2006 John M. Gabriele * Copyright (C) 2007 Jan Dvorak * * This program is distributed under the terms of the MIT license. * See the included MIT-LICENSE file for the terms of this license. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "../common/common.h" /* OpenGL 1.2 functions */ GL_FUNC_LOAD_4(BlendColor,GLvoid, GLclampf,GLclampf,GLclampf,GLclampf, "1.2") GL_FUNC_LOAD_1(BlendEquation,GLvoid, GLenum, "1.2") GL_FUNC_LOAD_5(CopyColorTable,GLvoid, GLenum,GLenum,GLint,GLint,GLsizei, "1.2") GL_FUNC_LOAD_5(CopyColorSubTable,GLvoid, GLenum,GLsizei,GLint,GLint,GLsizei, "1.2") GL_FUNC_LOAD_3(ConvolutionParameterf,GLvoid, GLenum,GLenum,GLfloat, "1.2") GL_FUNC_LOAD_3(ConvolutionParameteri,GLvoid, GLenum,GLenum,GLint, "1.2") GL_FUNC_LOAD_5(CopyConvolutionFilter1D,GLvoid, GLenum,GLenum,GLint,GLint,GLsizei, "1.2") GL_FUNC_LOAD_6(CopyConvolutionFilter2D,GLvoid, GLenum,GLenum,GLint,GLint,GLsizei,GLsizei, "1.2") GL_FUNC_LOAD_4(Histogram,GLvoid, GLenum,GLsizei,GLenum,GLboolean, "1.2") GL_FUNC_LOAD_3(Minmax,GLvoid, GLenum,GLenum,GLboolean, "1.2") GL_FUNC_LOAD_1(ResetHistogram,GLvoid, GLenum, "1.2") GL_FUNC_LOAD_1(ResetMinmax,GLvoid, GLenum, "1.2") GL_FUNC_LOAD_9(CopyTexSubImage3D,GLvoid, GLenum,GLint,GLint,GLint,GLint,GLint,GLint,GLsizei,GLsizei, "1.2") static void (APIENTRY * fptr_glDrawRangeElements)(GLenum,GLuint,GLuint,GLsizei,GLenum,GLvoid*); static VALUE gl_DrawRangeElements(obj,arg1,arg2,arg3,arg4,arg5,arg6) VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6; { GLenum mode; GLuint start; GLuint end; GLsizei count; GLenum type; LOAD_GL_FUNC(glDrawRangeElements,"1.2") mode = (GLenum)NUM2INT(arg1); start = (GLuint)NUM2UINT(arg2); end = (GLuint)NUM2UINT(arg3); count = (GLsizei)NUM2UINT(arg4); type = (GLenum)NUM2INT(arg5); if (CheckBufferBinding(GL_ELEMENT_ARRAY_BUFFER_BINDING)) { fptr_glDrawRangeElements(mode, start, end, count, type, (GLvoid *)NUM2INT(arg6)); } else { VALUE data; data = pack_array_or_pass_string(type,arg6); fptr_glDrawRangeElements(mode, start, end, count, type, RSTRING_PTR(data)); } CHECK_GLERROR return Qnil; } static void (APIENTRY * fptr_glColorTable)(GLenum,GLenum,GLsizei,GLenum,GLenum,GLvoid*); static VALUE gl_ColorTable(obj,arg1,arg2,arg3,arg4,arg5,arg6) VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6; { GLenum target; GLenum internalformat; GLsizei width; GLenum format; GLenum type; LOAD_GL_FUNC(glColorTable,"1.2") target = (GLenum)NUM2INT(arg1); internalformat = (GLenum)NUM2INT(arg2); width = (GLsizei)NUM2UINT(arg3); format = (GLenum)NUM2INT(arg4); type = (GLenum)NUM2INT(arg5); if (CheckBufferBinding(GL_PIXEL_UNPACK_BUFFER_BINDING)) { fptr_glColorTable(target,internalformat,width,format,type,(GLvoid *)NUM2INT(arg6)); } else { VALUE data; data = pack_array_or_pass_string(type,arg6); CheckDataSize(type,format,width,data); fptr_glColorTable(target,internalformat,width,format,type,RSTRING_PTR(data)); } CHECK_GLERROR return Qnil; } static void (APIENTRY * fptr_glColorTableParameterfv)(GLenum,GLenum,const GLfloat*); static VALUE gl_ColorTableParameterfv(obj,arg1,arg2,arg3) VALUE obj,arg1,arg2,arg3; { GLenum target; GLenum pname; GLfloat params[4] = {0.0,0.0,0.0,0.0}; LOAD_GL_FUNC(glColorTableParameterfv,"1.2") target = (GLenum)NUM2INT(arg1); pname = (GLenum)NUM2INT(arg2); Check_Type(arg3,T_ARRAY); ary2cflt(arg3,params,4); fptr_glColorTableParameterfv(target,pname,params); CHECK_GLERROR return Qnil; } static void (APIENTRY * fptr_glColorTableParameteriv)(GLenum,GLenum,const GLint*); static VALUE gl_ColorTableParameteriv(obj,arg1,arg2,arg3) VALUE obj,arg1,arg2,arg3; { GLenum target; GLenum pname; GLint params[4] = {0,0,0,0}; LOAD_GL_FUNC(glColorTableParameteriv,"1.2") target = (GLenum)NUM2INT(arg1); pname = (GLenum)NUM2INT(arg2); Check_Type(arg3,T_ARRAY); ary2cint(arg3,params,4); fptr_glColorTableParameteriv(target,pname,params); CHECK_GLERROR return Qnil; } static void (APIENTRY * fptr_glGetColorTableParameterfv)(GLenum,GLenum,GLfloat *); static VALUE gl_GetColorTableParameterfv(obj,arg1,arg2) VALUE obj,arg1,arg2; { GLenum target; GLenum pname; GLfloat params[4] = {0.0,0.0,0.0,0.0}; GLsizei size; LOAD_GL_FUNC(glGetColorTableParameterfv,"1.2") target = (GLenum)NUM2INT(arg1); pname = (GLenum)NUM2INT(arg2); switch (pname) { case GL_COLOR_TABLE_SCALE: case GL_COLOR_TABLE_BIAS: size = 4; break; default: size = 1; break; } fptr_glGetColorTableParameterfv(target,pname,params); RET_ARRAY_OR_SINGLE(size,RETCONV_GLfloat,params) } static void (APIENTRY * fptr_glGetColorTableParameteriv)(GLenum,GLenum,GLint *); static VALUE gl_GetColorTableParameteriv(obj,arg1,arg2) VALUE obj,arg1,arg2; { GLenum target; GLenum pname; GLint params[4] = {0,0,0,0}; GLsizei size; LOAD_GL_FUNC(glGetColorTableParameteriv,"1.2") target = (GLenum)NUM2INT(arg1); pname = (GLenum)NUM2INT(arg2); switch (pname) { case GL_COLOR_TABLE_SCALE: case GL_COLOR_TABLE_BIAS: size = 4; break; default: size = 1; break; } fptr_glGetColorTableParameteriv(target,pname,params); RET_ARRAY_OR_SINGLE(size,RETCONV_GLint,params) } static void (APIENTRY * fptr_glGetColorTable)(GLenum,GLenum,GLenum,GLvoid *); static VALUE gl_GetColorTable(obj,arg1,arg2,arg3) VALUE obj,arg1,arg2,arg3; { GLenum target; GLenum format; GLenum type; GLsizei width = 0; VALUE data; LOAD_GL_FUNC(glGetColorTable,"1.2") LOAD_GL_FUNC(glGetColorTableParameteriv,"1.2") target = (GLenum)NUM2INT(arg1); format = (GLenum)NUM2INT(arg2); type = (GLenum)NUM2INT(arg3); fptr_glGetColorTableParameteriv(target,GL_COLOR_TABLE_WIDTH,&width); CHECK_GLERROR data = allocate_buffer_with_string(GetDataSize(type,format,width)); FORCE_PIXEL_STORE_MODE fptr_glGetColorTable(target,format,type,(GLvoid*)RSTRING_PTR(data)); RESTORE_PIXEL_STORE_MODE CHECK_GLERROR return data; } static void (APIENTRY * fptr_glColorSubTable)(GLenum,GLsizei,GLsizei,GLenum,GLenum,const GLvoid *data); static VALUE gl_ColorSubTable(obj,arg1,arg2,arg3,arg4,arg5,arg6) VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6; { GLenum target; GLsizei start; GLsizei count; GLenum format; GLenum type; LOAD_GL_FUNC(glColorSubTable,"1.2") target = (GLenum)NUM2INT(arg1); start = (GLsizei)NUM2UINT(arg2); count = (GLsizei)NUM2UINT(arg3); format = (GLenum)NUM2INT(arg4); type = (GLenum)NUM2INT(arg5); if (CheckBufferBinding(GL_PIXEL_UNPACK_BUFFER_BINDING)) { fptr_glColorSubTable(target,start,count,format,type,(GLvoid *)NUM2INT(arg6)); } else { VALUE data; data = pack_array_or_pass_string(type,arg6); CheckDataSize(type,format,count,data); fptr_glColorSubTable(target,start,count,format,type,RSTRING_PTR(data)); } CHECK_GLERROR return Qnil; } static void (APIENTRY * fptr_glConvolutionFilter1D)(GLenum,GLenum,GLsizei,GLenum,GLenum,const GLvoid *); static VALUE gl_ConvolutionFilter1D(obj,arg1,arg2,arg3,arg4,arg5,arg6) VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6; { GLenum target; GLenum internalformat; GLsizei width; GLenum format; GLenum type; LOAD_GL_FUNC(glConvolutionFilter1D,"1.2") target = (GLenum)NUM2INT(arg1); internalformat = (GLenum)NUM2INT(arg2); width = (GLsizei)NUM2UINT(arg3); format = (GLenum)NUM2INT(arg4); type = (GLenum)NUM2INT(arg5); if (CheckBufferBinding(GL_PIXEL_UNPACK_BUFFER_BINDING)) { fptr_glConvolutionFilter1D(target,internalformat,width,format,type,(GLvoid *)NUM2INT(arg6)); } else { VALUE data; data = pack_array_or_pass_string(type,arg6); CheckDataSize(type,format,width,data); fptr_glConvolutionFilter1D(target,internalformat,width,format,type,RSTRING_PTR(data)); } CHECK_GLERROR return Qnil; } static void (APIENTRY * fptr_glConvolutionFilter2D)(GLenum,GLenum,GLsizei,GLsizei,GLenum,GLenum,const GLvoid *); static VALUE gl_ConvolutionFilter2D(obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7) VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7; { GLenum target; GLenum internalformat; GLsizei width; GLsizei height; GLenum format; GLenum type; LOAD_GL_FUNC(glConvolutionFilter2D,"1.2") target = (GLenum)NUM2INT(arg1); internalformat = (GLenum)NUM2INT(arg2); width = (GLsizei)NUM2UINT(arg3); height = (GLsizei)NUM2UINT(arg4); format = (GLenum)NUM2INT(arg5); type = (GLenum)NUM2INT(arg6); if (CheckBufferBinding(GL_PIXEL_UNPACK_BUFFER_BINDING)) { fptr_glConvolutionFilter2D(target,internalformat,width,height,format,type,(GLvoid *)NUM2INT(arg7)); } else { VALUE data; data = pack_array_or_pass_string(type,arg7); Check_Type(arg7,T_STRING); CheckDataSize(type,format,width*height,data); fptr_glConvolutionFilter2D(target,internalformat,width,height,format,type,RSTRING_PTR(data)); } CHECK_GLERROR return Qnil; } static void (APIENTRY * fptr_glConvolutionParameterfv)(GLenum,GLenum,const GLfloat *); static VALUE gl_ConvolutionParameterfv(obj,arg1,arg2,arg3) VALUE obj,arg1,arg2,arg3; { GLenum target; GLenum pname; GLfloat params[4] = {0.0,0.0,0.0,0.0}; LOAD_GL_FUNC(glConvolutionParameterfv,"1.2") target = (GLenum)NUM2INT(arg1); pname = (GLenum)NUM2INT(arg2); Check_Type(arg3,T_ARRAY); ary2cflt(arg3,params,4); fptr_glConvolutionParameterfv(target,pname,params); CHECK_GLERROR return Qnil; } static void (APIENTRY * fptr_glConvolutionParameteriv)(GLenum,GLenum,const GLint *); static VALUE gl_ConvolutionParameteriv(obj,arg1,arg2,arg3) VALUE obj,arg1,arg2,arg3; { GLenum target; GLenum pname; GLint params[4] = {0,0,0,0}; LOAD_GL_FUNC(glConvolutionParameteriv,"1.2") target = (GLenum)NUM2INT(arg1); pname = (GLenum)NUM2INT(arg2); Check_Type(arg3,T_ARRAY); ary2cint(arg3,params,4); fptr_glConvolutionParameteriv(target,pname,params); CHECK_GLERROR return Qnil; } static void (APIENTRY * fptr_glGetConvolutionParameterfv)(GLenum,GLenum,GLfloat *); static VALUE gl_GetConvolutionParameterfv(obj,arg1,arg2) VALUE obj,arg1,arg2; { GLenum target; GLenum pname; GLfloat params[4] = {0.0,0.0,0.0,0.0}; GLsizei size; LOAD_GL_FUNC(glGetConvolutionParameterfv,"1.2") target = (GLenum)NUM2INT(arg1); pname = (GLenum)NUM2INT(arg2); switch(pname) { case GL_CONVOLUTION_BORDER_COLOR: case GL_CONVOLUTION_FILTER_SCALE: case GL_CONVOLUTION_FILTER_BIAS: size = 4; break; default: size = 1; break; } fptr_glGetConvolutionParameterfv(target,pname,params); RET_ARRAY_OR_SINGLE(size,RETCONV_GLfloat,params) } static void (APIENTRY * fptr_glGetConvolutionParameteriv)(GLenum,GLenum,GLint *); static VALUE gl_GetConvolutionParameteriv(obj,arg1,arg2) VALUE obj,arg1,arg2; { GLenum target; GLenum pname; GLint params[4] = {0,0,0,0}; GLsizei size; LOAD_GL_FUNC(glGetConvolutionParameteriv,"1.2") target = (GLenum)NUM2INT(arg1); pname = (GLenum)NUM2INT(arg2); switch(pname) { case GL_CONVOLUTION_BORDER_COLOR: case GL_CONVOLUTION_FILTER_SCALE: case GL_CONVOLUTION_FILTER_BIAS: size = 4; break; default: size = 1; break; } fptr_glGetConvolutionParameteriv(target,pname,params); RET_ARRAY_OR_SINGLE(size,RETCONV_GLint,params) } static void (APIENTRY * fptr_glGetConvolutionFilter)(GLenum,GLenum,GLenum,GLvoid *); static VALUE gl_GetConvolutionFilter(argc,argv,obj) int argc; VALUE *argv; VALUE obj; { GLenum target; GLenum format; GLenum type; GLint size = 0; VALUE data; VALUE args[4]; int numargs; LOAD_GL_FUNC(glGetConvolutionFilter,"1.2") LOAD_GL_FUNC(glGetConvolutionParameteriv,"1.2") numargs = rb_scan_args(argc, argv, "31", &args[0], &args[1], &args[2], &args[3]); target = (GLenum)NUM2INT(args[0]); format = (GLenum)NUM2INT(args[1]); type = (GLenum)NUM2INT(args[2]); switch(numargs) { default: case 3: if (CheckBufferBinding(GL_PIXEL_PACK_BUFFER_BINDING)) rb_raise(rb_eArgError, "Pixel pack buffer bound, but offset argument missing"); if (target==GL_CONVOLUTION_1D) { fptr_glGetConvolutionParameteriv(target,GL_CONVOLUTION_WIDTH,&size); } else { GLint tmp = 0; fptr_glGetConvolutionParameteriv(target,GL_CONVOLUTION_WIDTH,&tmp); fptr_glGetConvolutionParameteriv(target,GL_CONVOLUTION_HEIGHT,&size); size *=tmp; } CHECK_GLERROR data = allocate_buffer_with_string(GetDataSize(type,format,size)); FORCE_PIXEL_STORE_MODE fptr_glGetConvolutionFilter(target,format,type,(GLvoid*)RSTRING_PTR(data)); RESTORE_PIXEL_STORE_MODE CHECK_GLERROR return data; case 4: if (!CheckBufferBinding(GL_PIXEL_PACK_BUFFER_BINDING)) rb_raise(rb_eArgError, "Pixel pack buffer not bound"); FORCE_PIXEL_STORE_MODE fptr_glGetConvolutionFilter(target,format,type,(GLvoid*)NUM2INT(args[3])); RESTORE_PIXEL_STORE_MODE CHECK_GLERROR return Qnil; } } static void (APIENTRY * fptr_glGetSeparableFilter)(GLenum,GLenum,GLenum,GLvoid*,GLvoid*,GLvoid*); static VALUE gl_GetSeparableFilter(argc,argv,obj) int argc; VALUE *argv; VALUE obj; { GLenum target; GLenum format; GLenum type; GLint size_row = 0; GLint size_column = 0; VALUE data_row; VALUE data_column; VALUE retary; VALUE args[6]; int numargs; LOAD_GL_FUNC(glGetSeparableFilter,"1.2") LOAD_GL_FUNC(glGetConvolutionParameteriv,"1.2") numargs = rb_scan_args(argc, argv, "33", &args[0], &args[1], &args[2], &args[3], &args[4], &args[5]); target = (GLenum)NUM2INT(args[0]); format = (GLenum)NUM2INT(args[1]); type = (GLenum)NUM2INT(args[2]); switch(numargs) { default: case 3: if (CheckBufferBinding(GL_PIXEL_PACK_BUFFER_BINDING)) rb_raise(rb_eArgError, "Pixel pack buffer bound, but offset arguments missing"); fptr_glGetConvolutionParameteriv(target,GL_CONVOLUTION_WIDTH,&size_row); fptr_glGetConvolutionParameteriv(target,GL_CONVOLUTION_HEIGHT,&size_column); CHECK_GLERROR data_row = allocate_buffer_with_string(GetDataSize(type,format,size_row)); data_column = allocate_buffer_with_string(GetDataSize(type,format,size_column)); FORCE_PIXEL_STORE_MODE fptr_glGetSeparableFilter(target,format,type,(GLvoid*)RSTRING_PTR(data_row),(GLvoid*)RSTRING_PTR(data_column),0); RESTORE_PIXEL_STORE_MODE retary = rb_ary_new2(2); rb_ary_push(retary, data_row); rb_ary_push(retary, data_column); CHECK_GLERROR return retary; break; case 6: if (!CheckBufferBinding(GL_PIXEL_PACK_BUFFER_BINDING)) rb_raise(rb_eArgError, "Pixel pack buffer not bound"); FORCE_PIXEL_STORE_MODE fptr_glGetSeparableFilter(target,format,type,(GLvoid*)NUM2INT(args[3]),(GLvoid*)NUM2INT(args[4]),(GLvoid*)NUM2INT(args[5])); RESTORE_PIXEL_STORE_MODE CHECK_GLERROR return Qnil; } } static void (APIENTRY * fptr_glSeparableFilter2D)(GLenum,GLenum,GLsizei,GLsizei,GLenum,GLenum,const GLvoid *,const GLvoid *); static VALUE gl_SeparableFilter2D(obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8) VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8; { GLenum target; GLenum internalformat; GLsizei width; GLsizei height; GLenum format; GLenum type; LOAD_GL_FUNC(glSeparableFilter2D,"1.2") target = (GLenum)NUM2INT(arg1); internalformat = (GLenum)NUM2INT(arg2); width = (GLsizei)NUM2UINT(arg3); height = (GLsizei)NUM2UINT(arg4); format = (GLenum)NUM2INT(arg5); type = (GLenum)NUM2INT(arg6); if (CheckBufferBinding(GL_PIXEL_UNPACK_BUFFER_BINDING)) { fptr_glSeparableFilter2D(target,internalformat,width,height,format,type,(GLvoid *)NUM2INT(arg7),(GLvoid *)NUM2INT(arg8)); } else { VALUE data_1,data_2; data_1 = pack_array_or_pass_string(type,arg7); data_2 = pack_array_or_pass_string(type,arg8); CheckDataSize(type,format,width,data_1); CheckDataSize(type,format,height,data_2); fptr_glSeparableFilter2D(target,internalformat,width,height,format,type,RSTRING_PTR(data_1),RSTRING_PTR(data_2)); } CHECK_GLERROR return Qnil; } static void (APIENTRY * fptr_glGetHistogramParameterfv)(GLenum,GLenum,GLfloat *); static VALUE gl_GetHistogramParameterfv(obj,arg1,arg2,arg3) VALUE obj,arg1,arg2,arg3; { GLenum target; GLenum pname; GLfloat params = 0.0; LOAD_GL_FUNC(glGetHistogramParameterfv,"1.2") target = (GLenum)NUM2INT(arg1); pname = (GLenum)NUM2INT(arg2); fptr_glGetHistogramParameterfv(target,pname,¶ms); CHECK_GLERROR return RETCONV_GLfloat(params); } static void (APIENTRY * fptr_glGetHistogramParameteriv)(GLenum,GLenum,GLint *); static VALUE gl_GetHistogramParameteriv(obj,arg1,arg2,arg3) VALUE obj,arg1,arg2,arg3; { GLenum target; GLenum pname; GLint params = 0; LOAD_GL_FUNC(glGetHistogramParameteriv,"1.2") target = (GLenum)NUM2INT(arg1); pname = (GLenum)NUM2INT(arg2); fptr_glGetHistogramParameteriv(target,pname,¶ms); CHECK_GLERROR return cond_GLBOOL2RUBY(pname,params); } static void (APIENTRY * fptr_glGetHistogram)(GLenum,GLboolean,GLenum,GLenum,GLvoid*); static VALUE gl_GetHistogram(argc,argv,obj) int argc; VALUE *argv; VALUE obj; { GLenum target; GLboolean reset; GLenum format; GLenum type; GLint size = 0; VALUE data; VALUE args[5]; int numargs; LOAD_GL_FUNC(glGetHistogram,"1.2") LOAD_GL_FUNC(glGetHistogramParameteriv,"1.2") numargs = rb_scan_args(argc, argv, "41", &args[0], &args[1], &args[2], &args[3], &args[4]); target = (GLenum)NUM2INT(args[0]); reset = (GLboolean)NUM2INT(args[1]); format = (GLenum)NUM2INT(args[2]); type = (GLenum)NUM2INT(args[3]); switch(numargs) { default: case 4: if (CheckBufferBinding(GL_PIXEL_PACK_BUFFER_BINDING)) rb_raise(rb_eArgError, "Pixel pack buffer bound, but offset argument missing"); fptr_glGetHistogramParameteriv(target,GL_HISTOGRAM_WIDTH,&size); CHECK_GLERROR data = allocate_buffer_with_string(GetDataSize(type,format,size)); FORCE_PIXEL_STORE_MODE fptr_glGetHistogram(target,reset,format,type,(GLvoid*)RSTRING_PTR(data)); RESTORE_PIXEL_STORE_MODE CHECK_GLERROR return data; break; case 5: if (!CheckBufferBinding(GL_PIXEL_PACK_BUFFER_BINDING)) rb_raise(rb_eArgError, "Pixel pack buffer not bound"); FORCE_PIXEL_STORE_MODE fptr_glGetHistogram(target,reset,format,type,(GLvoid*)NUM2INT(args[4])); RESTORE_PIXEL_STORE_MODE CHECK_GLERROR return Qnil; } } static void (APIENTRY * fptr_glGetMinmax)(GLenum,GLboolean,GLenum,GLenum,GLvoid *); static VALUE gl_GetMinmax(argc,argv,obj) int argc; VALUE *argv; VALUE obj; { GLenum target; GLboolean reset; GLenum format; GLenum type; VALUE data; VALUE args[5]; int numargs; LOAD_GL_FUNC(glGetMinmax,"1.2") numargs = rb_scan_args(argc, argv, "41", &args[0], &args[1], &args[2], &args[3], &args[4]); target = (GLenum)NUM2INT(args[0]); reset = (GLboolean)NUM2INT(args[1]); format = (GLenum)NUM2INT(args[2]); type = (GLenum)NUM2INT(args[3]); switch(numargs) { default: case 4: if (CheckBufferBinding(GL_PIXEL_PACK_BUFFER_BINDING)) rb_raise(rb_eArgError, "Pixel pack buffer bound, but offset argument missing"); data = allocate_buffer_with_string(GetDataSize(type,format,2)); FORCE_PIXEL_STORE_MODE fptr_glGetMinmax(target,reset,format,type,(GLvoid*)RSTRING_PTR(data)); RESTORE_PIXEL_STORE_MODE CHECK_GLERROR return data; break; case 5: if (!CheckBufferBinding(GL_PIXEL_PACK_BUFFER_BINDING)) rb_raise(rb_eArgError, "Pixel pack buffer not bound"); FORCE_PIXEL_STORE_MODE fptr_glGetMinmax(target,reset,format,type,(GLvoid*)NUM2INT(args[4])); RESTORE_PIXEL_STORE_MODE CHECK_GLERROR return Qnil; } } static void (APIENTRY * fptr_glGetMinmaxParameterfv)(GLenum,GLenum,GLfloat *); static VALUE gl_GetMinmaxParameterfv(obj,arg1,arg2) VALUE obj,arg1,arg2; { GLenum target; GLenum pname; GLfloat params = 0.0; LOAD_GL_FUNC(glGetMinmaxParameterfv,"1.2") target = (GLenum)NUM2INT(arg1); pname = (GLenum)NUM2INT(arg2); fptr_glGetMinmaxParameterfv(target,pname,¶ms); CHECK_GLERROR return RETCONV_GLfloat(params); } static void (APIENTRY * fptr_glGetMinmaxParameteriv)(GLenum,GLenum,GLint *); static VALUE gl_GetMinmaxParameteriv(obj,arg1,arg2) VALUE obj,arg1,arg2; { GLenum target; GLenum pname; GLint params = 0; LOAD_GL_FUNC(glGetMinmaxParameteriv,"1.2") target = (GLenum)NUM2INT(arg1); pname = (GLenum)NUM2INT(arg2); fptr_glGetMinmaxParameteriv(target,pname,¶ms); CHECK_GLERROR return cond_GLBOOL2RUBY(pname,params); } static void (APIENTRY * fptr_glTexImage3D)(GLenum,GLint,GLint,GLsizei,GLsizei,GLsizei,GLint,GLenum,GLenum,const GLvoid*); static VALUE gl_TexImage3D(obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10) VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10; { GLenum target; GLint level; GLint internalFormat; GLsizei width; GLsizei height; GLsizei depth; GLint border; GLenum format; GLenum type; const char *pixels; LOAD_GL_FUNC(glTexImage3D,"1.2") target = (GLenum)NUM2INT(arg1); level = (GLint)NUM2INT(arg2); internalFormat = (GLint)NUM2INT(arg3); width = (GLsizei)NUM2UINT(arg4); height = (GLsizei)NUM2UINT(arg5); depth = (GLsizei)NUM2UINT(arg6); border = (GLint)NUM2INT(arg7); format = (GLenum)NUM2INT(arg8); type = (GLenum)NUM2INT(arg9); if (CheckBufferBinding(GL_PIXEL_UNPACK_BUFFER_BINDING)) { fptr_glTexImage3D( target, level, internalFormat, width, height, depth, border, format, type,(GLvoid *)NUM2INT(arg10)); CHECK_GLERROR return Qnil; } if (target == GL_PROXY_TEXTURE_3D || target == GL_PROXY_TEXTURE_1D_STACK_MESAX || target == GL_PROXY_TEXTURE_2D_STACK_MESAX || target == GL_PROXY_TEXTURE_2D_ARRAY_EXT || NIL_P(arg10)) { /* proxy texture, no data read */ pixels = NULL; } else { VALUE data; data = pack_array_or_pass_string(type,arg10); CheckDataSize(type,format,width*height*depth,data); pixels = RSTRING_PTR(data); } fptr_glTexImage3D( target, level, internalFormat, width, height, depth, border, format, type,pixels); CHECK_GLERROR return Qnil; } static void (APIENTRY * fptr_glTexSubImage3D)(GLenum,GLint,GLint,GLint,GLint,GLsizei,GLsizei,GLsizei,GLenum,GLenum,const GLvoid*); static VALUE gl_TexSubImage3D(obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11) VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11; { GLenum target; GLint level; GLint xoffset; GLint yoffset; GLint zoffset; GLsizei width; GLsizei height; GLsizei depth; GLenum format; GLenum type; LOAD_GL_FUNC(glTexSubImage3D,"1.2") target = (GLenum)NUM2INT(arg1); level = (GLint)NUM2INT(arg2); xoffset = (GLint)NUM2INT(arg3); yoffset = (GLint)NUM2INT(arg4); zoffset = (GLint)NUM2INT(arg5); width = (GLsizei)NUM2UINT(arg6); height = (GLsizei)NUM2UINT(arg7); depth = (GLsizei)NUM2UINT(arg8); format = (GLenum)NUM2INT(arg9); type = (GLenum)NUM2INT(arg10); if (CheckBufferBinding(GL_PIXEL_UNPACK_BUFFER_BINDING)) { fptr_glTexSubImage3D( target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, (GLvoid *)NUM2INT(arg11)); } else { VALUE data; data = pack_array_or_pass_string(type,arg11); CheckDataSize(type,format,height*width*depth,data); fptr_glTexSubImage3D( target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, RSTRING_PTR(data)); } CHECK_GLERROR return Qnil; } void gl_init_functions_1_2(VALUE module) { rb_define_module_function(module, "glBlendColor", gl_BlendColor, 4); rb_define_module_function(module, "glBlendEquation", gl_BlendEquation, 1); rb_define_module_function(module, "glDrawRangeElements", gl_DrawRangeElements, 6); rb_define_module_function(module, "glColorTable", gl_ColorTable, 6); rb_define_module_function(module, "glColorTableParameterfv", gl_ColorTableParameterfv, 3); rb_define_module_function(module, "glColorTableParameteriv", gl_ColorTableParameteriv, 3); rb_define_module_function(module, "glCopyColorTable", gl_CopyColorTable, 5); rb_define_module_function(module, "glGetColorTable", gl_GetColorTable, 3); rb_define_module_function(module, "glGetColorTableParameterfv", gl_GetColorTableParameterfv, 2); rb_define_module_function(module, "glGetColorTableParameteriv", gl_GetColorTableParameteriv, 2); rb_define_module_function(module, "glColorSubTable", gl_ColorSubTable, 6); rb_define_module_function(module, "glCopyColorSubTable", gl_CopyColorSubTable, 5); rb_define_module_function(module, "glConvolutionFilter1D", gl_ConvolutionFilter1D, 6); rb_define_module_function(module, "glConvolutionFilter2D", gl_ConvolutionFilter2D, 7); rb_define_module_function(module, "glConvolutionParameterf", gl_ConvolutionParameterf, 3); rb_define_module_function(module, "glConvolutionParameterfv", gl_ConvolutionParameterfv, 3); rb_define_module_function(module, "glConvolutionParameteri", gl_ConvolutionParameteri, 3); rb_define_module_function(module, "glConvolutionParameteriv", gl_ConvolutionParameteriv, 3); rb_define_module_function(module, "glCopyConvolutionFilter1D", gl_CopyConvolutionFilter1D, 5); rb_define_module_function(module, "glCopyConvolutionFilter2D", gl_CopyConvolutionFilter2D, 6); rb_define_module_function(module, "glGetConvolutionFilter", gl_GetConvolutionFilter, -1); rb_define_module_function(module, "glGetConvolutionParameterfv", gl_GetConvolutionParameterfv, 2); rb_define_module_function(module, "glGetConvolutionParameteriv", gl_GetConvolutionParameteriv, 2); rb_define_module_function(module, "glGetSeparableFilter", gl_GetSeparableFilter, -1); rb_define_module_function(module, "glSeparableFilter2D", gl_SeparableFilter2D, 8); rb_define_module_function(module, "glGetHistogram", gl_GetHistogram, -1); rb_define_module_function(module, "glGetHistogramParameterfv", gl_GetHistogramParameterfv, 2); rb_define_module_function(module, "glGetHistogramParameteriv", gl_GetHistogramParameteriv, 2); rb_define_module_function(module, "glGetMinmax", gl_GetMinmax, -1); rb_define_module_function(module, "glGetMinmaxParameterfv", gl_GetMinmaxParameterfv, 2); rb_define_module_function(module, "glGetMinmaxParameteriv", gl_GetMinmaxParameteriv, 2); rb_define_module_function(module, "glHistogram", gl_Histogram, 4); rb_define_module_function(module, "glMinmax", gl_Minmax, 3); rb_define_module_function(module, "glResetHistogram", gl_ResetHistogram, 1); rb_define_module_function(module, "glResetMinmax", gl_ResetMinmax, 1); rb_define_module_function(module, "glTexImage3D", gl_TexImage3D, 10); rb_define_module_function(module, "glTexSubImage3D", gl_TexSubImage3D, 11); rb_define_module_function(module, "glCopyTexSubImage3D", gl_CopyTexSubImage3D, 9); } ruby-opengl-0.60.1.orig/ext/gl/gl-error.c0000644000000000000000000000605211377006423016603 0ustar rootroot/* * Copyright (C) 2007 Jan Dvorak * * This program is distributed under the terms of the MIT license. * See the included MIT-LICENSE file for the terms of this license. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "../common/common.h" VALUE error_checking = Qtrue; VALUE Class_GLError; #define BUFSIZE 256 void check_for_glerror(void) { GLenum error; error = glGetError(); if (error==GL_NO_ERROR) { /* no errors == instant return */ return; } else { /* process errors */ const char *error_string; int queued_errors = 0; char message[BUFSIZE]; VALUE exc; /* check for queued errors */ for(queued_errors = 0; glGetError()!=GL_NO_ERROR; queued_errors++) ; switch(error) { case GL_INVALID_ENUM: error_string = "invalid enumerant"; break; case GL_INVALID_VALUE: error_string = "invalid value"; break; case GL_INVALID_OPERATION: error_string = "invalid operation"; break; case GL_STACK_OVERFLOW: error_string = "stack overflow"; break; case GL_STACK_UNDERFLOW: error_string = "stack underflow"; break; case GL_OUT_OF_MEMORY: error_string = "out of memory"; break; case GL_TABLE_TOO_LARGE: error_string = "table too large"; break; case GL_INVALID_FRAMEBUFFER_OPERATION_EXT: error_string = "invalid framebuffer operation"; break; default: error_string = "unknown error"; break; } if (queued_errors==0) { snprintf(message,BUFSIZE,"%s",error_string); } else { snprintf(message,BUFSIZE,"%s [%i queued error(s) cleaned]",error_string,queued_errors); } exc = rb_funcall(Class_GLError, rb_intern("new"), 2, rb_str_new2(message), INT2NUM(error)); rb_funcall(rb_cObject, rb_intern("raise"), 1, exc); } } VALUE GLError_initialize(VALUE obj,VALUE message, VALUE error_id) { rb_call_super(1, &message); rb_iv_set(obj, "@id", error_id); return obj; } static VALUE enable_error_checking(VALUE obj) { error_checking = Qtrue; return Qnil; } static VALUE disable_error_checking(VALUE obj) { error_checking = Qfalse; return Qnil; } static VALUE is_error_checking_enabled(VALUE obj) { return error_checking; } void gl_init_error(VALUE module) { Class_GLError = rb_define_class_under(module, "Error", rb_eStandardError); rb_define_method(Class_GLError, "initialize", GLError_initialize, 2); rb_define_attr(Class_GLError, "id", 1, 0); rb_define_module_function(module, "enable_error_checking", enable_error_checking, 0); rb_define_module_function(module, "disable_error_checking", disable_error_checking, 0); rb_define_module_function(module, "is_error_checking_enabled?", is_error_checking_enabled, 0); rb_global_variable(&error_checking); } ruby-opengl-0.60.1.orig/ext/gl/gl-1.3.c0000644000000000000000000004136611377006423015762 0ustar rootroot/* * Copyright (C) 2007 Jan Dvorak * * This program is distributed under the terms of the MIT license. * See the included MIT-LICENSE file for the terms of this license. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "../common/common.h" /* OpenGL 1.3 functions */ GL_FUNC_LOAD_1(ActiveTexture,GLvoid, GLenum, "1.3") GL_FUNC_LOAD_1(ClientActiveTexture,GLvoid, GLenum, "1.3") GL_FUNC_LOAD_2(MultiTexCoord1d,GLvoid, GLenum,GLdouble, "1.3") GL_FUNC_LOAD_2(MultiTexCoord1f,GLvoid, GLenum,GLfloat, "1.3") GL_FUNC_LOAD_2(MultiTexCoord1i,GLvoid, GLenum,GLint, "1.3") GL_FUNC_LOAD_2(MultiTexCoord1s,GLvoid, GLenum,GLshort, "1.3") GL_FUNC_LOAD_3(MultiTexCoord2d,GLvoid, GLenum,GLdouble,GLdouble, "1.3") GL_FUNC_LOAD_3(MultiTexCoord2f,GLvoid, GLenum,GLfloat,GLfloat, "1.3") GL_FUNC_LOAD_3(MultiTexCoord2i,GLvoid, GLenum,GLint,GLint, "1.3") GL_FUNC_LOAD_3(MultiTexCoord2s,GLvoid, GLenum,GLshort,GLshort, "1.3") GL_FUNC_LOAD_4(MultiTexCoord3d,GLvoid, GLenum,GLdouble,GLdouble,GLdouble, "1.3") GL_FUNC_LOAD_4(MultiTexCoord3f,GLvoid, GLenum,GLfloat,GLfloat,GLfloat, "1.3") GL_FUNC_LOAD_4(MultiTexCoord3i,GLvoid, GLenum,GLint,GLint,GLint, "1.3") GL_FUNC_LOAD_4(MultiTexCoord3s,GLvoid, GLenum,GLshort,GLshort,GLshort, "1.3") GL_FUNC_LOAD_5(MultiTexCoord4d,GLvoid, GLenum,GLdouble,GLdouble,GLdouble,GLdouble, "1.3") GL_FUNC_LOAD_5(MultiTexCoord4f,GLvoid, GLenum,GLfloat,GLfloat,GLfloat,GLfloat, "1.3") GL_FUNC_LOAD_5(MultiTexCoord4i,GLvoid, GLenum,GLint,GLint,GLint,GLint, "1.3") GL_FUNC_LOAD_5(MultiTexCoord4s,GLvoid, GLenum,GLshort,GLshort,GLshort,GLshort, "1.3") GL_FUNC_LOAD_2(SampleCoverage,GLvoid, GLclampf,GLboolean, "1.3") #define GLMULTITEXCOORD_VFUNC(_type_) \ static VALUE \ gl_MultiTexCoord##_type_##v(argc,argv,obj) \ int argc; \ VALUE *argv; \ VALUE obj; \ { \ int num; \ VALUE args[5]; \ RArray *ary; \ switch (num = rb_scan_args(argc, argv, "23", &args[0], &args[1], &args[2], &args[3],&args[4])) { \ case 2: \ if (TYPE(args[1]) == T_ARRAY) { \ ary = RARRAY(args[1]); \ switch (RARRAY_LEN(ary)) { \ case 1: \ gl_MultiTexCoord1##_type_(obj,args[0],RARRAY_PTR(ary)[0]); \ break; \ case 2: \ gl_MultiTexCoord2##_type_(obj,args[0],RARRAY_PTR(ary)[0],RARRAY_PTR(ary)[1]); \ break; \ case 3: \ gl_MultiTexCoord3##_type_(obj,args[0],RARRAY_PTR(ary)[0],RARRAY_PTR(ary)[1],RARRAY_PTR(ary)[2]); \ break; \ case 4: \ gl_MultiTexCoord4##_type_(obj,args[0],RARRAY_PTR(ary)[0],RARRAY_PTR(ary)[1],RARRAY_PTR(ary)[2],RARRAY_PTR(ary)[3]); \ break; \ default: \ rb_raise(rb_eArgError, "array length:%d", num); \ } \ } \ else { \ gl_MultiTexCoord1##_type_(obj,args[0], args[1]); \ break; \ } \ break; \ case 3: \ gl_MultiTexCoord2##_type_(obj,args[0], args[1], args[2]); \ break; \ case 4: \ gl_MultiTexCoord3##_type_(obj,args[0], args[1], args[2], args[3]); \ break; \ case 5: \ gl_MultiTexCoord4##_type_(obj,args[0], args[1], args[2], args[3], args[4]); \ break; \ default: \ rb_raise(rb_eArgError, "too many arguments"); \ break; \ } \ return Qnil; \ } GLMULTITEXCOORD_VFUNC(d) GLMULTITEXCOORD_VFUNC(f) GLMULTITEXCOORD_VFUNC(i) GLMULTITEXCOORD_VFUNC(s) #undef GLTEXCOORD_VFUNC #define TRANSPOSEMATRIX_FUNC(_name_,_type_) \ static void (APIENTRY * fptr_gl##_name_)(const _type_[]); \ static VALUE \ gl_##_name_(obj,arg1) \ VALUE obj,arg1; \ { \ _type_ m[4*4]; \ LOAD_GL_FUNC(gl##_name_,"1.3") \ ary2cmat##_type_(arg1, m, 4, 4); \ fptr_gl##_name_(m); \ CHECK_GLERROR \ return Qnil; \ } TRANSPOSEMATRIX_FUNC(LoadTransposeMatrixf,float) TRANSPOSEMATRIX_FUNC(LoadTransposeMatrixd,double) TRANSPOSEMATRIX_FUNC(MultTransposeMatrixf,float) TRANSPOSEMATRIX_FUNC(MultTransposeMatrixd,double) #undef TRANSPOSEMATRIX_FUNC static void (APIENTRY * fptr_glCompressedTexImage3D)(GLenum,GLint,GLenum,GLsizei,GLsizei,GLsizei,GLint,GLsizei,GLvoid*); static VALUE gl_CompressedTexImage3D(obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9) VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9; { GLenum target; GLint level; GLenum internalformat; GLsizei width; GLsizei height; GLsizei depth; GLint border; GLsizei imagesize; GLvoid *pixels; LOAD_GL_FUNC(glCompressedTexImage3D,"1.3") target = (GLenum)NUM2INT(arg1); level = (GLint)NUM2INT(arg2); internalformat = (GLenum)NUM2INT(arg3); width = (GLsizei)NUM2UINT(arg4); height = (GLsizei)NUM2UINT(arg5); depth = (GLsizei)NUM2UINT(arg6); border = (GLint)NUM2INT(arg7); imagesize = (GLsizei)NUM2UINT(arg8); if (CheckBufferBinding(GL_PIXEL_UNPACK_BUFFER_BINDING)) { fptr_glCompressedTexImage3D(target,level,internalformat,width,height,depth,border,imagesize,(GLvoid *)NUM2INT(arg9)); } else { if (TYPE(arg9) == T_STRING || TYPE(arg9) == T_ARRAY) { VALUE data; data = pack_array_or_pass_string(GL_UNSIGNED_BYTE,arg9); if (RSTRING_LEN(data) < imagesize) rb_raise(rb_eArgError, "string length:%li",RSTRING_LEN(data)); pixels = RSTRING_PTR(data); } else if (NIL_P(arg9)) { pixels = NULL; } else { Check_Type(arg9,T_STRING); /* force exception */ return Qnil; } fptr_glCompressedTexImage3D(target,level,internalformat,width,height,depth,border,imagesize,pixels); } CHECK_GLERROR return Qnil; } static void (APIENTRY * fptr_glCompressedTexImage2D)(GLenum,GLint,GLenum,GLsizei,GLsizei,GLint,GLsizei,GLvoid*); static VALUE gl_CompressedTexImage2D(obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8) VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8; { GLenum target; GLint level; GLenum internalformat; GLsizei width; GLsizei height; GLint border; GLsizei imagesize; GLvoid *pixels; LOAD_GL_FUNC(glCompressedTexImage2D,"1.3") target = (GLenum)NUM2INT(arg1); level = (GLint)NUM2INT(arg2); internalformat = (GLenum)NUM2INT(arg3); width = (GLsizei)NUM2UINT(arg4); height = (GLsizei)NUM2UINT(arg5); border = (GLint)NUM2INT(arg6); imagesize = (GLsizei)NUM2UINT(arg7); if (CheckBufferBinding(GL_PIXEL_UNPACK_BUFFER_BINDING)) { fptr_glCompressedTexImage2D(target,level,internalformat,width,height,border,imagesize,(GLvoid *)NUM2INT(arg8)); } else { if (TYPE(arg8) == T_STRING || TYPE(arg8) == T_ARRAY) { VALUE data; data = pack_array_or_pass_string(GL_UNSIGNED_BYTE,arg8); if (RSTRING_LEN(data) < imagesize) rb_raise(rb_eArgError, "string length:%li",RSTRING_LEN(data)); pixels = RSTRING_PTR(data); } else if (NIL_P(arg8)) { pixels = NULL; } else { Check_Type(arg8,T_STRING); /* force exception */ return Qnil; } fptr_glCompressedTexImage2D(target,level,internalformat,width,height,border,imagesize,pixels); } CHECK_GLERROR return Qnil; } static void (APIENTRY * fptr_glCompressedTexImage1D)(GLenum,GLint,GLenum,GLsizei,GLint,GLsizei,GLvoid*); static VALUE gl_CompressedTexImage1D(obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7) VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7; { GLenum target; GLint level; GLenum internalformat; GLsizei width; GLint border; GLsizei imagesize; GLvoid *pixels; LOAD_GL_FUNC(glCompressedTexImage1D,"1.3") target = (GLenum)NUM2INT(arg1); level = (GLint)NUM2INT(arg2); internalformat = (GLenum)NUM2INT(arg3); width = (GLsizei)NUM2UINT(arg4); border = (GLint)NUM2INT(arg5); imagesize = (GLsizei)NUM2UINT(arg6); if (CheckBufferBinding(GL_PIXEL_UNPACK_BUFFER_BINDING)) { fptr_glCompressedTexImage1D(target,level,internalformat,width,border,imagesize,(GLvoid *)NUM2INT(arg7)); } else { if (TYPE(arg7) == T_STRING || TYPE(arg7) == T_ARRAY) { VALUE data; data = pack_array_or_pass_string(GL_UNSIGNED_BYTE,arg7); if (RSTRING_LEN(data) < imagesize) rb_raise(rb_eArgError, "string length:%li",RSTRING_LEN(data)); pixels = RSTRING_PTR(data); } else if (NIL_P(arg7)) { pixels = NULL; } else { Check_Type(arg7,T_STRING); /* force exception */ return Qnil; } fptr_glCompressedTexImage1D(target,level,internalformat,width,border,imagesize,pixels); } CHECK_GLERROR return Qnil; } static void (APIENTRY * fptr_glCompressedTexSubImage3D)(GLenum,GLint,GLint,GLint,GLint,GLsizei,GLsizei,GLsizei,GLenum,GLsizei,GLvoid*); static VALUE gl_CompressedTexSubImage3D(obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11) VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11; { GLenum target; GLint level; GLint xoffset; GLint yoffset; GLint zoffset; GLsizei width; GLsizei height; GLsizei depth; GLenum format; GLsizei imagesize; GLvoid *pixels; LOAD_GL_FUNC(glCompressedTexSubImage3D,"1.3") target = (GLenum)NUM2INT(arg1); level = (GLint)NUM2INT(arg2); xoffset = (GLint)NUM2INT(arg3); yoffset = (GLint)NUM2INT(arg4); zoffset = (GLint)NUM2INT(arg5); width = (GLsizei)NUM2UINT(arg6); height = (GLsizei)NUM2UINT(arg7); depth = (GLsizei)NUM2UINT(arg8); format = (GLenum)NUM2INT(arg9); imagesize = (GLsizei)NUM2UINT(arg10); if (CheckBufferBinding(GL_PIXEL_UNPACK_BUFFER_BINDING)) { fptr_glCompressedTexSubImage3D(target,level,xoffset,yoffset,zoffset,width,height,depth,format,imagesize,(GLvoid *)NUM2INT(arg11)); } else { VALUE data; data = pack_array_or_pass_string(GL_UNSIGNED_BYTE,arg11); if (RSTRING_LEN(data) < imagesize) rb_raise(rb_eArgError, "string length:%li",RSTRING_LEN(data)); pixels = RSTRING_PTR(data); fptr_glCompressedTexSubImage3D(target,level,xoffset,yoffset,zoffset,width,height,depth,format,imagesize,pixels); } CHECK_GLERROR return Qnil; } static void (APIENTRY * fptr_glCompressedTexSubImage2D)(GLenum,GLint,GLint,GLint,GLsizei,GLsizei,GLenum,GLsizei,GLvoid*); static VALUE gl_CompressedTexSubImage2D(obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9) VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9; { GLenum target; GLint level; GLint xoffset; GLint yoffset; GLsizei width; GLsizei height; GLenum format; GLsizei imagesize; GLvoid *pixels; LOAD_GL_FUNC(glCompressedTexSubImage2D,"1.3") target = (GLenum)NUM2INT(arg1); level = (GLint)NUM2INT(arg2); xoffset = (GLint)NUM2INT(arg3); yoffset = (GLint)NUM2INT(arg4); width = (GLsizei)NUM2UINT(arg5); height = (GLsizei)NUM2UINT(arg6); format = (GLenum)NUM2INT(arg7); imagesize = (GLsizei)NUM2UINT(arg8); if (CheckBufferBinding(GL_PIXEL_UNPACK_BUFFER_BINDING)) { fptr_glCompressedTexSubImage2D(target,level,xoffset,yoffset,width,height,format,imagesize,(GLvoid *)NUM2INT(arg9)); } else { VALUE data; data = pack_array_or_pass_string(GL_UNSIGNED_BYTE,arg9); if (RSTRING_LEN(data) < imagesize) rb_raise(rb_eArgError, "string length:%li",RSTRING_LEN(data)); pixels = RSTRING_PTR(data); fptr_glCompressedTexSubImage2D(target,level,xoffset,yoffset,width,height,format,imagesize,pixels); } CHECK_GLERROR return Qnil; } static void (APIENTRY * fptr_glCompressedTexSubImage1D)(GLenum,GLint,GLint,GLsizei,GLenum,GLsizei,GLvoid*); static VALUE gl_CompressedTexSubImage1D(obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7) VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7; { GLenum target; GLint level; GLint xoffset; GLsizei width; GLenum format; GLsizei imagesize; GLvoid *pixels; LOAD_GL_FUNC(glCompressedTexSubImage1D,"1.3") target = (GLenum)NUM2INT(arg1); level = (GLint)NUM2INT(arg2); xoffset = (GLint)NUM2INT(arg3); width = (GLsizei)NUM2UINT(arg4); format = (GLenum)NUM2INT(arg5); imagesize = (GLsizei)NUM2UINT(arg6); if (CheckBufferBinding(GL_PIXEL_UNPACK_BUFFER_BINDING)) { fptr_glCompressedTexSubImage1D(target,level,xoffset,width,format,imagesize,(GLvoid *)NUM2INT(arg7)); } else { VALUE data; data = pack_array_or_pass_string(GL_UNSIGNED_BYTE,arg7); if (RSTRING_LEN(data) < imagesize) rb_raise(rb_eArgError, "string length:%li",RSTRING_LEN(data)); pixels = RSTRING_PTR(data); fptr_glCompressedTexSubImage1D(target,level,xoffset,width,format,imagesize,pixels); } CHECK_GLERROR return Qnil; } static void (APIENTRY * fptr_glGetCompressedTexImage)(GLenum,GLint,GLvoid*); static VALUE gl_GetCompressedTexImage(argc,argv,obj) int argc; VALUE *argv; VALUE obj; { GLenum target; GLint lod; GLsizei size = 0; VALUE data; VALUE args[3]; int numargs; LOAD_GL_FUNC(glGetCompressedTexImage,"1.3") numargs = rb_scan_args(argc, argv, "21", &args[0], &args[1], &args[2]); target = (GLenum)NUM2INT(args[0]); lod = (GLenum)NUM2INT(args[1]); switch(numargs) { default: case 2: if (CheckBufferBinding(GL_PIXEL_PACK_BUFFER_BINDING)) rb_raise(rb_eArgError, "Pixel pack buffer bound, but offset argument missing"); glGetTexLevelParameteriv(target,lod,GL_TEXTURE_COMPRESSED_IMAGE_SIZE,&size); /* 1.0 function */ CHECK_GLERROR data = allocate_buffer_with_string(size); fptr_glGetCompressedTexImage(target,lod,(GLvoid*)RSTRING_PTR(data)); CHECK_GLERROR return data; case 3: fptr_glGetCompressedTexImage(target,lod,(GLvoid*)NUM2INT(args[2])); CHECK_GLERROR return Qnil; } } void gl_init_functions_1_3(VALUE module) { rb_define_module_function(module, "glActiveTexture", gl_ActiveTexture, 1); rb_define_module_function(module, "glClientActiveTexture", gl_ClientActiveTexture, 1); rb_define_module_function(module, "glMultiTexCoord1d", gl_MultiTexCoord1d, 2); rb_define_module_function(module, "glMultiTexCoord1f", gl_MultiTexCoord1f, 2); rb_define_module_function(module, "glMultiTexCoord1i", gl_MultiTexCoord1i, 2); rb_define_module_function(module, "glMultiTexCoord1s", gl_MultiTexCoord1s, 2); rb_define_module_function(module, "glMultiTexCoord2d", gl_MultiTexCoord2d, 3); rb_define_module_function(module, "glMultiTexCoord2f", gl_MultiTexCoord2f, 3); rb_define_module_function(module, "glMultiTexCoord2i", gl_MultiTexCoord2i, 3); rb_define_module_function(module, "glMultiTexCoord2s", gl_MultiTexCoord2s, 3); rb_define_module_function(module, "glMultiTexCoord3d", gl_MultiTexCoord3d, 4); rb_define_module_function(module, "glMultiTexCoord3f", gl_MultiTexCoord3f, 4); rb_define_module_function(module, "glMultiTexCoord3i", gl_MultiTexCoord3i, 4); rb_define_module_function(module, "glMultiTexCoord3s", gl_MultiTexCoord3s, 4); rb_define_module_function(module, "glMultiTexCoord4d", gl_MultiTexCoord4d, 5); rb_define_module_function(module, "glMultiTexCoord4f", gl_MultiTexCoord4f, 5); rb_define_module_function(module, "glMultiTexCoord4i", gl_MultiTexCoord4i, 5); rb_define_module_function(module, "glMultiTexCoord4s", gl_MultiTexCoord4s, 5); rb_define_module_function(module, "glLoadTransposeMatrixf", gl_LoadTransposeMatrixf, 1); rb_define_module_function(module, "glLoadTransposeMatrixd", gl_LoadTransposeMatrixd, 1); rb_define_module_function(module, "glMultTransposeMatrixf", gl_MultTransposeMatrixf, 1); rb_define_module_function(module, "glMultTransposeMatrixd", gl_MultTransposeMatrixd, 1); rb_define_module_function(module, "glSampleCoverage", gl_SampleCoverage, 2); rb_define_module_function(module, "glCompressedTexImage3D", gl_CompressedTexImage3D, 9); rb_define_module_function(module, "glCompressedTexImage2D", gl_CompressedTexImage2D, 8); rb_define_module_function(module, "glCompressedTexImage1D", gl_CompressedTexImage1D, 7); rb_define_module_function(module, "glCompressedTexSubImage3D", gl_CompressedTexSubImage3D, 11); rb_define_module_function(module, "glCompressedTexSubImage2D", gl_CompressedTexSubImage2D, 9); rb_define_module_function(module, "glCompressedTexSubImage1D", gl_CompressedTexSubImage1D, 7); rb_define_module_function(module, "glGetCompressedTexImage", gl_GetCompressedTexImage, -1); /* Additional functions */ rb_define_module_function(module, "glMultiTexCoord", gl_MultiTexCoorddv, -1); rb_define_module_function(module, "glMultiTexCoord1dv", gl_MultiTexCoorddv, -1); rb_define_module_function(module, "glMultiTexCoord1fv", gl_MultiTexCoordfv, -1); rb_define_module_function(module, "glMultiTexCoord1iv", gl_MultiTexCoordiv, -1); rb_define_module_function(module, "glMultiTexCoord1sv", gl_MultiTexCoordsv, -1); rb_define_module_function(module, "glMultiTexCoord2dv", gl_MultiTexCoorddv, -1); rb_define_module_function(module, "glMultiTexCoord2fv", gl_MultiTexCoordfv, -1); rb_define_module_function(module, "glMultiTexCoord2iv", gl_MultiTexCoordiv, -1); rb_define_module_function(module, "glMultiTexCoord2sv", gl_MultiTexCoordsv, -1); rb_define_module_function(module, "glMultiTexCoord3dv", gl_MultiTexCoorddv, -1); rb_define_module_function(module, "glMultiTexCoord3fv", gl_MultiTexCoordfv, -1); rb_define_module_function(module, "glMultiTexCoord3iv", gl_MultiTexCoordiv, -1); rb_define_module_function(module, "glMultiTexCoord3sv", gl_MultiTexCoordsv, -1); rb_define_module_function(module, "glMultiTexCoord4dv", gl_MultiTexCoorddv, -1); rb_define_module_function(module, "glMultiTexCoord4fv", gl_MultiTexCoordfv, -1); rb_define_module_function(module, "glMultiTexCoord4iv", gl_MultiTexCoordiv, -1); rb_define_module_function(module, "glMultiTexCoord4sv", gl_MultiTexCoordsv, -1); } ruby-opengl-0.60.1.orig/ext/gl/gl-ext-3dfx.c0000644000000000000000000000175411377006423017120 0ustar rootroot/* * Copyright (C) 2007 Jan Dvorak * * This program is distributed under the terms of the MIT license. * See the included MIT-LICENSE file for the terms of this license. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "../common/common.h" /* OpenGL 3DFX extensions */ /* #208 - GL_3DFX_tbuffer */ GL_FUNC_LOAD_1(TbufferMask3DFX,GLvoid, GLuint, "GL_3DFX_tbuffer") void gl_init_functions_ext_3dfx(VALUE module) { /* #208 - GL_3DFX_tbuffer */ rb_define_module_function(module, "glTbufferMask3DFX", gl_TbufferMask3DFX, 1); } ruby-opengl-0.60.1.orig/ext/glu/0000755000000000000000000000000011377006423015070 5ustar rootrootruby-opengl-0.60.1.orig/ext/glu/glu.c0000644000000000000000000011217411377006423016031 0ustar rootroot/* * Last edit by previous maintainer: * 2003/10/25 15:25:05, yoshi * * Copyright (C) 1999 - 2005 Yoshi * Copyright (C) 2006 John M. Gabriele * * This program is distributed under the terms of the MIT license. * See the included COPYRIGHT file for the terms of this license. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "../common/common.h" static VALUE module; VALUE Class_GLUError; void glu_init_enums(VALUE); typedef GLUtesselator tesselatorObj; /* pointers passed to gluNurbsCurve/Surface etc., - some implementations (Mesa) needs these to be valid at EndCurve/Surface etc. call., so we store them here and free them after that call */ struct glu_MesaStack { int len; GLfloat **ptr; }; static struct glu_MesaStack gms = {0, NULL}; struct nurbsdata { GLUnurbsObj *nobj; VALUE n_ref; }; struct tessdata { tesselatorObj *tobj; VALUE t_ref; }; struct quaddata { GLUquadricObj *qobj; VALUE q_ref; }; static VALUE cNurbs; static VALUE cTess; static VALUE cQuad; #define REF_LAST 15 #define GetNURBS(obj, ndata) {\ Data_Get_Struct(obj, struct nurbsdata, ndata);\ if (ndata->nobj == NULL) rb_raise(rb_eRuntimeError, "Nurbs Object already deleted!");\ } #define GetTESS(obj, tdata) {\ Data_Get_Struct(obj, struct tessdata, tdata);\ if (tdata->tobj == NULL) rb_raise(rb_eRuntimeError, "Triangulator Object already deleted!");\ } #define GetQUAD(obj, qdata) {\ Data_Get_Struct(obj, struct quaddata, qdata);\ if (qdata->qobj == NULL) rb_raise(rb_eRuntimeError, "Quadric Object already deleted!");\ } static ID callId; static ID refId; /* * GLU Implementation */ /* * Nurbs */ /* from nurbscrv.c */ static int get_curve_dim(type) GLenum type; { switch(type) { case GL_MAP1_VERTEX_3: return 3; case GL_MAP1_VERTEX_4: return 4; case GL_MAP1_INDEX: return 1; case GL_MAP1_COLOR_4: return 4; case GL_MAP1_NORMAL: return 3; case GL_MAP1_TEXTURE_COORD_1: return 1; case GL_MAP1_TEXTURE_COORD_2: return 2; case GL_MAP1_TEXTURE_COORD_3: return 3; case GL_MAP1_TEXTURE_COORD_4: return 4; default: rb_raise(rb_eArgError,"Unknown curve type '%i'",type); } return 0; /* never gets here */ } /* from nurbssrf.c */ static int get_surface_dim(GLenum type) { switch(type) { case GL_MAP2_VERTEX_3: return 3; case GL_MAP2_VERTEX_4: return 4; case GL_MAP2_INDEX: return 1; case GL_MAP2_COLOR_4: return 4; case GL_MAP2_NORMAL: return 3; case GL_MAP2_TEXTURE_COORD_1: return 1; case GL_MAP2_TEXTURE_COORD_2: return 2; case GL_MAP2_TEXTURE_COORD_3: return 3; case GL_MAP2_TEXTURE_COORD_4: return 4; default: rb_raise(rb_eArgError,"Unknown surface type '%i'",type); } return 0; /* never gets here */ } VALUE GLUError_initialize(VALUE obj,VALUE message, VALUE error_id) { rb_call_super(1, &message); rb_iv_set(obj, "@id", error_id); return obj; } void check_for_gluerror(GLenum error) { char *error_string = ""; VALUE exc; /* no error */ if (error==0) return; switch(error) { case GLU_INVALID_ENUM: error_string = "invalid enumerant"; break; case GLU_INVALID_VALUE: error_string = "invalid value"; break; case GLU_INVALID_OPERATION: error_string = "invalid operation"; break; case GLU_OUT_OF_MEMORY: error_string = "out of memory"; break; default: error_string = "unknown error"; break; } exc = rb_funcall(Class_GLUError, rb_intern("new"), 2, rb_str_new2(error_string), RETCONV_GLenum(error)); rb_funcall(rb_cObject, rb_intern("raise"), 1, exc); } /* * NURBS API */ static VALUE n_current; static void free_nurbs(ndata) struct nurbsdata *ndata; { if (ndata->nobj) gluDeleteNurbsRenderer(ndata->nobj); ndata->nobj = NULL; ndata->n_ref = Qnil; } static void mark_nurbs(ndata) struct nurbsdata* ndata; { if (ndata->nobj) rb_gc_mark(ndata->n_ref); } static void CALLBACK n_error(errorno) GLenum errorno; { VALUE nurbs; struct nurbsdata *ndata; nurbs = rb_ary_entry(n_current, -1); if (nurbs == Qnil) return; GetNURBS(nurbs, ndata); rb_funcall(rb_ary_entry(ndata->n_ref, GLU_ERROR), callId, 1, INT2NUM(errorno)); } static VALUE glu_NurbsCallback(obj, arg1, arg2, arg3) VALUE obj, arg1, arg2, arg3; { struct nurbsdata* ndata; GLenum type; GetNURBS(arg1, ndata); type = (GLenum)NUM2INT(arg2); if (!rb_obj_is_kind_of(arg3,rb_cProc) && !NIL_P(arg3)) rb_raise(rb_eTypeError, "gluNurbsCallback needs Proc Object:%s",rb_class2name(CLASS_OF(arg3))); if (type!=GLU_ERROR) return Qnil; rb_ary_store(ndata->n_ref, type, arg3); if (NIL_P(arg3)) gluNurbsCallback(ndata->nobj, type, NULL); else gluNurbsCallback(ndata->nobj, type, n_error); return Qnil; } static VALUE glu_NewNurbsRenderer(obj) VALUE obj; { VALUE ret; struct nurbsdata *ndata; ret = Data_Make_Struct(cNurbs, struct nurbsdata, mark_nurbs, free_nurbs, ndata); ndata->nobj = gluNewNurbsRenderer(); ndata->n_ref = rb_ary_new2(REF_LAST); return ret; } static VALUE glu_DeleteNurbsRenderer(obj, arg1) VALUE obj, arg1; { struct nurbsdata *ndata; GetNURBS(arg1, ndata); free_nurbs(ndata); return Qnil; } static VALUE glu_NurbsProperty(obj, arg1, arg2, arg3) VALUE obj, arg1, arg2, arg3; { struct nurbsdata *ndata; GLenum property; GLfloat value; GetNURBS(arg1, ndata); property = (GLenum)NUM2INT(arg2); value = (GLfloat)NUM2DBL(arg3); gluNurbsProperty(ndata->nobj, property, value); return Qnil; } static VALUE glu_GetNurbsProperty(obj, arg1, arg2) VALUE obj, arg1, arg2; { struct nurbsdata *ndata; GLenum property; GLfloat value; GetNURBS(arg1, ndata); property = (GLenum)NUM2INT(arg2); gluGetNurbsProperty(ndata->nobj, property, &value); return cond_GLBOOL2RUBY_F(property,value); } static VALUE glu_BeginCurve(obj, arg1) VALUE obj, arg1; { struct nurbsdata *ndata; GetNURBS(arg1, ndata); rb_ary_push(n_current, arg1); gluBeginCurve(ndata->nobj); return Qnil; } static VALUE glu_EndCurve(obj, arg1) VALUE obj, arg1; { struct nurbsdata *ndata; GetNURBS(arg1, ndata); gluEndCurve(ndata->nobj); for (;gms.len>0;gms.len--) free(gms.ptr[gms.len-1]); free(gms.ptr); gms.ptr = NULL; rb_ary_pop(n_current); return Qnil; } static VALUE glu_NurbsCurve(argc,argv,obj) int argc; VALUE *argv; VALUE obj; { struct nurbsdata *ndata; GLint uknot_count; GLfloat *uknot; GLint u_stride; GLint uorder; GLfloat *ctlarray; GLenum type; VALUE args[7]; VALUE ary_ctl1; switch (rb_scan_args(argc, argv, "52", &args[0], &args[1], &args[2], &args[3], &args[4], &args[5], &args[6])) { case 5: uknot_count = RARRAY_LEN(args[1]); uorder = (GLenum)NUM2INT(args[3]); type = (GLenum)NUM2INT(args[4]); u_stride = get_curve_dim(type); uknot = ALLOC_N(GLfloat, uknot_count); ary2cflt(args[1], uknot, uknot_count); ary_ctl1 = rb_funcall(args[2],rb_intern("flatten"),0); break; case 7: uknot_count = (GLint)NUM2INT(args[1]); u_stride = (GLint)NUM2INT(args[3]); uorder = (GLint)NUM2INT(args[5]); type = (GLenum)NUM2INT(args[6]); uknot = ALLOC_N(GLfloat, uknot_count); ary2cflt(args[2], uknot, uknot_count); ary_ctl1 = rb_funcall(args[4],rb_intern("flatten"),0); break; default: rb_raise(rb_eArgError, "gluNurbsCurve needs 5 or 7 arguments"); } ctlarray = ALLOC_N(GLfloat, u_stride*(uknot_count-uorder)); ary2cflt((VALUE)ary_ctl1, ctlarray, (uknot_count-uorder)*u_stride); GetNURBS(args[0], ndata); gluNurbsCurve(ndata->nobj, uknot_count, uknot, u_stride, ctlarray, uorder, type); /* store the pointers */ gms.ptr = REALLOC_N(gms.ptr, GLfloat*, gms.len+=2); gms.ptr[gms.len - 2] = uknot; gms.ptr[gms.len - 1] = ctlarray; return Qnil; } static VALUE glu_BeginSurface(obj, arg1) VALUE obj, arg1; { struct nurbsdata *ndata; GetNURBS(arg1, ndata); rb_ary_push(n_current, arg1); gluBeginSurface(ndata->nobj); return Qnil; } static VALUE glu_EndSurface(obj, arg1) VALUE obj, arg1; { struct nurbsdata *ndata; GetNURBS(arg1, ndata); gluEndSurface(ndata->nobj); for(; gms.len>0; gms.len--) free(gms.ptr[gms.len-1]); free(gms.ptr); gms.ptr = NULL; rb_ary_pop(n_current); return Qnil; } static VALUE glu_NurbsSurface(argc, argv, obj) int argc; VALUE *argv; VALUE obj; { struct nurbsdata *ndata; GLint sknot_count; GLfloat *sknot; GLint tknot_count; GLfloat *tknot; GLint s_stride; GLint t_stride; GLfloat *ctlarray; GLint sorder; GLint torder; GLenum type; VALUE args[11]; VALUE ary_ctl1; int type_len; switch (rb_scan_args(argc, argv, "74", &args[0], &args[1], &args[2], &args[3], &args[4], &args[5], &args[6], &args[7], &args[8], &args[9], &args[10])) { case 7: sknot_count = RARRAY_LEN(args[1]); sknot = ALLOC_N(GLfloat, sknot_count); ary2cflt(args[1], sknot, sknot_count); tknot_count = RARRAY_LEN(args[2]); tknot = ALLOC_N(GLfloat, tknot_count); ary2cflt(args[2], tknot, tknot_count); sorder = (GLint)NUM2INT(args[4]); torder = (GLint)NUM2INT(args[5]); type = (GLenum)NUM2INT(args[6]); t_stride = get_surface_dim(type); s_stride = t_stride * sorder; ctlarray = ALLOC_N(GLfloat, (sknot_count-sorder)*(tknot_count-torder)*t_stride); ary_ctl1 = rb_funcall(args[3],rb_intern("flatten"),0); ary2cflt(ary_ctl1, ctlarray, (sknot_count-sorder)*(tknot_count-torder)*t_stride); break; case 11: sknot_count = (GLint)NUM2INT(args[1]); sknot = ALLOC_N(GLfloat, sknot_count); ary2cflt(args[2], sknot, sknot_count); tknot_count = (GLint)NUM2INT(args[3]); tknot = ALLOC_N(GLfloat, tknot_count); ary2cflt(args[4], tknot, tknot_count); s_stride = (GLint)NUM2INT(args[5]); t_stride = (GLint)NUM2INT(args[6]); sorder = (GLint)NUM2INT(args[8]); torder = (GLint)NUM2INT(args[9]); type = (GLint)NUM2INT(args[10]); type_len = get_surface_dim(type); ctlarray = ALLOC_N(GLfloat, (sknot_count-sorder)*(tknot_count-torder)*type_len); ary_ctl1 = rb_funcall(args[7],rb_intern("flatten"),0); ary2cflt(ary_ctl1, ctlarray, (sknot_count-sorder)*(tknot_count-torder)*type_len); break; default: rb_raise(rb_eArgError, "gluNurbsSurface needs 7 or 11 arguments"); return Qnil; /* not reached */ } GetNURBS(args[0], ndata); gluNurbsSurface(ndata->nobj, sknot_count, sknot, tknot_count, tknot, s_stride, t_stride, ctlarray, sorder, torder, type); /* store the pointers */ gms.ptr = REALLOC_N(gms.ptr, GLfloat*, gms.len+=3); gms.ptr[gms.len-3] = sknot; gms.ptr[gms.len-2] = tknot; gms.ptr[gms.len-1] = ctlarray; return Qnil; } static VALUE glu_BeginTrim(obj, arg1) VALUE obj, arg1; { struct nurbsdata *ndata; GetNURBS(arg1, ndata); rb_ary_push(n_current, arg1); gluBeginTrim(ndata->nobj); return Qnil; } static VALUE glu_EndTrim(obj, arg1) VALUE obj, arg1; { struct nurbsdata *ndata; GetNURBS(arg1, ndata); gluEndTrim(ndata->nobj); rb_ary_pop(n_current); return Qnil; } static VALUE glu_PwlCurve(argc, argv, obj) int argc; VALUE *argv; VALUE obj; { struct nurbsdata *ndata; GLint count; GLfloat *array; GLint stride; GLenum type; VALUE args[5]; VALUE ary_ctl1; switch (rb_scan_args(argc, argv, "32", &args[0], &args[1], &args[2], &args[3], &args[4])) { case 3: count = RARRAY_LEN(args[1]); type = NUM2INT(args[2]); stride = (type == GLU_MAP1_TRIM_2 ? 2 : 3); array = ALLOC_N(GLfloat, count*stride); ary_ctl1 = rb_funcall(args[1],rb_intern("flatten"),0); ary2cflt(ary_ctl1, array, count*stride); break; case 5: count = NUM2INT(args[1]); stride = NUM2INT(args[3]); type = NUM2INT(args[4]); array = ALLOC_N(GLfloat, count*stride); ary_ctl1 = rb_funcall(args[2],rb_intern("flatten"),0); ary2cflt(ary_ctl1, array, count*stride); break; default: rb_raise(rb_eArgError, "gluPwlCurve needs 3 or 5 arguments"); return Qnil; /* not reached */ } GetNURBS(args[0], ndata); gluPwlCurve(ndata->nobj, count, array, stride, type); free(array); return Qnil; } static VALUE glu_LoadSamplingMatrices(obj,arg1,arg2,arg3,arg4) VALUE obj, arg1,arg2,arg3,arg4; { struct nurbsdata *ndata; GLfloat mdl_mtx[4*4]; GLfloat persp_mtx[4*4]; GLint viewport[4]; GetNURBS(arg1, ndata); ary2cmatfloat(arg2,mdl_mtx,4,4); ary2cmatfloat(arg3,persp_mtx,4,4); ary2cint(arg4,viewport,4); gluLoadSamplingMatrices(ndata->nobj,mdl_mtx,persp_mtx,viewport); return Qnil; } /* * Tesselation API */ static VALUE t_current; #define TESS_DATA 0 #define TESS_BEGIN 1 #define TESS_VERTEX 2 #define TESS_END 3 #define TESS_ERROR 4 #define TESS_EDGE_FLAG 5 #define TESS_OUTDATA 6 #define TESS_COMBINE 7 #define TESS_BEGIN_DATA 8 #define TESS_VERTEX_DATA 9 #define TESS_END_DATA 10 #define TESS_ERROR_DATA 11 #define TESS_EDGE_FLAG_DATA 12 #define TESS_COMBINE_DATA 13 #define TESS_USERDATA 14 static void mark_tess(tdata) struct tessdata* tdata; { if (tdata->tobj) rb_gc_mark(tdata->t_ref); } static void free_tess(tdata) struct tessdata *tdata; { if (tdata->tobj) gluDeleteTess(tdata->tobj); tdata->t_ref = Qnil; tdata->tobj = NULL; } static VALUE glu_NewTess(obj) VALUE obj; { VALUE ret; struct tessdata *tdata; ret = Data_Make_Struct(cTess, struct tessdata, mark_tess, free_tess, tdata); tdata->tobj = gluNewTess(); tdata->t_ref = rb_ary_new2(REF_LAST); return ret; } static VALUE glu_DeleteTess(obj, arg1) VALUE obj, arg1; { struct tessdata *tdata; GetTESS(arg1, tdata); free_tess(tdata); return Qnil; } /* tess* callback function wrappers */ #define TESS_CALLBACK_COMMON \ VALUE tess; \ struct tessdata *tdata; \ tess = rb_ary_entry(t_current, -1); \ if (tess == Qnil) \ return; \ GetTESS(tess, tdata); static void CALLBACK t_begin(type) GLenum type; { TESS_CALLBACK_COMMON rb_funcall(rb_ary_entry(tdata->t_ref, TESS_BEGIN), callId, 1, INT2NUM(type)); } static void CALLBACK t_edgeFlag(flag) GLboolean flag; { TESS_CALLBACK_COMMON rb_funcall(rb_ary_entry(tdata->t_ref, TESS_EDGE_FLAG), callId, 1, GLBOOL2RUBY(flag)); } static void CALLBACK t_vertex(data) void* data; { TESS_CALLBACK_COMMON rb_funcall(rb_ary_entry(tdata->t_ref, TESS_VERTEX), callId, 1, data); } static void CALLBACK t_end() { TESS_CALLBACK_COMMON rb_funcall(rb_ary_entry(tdata->t_ref, TESS_END), callId, 0); } static void CALLBACK t_error(errorno) GLenum errorno; { TESS_CALLBACK_COMMON rb_funcall(rb_ary_entry(tdata->t_ref, TESS_ERROR), callId, 1, INT2NUM(errorno)); } static void CALLBACK t_begin_data(type, user_data) GLenum type; void* user_data; { TESS_CALLBACK_COMMON rb_funcall(rb_ary_entry(tdata->t_ref, TESS_BEGIN_DATA), callId, 2, INT2NUM(type), user_data); } static void CALLBACK t_edgeFlag_data(flag, user_data) GLboolean flag; void* user_data; { TESS_CALLBACK_COMMON rb_funcall(rb_ary_entry(tdata->t_ref, TESS_EDGE_FLAG_DATA), callId, 2, GLBOOL2RUBY(flag), user_data); } static void CALLBACK t_vertex_data(data, user_data) void* data; void* user_data; { TESS_CALLBACK_COMMON rb_funcall(rb_ary_entry(tdata->t_ref, TESS_VERTEX_DATA), callId, 2, data, user_data); } static void CALLBACK t_end_data(user_data) void* user_data; { TESS_CALLBACK_COMMON rb_funcall(rb_ary_entry(tdata->t_ref, TESS_END_DATA), callId, 1, user_data); } static void CALLBACK t_error_data(errorno, user_data) GLenum errorno; void* user_data; { TESS_CALLBACK_COMMON rb_funcall(rb_ary_entry(tdata->t_ref, TESS_ERROR_DATA), callId, 2, INT2NUM(errorno), user_data); } static void CALLBACK t_combine(coords, vertex_data, weight, outData) GLdouble coords[3]; void* vertex_data[4]; GLfloat weight[4]; void** outData; { VALUE rb_coord, rb_vertex_data, rb_weight; int i; TESS_CALLBACK_COMMON rb_coord = rb_ary_new2(3); for (i = 0; i < 3; i++) rb_ary_store(rb_coord, i, rb_float_new(coords[i])); rb_vertex_data = rb_ary_new2(4); for (i = 0; i < 4; i++) rb_ary_store(rb_vertex_data, i, (VALUE)vertex_data[i]); rb_weight = rb_ary_new2(4); for (i = 0; i < 4; i++) rb_ary_store(rb_weight, i, rb_float_new(weight[i])); *outData = (void*)rb_funcall(rb_ary_entry(tdata->t_ref, TESS_COMBINE), callId, 3, rb_coord, rb_vertex_data, rb_weight); rb_ary_push(rb_ary_entry(tdata->t_ref, TESS_OUTDATA), (VALUE)*outData); } static void CALLBACK t_combine_data(coords, vertex_data, weight, outData, user_data) GLdouble coords[3]; void* vertex_data[4]; GLfloat weight[4]; void** outData; void* user_data; { VALUE rb_coord, rb_vertex_data, rb_weight; int i; TESS_CALLBACK_COMMON rb_coord = rb_ary_new2(3); for (i = 0; i < 3; i++) rb_ary_store(rb_coord, i, rb_float_new(coords[i])); rb_vertex_data = rb_ary_new2(4); for (i = 0; i < 4; i++) rb_ary_store(rb_vertex_data, i, (VALUE)vertex_data[i]); rb_weight = rb_ary_new2(4); for (i = 0; i < 4; i++) rb_ary_store(rb_weight, i, rb_float_new(weight[i])); *outData = (void*)rb_funcall(rb_ary_entry(tdata->t_ref, TESS_COMBINE_DATA), callId, 4, rb_coord, rb_vertex_data, rb_weight, (VALUE)user_data); rb_ary_push(rb_ary_entry(tdata->t_ref, TESS_OUTDATA), (VALUE)*outData); } #undef TESS_CALLBACK_COMMON static VALUE glu_TessProperty(obj, arg1, arg2, arg3) VALUE obj, arg1, arg2; { struct tessdata* tdata; GLenum property; GLdouble value; GetTESS(arg1, tdata); property = (GLenum)NUM2INT(arg2); value = (GLdouble)NUM2DBL(arg3); gluTessProperty(tdata->tobj, property, value); return Qnil; } static VALUE glu_GetTessProperty(obj, arg1, arg2) VALUE obj, arg1, arg2; { struct tessdata* tdata; GLenum property; GLdouble value; GetTESS(arg1, tdata); property = (GLenum)NUM2INT(arg2); gluGetTessProperty(tdata->tobj, property, &value); return cond_GLBOOL2RUBY_F(property,value); } static VALUE glu_TessNormal(obj, arg1, arg2, arg3, arg4) VALUE obj, arg1, arg2, arg3, arg4; { struct tessdata* tdata; GLdouble x, y, z; GetTESS(arg1, tdata); x = (GLdouble)NUM2DBL(arg2); y = (GLdouble)NUM2DBL(arg3); z = (GLdouble)NUM2DBL(arg4); gluTessNormal(tdata->tobj, x, y, z); return Qnil; } static VALUE glu_TessBeginPolygon(obj, arg1, arg2) VALUE obj, arg1, arg2; { struct tessdata* tdata; GetTESS(arg1, tdata); rb_ary_store(tdata->t_ref, TESS_USERDATA, arg2); rb_ary_store(tdata->t_ref, TESS_OUTDATA, rb_ary_new()); rb_ary_store(tdata->t_ref, TESS_DATA, rb_ary_new()); rb_ary_push(t_current, arg1); gluTessBeginPolygon(tdata->tobj, (void*)arg2); return Qnil; } static VALUE glu_TessEndPolygon(obj, arg1) VALUE obj, arg1; { struct tessdata* tdata; GetTESS(arg1, tdata); gluTessEndPolygon(tdata->tobj); rb_ary_store(tdata->t_ref, TESS_USERDATA, Qnil); rb_ary_store(tdata->t_ref, TESS_OUTDATA, Qnil); rb_ary_store(tdata->t_ref, TESS_DATA, Qnil); rb_ary_pop(t_current); return Qnil; } static VALUE glu_TessBeginContour(obj, arg1) VALUE obj, arg1; { struct tessdata* tdata; GetTESS(arg1, tdata); gluTessBeginContour(tdata->tobj); return Qnil; } static VALUE glu_TessEndContour(obj, arg1) VALUE obj, arg1; { struct tessdata* tdata; GetTESS(arg1, tdata); gluTessEndContour(tdata->tobj); return Qnil; } #define TESS_CALLBACK_CASE(_type_,_function_) \ case GLU_##_type_: \ rb_ary_store(tdata->t_ref, _type_, arg3); \ if (NIL_P(arg3)) \ gluTessCallback(tdata->tobj, type, NULL); \ else \ gluTessCallback(tdata->tobj, type, _function_); \ break; static VALUE glu_TessCallback(obj, arg1, arg2, arg3) VALUE obj, arg1, arg2, arg3; { struct tessdata* tdata; GLenum type; GetTESS(arg1, tdata); type = (GLenum)NUM2INT(arg2); if (!rb_obj_is_kind_of(arg3,rb_cProc) && !NIL_P(arg3)) rb_raise(rb_eTypeError, "gluTessCallback needs Proc Object:%s",rb_class2name(CLASS_OF(arg3))); switch (type) { TESS_CALLBACK_CASE(TESS_BEGIN,t_begin) TESS_CALLBACK_CASE(TESS_BEGIN_DATA,t_begin_data) TESS_CALLBACK_CASE(TESS_EDGE_FLAG,t_edgeFlag) TESS_CALLBACK_CASE(TESS_EDGE_FLAG_DATA,t_edgeFlag_data) TESS_CALLBACK_CASE(TESS_VERTEX,t_vertex) TESS_CALLBACK_CASE(TESS_VERTEX_DATA,t_vertex_data) TESS_CALLBACK_CASE(TESS_END,t_end) TESS_CALLBACK_CASE(TESS_END_DATA,t_end_data) TESS_CALLBACK_CASE(TESS_ERROR,t_error) TESS_CALLBACK_CASE(TESS_ERROR_DATA,t_error_data) TESS_CALLBACK_CASE(TESS_COMBINE,t_combine) TESS_CALLBACK_CASE(TESS_COMBINE_DATA,t_combine_data) } return Qnil; } #undef TESS_CALLBACK_CASE static VALUE glu_BeginPolygon(obj, arg1) VALUE obj, arg1; { struct tessdata* tdata; GetTESS(arg1, tdata); rb_ary_store(tdata->t_ref, TESS_DATA, rb_ary_new()); rb_ary_push(t_current, arg1); gluBeginPolygon(tdata->tobj); return Qnil; } static VALUE glu_TessVertex(obj, arg1, arg2, arg3) VALUE obj, arg1, arg2, arg3; { struct tessdata* tdata; GLdouble v[3] = {0.0,0.0,0.0}; GetTESS(arg1, tdata); rb_ary_push(rb_ary_entry(tdata->t_ref, TESS_DATA), arg3); Check_Type(arg2,T_ARRAY); ary2cdbl(arg2, v, 3); gluTessVertex(tdata->tobj, v,(void *)arg3); return Qnil; } static VALUE glu_NextContour(obj, arg1, arg2) VALUE obj, arg1, arg2; { struct tessdata* tdata; GLenum type; GetTESS(arg1, tdata); type = (GLenum)NUM2INT(arg2); gluNextContour(tdata->tobj, type); return Qnil; } static VALUE glu_EndPolygon(obj, arg1) VALUE obj, arg1; { struct tessdata* tdata; GetTESS(arg1, tdata); gluEndPolygon(tdata->tobj); rb_ary_store(tdata->t_ref, TESS_DATA, Qnil); rb_ary_pop(t_current); return Qnil; } /* * Quadric API */ static VALUE q_current; static void CALLBACK q_error(errorno) GLenum errorno; { VALUE quad; struct quaddata *qdata; quad = rb_ary_entry(q_current, -1); if (quad == Qnil) return; GetQUAD(quad, qdata); rb_funcall(rb_ary_entry(qdata->q_ref, GLU_ERROR), callId, 1, INT2NUM(errorno)); } static VALUE glu_QuadricCallback(obj, arg1, arg2, arg3) VALUE obj, arg1, arg2, arg3; { struct quaddata* qdata; GLenum type; GetQUAD(arg1, qdata); type = (GLenum)NUM2INT(arg2); if (!rb_obj_is_kind_of(arg3,rb_cProc) && !NIL_P(arg3)) rb_raise(rb_eTypeError, "gluQuadricCallback needs Proc Object:%s",rb_class2name(CLASS_OF(arg3))); if (type!=GLU_ERROR) return Qnil; rb_ary_store(qdata->q_ref, type, arg3); if (NIL_P(arg3)) gluQuadricCallback(qdata->qobj, type, NULL); else gluQuadricCallback(qdata->qobj, type, q_error); return Qnil; } static void free_quad(qdata) struct quaddata *qdata; { if (qdata->qobj) gluDeleteQuadric(qdata->qobj); qdata->qobj = NULL; qdata->q_ref = Qnil; } static void mark_quad(qdata) struct quaddata* qdata; { if (qdata->qobj) rb_gc_mark(qdata->q_ref); } static VALUE glu_NewQuadric(obj) VALUE obj; { VALUE ret; struct quaddata *qdata; ret = Data_Make_Struct(cQuad, struct quaddata, mark_quad, free_quad, qdata); qdata->qobj = gluNewQuadric(); qdata->q_ref = rb_ary_new2(REF_LAST); return ret; } static VALUE glu_DeleteQuadric(obj, arg1) VALUE obj, arg1; { struct quaddata *qdata; GetQUAD(arg1, qdata); free_quad(qdata); return Qnil; } static VALUE glu_QuadricNormals(obj, arg1, arg2) VALUE obj, arg1, arg2; { struct quaddata* qdata; GLenum normals; GetQUAD(arg1, qdata); normals = (GLenum)NUM2INT(arg2); gluQuadricNormals(qdata->qobj, normals); return Qnil; } static VALUE glu_QuadricTexture(obj, arg1, arg2) VALUE obj, arg1, arg2; { struct quaddata* qdata; GLboolean textureCoords; GetQUAD(arg1, qdata); textureCoords = (GLboolean)NUM2INT(arg2); gluQuadricTexture(qdata->qobj, textureCoords); return Qnil; } static VALUE glu_QuadricOrientation(obj, arg1, arg2) VALUE obj, arg1, arg2; { struct quaddata* qdata; GLenum orientation; GetQUAD(arg1, qdata); orientation = (GLenum)NUM2INT(arg2); gluQuadricOrientation(qdata->qobj, orientation); return Qnil; } static VALUE glu_QuadricDrawStyle(obj, arg1, arg2) VALUE obj, arg1, arg2; { struct quaddata* qdata; GLenum drawStyle; GetQUAD(arg1, qdata); drawStyle = (GLenum)NUM2INT(arg2); gluQuadricDrawStyle(qdata->qobj, drawStyle); return Qnil; } static VALUE glu_Cylinder(obj, arg1, arg2, arg3, arg4, arg5, arg6) VALUE obj, arg1, arg2, arg3, arg4, arg5, arg6; { struct quaddata* qdata; GLdouble baseRadius; GLdouble topRadius; GLdouble height; GLint slices; GLint stacks; GetQUAD(arg1, qdata); baseRadius = (GLdouble)NUM2DBL(arg2); topRadius = (GLdouble)NUM2DBL(arg3); height = (GLdouble)NUM2DBL(arg4); slices = (GLint)NUM2INT(arg5); stacks = (GLint)NUM2INT(arg6); rb_ary_push(q_current, arg1); gluCylinder(qdata->qobj, baseRadius, topRadius, height, slices, stacks); rb_ary_pop(q_current); return Qnil; } static VALUE glu_Disk(obj, arg1, arg2, arg3, arg4, arg5) VALUE obj, arg1, arg2, arg3, arg4, arg5; { struct quaddata* qdata; GLdouble innerRadius; GLdouble outerRadius; GLint slices; GLint loops; GetQUAD(arg1, qdata); innerRadius = (GLdouble)NUM2DBL(arg2); outerRadius = (GLdouble)NUM2DBL(arg3); slices = (GLint)NUM2INT(arg4); loops = (GLint)NUM2INT(arg5); rb_ary_push(q_current, arg1); gluDisk(qdata->qobj, innerRadius, outerRadius, slices, loops); rb_ary_pop(q_current); return Qnil; } static VALUE glu_PartialDisk(obj, arg1, arg2, arg3, arg4, arg5, arg6, arg7) VALUE obj, arg1, arg2, arg3, arg4, arg5, arg6, arg7; { struct quaddata* qdata; GLdouble innerRadius; GLdouble outerRadius; GLint slices; GLint loops; GLdouble startAngle; GLdouble sweepAngle; GetQUAD(arg1, qdata); innerRadius = (GLdouble)NUM2DBL(arg2); outerRadius = (GLdouble)NUM2DBL(arg3); slices = (GLint)NUM2INT(arg4); loops = (GLint)NUM2INT(arg5); startAngle = (GLdouble)NUM2DBL(arg6); sweepAngle = (GLdouble)NUM2DBL(arg7); rb_ary_push(q_current, arg1); gluPartialDisk(qdata->qobj, innerRadius, outerRadius, slices, loops, startAngle, sweepAngle); rb_ary_pop(q_current); return Qnil; } static VALUE glu_Sphere(obj, arg1, arg2, arg3, arg4) VALUE obj, arg1, arg2, arg3, arg4; { struct quaddata* qdata; GLdouble radius; GLint slices; GLint stacks; GetQUAD(arg1, qdata); radius = (GLdouble)NUM2DBL(arg2); slices = (GLint)NUM2INT(arg3); stacks = (GLint)NUM2INT(arg4); rb_ary_push(q_current, arg1); gluSphere(qdata->qobj, radius, slices, stacks); rb_ary_pop(q_current); return Qnil; } /* */ static VALUE glu_LookAt(obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9) VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9; { GLdouble eyex; GLdouble eyey; GLdouble eyez; GLdouble centerx; GLdouble centery; GLdouble centerz; GLdouble upx; GLdouble upy; GLdouble upz; eyex = (GLdouble)NUM2DBL(arg1); eyey = (GLdouble)NUM2DBL(arg2); eyez = (GLdouble)NUM2DBL(arg3); centerx = (GLdouble)NUM2DBL(arg4); centery = (GLdouble)NUM2DBL(arg5); centerz = (GLdouble)NUM2DBL(arg6); upx = (GLdouble)NUM2DBL(arg7); upy = (GLdouble)NUM2DBL(arg8); upz = (GLdouble)NUM2DBL(arg9); gluLookAt( eyex, eyey, eyez, centerx, centery, centerz, upx, upy, upz ); return Qnil; } static VALUE glu_Ortho2D(obj,arg1,arg2,arg3,arg4) VALUE obj,arg1,arg2,arg3,arg4; { GLdouble left; GLdouble right; GLdouble bottom; GLdouble top; left = (GLdouble)NUM2DBL(arg1); right = (GLdouble)NUM2DBL(arg2); bottom = (GLdouble)NUM2DBL(arg3); top = (GLdouble)NUM2DBL(arg4); gluOrtho2D(left,right,bottom,top); return Qnil; } static VALUE glu_Perspective(obj,arg1,arg2,arg3,arg4) VALUE obj,arg1,arg2,arg3,arg4; { GLdouble fovy; GLdouble aspect; GLdouble zNear; GLdouble zFar; fovy = (GLdouble)NUM2DBL(arg1); aspect = (GLdouble)NUM2DBL(arg2); zNear = (GLdouble)NUM2DBL(arg3); zFar = (GLdouble)NUM2DBL(arg4); gluPerspective(fovy,aspect,zNear,zFar); return Qnil; } static VALUE glu_PickMatrix(argc,argv,obj) int argc; VALUE* argv; VALUE obj; { GLdouble x; GLdouble y; GLdouble width; GLdouble height; GLint viewport[4]; VALUE args[5]; switch (rb_scan_args(argc, argv, "23", &args[0], &args[1], &args[2], &args[3], &args[4])) { case 2: width = 5.0f; height = 5.0f; glGetIntegerv(GL_VIEWPORT, viewport); break; case 4: width = (GLdouble)NUM2DBL(args[2]); height = (GLdouble)NUM2DBL(args[3]); glGetIntegerv(GL_VIEWPORT, viewport); break; case 5: width = (GLdouble)NUM2DBL(args[2]); height = (GLdouble)NUM2DBL(args[3]); ary2cint(args[4], viewport, 4); break; default: rb_raise(rb_eArgError, "gluPickMatrix needs 2,4 or 5 parameters"); } x = (GLdouble)NUM2DBL(args[0]); y = (GLdouble)NUM2DBL(args[1]); gluPickMatrix(x, y, width, height, viewport); return Qnil; } static VALUE glu_Project(argc,argv,obj) int argc; VALUE* argv; VALUE obj; { GLdouble ox; GLdouble oy; GLdouble oz; GLdouble mdl_mtx[4*4]; GLdouble prj_mtx[4*4]; GLint vport[4]; GLdouble wx; GLdouble wy; GLdouble wz; VALUE args[6]; switch (rb_scan_args(argc, argv, "33", &args[0], &args[1], &args[2], &args[3], &args[4], &args[5])) { case 3: glGetDoublev(GL_MODELVIEW_MATRIX, mdl_mtx); glGetDoublev(GL_PROJECTION_MATRIX, prj_mtx); glGetIntegerv(GL_VIEWPORT, vport); break; case 6: ary2cmatdouble(args[3], mdl_mtx, 4, 4); ary2cmatdouble(args[4], prj_mtx, 4, 4); ary2cint(args[5], vport, 4); break; default: rb_raise(rb_eArgError, "gluProject needs 3 or 6 parameters"); } ox = (GLdouble)NUM2DBL(args[0]); oy = (GLdouble)NUM2DBL(args[1]); oz = (GLdouble)NUM2DBL(args[2]); if (gluProject(ox, oy, oz, mdl_mtx, prj_mtx, vport, &wx, &wy, &wz) == GL_TRUE) { return rb_ary_new3(3, rb_float_new(wx), rb_float_new(wy), rb_float_new(wz)); } else { check_for_gluerror(GLU_INVALID_VALUE); return Qnil; /* not reached */ } } static VALUE glu_UnProject(argc,argv,obj) int argc; VALUE* argv; VALUE obj; { GLdouble wx; GLdouble wy; GLdouble wz; GLdouble mdl_mtx[4*4]; GLdouble prj_mtx[4*4]; GLint vport[4]; GLdouble ox; GLdouble oy; GLdouble oz; VALUE args[6]; switch (rb_scan_args(argc, argv, "33", &args[0], &args[1], &args[2], &args[3], &args[4], &args[5])) { case 3: glGetDoublev(GL_MODELVIEW_MATRIX, mdl_mtx); glGetDoublev(GL_PROJECTION_MATRIX, prj_mtx); glGetIntegerv(GL_VIEWPORT, vport); break; case 6: ary2cmatdouble(args[3], mdl_mtx, 4, 4); ary2cmatdouble(args[4], prj_mtx, 4, 4); ary2cint(args[5], vport, 4); break; default: rb_raise(rb_eArgError, "gluUnProject needs 3 or 6 parameters"); } wx = (GLdouble)NUM2DBL(args[0]); wy = (GLdouble)NUM2DBL(args[1]); wz = (GLdouble)NUM2DBL(args[2]); if (gluUnProject(wx, wy, wz, mdl_mtx, prj_mtx, vport, &ox, &oy, &oz) == GL_TRUE) { return rb_ary_new3(3, rb_float_new(ox), rb_float_new(oy), rb_float_new(oz)); } else { check_for_gluerror(GLU_INVALID_VALUE); return Qnil; /* not reached */ } } static VALUE glu_Build1DMipmaps(obj, arg1, arg2, arg3, arg4, arg5, arg6) VALUE obj, arg1, arg2, arg3, arg4, arg5, arg6; { GLenum target; GLint components; GLint width; GLenum format; GLenum type; int ret; target = (GLenum)NUM2INT(arg1); components = (GLint)NUM2INT(arg2); width = (GLint)NUM2INT(arg3); format = (GLenum)NUM2INT(arg4); type = (GLenum)NUM2INT(arg5); Check_Type(arg6,T_STRING); CheckDataSize(type,format,width,arg6); ret = gluBuild1DMipmaps(target, components, width, format, type, RSTRING_PTR(arg6)); check_for_gluerror(ret); return INT2NUM(ret); } static VALUE glu_Build2DMipmaps(obj, arg1, arg2, arg3, arg4, arg5, arg6, arg7) VALUE obj, arg1, arg2, arg3, arg4, arg5, arg6, arg7; { GLenum target; GLint components; GLint width; GLint height; GLenum format; GLenum type; int ret; target = (GLenum)NUM2INT(arg1); components = (GLint)NUM2INT(arg2); width = (GLint)NUM2INT(arg3); height = (GLint)NUM2INT(arg4); format = (GLenum)NUM2INT(arg5); type = (GLenum)NUM2INT(arg6); Check_Type(arg7,T_STRING); CheckDataSize(type,format,width*height,arg7); ret = gluBuild2DMipmaps(target, components, width, height, format, type, RSTRING_PTR(arg7)); check_for_gluerror(ret); return INT2NUM(ret); } static VALUE glu_ScaleImage(obj, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) VALUE obj, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8; { GLenum format; GLint widthin; GLint heightin; GLenum typein; void* datain; GLint widthout; GLint heightout; GLenum typeout; VALUE ret; GLint retcode; format = (GLenum)NUM2INT(arg1); widthin = (GLint)NUM2INT(arg2); heightin = (GLint)NUM2INT(arg3); typein = (GLenum)NUM2INT(arg4); Check_Type(arg5,T_STRING); CheckDataSize(typein,format,heightin*widthin,arg5); datain = RSTRING_PTR(arg5); widthout = (GLint)NUM2INT(arg6); heightout = (GLint)NUM2INT(arg7); typeout = (GLenum)NUM2INT(arg8); ret = allocate_buffer_with_string(GetDataSize(typeout,format,widthout*heightout)); retcode = gluScaleImage(format, widthin, heightin, typein, datain, widthout, heightout, typeout, (GLvoid*)RSTRING_PTR(ret)); check_for_gluerror(retcode); return ret; } static VALUE glu_ErrorString(obj, arg1) VALUE obj, arg1; { GLenum errorCode; GLubyte* error; errorCode = (GLenum)NUM2INT(arg1); error = (GLubyte*)gluErrorString(errorCode); if (error) return rb_str_new2((char *)error); else return Qnil; } static VALUE glu_GetString(obj, arg1) VALUE obj, arg1; { GLenum name; GLubyte* str; name = (GLenum)NUM2INT(arg1); str = (GLubyte*)gluGetString(name); if (str) return rb_str_new2((char *)str); else return Qnil; } static VALUE module; DLLEXPORT void Init_glu() { callId = rb_intern("call"); refId = rb_intern("[]"); module = rb_define_module("Glu"); glu_init_enums(module); rb_define_module_function(module, "gluNewNurbsRenderer", glu_NewNurbsRenderer, 0); rb_define_module_function(module, "gluDeleteNurbsRenderer", glu_DeleteNurbsRenderer, 1); rb_define_module_function(module, "gluNurbsProperty", glu_NurbsProperty, 3); rb_define_module_function(module, "gluGetNurbsProperty", glu_GetNurbsProperty, 2); rb_define_module_function(module, "gluBeginCurve", glu_BeginCurve, 1); rb_define_module_function(module, "gluEndCurve", glu_EndCurve, 1); rb_define_module_function(module, "gluNurbsCurve", glu_NurbsCurve, -1); rb_define_module_function(module, "gluBeginSurface", glu_BeginSurface, 1); rb_define_module_function(module, "gluEndSurface", glu_EndSurface, 1); rb_define_module_function(module, "gluNurbsSurface", glu_NurbsSurface, -1); rb_define_module_function(module, "gluBeginTrim", glu_BeginTrim, 1); rb_define_module_function(module, "gluEndTrim", glu_EndTrim, 1); rb_define_module_function(module, "gluPwlCurve", glu_PwlCurve, -1); rb_define_module_function(module, "gluNewTess", glu_NewTess, 0); rb_define_module_function(module, "gluDeleteTess", glu_DeleteTess, 1); rb_define_module_function(module, "gluTessCallback", glu_TessCallback, 3); rb_define_module_function(module, "gluBeginPolygon", glu_BeginPolygon, 1); rb_define_module_function(module, "gluTessVertex", glu_TessVertex, 3); rb_define_module_function(module, "gluNextContour", glu_NextContour, 2); rb_define_module_function(module, "gluEndPolygon", glu_EndPolygon, 1); rb_define_module_function(module, "gluTessBeginPolygon", glu_TessBeginPolygon, 2); rb_define_module_function(module, "gluTessBeginContour", glu_TessBeginContour, 1); rb_define_module_function(module, "gluTessEndContour", glu_TessEndContour, 1); rb_define_module_function(module, "gluTessEndPolygon", glu_TessEndPolygon, 1); rb_define_module_function(module, "gluTessProperty", glu_TessProperty, 3); rb_define_module_function(module, "gluTessNormal", glu_TessNormal, 4); rb_define_module_function(module, "gluGetTessProperty", glu_GetTessProperty, 2); rb_define_module_function(module, "gluNewQuadric", glu_NewQuadric, 0); rb_define_module_function(module, "gluDeleteQuadric", glu_DeleteQuadric, 1); rb_define_module_function(module, "gluQuadricNormals", glu_QuadricNormals, 2); rb_define_module_function(module, "gluQuadricTexture", glu_QuadricTexture, 2); rb_define_module_function(module, "gluQuadricOrientation", glu_QuadricOrientation, 2); rb_define_module_function(module, "gluQuadricDrawStyle", glu_QuadricDrawStyle, 2); rb_define_module_function(module, "gluCylinder", glu_Cylinder, 6); rb_define_module_function(module, "gluDisk", glu_Disk, 5); rb_define_module_function(module, "gluPartialDisk", glu_PartialDisk, 7); rb_define_module_function(module, "gluSphere", glu_Sphere, 4); rb_define_module_function(module, "gluLookAt", glu_LookAt, 9); rb_define_module_function(module, "gluOrtho2D", glu_Ortho2D, 4); rb_define_module_function(module, "gluPerspective", glu_Perspective, 4); rb_define_module_function(module, "gluPickMatrix", glu_PickMatrix, -1); rb_define_module_function(module, "gluProject", glu_Project, -1); rb_define_module_function(module, "gluUnProject", glu_UnProject, -1); rb_define_module_function(module, "gluBuild1DMipmaps", glu_Build1DMipmaps, 6); rb_define_module_function(module, "gluBuild2DMipmaps", glu_Build2DMipmaps, 7); rb_define_module_function(module, "gluScaleImage", glu_ScaleImage, 8); rb_define_module_function(module, "gluErrorString", glu_ErrorString, 1); rb_define_module_function(module, "gluGetString", glu_GetString, 1); rb_define_module_function(module, "gluLoadSamplingMatrices",glu_LoadSamplingMatrices,4); rb_define_module_function(module, "gluQuadricCallback", glu_QuadricCallback, 3); rb_define_module_function(module, "gluNurbsCallback", glu_NurbsCallback, 3); Class_GLUError = rb_define_class_under(module, "Error", rb_eStandardError); rb_define_method(Class_GLUError, "initialize", GLUError_initialize, 2); rb_define_attr(Class_GLUError, "id", 1, 0); cNurbs = rb_define_class("Nurbs", rb_cObject); cTess = rb_define_class("Tess", rb_cObject); cQuad = rb_define_class("Quadric", rb_cObject); rb_global_variable(&t_current); /* current active tesselator, nurbs and quadric, used for callbacks */ t_current = rb_ary_new(); rb_global_variable(&n_current); n_current = rb_ary_new(); rb_global_variable(&q_current); q_current = rb_ary_new(); } ruby-opengl-0.60.1.orig/ext/glu/mkrf_conf.rb0000644000000000000000000000231611377006423017363 0ustar rootroot# extconf.rb for ruby-opengl's glu extension module. # # Copyright (C) 2006 John M. Gabriele # # This program is distributed under the terms of the MIT license. # See the included COPYRIGHT file for the terms of this license. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. require 'rubygems' require 'mkrf' RUBYVER = " -DRUBY_VERSION=" + RUBY_VERSION.split(".").join Mkrf::Generator.new( 'glu' ) do |g| case RUBY_PLATFORM when /darwin/ g.cflags << RUBYVER g.ldshared << ' -framework OpenGL' when /mswin32/ g.cflags << ' -DWIN32' + RUBYVER g.include_library( 'opengl32.lib', 'glVertex3d') g.include_library( 'glu32.lib', 'gluLookAt') else g.cflags << ' -Wall' + RUBYVER g.include_library( 'GLU', 'gluLookAt' ) g.include_library( 'GL', 'glVertex3d') end end ruby-opengl-0.60.1.orig/ext/glu/glu-enums.c0000644000000000000000000002740311377006423017156 0ustar rootroot/* This file was genereated on Mon Feb 16 18:08:57 +0100 2009 source: http://oss.sgi.com/cgi-bin/cvsweb.cgi/~checkout~/projects/ogl-sample/main/doc/registry/specs/enumglu.spec */ #include "../common/common.h" void glu_init_enums(VALUE module) { rb_define_const(module, "GLU_TRUE", Qtrue); rb_define_const(module, "GLU_FALSE", Qfalse); rb_define_const(module, "GLU_AUTO_LOAD_MATRIX", INT2NUM(GLU_AUTO_LOAD_MATRIX)); rb_define_const(module, "GLU_BEGIN", INT2NUM(GLU_BEGIN)); rb_define_const(module, "GLU_CCW", INT2NUM(GLU_CCW)); rb_define_const(module, "GLU_CULLING", INT2NUM(GLU_CULLING)); rb_define_const(module, "GLU_CW", INT2NUM(GLU_CW)); rb_define_const(module, "GLU_DISPLAY_MODE", INT2NUM(GLU_DISPLAY_MODE)); rb_define_const(module, "GLU_DOMAIN_DISTANCE", INT2NUM(GLU_DOMAIN_DISTANCE)); rb_define_const(module, "GLU_EDGE_FLAG", INT2NUM(GLU_EDGE_FLAG)); rb_define_const(module, "GLU_END", INT2NUM(GLU_END)); rb_define_const(module, "GLU_ERROR", INT2NUM(GLU_ERROR)); rb_define_const(module, "GLU_EXTENSIONS", INT2NUM(GLU_EXTENSIONS)); rb_define_const(module, "GLU_EXTERIOR", INT2NUM(GLU_EXTERIOR)); rb_define_const(module, "GLU_EXT_nurbs_tessellator", INT2NUM(GLU_EXT_nurbs_tessellator)); rb_define_const(module, "GLU_EXT_object_space_tess", INT2NUM(GLU_EXT_object_space_tess)); rb_define_const(module, "GLU_FILL", INT2NUM(GLU_FILL)); rb_define_const(module, "GLU_FLAT", INT2NUM(GLU_FLAT)); rb_define_const(module, "GLU_INSIDE", INT2NUM(GLU_INSIDE)); rb_define_const(module, "GLU_INTERIOR", INT2NUM(GLU_INTERIOR)); rb_define_const(module, "GLU_INVALID_ENUM", INT2NUM(GLU_INVALID_ENUM)); rb_define_const(module, "GLU_INVALID_OPERATION", INT2NUM(GLU_INVALID_OPERATION)); rb_define_const(module, "GLU_INVALID_VALUE", INT2NUM(GLU_INVALID_VALUE)); rb_define_const(module, "GLU_LAGRANGIAN_SGI", INT2NUM(GLU_LAGRANGIAN_SGI)); rb_define_const(module, "GLU_LINE", INT2NUM(GLU_LINE)); rb_define_const(module, "GLU_MAP1_TRIM_2", INT2NUM(GLU_MAP1_TRIM_2)); rb_define_const(module, "GLU_MAP1_TRIM_3", INT2NUM(GLU_MAP1_TRIM_3)); rb_define_const(module, "GLU_MITCHELL_NETRAVALI_SGI", INT2NUM(GLU_MITCHELL_NETRAVALI_SGI)); rb_define_const(module, "GLU_NONE", INT2NUM(GLU_NONE)); rb_define_const(module, "GLU_NURBS_BEGIN", INT2NUM(GLU_NURBS_BEGIN)); rb_define_const(module, "GLU_NURBS_BEGIN_DATA", INT2NUM(GLU_NURBS_BEGIN_DATA)); rb_define_const(module, "GLU_NURBS_BEGIN_DATA_EXT", INT2NUM(GLU_NURBS_BEGIN_DATA_EXT)); rb_define_const(module, "GLU_NURBS_BEGIN_EXT", INT2NUM(GLU_NURBS_BEGIN_EXT)); rb_define_const(module, "GLU_NURBS_COLOR", INT2NUM(GLU_NURBS_COLOR)); rb_define_const(module, "GLU_NURBS_COLOR_DATA", INT2NUM(GLU_NURBS_COLOR_DATA)); rb_define_const(module, "GLU_NURBS_COLOR_DATA_EXT", INT2NUM(GLU_NURBS_COLOR_DATA_EXT)); rb_define_const(module, "GLU_NURBS_COLOR_EXT", INT2NUM(GLU_NURBS_COLOR_EXT)); rb_define_const(module, "GLU_NURBS_END", INT2NUM(GLU_NURBS_END)); rb_define_const(module, "GLU_NURBS_END_DATA", INT2NUM(GLU_NURBS_END_DATA)); rb_define_const(module, "GLU_NURBS_END_DATA_EXT", INT2NUM(GLU_NURBS_END_DATA_EXT)); rb_define_const(module, "GLU_NURBS_END_EXT", INT2NUM(GLU_NURBS_END_EXT)); rb_define_const(module, "GLU_NURBS_ERROR", INT2NUM(GLU_NURBS_ERROR)); rb_define_const(module, "GLU_NURBS_ERROR1", INT2NUM(GLU_NURBS_ERROR1)); rb_define_const(module, "GLU_NURBS_ERROR10", INT2NUM(GLU_NURBS_ERROR10)); rb_define_const(module, "GLU_NURBS_ERROR11", INT2NUM(GLU_NURBS_ERROR11)); rb_define_const(module, "GLU_NURBS_ERROR12", INT2NUM(GLU_NURBS_ERROR12)); rb_define_const(module, "GLU_NURBS_ERROR13", INT2NUM(GLU_NURBS_ERROR13)); rb_define_const(module, "GLU_NURBS_ERROR14", INT2NUM(GLU_NURBS_ERROR14)); rb_define_const(module, "GLU_NURBS_ERROR15", INT2NUM(GLU_NURBS_ERROR15)); rb_define_const(module, "GLU_NURBS_ERROR16", INT2NUM(GLU_NURBS_ERROR16)); rb_define_const(module, "GLU_NURBS_ERROR17", INT2NUM(GLU_NURBS_ERROR17)); rb_define_const(module, "GLU_NURBS_ERROR18", INT2NUM(GLU_NURBS_ERROR18)); rb_define_const(module, "GLU_NURBS_ERROR19", INT2NUM(GLU_NURBS_ERROR19)); rb_define_const(module, "GLU_NURBS_ERROR2", INT2NUM(GLU_NURBS_ERROR2)); rb_define_const(module, "GLU_NURBS_ERROR20", INT2NUM(GLU_NURBS_ERROR20)); rb_define_const(module, "GLU_NURBS_ERROR21", INT2NUM(GLU_NURBS_ERROR21)); rb_define_const(module, "GLU_NURBS_ERROR22", INT2NUM(GLU_NURBS_ERROR22)); rb_define_const(module, "GLU_NURBS_ERROR23", INT2NUM(GLU_NURBS_ERROR23)); rb_define_const(module, "GLU_NURBS_ERROR24", INT2NUM(GLU_NURBS_ERROR24)); rb_define_const(module, "GLU_NURBS_ERROR25", INT2NUM(GLU_NURBS_ERROR25)); rb_define_const(module, "GLU_NURBS_ERROR26", INT2NUM(GLU_NURBS_ERROR26)); rb_define_const(module, "GLU_NURBS_ERROR27", INT2NUM(GLU_NURBS_ERROR27)); rb_define_const(module, "GLU_NURBS_ERROR28", INT2NUM(GLU_NURBS_ERROR28)); rb_define_const(module, "GLU_NURBS_ERROR29", INT2NUM(GLU_NURBS_ERROR29)); rb_define_const(module, "GLU_NURBS_ERROR3", INT2NUM(GLU_NURBS_ERROR3)); rb_define_const(module, "GLU_NURBS_ERROR30", INT2NUM(GLU_NURBS_ERROR30)); rb_define_const(module, "GLU_NURBS_ERROR31", INT2NUM(GLU_NURBS_ERROR31)); rb_define_const(module, "GLU_NURBS_ERROR32", INT2NUM(GLU_NURBS_ERROR32)); rb_define_const(module, "GLU_NURBS_ERROR33", INT2NUM(GLU_NURBS_ERROR33)); rb_define_const(module, "GLU_NURBS_ERROR34", INT2NUM(GLU_NURBS_ERROR34)); rb_define_const(module, "GLU_NURBS_ERROR35", INT2NUM(GLU_NURBS_ERROR35)); rb_define_const(module, "GLU_NURBS_ERROR36", INT2NUM(GLU_NURBS_ERROR36)); rb_define_const(module, "GLU_NURBS_ERROR37", INT2NUM(GLU_NURBS_ERROR37)); rb_define_const(module, "GLU_NURBS_ERROR4", INT2NUM(GLU_NURBS_ERROR4)); rb_define_const(module, "GLU_NURBS_ERROR5", INT2NUM(GLU_NURBS_ERROR5)); rb_define_const(module, "GLU_NURBS_ERROR6", INT2NUM(GLU_NURBS_ERROR6)); rb_define_const(module, "GLU_NURBS_ERROR7", INT2NUM(GLU_NURBS_ERROR7)); rb_define_const(module, "GLU_NURBS_ERROR8", INT2NUM(GLU_NURBS_ERROR8)); rb_define_const(module, "GLU_NURBS_ERROR9", INT2NUM(GLU_NURBS_ERROR9)); rb_define_const(module, "GLU_NURBS_MODE", INT2NUM(GLU_NURBS_MODE)); rb_define_const(module, "GLU_NURBS_MODE_EXT", INT2NUM(GLU_NURBS_MODE_EXT)); rb_define_const(module, "GLU_NURBS_NORMAL", INT2NUM(GLU_NURBS_NORMAL)); rb_define_const(module, "GLU_NURBS_NORMAL_DATA", INT2NUM(GLU_NURBS_NORMAL_DATA)); rb_define_const(module, "GLU_NURBS_NORMAL_DATA_EXT", INT2NUM(GLU_NURBS_NORMAL_DATA_EXT)); rb_define_const(module, "GLU_NURBS_NORMAL_EXT", INT2NUM(GLU_NURBS_NORMAL_EXT)); rb_define_const(module, "GLU_NURBS_RENDERER", INT2NUM(GLU_NURBS_RENDERER)); rb_define_const(module, "GLU_NURBS_RENDERER_EXT", INT2NUM(GLU_NURBS_RENDERER_EXT)); rb_define_const(module, "GLU_NURBS_TESSELLATOR", INT2NUM(GLU_NURBS_TESSELLATOR)); rb_define_const(module, "GLU_NURBS_TESSELLATOR_EXT", INT2NUM(GLU_NURBS_TESSELLATOR_EXT)); rb_define_const(module, "GLU_NURBS_TEXTURE_COORD", INT2NUM(GLU_NURBS_TEXTURE_COORD)); rb_define_const(module, "GLU_NURBS_TEXTURE_COORD_DATA", INT2NUM(GLU_NURBS_TEXTURE_COORD_DATA)); rb_define_const(module, "GLU_NURBS_TEXTURE_COORD_DATA_EXT", INT2NUM(GLU_NURBS_TEXTURE_COORD_DATA_EXT)); rb_define_const(module, "GLU_NURBS_TEXTURE_COORD_EXT", INT2NUM(GLU_NURBS_TEXTURE_COORD_EXT)); rb_define_const(module, "GLU_NURBS_VERTEX", INT2NUM(GLU_NURBS_VERTEX)); rb_define_const(module, "GLU_NURBS_VERTEX_DATA", INT2NUM(GLU_NURBS_VERTEX_DATA)); rb_define_const(module, "GLU_NURBS_VERTEX_DATA_EXT", INT2NUM(GLU_NURBS_VERTEX_DATA_EXT)); rb_define_const(module, "GLU_NURBS_VERTEX_EXT", INT2NUM(GLU_NURBS_VERTEX_EXT)); rb_define_const(module, "GLU_OBJECT_PARAMETRIC_ERROR", INT2NUM(GLU_OBJECT_PARAMETRIC_ERROR)); rb_define_const(module, "GLU_OBJECT_PARAMETRIC_ERROR_EXT", INT2NUM(GLU_OBJECT_PARAMETRIC_ERROR_EXT)); rb_define_const(module, "GLU_OBJECT_PATH_LENGTH", INT2NUM(GLU_OBJECT_PATH_LENGTH)); rb_define_const(module, "GLU_OBJECT_PATH_LENGTH_EXT", INT2NUM(GLU_OBJECT_PATH_LENGTH_EXT)); rb_define_const(module, "GLU_OUTLINE_PATCH", INT2NUM(GLU_OUTLINE_PATCH)); rb_define_const(module, "GLU_OUTLINE_POLYGON", INT2NUM(GLU_OUTLINE_POLYGON)); rb_define_const(module, "GLU_OUTSIDE", INT2NUM(GLU_OUTSIDE)); rb_define_const(module, "GLU_OUT_OF_MEMORY", INT2NUM(GLU_OUT_OF_MEMORY)); rb_define_const(module, "GLU_PARAMETRIC_ERROR", INT2NUM(GLU_PARAMETRIC_ERROR)); rb_define_const(module, "GLU_PARAMETRIC_TOLERANCE", INT2NUM(GLU_PARAMETRIC_TOLERANCE)); rb_define_const(module, "GLU_PATH_LENGTH", INT2NUM(GLU_PATH_LENGTH)); rb_define_const(module, "GLU_POINT", INT2NUM(GLU_POINT)); rb_define_const(module, "GLU_SAMPLING_METHOD", INT2NUM(GLU_SAMPLING_METHOD)); rb_define_const(module, "GLU_SAMPLING_TOLERANCE", INT2NUM(GLU_SAMPLING_TOLERANCE)); rb_define_const(module, "GLU_SILHOUETTE", INT2NUM(GLU_SILHOUETTE)); rb_define_const(module, "GLU_SMOOTH", INT2NUM(GLU_SMOOTH)); rb_define_const(module, "GLU_TESS_BEGIN", INT2NUM(GLU_TESS_BEGIN)); rb_define_const(module, "GLU_TESS_BEGIN_DATA", INT2NUM(GLU_TESS_BEGIN_DATA)); rb_define_const(module, "GLU_TESS_BOUNDARY_ONLY", INT2NUM(GLU_TESS_BOUNDARY_ONLY)); rb_define_const(module, "GLU_TESS_COMBINE", INT2NUM(GLU_TESS_COMBINE)); rb_define_const(module, "GLU_TESS_COMBINE_DATA", INT2NUM(GLU_TESS_COMBINE_DATA)); rb_define_const(module, "GLU_TESS_COORD_TOO_LARGE", INT2NUM(GLU_TESS_COORD_TOO_LARGE)); rb_define_const(module, "GLU_TESS_EDGE_FLAG", INT2NUM(GLU_TESS_EDGE_FLAG)); rb_define_const(module, "GLU_TESS_EDGE_FLAG_DATA", INT2NUM(GLU_TESS_EDGE_FLAG_DATA)); rb_define_const(module, "GLU_TESS_END", INT2NUM(GLU_TESS_END)); rb_define_const(module, "GLU_TESS_END_DATA", INT2NUM(GLU_TESS_END_DATA)); rb_define_const(module, "GLU_TESS_ERROR", INT2NUM(GLU_TESS_ERROR)); rb_define_const(module, "GLU_TESS_ERROR1", INT2NUM(GLU_TESS_ERROR1)); rb_define_const(module, "GLU_TESS_ERROR2", INT2NUM(GLU_TESS_ERROR2)); rb_define_const(module, "GLU_TESS_ERROR3", INT2NUM(GLU_TESS_ERROR3)); rb_define_const(module, "GLU_TESS_ERROR4", INT2NUM(GLU_TESS_ERROR4)); rb_define_const(module, "GLU_TESS_ERROR5", INT2NUM(GLU_TESS_ERROR5)); rb_define_const(module, "GLU_TESS_ERROR6", INT2NUM(GLU_TESS_ERROR6)); rb_define_const(module, "GLU_TESS_ERROR7", INT2NUM(GLU_TESS_ERROR7)); rb_define_const(module, "GLU_TESS_ERROR8", INT2NUM(GLU_TESS_ERROR8)); rb_define_const(module, "GLU_TESS_ERROR_DATA", INT2NUM(GLU_TESS_ERROR_DATA)); rb_define_const(module, "GLU_TESS_MISSING_BEGIN_CONTOUR", INT2NUM(GLU_TESS_MISSING_BEGIN_CONTOUR)); rb_define_const(module, "GLU_TESS_MISSING_BEGIN_POLYGON", INT2NUM(GLU_TESS_MISSING_BEGIN_POLYGON)); rb_define_const(module, "GLU_TESS_MISSING_END_CONTOUR", INT2NUM(GLU_TESS_MISSING_END_CONTOUR)); rb_define_const(module, "GLU_TESS_MISSING_END_POLYGON", INT2NUM(GLU_TESS_MISSING_END_POLYGON)); rb_define_const(module, "GLU_TESS_NEED_COMBINE_CALLBACK", INT2NUM(GLU_TESS_NEED_COMBINE_CALLBACK)); rb_define_const(module, "GLU_TESS_TOLERANCE", INT2NUM(GLU_TESS_TOLERANCE)); rb_define_const(module, "GLU_TESS_VERTEX", INT2NUM(GLU_TESS_VERTEX)); rb_define_const(module, "GLU_TESS_VERTEX_DATA", INT2NUM(GLU_TESS_VERTEX_DATA)); rb_define_const(module, "GLU_TESS_WINDING_ABS_GEQ_TWO", INT2NUM(GLU_TESS_WINDING_ABS_GEQ_TWO)); rb_define_const(module, "GLU_TESS_WINDING_NEGATIVE", INT2NUM(GLU_TESS_WINDING_NEGATIVE)); rb_define_const(module, "GLU_TESS_WINDING_NONZERO", INT2NUM(GLU_TESS_WINDING_NONZERO)); rb_define_const(module, "GLU_TESS_WINDING_ODD", INT2NUM(GLU_TESS_WINDING_ODD)); rb_define_const(module, "GLU_TESS_WINDING_POSITIVE", INT2NUM(GLU_TESS_WINDING_POSITIVE)); rb_define_const(module, "GLU_TESS_WINDING_RULE", INT2NUM(GLU_TESS_WINDING_RULE)); rb_define_const(module, "GLU_UNKNOWN", INT2NUM(GLU_UNKNOWN)); rb_define_const(module, "GLU_U_STEP", INT2NUM(GLU_U_STEP)); rb_define_const(module, "GLU_VERSION", INT2NUM(GLU_VERSION)); rb_define_const(module, "GLU_VERSION_1_1", INT2NUM(GLU_VERSION_1_1)); rb_define_const(module, "GLU_VERSION_1_2", INT2NUM(GLU_VERSION_1_2)); rb_define_const(module, "GLU_VERSION_1_3", INT2NUM(GLU_VERSION_1_3)); rb_define_const(module, "GLU_VERTEX", INT2NUM(GLU_VERTEX)); rb_define_const(module, "GLU_V_STEP", INT2NUM(GLU_V_STEP)); } ruby-opengl-0.60.1.orig/ext/common/0000755000000000000000000000000011377006423015571 5ustar rootrootruby-opengl-0.60.1.orig/ext/common/funcdef.h0000644000000000000000000003302311377006423017355 0ustar rootroot/* * Copyright (C) 2007 Jan Dvorak * * This program is distributed under the terms of the MIT license. * See the included MIT-LICENSE file for the terms of this license. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /* These macros are for simplification of function definition, as passing arguments from/to OpenGL usually follows the same few patterns. It would be probably wise to adapt the whole bindings to C++ (templates, overloaded functions, etc.), but for now supporting ruby extension for Windows means MSVC6, and that in turn means unspeakable horrors and pains for everyone attempting to merely write, much less debug or maintain any template-based code. */ /* Will load function pointer for function _NAME_ on first call to the function, or raise if the OpenGL version is less then required or the required extension is not supported */ #define LOAD_GL_FUNC(_NAME_,_VEREXT_) \ if (fptr_##_NAME_==NULL) { \ if (CheckVersionExtension(_VEREXT_)==GL_FALSE) { \ if (isdigit(_VEREXT_[0])) \ rb_raise(rb_eNotImpError,"OpenGL version %s is not available on this system",_VEREXT_); \ else \ rb_raise(rb_eNotImpError,"Extension %s is not available on this system",_VEREXT_); \ } \ fptr_##_NAME_ = load_gl_function(#_NAME_, 1); \ } /* Macroset for defining simple functions, i.e. functions that take n arguments and pass them to GL API function without any additional processing. Some checking is implicit in _conversion_ argument - e.g. NUM2INT makes sure that user is really passing type that can be converted to INT, otherwire raises. *_LOAD version of macros are for defining functions where we load function pointer instead of direct call - that means all functions above OpenGL 1.1 (including all extensions) */ #define ARGLIST0 #define ARGLIST1 ,arg1 #define ARGLIST2 ,arg1,arg2 #define ARGLIST3 ,arg1,arg2,arg3 #define ARGLIST4 ,arg1,arg2,arg3,arg4 #define ARGLIST5 ,arg1,arg2,arg3,arg4,arg5 #define ARGLIST6 ,arg1,arg2,arg3,arg4,arg5,arg6 #define ARGLIST7 ,arg1,arg2,arg3,arg4,arg5,arg6,arg7 #define ARGLIST8 ,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8 #define ARGLIST9 ,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9 #define ARGLIST10 ,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10 #define CONV_GLenum (GLenum)NUM2UINT #define CONV_GLboolean (GLboolean)NUM2UINT #define CONV_GLbitfield (GLbitfield)NUM2UINT #define CONV_GLbyte (GLbyte)NUM2INT #define CONV_GLshort (GLshort)NUM2INT #define CONV_GLint (GLint)NUM2INT #define CONV_GLubyte (GLubyte)NUM2UINT #define CONV_GLushort (GLushort)NUM2UINT #define CONV_GLuint (GLuint)NUM2UINT #define CONV_GLsizei (GLsizei)NUM2INT #define CONV_GLfloat (GLfloat)NUM2DBL #define CONV_GLclampf (GLclampf)NUM2DBL #define CONV_GLdouble (GLdouble)NUM2DBL #define CONV_GLclampd (GLclampd)NUM2DBL #define RETDECL_BASE(_t_) _t_ ret = (_t_) 0; #define RETDECL_GLvoid #define RETDECL_void #define RETDECL_GLenum RETDECL_BASE(GLenum) #define RETDECL_GLboolean RETDECL_BASE(GLboolean) #define RETDECL_GLbitfield RETDECL_BASE(GLbitfield) #define RETDECL_GLbyte RETDECL_BASE(GLbyte) #define RETDECL_GLshort RETDECL_BASE(GLshort) #define RETDECL_GLint RETDECL_BASE(GLint) #define RETDECL_GLubyte RETDECL_BASE(GLubyte) #define RETDECL_GLushort RETDECL_BASE(GLushort) #define RETDECL_GLuint RETDECL_BASE(GLuint) #define RETDECL_GLsizei RETDECL_BASE(GLsizei) #define RETDECL_GLfloat RETDECL_BASE(GLfloat) #define RETDECL_GLclampf RETDECL_BASE(GLclampf) #define RETDECL_GLdouble RETDECL_BASE(GLdouble) #define RETDECL_GLclampd RETDECL_BASE(GLclampd) #define RETSTAT_GLvoid #define RETSTAT_void #define RETSTAT_GLenum ret= #define RETSTAT_GLboolean ret= #define RETSTAT_GLbitfield ret= #define RETSTAT_GLbyte ret= #define RETSTAT_GLshort ret= #define RETSTAT_GLint ret= #define RETSTAT_GLubyte ret= #define RETSTAT_GLushort ret= #define RETSTAT_GLuint ret= #define RETSTAT_GLsizei ret= #define RETSTAT_GLfloat ret= #define RETSTAT_GLclampf ret= #define RETSTAT_GLdouble ret= #define RETSTAT_GLclampd ret= #define RETCONV_GLvoid(x) Qnil #define RETCONV_void(x) Qnil #define RETCONV_GLenum(x) UINT2NUM(x) #define RETCONV_GLboolean(x) GLBOOL2RUBY(x) #define RETCONV_GLbitfield(x) UINT2NUM(x) #define RETCONV_GLbyte(x) INT2NUM(x) #define RETCONV_GLshort(x) INT2NUM(x) #define RETCONV_GLint(x) INT2NUM(x) #define RETCONV_GLubyte(x) UINT2NUM(x) #define RETCONV_GLushort(x) UINT2NUM(x) #define RETCONV_GLuint(x) UINT2NUM(x) #define RETCONV_GLsizei(x) INT2NUM(x) #define RETCONV_GLfloat(x) rb_float_new(x) #define RETCONV_GLclampf(x) rb_float_new(x) #define RETCONV_GLdouble(x) rb_float_new(x) #define RETCONV_GLclampd(x) rb_float_new(x) #define PROTOPARAM0(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10) void #define PROTOPARAM1(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10) p1 #define PROTOPARAM2(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10) p1,p2 #define PROTOPARAM3(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10) p1,p2,p3 #define PROTOPARAM4(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10) p1,p2,p3,p4 #define PROTOPARAM5(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10) p1,p2,p3,p4,p5 #define PROTOPARAM6(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10) p1,p2,p3,p4,p5,p6 #define PROTOPARAM7(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10) p1,p2,p3,p4,p5,p6,p7 #define PROTOPARAM8(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10) p1,p2,p3,p4,p5,p6,p7,p8 #define PROTOPARAM9(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10) p1,p2,p3,p4,p5,p6,p7,p8,p9 #define PROTOPARAM10(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10) p1,p2,p3,p4,p5,p6,p7,p8,p9,p10 #define CALLCONV0(cv1,cv2,cv3,cv4,cv5,cv6,cv7,cv8,cv9,cv10) #define CALLCONV1(cv1,cv2,cv3,cv4,cv5,cv6,cv7,cv8,cv9,cv10) CONV_##cv1(arg1) #define CALLCONV2(cv1,cv2,cv3,cv4,cv5,cv6,cv7,cv8,cv9,cv10) CONV_##cv1(arg1),CONV_##cv2(arg2) #define CALLCONV3(cv1,cv2,cv3,cv4,cv5,cv6,cv7,cv8,cv9,cv10) CONV_##cv1(arg1),CONV_##cv2(arg2),CONV_##cv3(arg3) #define CALLCONV4(cv1,cv2,cv3,cv4,cv5,cv6,cv7,cv8,cv9,cv10) CONV_##cv1(arg1),CONV_##cv2(arg2),CONV_##cv3(arg3),CONV_##cv4(arg4) #define CALLCONV5(cv1,cv2,cv3,cv4,cv5,cv6,cv7,cv8,cv9,cv10) CONV_##cv1(arg1),CONV_##cv2(arg2),CONV_##cv3(arg3),CONV_##cv4(arg4),CONV_##cv5(arg5) #define CALLCONV6(cv1,cv2,cv3,cv4,cv5,cv6,cv7,cv8,cv9,cv10) CONV_##cv1(arg1),CONV_##cv2(arg2),CONV_##cv3(arg3),CONV_##cv4(arg4),CONV_##cv5(arg5),CONV_##cv6(arg6) #define CALLCONV7(cv1,cv2,cv3,cv4,cv5,cv6,cv7,cv8,cv9,cv10) CONV_##cv1(arg1),CONV_##cv2(arg2),CONV_##cv3(arg3),CONV_##cv4(arg4),CONV_##cv5(arg5),CONV_##cv6(arg6),CONV_##cv7(arg7) #define CALLCONV8(cv1,cv2,cv3,cv4,cv5,cv6,cv7,cv8,cv9,cv10) CONV_##cv1(arg1),CONV_##cv2(arg2),CONV_##cv3(arg3),CONV_##cv4(arg4),CONV_##cv5(arg5),CONV_##cv6(arg6),CONV_##cv7(arg7),CONV_##cv8(arg8) #define CALLCONV9(cv1,cv2,cv3,cv4,cv5,cv6,cv7,cv8,cv9,cv10) CONV_##cv1(arg1),CONV_##cv2(arg2),CONV_##cv3(arg3),CONV_##cv4(arg4),CONV_##cv5(arg5),CONV_##cv6(arg6),CONV_##cv7(arg7),CONV_##cv8(arg8),CONV_##cv9(arg9) #define CALLCONV10(cv1,cv2,cv3,cv4,cv5,cv6,cv7,cv8,cv9,cv10) CONV_##cv1(arg1),CONV_##cv2(arg2),CONV_##cv3(arg3),CONV_##cv4(arg4),CONV_##cv5(arg5),CONV_##cv6(arg6),CONV_##cv7(arg7),CONV_##cv8(arg8),CONV_##cv9(arg9),CONV_##cv10(arg10) #define GL_FUNC_LOAD(_num_,_name_,_returntype_,targ1,targ2,targ3,targ4,targ5,targ6,targ7,targ8,targ9,targ10,_ver_) \ static _returntype_ (APIENTRY * fptr_gl##_name_)(PROTOPARAM##_num_(targ1,targ2,targ3,targ4,targ5,targ6,targ7,targ8,targ9,targ10)); \ static VALUE \ gl_##_name_(obj ARGLIST##_num_) \ VALUE obj ARGLIST##_num_; \ { \ RETDECL_##_returntype_ \ LOAD_GL_FUNC(gl##_name_,_ver_) \ RETSTAT_##_returntype_ fptr_gl##_name_(CALLCONV##_num_(targ1,targ2,targ3,targ4,targ5,targ6,targ7,targ8,targ9,targ10)); \ CHECK_GLERROR \ return RETCONV_##_returntype_(ret) ; \ } #define GL_FUNC_STATIC(_num_,_name_,_returntype_,targ1,targ2,targ3,targ4,targ5,targ6,targ7,targ8,targ9,targ10) \ static VALUE \ gl_##_name_(obj ARGLIST##_num_) \ VALUE obj ARGLIST##_num_; \ { \ RETDECL_##_returntype_ \ RETSTAT_##_returntype_ gl##_name_(CALLCONV##_num_(targ1,targ2,targ3,targ4,targ5,targ6,targ7,targ8,targ9,targ10)); \ CHECK_GLERROR \ return RETCONV_##_returntype_(ret) ; \ } #define GL_FUNC_LOAD_0(_name_,_returntype_,_ver_) GL_FUNC_LOAD(0, _name_,_returntype_,0,0,0,0,0,0,0,0,0,0,_ver_) #define GL_FUNC_LOAD_1(_name_,_returntype_,targ1,_ver_) GL_FUNC_LOAD(1, _name_,_returntype_,targ1,0,0,0,0,0,0,0,0,0,_ver_) #define GL_FUNC_LOAD_2(_name_,_returntype_,targ1,targ2,_ver_) GL_FUNC_LOAD(2, _name_,_returntype_,targ1,targ2,0,0,0,0,0,0,0,0,_ver_) #define GL_FUNC_LOAD_3(_name_,_returntype_,targ1,targ2,targ3,_ver_) GL_FUNC_LOAD(3, _name_,_returntype_,targ1,targ2,targ3,0,0,0,0,0,0,0,_ver_) #define GL_FUNC_LOAD_4(_name_,_returntype_,targ1,targ2,targ3,targ4,_ver_) GL_FUNC_LOAD(4, _name_,_returntype_,targ1,targ2,targ3,targ4,0,0,0,0,0,0,_ver_) #define GL_FUNC_LOAD_5(_name_,_returntype_,targ1,targ2,targ3,targ4,targ5,_ver_) GL_FUNC_LOAD(5, _name_,_returntype_,targ1,targ2,targ3,targ4,targ5,0,0,0,0,0,_ver_) #define GL_FUNC_LOAD_6(_name_,_returntype_,targ1,targ2,targ3,targ4,targ5,targ6,_ver_) GL_FUNC_LOAD(6, _name_,_returntype_,targ1,targ2,targ3,targ4,targ5,targ6,0,0,0,0,_ver_) #define GL_FUNC_LOAD_7(_name_,_returntype_,targ1,targ2,targ3,targ4,targ5,targ6,targ7,_ver_) GL_FUNC_LOAD(7, _name_,_returntype_,targ1,targ2,targ3,targ4,targ5,targ6,targ7,0,0,0,_ver_) #define GL_FUNC_LOAD_8(_name_,_returntype_,targ1,targ2,targ3,targ4,targ5,targ6,targ7,targ8,_ver_) GL_FUNC_LOAD(8, _name_,_returntype_,targ1,targ2,targ3,targ4,targ5,targ6,targ7,targ8,0,0,_ver_) #define GL_FUNC_LOAD_9(_name_,_returntype_,targ1,targ2,targ3,targ4,targ5,targ6,targ7,targ8,targ9,_ver_) GL_FUNC_LOAD(9, _name_,_returntype_,targ1,targ2,targ3,targ4,targ5,targ6,targ7,targ8,targ9,0,_ver_) #define GL_FUNC_LOAD_10(_name_,_returntype_,targ1,targ2,targ3,targ4,targ5,targ6,targ7,targ8,targ9,targ10,_ver_) GL_FUNC_LOAD(10, _name_,_returntype_,targ1,targ2,targ3,targ4,targ5,targ6,targ7,targ8,targ9,targ10,_ver_) #define GL_FUNC_STATIC_0(_name_,_returntype_) GL_FUNC_STATIC(0, _name_,_returntype_,0,0,0,0,0,0,0,0,0,0) #define GL_FUNC_STATIC_1(_name_,_returntype_,targ1) GL_FUNC_STATIC(1, _name_,_returntype_,targ1,0,0,0,0,0,0,0,0,0) #define GL_FUNC_STATIC_2(_name_,_returntype_,targ1,targ2) GL_FUNC_STATIC(2, _name_,_returntype_,targ1,targ2,0,0,0,0,0,0,0,0) #define GL_FUNC_STATIC_3(_name_,_returntype_,targ1,targ2,targ3) GL_FUNC_STATIC(3, _name_,_returntype_,targ1,targ2,targ3,0,0,0,0,0,0,0) #define GL_FUNC_STATIC_4(_name_,_returntype_,targ1,targ2,targ3,targ4) GL_FUNC_STATIC(4, _name_,_returntype_,targ1,targ2,targ3,targ4,0,0,0,0,0,0) #define GL_FUNC_STATIC_5(_name_,_returntype_,targ1,targ2,targ3,targ4,targ5) GL_FUNC_STATIC(5, _name_,_returntype_,targ1,targ2,targ3,targ4,targ5,0,0,0,0,0) #define GL_FUNC_STATIC_6(_name_,_returntype_,targ1,targ2,targ3,targ4,targ5,targ6) GL_FUNC_STATIC(6, _name_,_returntype_,targ1,targ2,targ3,targ4,targ5,targ6,0,0,0,0) #define GL_FUNC_STATIC_7(_name_,_returntype_,targ1,targ2,targ3,targ4,targ5,targ6,targ7) GL_FUNC_STATIC(7, _name_,_returntype_,targ1,targ2,targ3,targ4,targ5,targ6,targ7,0,0,0) #define GL_FUNC_STATIC_8(_name_,_returntype_,targ1,targ2,targ3,targ4,targ5,targ6,targ7,targ8) GL_FUNC_STATIC(8, _name_,_returntype_,targ1,targ2,targ3,targ4,targ5,targ6,targ7,targ8,0,0) #define GL_FUNC_STATIC_9(_name_,_returntype_,targ1,targ2,targ3,targ4,targ5,targ6,targ7,targ8,targ9) GL_FUNC_STATIC(9, _name_,_returntype_,targ1,targ2,targ3,targ4,targ5,targ6,targ7,targ8,targ9,0) #define GL_FUNC_STATIC_10(_name_,_returntype_,targ1,targ2,targ3,targ4,targ5,targ6,targ7,targ8,targ9,targ10_ver_) GL_FUNC_STATIC(10, _name_,_returntype_,targ1,targ2,targ3,targ4,targ5,targ6,targ7,targ8,targ9,targ10) /* Templates for glGen* and glDelete* */ #define GL_FUNC_GENOBJECTS_LOAD(_name_,_ver_) \ static void (APIENTRY * fptr_gl##_name_)(GLsizei,GLuint *); \ static VALUE gl_##_name_(VALUE obj,VALUE arg1) \ { \ GLsizei n; \ GLuint *objects; \ VALUE ret; \ unsigned int i; \ LOAD_GL_FUNC(gl##_name_,_ver_) \ n = CONV_GLsizei(arg1); \ objects = ALLOC_N(GLuint, n); \ fptr_gl##_name_(n,objects); \ ret = rb_ary_new2(n); \ for (i = 0; i < n; i++) \ rb_ary_push(ret, RETCONV_GLuint(objects[i])); \ xfree(objects); \ CHECK_GLERROR \ return ret; \ } #define GL_FUNC_GENOBJECTS(_name_) \ static VALUE gl_##_name_(VALUE obj,VALUE arg1) \ { \ GLsizei n; \ GLuint *objects; \ VALUE ret; \ unsigned int i; \ n = CONV_GLsizei(arg1); \ objects = ALLOC_N(GLuint, n); \ gl##_name_(n,objects); \ ret = rb_ary_new2(n); \ for (i = 0; i < n; i++) \ rb_ary_push(ret, RETCONV_GLuint(objects[i])); \ xfree(objects); \ CHECK_GLERROR \ return ret; \ } #define GL_FUNC_DELETEOBJECTS_LOAD(_name_,_ver_) \ static void (APIENTRY * fptr_gl##_name_)(GLsizei,const GLuint *); \ static VALUE gl_##_name_(VALUE obj,VALUE arg1) \ { \ GLsizei n; \ LOAD_GL_FUNC(gl##_name_,_ver_) \ if (TYPE(arg1)==T_ARRAY) { \ GLuint *objects; \ n = RARRAY_LEN(arg1); \ objects = ALLOC_N(GLuint,n); \ ary2cuint(arg1,objects,n); \ fptr_gl##_name_(n,objects); \ xfree(objects); \ } else { \ GLuint object; \ object = CONV_GLsizei(arg1); \ fptr_gl##_name_(1,&object); \ } \ CHECK_GLERROR \ return Qnil; \ } #define GL_FUNC_DELETEOBJECTS(_name_) \ static VALUE gl_##_name_(VALUE obj,VALUE arg1) \ { \ GLsizei n; \ if (TYPE(arg1)==T_ARRAY) { \ GLuint *objects; \ n = RARRAY_LEN(arg1); \ objects = ALLOC_N(GLuint,n); \ ary2cuint(arg1,objects,n); \ gl##_name_(n,objects); \ xfree(objects); \ } else { \ GLuint object; \ object = CONV_GLsizei(arg1); \ gl##_name_(1,&object); \ } \ CHECK_GLERROR \ return Qnil; \ } ruby-opengl-0.60.1.orig/ext/common/gl-types.h0000644000000000000000000000317511377006423017514 0ustar rootroot/* * Copyright (C) 2007 Jan Dvorak * * This program is distributed under the terms of the MIT license. * See the included MIT-LICENSE file for the terms of this license. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /* GL types - define if system GLheaders are not recent Note: must be included before gl-enums.h */ #if defined(_WIN32) && defined(__GNUC__) #include #elif defined(_WIN32) typedef __int64 int64_t; typedef unsigned __int64 uint64_t; #else #include #endif /* GL base */ #ifndef GL_VERSION_1_5 typedef ptrdiff_t GLintptr; typedef ptrdiff_t GLsizeiptr; #endif #ifndef GL_VERSION_2_0 typedef char GLchar; #endif /* new GL types introduced by ARB extensions */ #ifndef GL_ARB_half_float_pixel typedef unsigned short GLhalfARB; #endif #ifndef GL_ARB_shader_objects typedef char GLcharARB; typedef unsigned int GLhandleARB; #endif #ifndef GL_ARB_vertex_buffer_object typedef ptrdiff_t GLintptrARB; typedef ptrdiff_t GLsizeiptrARB; #endif /* new GL types introduced by other extensions */ #ifndef GL_NV_half_float typedef unsigned short GLhalfNV; #endif #ifndef GL_EXT_timer_query typedef int64_t GLint64EXT; typedef uint64_t GLuint64EXT; #endif ruby-opengl-0.60.1.orig/ext/common/gl-error.h0000644000000000000000000000161211377006423017473 0ustar rootroot/* * Copyright (C) 2007 Jan Dvorak * * This program is distributed under the terms of the MIT license. * See the included MIT-LICENSE file for the terms of this license. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ void gl_init_error(VALUE); extern VALUE error_checking; extern VALUE inside_begin_end; void check_for_glerror(void); #define CHECK_GLERROR if (error_checking==Qtrue && inside_begin_end==Qfalse) check_for_glerror(); ruby-opengl-0.60.1.orig/ext/common/common.h0000644000000000000000000002550611377006423017242 0ustar rootroot/* * Last edit by previous maintainer: * 2000/01/06 16:37:43, kusano * * Copyright (C) 1999 - 2005 Yoshi * Copyright (C) 2006 John M. Gabriele * Copyright (C) 2007 James Adam * Copyright (C) 2007 Jan Dvorak * * This program is distributed under the terms of the MIT license. * See the included MIT-LICENSE file for the terms of this license. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #ifndef _COMMON_H_ #define _COMMON_H_ #include #include #ifdef __APPLE__ #include #include #include #include #include #include #elif defined WIN32 #include #include #include #include #else #include #include #include #include #endif #include "gl-types.h" #include "gl-enums.h" #include "glu-enums.h" #include "gl-error.h" #include "funcdef.h" #include "conv.h" #ifndef APIENTRY #define APIENTRY #endif #ifndef CALLBACK #define CALLBACK #endif #ifndef GLUTCALLBACK #define GLUTCALLBACK #endif #ifdef WIN32 #define DLLEXPORT __declspec(dllexport) #else #define DLLEXPORT #endif /* */ /* at least GL_MAX_VERTEX_ATTRIBS - usually 16 or 32 on today's high-end cards */ #define _MAX_VERTEX_ATTRIBS 64 typedef struct RArray RArray; extern VALUE cProc; /* For now we do not honor pixel store modes, so we need to force them to defaults on each affected function call for correct size requirement calculations */ #define FORCE_PIXEL_STORE_MODE \ glPushClientAttrib(GL_CLIENT_PIXEL_STORE_BIT); \ glPixelStorei(GL_PACK_ALIGNMENT, 1); \ glPixelStorei(GL_PACK_SKIP_PIXELS, 0); \ glPixelStorei(GL_PACK_SKIP_ROWS, 0); \ glPixelStorei(GL_PACK_ROW_LENGTH, 0); \ glPixelStorei(GL_PACK_SKIP_IMAGES, 0); \ glPixelStorei(GL_PACK_IMAGE_HEIGHT, 0); \ if (CheckVersionExtension("GL_SGIS_texture4D")) { \ glPixelStorei(GL_PACK_SKIP_VOLUMES_SGIS, 0); \ glPixelStorei(GL_PACK_IMAGE_DEPTH_SGIS, 0); \ } #define RESTORE_PIXEL_STORE_MODE \ glPopClientAttrib(); GLboolean CheckVersionExtension(const char *name); GLint CheckBufferBinding(GLint buffer); /* -------------------------------------------------------------------- */ /* gets number of components for given format */ static inline int glformat_size(GLenum format) { switch(format) { case GL_COLOR_INDEX: case GL_RED: case GL_GREEN: case GL_BLUE: case GL_ALPHA: case GL_RED_INTEGER_EXT: case GL_GREEN_INTEGER_EXT: case GL_BLUE_INTEGER_EXT: case GL_ALPHA_INTEGER_EXT: case GL_STENCIL_INDEX: case GL_DEPTH_COMPONENT: case GL_LUMINANCE: case GL_LUMINANCE_INTEGER_EXT: return 1; case GL_LUMINANCE_ALPHA: case GL_LUMINANCE_ALPHA_INTEGER_EXT: case GL_422_EXT: case GL_422_REV_EXT: case GL_422_AVERAGE_EXT: case GL_422_REV_AVERAGE_EXT: case GL_YCRCB_422_SGIX: case GL_YCBCR_422_APPLE: case GL_YCBCR_MESA: case GL_DEPTH_STENCIL_NV: case GL_HILO_NV: case GL_DSDT_NV: case GL_DUDV_ATI: case GL_DU8DV8_ATI: case GL_FORMAT_SUBSAMPLE_24_24_OML: return 2; case GL_RGB: case GL_RGB_INTEGER_EXT: case GL_BGR_EXT: case GL_BGR_INTEGER_EXT: case GL_YCRCB_444_SGIX: case GL_DSDT_MAG_NV: case GL_FORMAT_SUBSAMPLE_244_244_OML: return 3; case GL_RGBA: case GL_RGBA_INTEGER_EXT: case GL_BGRA_EXT: case GL_BGRA_INTEGER_EXT: case GL_ABGR_EXT: case GL_CMYK_EXT: case GL_DSDT_MAG_VIB_NV: return 4; case GL_CMYKA_EXT: return 5; /* GL spec permits passing direct format size instead of enum (now obsolete) */ case 1: case 2: case 3: case 4: return format; default: rb_raise(rb_eArgError, "Unknown GL format enum %i",format); return -1; /* not reached */ } } /* computes unit (pixel) size for given type and format */ static inline int gltype_glformat_unit_size(GLenum type,GLenum format) { unsigned int format_size; format_size = glformat_size(format); switch(type) { case GL_BYTE: case GL_UNSIGNED_BYTE: case GL_BITMAP: return 1*format_size; case GL_SHORT: case GL_UNSIGNED_SHORT: case GL_HALF_FLOAT_ARB: return 2*format_size; case GL_INT: case GL_UNSIGNED_INT: case GL_FLOAT: return 4*format_size; /* in packed formats all components are packed into/unpacked from single datatype, so number of components(format_size) doesn't matter for total size calculation */ case GL_UNSIGNED_BYTE_3_3_2: case GL_UNSIGNED_BYTE_2_3_3_REV: return 1; case GL_UNSIGNED_SHORT_5_6_5: case GL_UNSIGNED_SHORT_5_6_5_REV: case GL_UNSIGNED_SHORT_4_4_4_4: case GL_UNSIGNED_SHORT_4_4_4_4_REV: case GL_UNSIGNED_SHORT_5_5_5_1: case GL_UNSIGNED_SHORT_1_5_5_5_REV: case GL_UNSIGNED_SHORT_8_8_APPLE: case GL_UNSIGNED_SHORT_8_8_REV_APPLE: return 2; case GL_UNSIGNED_INT_8_8_8_8: case GL_UNSIGNED_INT_8_8_8_8_REV: case GL_UNSIGNED_INT_10_10_10_2: case GL_UNSIGNED_INT_2_10_10_10_REV: case GL_UNSIGNED_INT_24_8_NV: case GL_UNSIGNED_INT_S8_S8_8_8_NV: case GL_UNSIGNED_INT_8_8_S8_S8_REV_NV: case GL_UNSIGNED_INT_10F_11F_11F_REV_EXT: case GL_UNSIGNED_INT_5_9_9_9_REV_EXT: case GL_FLOAT_32_UNSIGNED_INT_24_8_REV_NV: return 4; default: rb_raise(rb_eArgError, "Unknown GL type enum %i",type); return -1; /* not reached */ } } /* returns size(units) for given type of shader uniform var */ static inline int get_uniform_size(GLenum uniform_type) { int uniform_size = 0; switch (uniform_type) { case GL_FLOAT: case GL_INT: case GL_UNSIGNED_INT: case GL_BOOL: case GL_SAMPLER_1D: case GL_SAMPLER_2D: case GL_SAMPLER_3D: case GL_SAMPLER_CUBE: case GL_SAMPLER_1D_SHADOW: case GL_SAMPLER_2D_SHADOW: case GL_SAMPLER_2D_RECT_ARB: case GL_SAMPLER_2D_RECT_SHADOW_ARB: case GL_SAMPLER_1D_ARRAY_EXT: case GL_SAMPLER_2D_ARRAY_EXT: case GL_SAMPLER_BUFFER_EXT: case GL_SAMPLER_1D_ARRAY_SHADOW_EXT: case GL_SAMPLER_2D_ARRAY_SHADOW_EXT: case GL_SAMPLER_CUBE_SHADOW_EXT: case GL_INT_SAMPLER_1D_EXT: case GL_INT_SAMPLER_2D_EXT: case GL_INT_SAMPLER_3D_EXT: case GL_INT_SAMPLER_CUBE_EXT: case GL_INT_SAMPLER_2D_RECT_EXT: case GL_INT_SAMPLER_1D_ARRAY_EXT: case GL_INT_SAMPLER_2D_ARRAY_EXT: case GL_INT_SAMPLER_BUFFER_EXT: case GL_UNSIGNED_INT_SAMPLER_1D_EXT: case GL_UNSIGNED_INT_SAMPLER_2D_EXT: case GL_UNSIGNED_INT_SAMPLER_3D_EXT: case GL_UNSIGNED_INT_SAMPLER_CUBE_EXT: case GL_UNSIGNED_INT_SAMPLER_2D_RECT_EXT: case GL_UNSIGNED_INT_SAMPLER_1D_ARRAY_EXT: case GL_UNSIGNED_INT_SAMPLER_2D_ARRAY_EXT: case GL_UNSIGNED_INT_SAMPLER_BUFFER_EXT: uniform_size = 1; break; case GL_FLOAT_VEC2: case GL_INT_VEC2: case GL_UNSIGNED_INT_VEC2_EXT: case GL_BOOL_VEC2: uniform_size = 2; break; case GL_FLOAT_VEC3: case GL_INT_VEC3: case GL_UNSIGNED_INT_VEC3_EXT: case GL_BOOL_VEC3: uniform_size = 3; break; case GL_FLOAT_VEC4: case GL_INT_VEC4: case GL_UNSIGNED_INT_VEC4_EXT: case GL_BOOL_VEC4: case GL_FLOAT_MAT2: uniform_size = 4; break; case GL_FLOAT_MAT2x3: case GL_FLOAT_MAT3x2: uniform_size = 6; break; case GL_FLOAT_MAT2x4: case GL_FLOAT_MAT4x2: uniform_size = 8; break; case GL_FLOAT_MAT3: uniform_size = 9; break; case GL_FLOAT_MAT4x3: case GL_FLOAT_MAT3x4: uniform_size = 12; break; case GL_FLOAT_MAT4: uniform_size = 16; break; default: rb_raise(rb_eTypeError, "Unsupported uniform type '%i'",uniform_type); } return uniform_size; } static inline int GetDataSize(GLenum type,GLenum format,int num) { int size; int unit_size; unit_size = gltype_glformat_unit_size(type,format); if (type==GL_BITMAP) size = unit_size*(num/8); /* FIXME account for alignment */ else size = unit_size*num; return size; } /* Checks if data size of 'data' string confirms to passed format values */ /* 'num' is number of elements, each of size 'format' * 'type' */ static inline void CheckDataSize(GLenum type,GLenum format,int num,VALUE data) { int size; size = GetDataSize(type,format,num); if (RSTRING_LEN(data) < size) rb_raise(rb_eArgError, "Length of specified data doesn't correspond to format and type parameters passed. Calculated length: %i",size); } /* -------------------------------------------------------------------- */ static inline VALUE allocate_buffer_with_string( int size ) { return rb_str_new(NULL, size); } /* -------------------------------------------------------------------- */ static inline void *load_gl_function(const char *name,int raise) { void *func_ptr = NULL; #if defined(__APPLE__) static const struct mach_header* library = NULL; char* symbolName; NSSymbol symbol; if (library == NULL) library = NSAddImage("/System/Library/Frameworks/OpenGL.framework/Versions/Current/OpenGL",NSADDIMAGE_OPTION_RETURN_ON_ERROR); if (library == NULL) rb_raise(rb_eRuntimeError,"Can't load OpenGL library for dynamic loading"); /* prepend a '_' for the Unix C symbol mangling convention */ symbolName = ALLOC_N(char,strlen(name) + 2); symbolName[0] = '_'; strcpy(symbolName+1, name); symbol = NSLookupSymbolInImage(library,symbolName,NSLOOKUPSYMBOLINIMAGE_OPTION_BIND | NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR); xfree(symbolName); if (symbol == NULL) func_ptr = NULL; else func_ptr = NSAddressOfSymbol(symbol); #elif defined(WIN32) || defined(_WIN32) func_ptr = wglGetProcAddress((LPCSTR)name); #elif defined(GLX_VERSION_1_4) func_ptr = glXGetProcAddress((const GLubyte *)name); #else func_ptr = glXGetProcAddressARB((const GLubyte *)name); #endif if (func_ptr == NULL && raise == 1) rb_raise(rb_eNotImpError,"Function %s is not available on this system",name); return func_ptr; } static inline VALUE pack_array_or_pass_string(GLenum type,VALUE ary) { char *type_str; if (TYPE(ary)==T_STRING) return ary; Check_Type(ary,T_ARRAY); switch(type) { case GL_FLOAT: type_str = "f*"; break; case GL_DOUBLE: type_str = "d*"; break; case GL_BYTE: type_str = "c*"; break; case GL_SHORT: type_str = "s*"; break; case GL_INT: type_str = "i*"; break; case GL_UNSIGNED_BYTE: type_str = "C*"; break; case GL_UNSIGNED_SHORT: type_str = "S*"; break; case GL_UNSIGNED_INT: type_str = "I*"; break; default: rb_raise(rb_eTypeError,"Unknown type %i",type); return Qnil; /* not reached */ } return rb_funcall(ary,rb_intern("pack"),1,rb_str_new2(type_str)); } /* -------------------------------------------------------------------- */ #endif /* _COMMON_H_ */ ruby-opengl-0.60.1.orig/ext/common/glu-enums.h0000644000000000000000000002435011377006423017662 0ustar rootroot/* This file was genereated on Mon Feb 16 18:08:57 +0100 2009 source: http://oss.sgi.com/cgi-bin/cvsweb.cgi/~checkout~/projects/ogl-sample/main/doc/registry/specs/enumglu.spec */ #ifndef GLU_AUTO_LOAD_MATRIX #define GLU_AUTO_LOAD_MATRIX 100200 #endif #ifndef GLU_BEGIN #define GLU_BEGIN 100100 #endif #ifndef GLU_CCW #define GLU_CCW 100121 #endif #ifndef GLU_CULLING #define GLU_CULLING 100201 #endif #ifndef GLU_CW #define GLU_CW 100120 #endif #ifndef GLU_DISPLAY_MODE #define GLU_DISPLAY_MODE 100204 #endif #ifndef GLU_DOMAIN_DISTANCE #define GLU_DOMAIN_DISTANCE 100217 #endif #ifndef GLU_EDGE_FLAG #define GLU_EDGE_FLAG 100104 #endif #ifndef GLU_END #define GLU_END 100102 #endif #ifndef GLU_ERROR #define GLU_ERROR 100103 #endif #ifndef GLU_EXTENSIONS #define GLU_EXTENSIONS 100801 #endif #ifndef GLU_EXTERIOR #define GLU_EXTERIOR 100123 #endif #ifndef GLU_EXT_nurbs_tessellator #define GLU_EXT_nurbs_tessellator 1 #endif #ifndef GLU_EXT_object_space_tess #define GLU_EXT_object_space_tess 1 #endif #ifndef GLU_FILL #define GLU_FILL 100012 #endif #ifndef GLU_FLAT #define GLU_FLAT 100001 #endif #ifndef GLU_INSIDE #define GLU_INSIDE 100021 #endif #ifndef GLU_INTERIOR #define GLU_INTERIOR 100122 #endif #ifndef GLU_INVALID_ENUM #define GLU_INVALID_ENUM 100900 #endif #ifndef GLU_INVALID_OPERATION #define GLU_INVALID_OPERATION 100904 #endif #ifndef GLU_INVALID_VALUE #define GLU_INVALID_VALUE 100901 #endif #ifndef GLU_LAGRANGIAN_SGI #define GLU_LAGRANGIAN_SGI 100300 #endif #ifndef GLU_LINE #define GLU_LINE 100011 #endif #ifndef GLU_MAP1_TRIM_2 #define GLU_MAP1_TRIM_2 100210 #endif #ifndef GLU_MAP1_TRIM_3 #define GLU_MAP1_TRIM_3 100211 #endif #ifndef GLU_MITCHELL_NETRAVALI_SGI #define GLU_MITCHELL_NETRAVALI_SGI 100301 #endif #ifndef GLU_NONE #define GLU_NONE 100002 #endif #ifndef GLU_NURBS_BEGIN #define GLU_NURBS_BEGIN 100164 #endif #ifndef GLU_NURBS_BEGIN_DATA #define GLU_NURBS_BEGIN_DATA 100170 #endif #ifndef GLU_NURBS_BEGIN_DATA_EXT #define GLU_NURBS_BEGIN_DATA_EXT 100170 #endif #ifndef GLU_NURBS_BEGIN_EXT #define GLU_NURBS_BEGIN_EXT 100164 #endif #ifndef GLU_NURBS_COLOR #define GLU_NURBS_COLOR 100167 #endif #ifndef GLU_NURBS_COLOR_DATA #define GLU_NURBS_COLOR_DATA 100173 #endif #ifndef GLU_NURBS_COLOR_DATA_EXT #define GLU_NURBS_COLOR_DATA_EXT 100173 #endif #ifndef GLU_NURBS_COLOR_EXT #define GLU_NURBS_COLOR_EXT 100167 #endif #ifndef GLU_NURBS_END #define GLU_NURBS_END 100169 #endif #ifndef GLU_NURBS_END_DATA #define GLU_NURBS_END_DATA 100175 #endif #ifndef GLU_NURBS_END_DATA_EXT #define GLU_NURBS_END_DATA_EXT 100175 #endif #ifndef GLU_NURBS_END_EXT #define GLU_NURBS_END_EXT 100169 #endif #ifndef GLU_NURBS_ERROR #define GLU_NURBS_ERROR 100103 #endif #ifndef GLU_NURBS_ERROR1 #define GLU_NURBS_ERROR1 100251 #endif #ifndef GLU_NURBS_ERROR10 #define GLU_NURBS_ERROR10 100260 #endif #ifndef GLU_NURBS_ERROR11 #define GLU_NURBS_ERROR11 100261 #endif #ifndef GLU_NURBS_ERROR12 #define GLU_NURBS_ERROR12 100262 #endif #ifndef GLU_NURBS_ERROR13 #define GLU_NURBS_ERROR13 100263 #endif #ifndef GLU_NURBS_ERROR14 #define GLU_NURBS_ERROR14 100264 #endif #ifndef GLU_NURBS_ERROR15 #define GLU_NURBS_ERROR15 100265 #endif #ifndef GLU_NURBS_ERROR16 #define GLU_NURBS_ERROR16 100266 #endif #ifndef GLU_NURBS_ERROR17 #define GLU_NURBS_ERROR17 100267 #endif #ifndef GLU_NURBS_ERROR18 #define GLU_NURBS_ERROR18 100268 #endif #ifndef GLU_NURBS_ERROR19 #define GLU_NURBS_ERROR19 100269 #endif #ifndef GLU_NURBS_ERROR2 #define GLU_NURBS_ERROR2 100252 #endif #ifndef GLU_NURBS_ERROR20 #define GLU_NURBS_ERROR20 100270 #endif #ifndef GLU_NURBS_ERROR21 #define GLU_NURBS_ERROR21 100271 #endif #ifndef GLU_NURBS_ERROR22 #define GLU_NURBS_ERROR22 100272 #endif #ifndef GLU_NURBS_ERROR23 #define GLU_NURBS_ERROR23 100273 #endif #ifndef GLU_NURBS_ERROR24 #define GLU_NURBS_ERROR24 100274 #endif #ifndef GLU_NURBS_ERROR25 #define GLU_NURBS_ERROR25 100275 #endif #ifndef GLU_NURBS_ERROR26 #define GLU_NURBS_ERROR26 100276 #endif #ifndef GLU_NURBS_ERROR27 #define GLU_NURBS_ERROR27 100277 #endif #ifndef GLU_NURBS_ERROR28 #define GLU_NURBS_ERROR28 100278 #endif #ifndef GLU_NURBS_ERROR29 #define GLU_NURBS_ERROR29 100279 #endif #ifndef GLU_NURBS_ERROR3 #define GLU_NURBS_ERROR3 100253 #endif #ifndef GLU_NURBS_ERROR30 #define GLU_NURBS_ERROR30 100280 #endif #ifndef GLU_NURBS_ERROR31 #define GLU_NURBS_ERROR31 100281 #endif #ifndef GLU_NURBS_ERROR32 #define GLU_NURBS_ERROR32 100282 #endif #ifndef GLU_NURBS_ERROR33 #define GLU_NURBS_ERROR33 100283 #endif #ifndef GLU_NURBS_ERROR34 #define GLU_NURBS_ERROR34 100284 #endif #ifndef GLU_NURBS_ERROR35 #define GLU_NURBS_ERROR35 100285 #endif #ifndef GLU_NURBS_ERROR36 #define GLU_NURBS_ERROR36 100286 #endif #ifndef GLU_NURBS_ERROR37 #define GLU_NURBS_ERROR37 100287 #endif #ifndef GLU_NURBS_ERROR4 #define GLU_NURBS_ERROR4 100254 #endif #ifndef GLU_NURBS_ERROR5 #define GLU_NURBS_ERROR5 100255 #endif #ifndef GLU_NURBS_ERROR6 #define GLU_NURBS_ERROR6 100256 #endif #ifndef GLU_NURBS_ERROR7 #define GLU_NURBS_ERROR7 100257 #endif #ifndef GLU_NURBS_ERROR8 #define GLU_NURBS_ERROR8 100258 #endif #ifndef GLU_NURBS_ERROR9 #define GLU_NURBS_ERROR9 100259 #endif #ifndef GLU_NURBS_MODE #define GLU_NURBS_MODE 100160 #endif #ifndef GLU_NURBS_MODE_EXT #define GLU_NURBS_MODE_EXT 100160 #endif #ifndef GLU_NURBS_NORMAL #define GLU_NURBS_NORMAL 100166 #endif #ifndef GLU_NURBS_NORMAL_DATA #define GLU_NURBS_NORMAL_DATA 100172 #endif #ifndef GLU_NURBS_NORMAL_DATA_EXT #define GLU_NURBS_NORMAL_DATA_EXT 100172 #endif #ifndef GLU_NURBS_NORMAL_EXT #define GLU_NURBS_NORMAL_EXT 100166 #endif #ifndef GLU_NURBS_RENDERER #define GLU_NURBS_RENDERER 100162 #endif #ifndef GLU_NURBS_RENDERER_EXT #define GLU_NURBS_RENDERER_EXT 100162 #endif #ifndef GLU_NURBS_TESSELLATOR #define GLU_NURBS_TESSELLATOR 100161 #endif #ifndef GLU_NURBS_TESSELLATOR_EXT #define GLU_NURBS_TESSELLATOR_EXT 100161 #endif #ifndef GLU_NURBS_TEXTURE_COORD #define GLU_NURBS_TEXTURE_COORD 100168 #endif #ifndef GLU_NURBS_TEXTURE_COORD_DATA #define GLU_NURBS_TEXTURE_COORD_DATA 100174 #endif #ifndef GLU_NURBS_TEXTURE_COORD_DATA_EXT #define GLU_NURBS_TEXTURE_COORD_DATA_EXT 100174 #endif #ifndef GLU_NURBS_TEXTURE_COORD_EXT #define GLU_NURBS_TEXTURE_COORD_EXT 100168 #endif #ifndef GLU_NURBS_VERTEX #define GLU_NURBS_VERTEX 100165 #endif #ifndef GLU_NURBS_VERTEX_DATA #define GLU_NURBS_VERTEX_DATA 100171 #endif #ifndef GLU_NURBS_VERTEX_DATA_EXT #define GLU_NURBS_VERTEX_DATA_EXT 100171 #endif #ifndef GLU_NURBS_VERTEX_EXT #define GLU_NURBS_VERTEX_EXT 100165 #endif #ifndef GLU_OBJECT_PARAMETRIC_ERROR #define GLU_OBJECT_PARAMETRIC_ERROR 100208 #endif #ifndef GLU_OBJECT_PARAMETRIC_ERROR_EXT #define GLU_OBJECT_PARAMETRIC_ERROR_EXT 100208 #endif #ifndef GLU_OBJECT_PATH_LENGTH #define GLU_OBJECT_PATH_LENGTH 100209 #endif #ifndef GLU_OBJECT_PATH_LENGTH_EXT #define GLU_OBJECT_PATH_LENGTH_EXT 100209 #endif #ifndef GLU_OUTLINE_PATCH #define GLU_OUTLINE_PATCH 100241 #endif #ifndef GLU_OUTLINE_POLYGON #define GLU_OUTLINE_POLYGON 100240 #endif #ifndef GLU_OUTSIDE #define GLU_OUTSIDE 100020 #endif #ifndef GLU_OUT_OF_MEMORY #define GLU_OUT_OF_MEMORY 100902 #endif #ifndef GLU_PARAMETRIC_ERROR #define GLU_PARAMETRIC_ERROR 100216 #endif #ifndef GLU_PARAMETRIC_TOLERANCE #define GLU_PARAMETRIC_TOLERANCE 100202 #endif #ifndef GLU_PATH_LENGTH #define GLU_PATH_LENGTH 100215 #endif #ifndef GLU_POINT #define GLU_POINT 100010 #endif #ifndef GLU_SAMPLING_METHOD #define GLU_SAMPLING_METHOD 100205 #endif #ifndef GLU_SAMPLING_TOLERANCE #define GLU_SAMPLING_TOLERANCE 100203 #endif #ifndef GLU_SILHOUETTE #define GLU_SILHOUETTE 100013 #endif #ifndef GLU_SMOOTH #define GLU_SMOOTH 100000 #endif #ifndef GLU_TESS_BEGIN #define GLU_TESS_BEGIN 100100 #endif #ifndef GLU_TESS_BEGIN_DATA #define GLU_TESS_BEGIN_DATA 100106 #endif #ifndef GLU_TESS_BOUNDARY_ONLY #define GLU_TESS_BOUNDARY_ONLY 100141 #endif #ifndef GLU_TESS_COMBINE #define GLU_TESS_COMBINE 100105 #endif #ifndef GLU_TESS_COMBINE_DATA #define GLU_TESS_COMBINE_DATA 100111 #endif #ifndef GLU_TESS_COORD_TOO_LARGE #define GLU_TESS_COORD_TOO_LARGE 100155 #endif #ifndef GLU_TESS_EDGE_FLAG #define GLU_TESS_EDGE_FLAG 100104 #endif #ifndef GLU_TESS_EDGE_FLAG_DATA #define GLU_TESS_EDGE_FLAG_DATA 100110 #endif #ifndef GLU_TESS_END #define GLU_TESS_END 100102 #endif #ifndef GLU_TESS_END_DATA #define GLU_TESS_END_DATA 100108 #endif #ifndef GLU_TESS_ERROR #define GLU_TESS_ERROR 100103 #endif #ifndef GLU_TESS_ERROR1 #define GLU_TESS_ERROR1 100151 #endif #ifndef GLU_TESS_ERROR2 #define GLU_TESS_ERROR2 100152 #endif #ifndef GLU_TESS_ERROR3 #define GLU_TESS_ERROR3 100153 #endif #ifndef GLU_TESS_ERROR4 #define GLU_TESS_ERROR4 100154 #endif #ifndef GLU_TESS_ERROR5 #define GLU_TESS_ERROR5 100155 #endif #ifndef GLU_TESS_ERROR6 #define GLU_TESS_ERROR6 100156 #endif #ifndef GLU_TESS_ERROR7 #define GLU_TESS_ERROR7 100157 #endif #ifndef GLU_TESS_ERROR8 #define GLU_TESS_ERROR8 100158 #endif #ifndef GLU_TESS_ERROR_DATA #define GLU_TESS_ERROR_DATA 100109 #endif #ifndef GLU_TESS_MISSING_BEGIN_CONTOUR #define GLU_TESS_MISSING_BEGIN_CONTOUR 100152 #endif #ifndef GLU_TESS_MISSING_BEGIN_POLYGON #define GLU_TESS_MISSING_BEGIN_POLYGON 100151 #endif #ifndef GLU_TESS_MISSING_END_CONTOUR #define GLU_TESS_MISSING_END_CONTOUR 100154 #endif #ifndef GLU_TESS_MISSING_END_POLYGON #define GLU_TESS_MISSING_END_POLYGON 100153 #endif #ifndef GLU_TESS_NEED_COMBINE_CALLBACK #define GLU_TESS_NEED_COMBINE_CALLBACK 100156 #endif #ifndef GLU_TESS_TOLERANCE #define GLU_TESS_TOLERANCE 100142 #endif #ifndef GLU_TESS_VERTEX #define GLU_TESS_VERTEX 100101 #endif #ifndef GLU_TESS_VERTEX_DATA #define GLU_TESS_VERTEX_DATA 100107 #endif #ifndef GLU_TESS_WINDING_ABS_GEQ_TWO #define GLU_TESS_WINDING_ABS_GEQ_TWO 100134 #endif #ifndef GLU_TESS_WINDING_NEGATIVE #define GLU_TESS_WINDING_NEGATIVE 100133 #endif #ifndef GLU_TESS_WINDING_NONZERO #define GLU_TESS_WINDING_NONZERO 100131 #endif #ifndef GLU_TESS_WINDING_ODD #define GLU_TESS_WINDING_ODD 100130 #endif #ifndef GLU_TESS_WINDING_POSITIVE #define GLU_TESS_WINDING_POSITIVE 100132 #endif #ifndef GLU_TESS_WINDING_RULE #define GLU_TESS_WINDING_RULE 100140 #endif #ifndef GLU_UNKNOWN #define GLU_UNKNOWN 100124 #endif #ifndef GLU_U_STEP #define GLU_U_STEP 100206 #endif #ifndef GLU_VERSION #define GLU_VERSION 100800 #endif #ifndef GLU_VERSION_1_1 #define GLU_VERSION_1_1 1 #endif #ifndef GLU_VERSION_1_2 #define GLU_VERSION_1_2 1 #endif #ifndef GLU_VERSION_1_3 #define GLU_VERSION_1_3 1 #endif #ifndef GLU_VERTEX #define GLU_VERTEX 100101 #endif #ifndef GLU_V_STEP #define GLU_V_STEP 100207 #endif ruby-opengl-0.60.1.orig/ext/common/conv.h0000644000000000000000000001634711377006423016722 0ustar rootroot/* * Copyright (C) 2007 Jan Dvorak * * This program is distributed under the terms of the MIT license. * See the included MIT-LICENSE file for the terms of this license. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /* Functions and macros for datatype conversion between Ruby and C */ /* Fast inline conversion functions as a replacement for the ones in libruby. FIXNUM_P is simple logical AND check so it comes first, TYPE() is simple function, and specified in header file so it can be inlined. For conversion, FIX2LONG is simple right shift, and RFLOAT()-> just pointer dereference. For converting Fixnum and Float types (which accounts for 99.9% of things you would want to pass to OpenGL), there is large performance boost as result. Also ruby 'true' and 'false' are converted to GL_TRUE/GL_FALSE for compatibility, and finally, we fallback to library functions for any other data types (and error handling). */ #if RUBY_VERSION <190 #define FLOAT_VAL_ACCESS(val) RFLOAT(val)->value #else #define FLOAT_VAL_ACCESS(val) RFLOAT(val)->float_value #endif #define FASTCONV(_name_,_type_,_convfix_,_convfallback_) \ static inline _type_ _name_(val) \ VALUE val; \ { \ if (FIXNUM_P(val)) \ return (_type_) _convfix_(val); \ \ if (TYPE(val) == T_FLOAT) \ return (_type_)FLOAT_VAL_ACCESS(val); \ \ if ((val) == Qtrue) \ return (_type_)(GL_TRUE); \ \ if ((val) == Qfalse || (val) == Qnil) \ return (_type_)(GL_FALSE); \ \ return (_convfallback_(val)); \ } FASTCONV(num2double,double,FIX2LONG,rb_num2dbl) #if SIZEOF_INT < SIZEOF_LONG /* For 64bit platforms with LP64 mode */ FASTCONV(num2int,long,FIX2LONG,rb_num2int) FASTCONV(num2uint,unsigned long,FIX2ULONG,rb_num2uint) #else /* All other platforms */ FASTCONV(num2int,long,FIX2LONG,(int)NUM2LONG) FASTCONV(num2uint,unsigned long,FIX2ULONG,(unsigned int)NUM2ULONG) #endif #undef NUM2DBL #define NUM2DBL num2double #undef NUM2INT #define NUM2INT num2int #undef NUM2UINT #define NUM2UINT num2uint #undef FASTCONV /* For conversion between ruby and GL boolean values */ #define GLBOOL2RUBY(x) (x)==GL_TRUE? Qtrue :( (x)==GL_FALSE? Qfalse : INT2NUM((x))) #define RUBYBOOL2GL(x) (x)==Qtrue? GL_TRUE : GL_FALSE #define cond_GLBOOL2RUBY_FUNC(_name_,_type_,_conv_) \ static inline VALUE _name_(GLenum pname,_type_ value) \ { \ switch (pname) { \ case GL_DELETE_STATUS: \ case GL_LINK_STATUS: \ case GL_VALIDATE_STATUS: \ case GL_COMPILE_STATUS: \ case GL_MINMAX_SINK: \ case GL_HISTOGRAM_SINK: \ case GL_COORD_REPLACE: \ case GL_TEXTURE_COMPRESSED: \ case GL_GENERATE_MIPMAP: \ case GL_TEXTURE_RESIDENT: \ case GL_BUFFER_MAPPED: \ case GL_VERTEX_ATTRIB_ARRAY_NORMALIZED: \ case GL_VERTEX_ATTRIB_ARRAY_ENABLED: \ case GL_QUERY_RESULT_AVAILABLE: \ case GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB: \ case GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT: \ case GL_FENCE_STATUS_NV: \ case GL_TEXTURE_FLOAT_COMPONENTS_NV: \ case GL_SHADER_CONSISTENT_NV: \ case GL_TEXTURE_COMPARE_SGIX: \ case GLU_TESS_BOUNDARY_ONLY: \ case GLU_CULLING: \ case GLU_AUTO_LOAD_MATRIX: \ return GLBOOL2RUBY(value); \ default: \ return _conv_(value); \ } \ } cond_GLBOOL2RUBY_FUNC(cond_GLBOOL2RUBY,GLint,INT2NUM) cond_GLBOOL2RUBY_FUNC(cond_GLBOOL2RUBY_U,GLuint,UINT2NUM) cond_GLBOOL2RUBY_FUNC(cond_GLBOOL2RUBY_LL,GLint64EXT,LL2NUM) cond_GLBOOL2RUBY_FUNC(cond_GLBOOL2RUBY_ULL,GLuint64EXT,ULL2NUM) cond_GLBOOL2RUBY_FUNC(cond_GLBOOL2RUBY_F,GLfloat,rb_float_new) cond_GLBOOL2RUBY_FUNC(cond_GLBOOL2RUBY_D,GLdouble,rb_float_new) /* For conversion between ruby array (or object that can be converted to array) and C array. The C array has to be preallocated by calling function. */ #define ARY2CTYPE(_type_,_convert_) \ static inline int ary2c##_type_( arg, cary, maxlen ) \ VALUE arg; \ GL##_type_ cary[]; \ int maxlen; \ { \ int i; \ struct RArray* ary; \ ary = RARRAY(rb_Array(arg)); \ if (maxlen < 1) \ maxlen = RARRAY_LEN(ary); \ else \ maxlen = maxlen < RARRAY_LEN(ary) ? maxlen : RARRAY_LEN(ary); \ for (i=0; i < maxlen; i++) \ cary[i] = (GL##_type_)_convert_(rb_ary_entry((VALUE)ary,i)); \ return i; \ } ARY2CTYPE(int,NUM2INT) ARY2CTYPE(uint,NUM2UINT) ARY2CTYPE(byte,NUM2INT) ARY2CTYPE(ubyte,NUM2INT) ARY2CTYPE(short,NUM2INT) ARY2CTYPE(ushort,NUM2INT) ARY2CTYPE(boolean,NUM2INT) ARY2CTYPE(float,NUM2DBL) ARY2CTYPE(double,NUM2DBL) #define ary2cflt ary2cfloat #define ary2cdbl ary2cdouble #undef ARY2CTYPE /* Converts either array or object responding to #to_a to C-style array */ #define ARY2CMAT(_type_) \ static inline void ary2cmat##_type_(rary, cary, cols, rows, count) \ VALUE rary; \ _type_ cary[]; \ int cols,rows; \ { \ int i; \ \ rary = rb_Array(rary); \ rary = rb_funcall(rary,rb_intern("flatten"),0); \ \ if (RARRAY_LEN(rary) != cols*rows) \ rb_raise(rb_eArgError, "passed array/matrix must have %i*%i elements",cols,rows); \ \ for (i=0; i < cols*rows; i++) \ cary[i] = (_type_) NUM2DBL(rb_ary_entry(rary,i)); \ } ARY2CMAT(double) ARY2CMAT(float) #undef ARY2CMAT #define ARY2CMATCNT(_type_) \ static inline void ary2cmat##_type_##count(rary, cary, cols, rows) \ VALUE rary; \ _type_ cary[]; \ int cols,rows; \ { \ int i; \ \ rary = rb_Array(rary); \ rary = rb_funcall(rary,rb_intern("flatten"),0); \ \ if (RARRAY_LEN(rary)<1 || (RARRAY_LEN(rary) % (cols*rows) != 0)) {\ xfree(cary); \ rb_raise(rb_eArgError, "passed array/matrix must conatain n x (%i*%i) elements",cols,rows); \ } \ \ for (i=0; i < RARRAY_LEN(rary); i++) \ cary[i] = (_type_) NUM2DBL(rb_ary_entry(rary,i)); \ } ARY2CMATCNT(double) ARY2CMATCNT(float) #undef ARY2CMATCNT #define EMPTY #define FREE(_x_) xfree(_x_); #define RET_ARRAY_OR_SINGLE(_size_,_conv_,_params_) RET_ARRAY_OR_SINGLE_FUNC(_size_,_conv_,_params_,EMPTY) #define RET_ARRAY_OR_SINGLE_FREE(_size_,_conv_,_params_) RET_ARRAY_OR_SINGLE_FUNC(_size_,_conv_,_params_,FREE(_params_)) #define RET_ARRAY_OR_SINGLE_FUNC(_size_,_conv_,_params_,_extra_) \ { \ int iter; \ VALUE return_array; \ if (_size_ == 1) { \ return_array = _conv_(_params_[0]); \ } else { \ return_array = rb_ary_new2(_size_); \ for(iter=0;iter<_size_;iter++) \ rb_ary_push(return_array, _conv_(_params_[iter])); \ } \ _extra_ \ CHECK_GLERROR \ return return_array; \ } #define RET_ARRAY_OR_SINGLE_BOOL(_size_,_conv_,_enum_,_params_) RET_ARRAY_OR_SINGLE_BOOL_FUNC(_size_,_conv_,_enum_,_params_,EMPTY) #define RET_ARRAY_OR_SINGLE_BOOL_FREE(_size_,_conv_,_enum_,_params_) RET_ARRAY_OR_SINGLE_BOOL_FUNC(_size_,_conv_,_enum_,_params_,FREE(_params_)) #define RET_ARRAY_OR_SINGLE_BOOL_FUNC(_size_,_conv_,_enum_,_params_,_extra_) \ { \ int iter; \ VALUE return_array; \ if (_size_ == 1) { \ return_array = _conv_(_enum_,_params_[0]); \ } else { \ return_array = rb_ary_new2(_size_); \ for(iter=0;iter<_size_;iter++) \ rb_ary_push(return_array, _conv_(_enum_,_params_[iter])); \ } \ _extra_ \ CHECK_GLERROR \ return return_array; \ } ruby-opengl-0.60.1.orig/ext/common/gl-enums.h0000644000000000000000000076050611377006423017507 0ustar rootroot/* This file was genereated on Mon Feb 16 18:08:56 +0100 2009 source: http://www.opengl.org/registry/api/enum.spec source: http://www.opengl.org/registry/api/enumext.spec */ #ifndef GL_1PASS_EXT #define GL_1PASS_EXT 0x80A1 #endif #ifndef GL_1PASS_SGIS #define GL_1PASS_SGIS 0x80A1 #endif #ifndef GL_2D #define GL_2D 0x0600 #endif #ifndef GL_2PASS_0_EXT #define GL_2PASS_0_EXT 0x80A2 #endif #ifndef GL_2PASS_0_SGIS #define GL_2PASS_0_SGIS 0x80A2 #endif #ifndef GL_2PASS_1_EXT #define GL_2PASS_1_EXT 0x80A3 #endif #ifndef GL_2PASS_1_SGIS #define GL_2PASS_1_SGIS 0x80A3 #endif #ifndef GL_2X_BIT_ATI #define GL_2X_BIT_ATI 0x00000001 #endif #ifndef GL_2_BYTES #define GL_2_BYTES 0x1407 #endif #ifndef GL_3D #define GL_3D 0x0601 #endif #ifndef GL_3D_COLOR #define GL_3D_COLOR 0x0602 #endif #ifndef GL_3D_COLOR_TEXTURE #define GL_3D_COLOR_TEXTURE 0x0603 #endif #ifndef GL_3_BYTES #define GL_3_BYTES 0x1408 #endif #ifndef GL_422_AVERAGE_EXT #define GL_422_AVERAGE_EXT 0x80CE #endif #ifndef GL_422_EXT #define GL_422_EXT 0x80CC #endif #ifndef GL_422_REV_AVERAGE_EXT #define GL_422_REV_AVERAGE_EXT 0x80CF #endif #ifndef GL_422_REV_EXT #define GL_422_REV_EXT 0x80CD #endif #ifndef GL_4D_COLOR_TEXTURE #define GL_4D_COLOR_TEXTURE 0x0604 #endif #ifndef GL_4PASS_0_EXT #define GL_4PASS_0_EXT 0x80A4 #endif #ifndef GL_4PASS_0_SGIS #define GL_4PASS_0_SGIS 0x80A4 #endif #ifndef GL_4PASS_1_EXT #define GL_4PASS_1_EXT 0x80A5 #endif #ifndef GL_4PASS_1_SGIS #define GL_4PASS_1_SGIS 0x80A5 #endif #ifndef GL_4PASS_2_EXT #define GL_4PASS_2_EXT 0x80A6 #endif #ifndef GL_4PASS_2_SGIS #define GL_4PASS_2_SGIS 0x80A6 #endif #ifndef GL_4PASS_3_EXT #define GL_4PASS_3_EXT 0x80A7 #endif #ifndef GL_4PASS_3_SGIS #define GL_4PASS_3_SGIS 0x80A7 #endif #ifndef GL_4X_BIT_ATI #define GL_4X_BIT_ATI 0x00000002 #endif #ifndef GL_4_BYTES #define GL_4_BYTES 0x1409 #endif #ifndef GL_8X_BIT_ATI #define GL_8X_BIT_ATI 0x00000004 #endif #ifndef GL_ABGR_EXT #define GL_ABGR_EXT 0x8000 #endif #ifndef GL_ACCUM #define GL_ACCUM 0x0100 #endif #ifndef GL_ACCUM_ALPHA_BITS #define GL_ACCUM_ALPHA_BITS 0x0D5B #endif #ifndef GL_ACCUM_BLUE_BITS #define GL_ACCUM_BLUE_BITS 0x0D5A #endif #ifndef GL_ACCUM_BUFFER_BIT #define GL_ACCUM_BUFFER_BIT 0x00000200 #endif #ifndef GL_ACCUM_CLEAR_VALUE #define GL_ACCUM_CLEAR_VALUE 0x0B80 #endif #ifndef GL_ACCUM_GREEN_BITS #define GL_ACCUM_GREEN_BITS 0x0D59 #endif #ifndef GL_ACCUM_RED_BITS #define GL_ACCUM_RED_BITS 0x0D58 #endif #ifndef GL_ACTIVE_ATTRIBUTES #define GL_ACTIVE_ATTRIBUTES 0x8B89 #endif #ifndef GL_ACTIVE_ATTRIBUTE_MAX_LENGTH #define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A #endif #ifndef GL_ACTIVE_STENCIL_FACE_EXT #define GL_ACTIVE_STENCIL_FACE_EXT 0x8911 #endif #ifndef GL_ACTIVE_TEXTURE #define GL_ACTIVE_TEXTURE 0x84E0 #endif #ifndef GL_ACTIVE_TEXTURE_ARB #define GL_ACTIVE_TEXTURE_ARB 0x84E0 #endif #ifndef GL_ACTIVE_UNIFORMS #define GL_ACTIVE_UNIFORMS 0x8B86 #endif #ifndef GL_ACTIVE_UNIFORM_MAX_LENGTH #define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87 #endif #ifndef GL_ACTIVE_VARYINGS_NV #define GL_ACTIVE_VARYINGS_NV 0x8C81 #endif #ifndef GL_ACTIVE_VARYING_MAX_LENGTH_NV #define GL_ACTIVE_VARYING_MAX_LENGTH_NV 0x8C82 #endif #ifndef GL_ACTIVE_VERTEX_UNITS_ARB #define GL_ACTIVE_VERTEX_UNITS_ARB 0x86A5 #endif #ifndef GL_ADD #define GL_ADD 0x0104 #endif #ifndef GL_ADD_ATI #define GL_ADD_ATI 0x8963 #endif #ifndef GL_ADD_SIGNED #define GL_ADD_SIGNED 0x8574 #endif #ifndef GL_ADD_SIGNED_ARB #define GL_ADD_SIGNED_ARB 0x8574 #endif #ifndef GL_ADD_SIGNED_EXT #define GL_ADD_SIGNED_EXT 0x8574 #endif #ifndef GL_ALIASED_LINE_WIDTH_RANGE #define GL_ALIASED_LINE_WIDTH_RANGE 0x846E #endif #ifndef GL_ALIASED_POINT_SIZE_RANGE #define GL_ALIASED_POINT_SIZE_RANGE 0x846D #endif #ifndef GL_ALLOW_DRAW_FRG_HINT_PGI #define GL_ALLOW_DRAW_FRG_HINT_PGI 0x1A210 #endif #ifndef GL_ALLOW_DRAW_MEM_HINT_PGI #define GL_ALLOW_DRAW_MEM_HINT_PGI 0x1A211 #endif #ifndef GL_ALLOW_DRAW_OBJ_HINT_PGI #define GL_ALLOW_DRAW_OBJ_HINT_PGI 0x1A20E #endif #ifndef GL_ALLOW_DRAW_WIN_HINT_PGI #define GL_ALLOW_DRAW_WIN_HINT_PGI 0x1A20F #endif #ifndef GL_ALL_ATTRIB_BITS #define GL_ALL_ATTRIB_BITS 0xFFFFFFFF #endif #ifndef GL_ALL_COMPLETED_NV #define GL_ALL_COMPLETED_NV 0x84F2 #endif #ifndef GL_ALPHA #define GL_ALPHA 0x1906 #endif #ifndef GL_ALPHA12 #define GL_ALPHA12 0x803D #endif #ifndef GL_ALPHA12_EXT #define GL_ALPHA12_EXT 0x803D #endif #ifndef GL_ALPHA16 #define GL_ALPHA16 0x803E #endif #ifndef GL_ALPHA16F_ARB #define GL_ALPHA16F_ARB 0x881C #endif #ifndef GL_ALPHA16I_EXT #define GL_ALPHA16I_EXT 0x8D8A #endif #ifndef GL_ALPHA16UI_EXT #define GL_ALPHA16UI_EXT 0x8D78 #endif #ifndef GL_ALPHA16_EXT #define GL_ALPHA16_EXT 0x803E #endif #ifndef GL_ALPHA32F_ARB #define GL_ALPHA32F_ARB 0x8816 #endif #ifndef GL_ALPHA32I_EXT #define GL_ALPHA32I_EXT 0x8D84 #endif #ifndef GL_ALPHA32UI_EXT #define GL_ALPHA32UI_EXT 0x8D72 #endif #ifndef GL_ALPHA4 #define GL_ALPHA4 0x803B #endif #ifndef GL_ALPHA4_EXT #define GL_ALPHA4_EXT 0x803B #endif #ifndef GL_ALPHA8 #define GL_ALPHA8 0x803C #endif #ifndef GL_ALPHA8I_EXT #define GL_ALPHA8I_EXT 0x8D90 #endif #ifndef GL_ALPHA8UI_EXT #define GL_ALPHA8UI_EXT 0x8D7E #endif #ifndef GL_ALPHA8_EXT #define GL_ALPHA8_EXT 0x803C #endif #ifndef GL_ALPHA_BIAS #define GL_ALPHA_BIAS 0x0D1D #endif #ifndef GL_ALPHA_BITS #define GL_ALPHA_BITS 0x0D55 #endif #ifndef GL_ALPHA_FLOAT16_ATI #define GL_ALPHA_FLOAT16_ATI 0x881C #endif #ifndef GL_ALPHA_FLOAT32_ATI #define GL_ALPHA_FLOAT32_ATI 0x8816 #endif #ifndef GL_ALPHA_INTEGER #define GL_ALPHA_INTEGER 0x8D97 #endif #ifndef GL_ALPHA_INTEGER_EXT #define GL_ALPHA_INTEGER_EXT 0x8D97 #endif #ifndef GL_ALPHA_MAX_CLAMP_INGR #define GL_ALPHA_MAX_CLAMP_INGR 0x8567 #endif #ifndef GL_ALPHA_MAX_SGIX #define GL_ALPHA_MAX_SGIX 0x8321 #endif #ifndef GL_ALPHA_MIN_CLAMP_INGR #define GL_ALPHA_MIN_CLAMP_INGR 0x8563 #endif #ifndef GL_ALPHA_MIN_SGIX #define GL_ALPHA_MIN_SGIX 0x8320 #endif #ifndef GL_ALPHA_SCALE #define GL_ALPHA_SCALE 0x0D1C #endif #ifndef GL_ALPHA_TEST #define GL_ALPHA_TEST 0x0BC0 #endif #ifndef GL_ALPHA_TEST_FUNC #define GL_ALPHA_TEST_FUNC 0x0BC1 #endif #ifndef GL_ALPHA_TEST_REF #define GL_ALPHA_TEST_REF 0x0BC2 #endif #ifndef GL_ALWAYS #define GL_ALWAYS 0x0207 #endif #ifndef GL_ALWAYS_FAST_HINT_PGI #define GL_ALWAYS_FAST_HINT_PGI 0x1A20C #endif #ifndef GL_ALWAYS_SOFT_HINT_PGI #define GL_ALWAYS_SOFT_HINT_PGI 0x1A20D #endif #ifndef GL_AMBIENT #define GL_AMBIENT 0x1200 #endif #ifndef GL_AMBIENT_AND_DIFFUSE #define GL_AMBIENT_AND_DIFFUSE 0x1602 #endif #ifndef GL_AND #define GL_AND 0x1501 #endif #ifndef GL_AND_INVERTED #define GL_AND_INVERTED 0x1504 #endif #ifndef GL_AND_REVERSE #define GL_AND_REVERSE 0x1502 #endif #ifndef GL_ARB_imaging #define GL_ARB_imaging 1 #endif #ifndef GL_ARRAY_BUFFER #define GL_ARRAY_BUFFER 0x8892 #endif #ifndef GL_ARRAY_BUFFER_ARB #define GL_ARRAY_BUFFER_ARB 0x8892 #endif #ifndef GL_ARRAY_BUFFER_BINDING #define GL_ARRAY_BUFFER_BINDING 0x8894 #endif #ifndef GL_ARRAY_BUFFER_BINDING_ARB #define GL_ARRAY_BUFFER_BINDING_ARB 0x8894 #endif #ifndef GL_ARRAY_ELEMENT_LOCK_COUNT_EXT #define GL_ARRAY_ELEMENT_LOCK_COUNT_EXT 0x81A9 #endif #ifndef GL_ARRAY_ELEMENT_LOCK_FIRST_EXT #define GL_ARRAY_ELEMENT_LOCK_FIRST_EXT 0x81A8 #endif #ifndef GL_ARRAY_OBJECT_BUFFER_ATI #define GL_ARRAY_OBJECT_BUFFER_ATI 0x8766 #endif #ifndef GL_ARRAY_OBJECT_OFFSET_ATI #define GL_ARRAY_OBJECT_OFFSET_ATI 0x8767 #endif #ifndef GL_ASYNC_DRAW_PIXELS_SGIX #define GL_ASYNC_DRAW_PIXELS_SGIX 0x835D #endif #ifndef GL_ASYNC_HISTOGRAM_SGIX #define GL_ASYNC_HISTOGRAM_SGIX 0x832C #endif #ifndef GL_ASYNC_MARKER_SGIX #define GL_ASYNC_MARKER_SGIX 0x8329 #endif #ifndef GL_ASYNC_READ_PIXELS_SGIX #define GL_ASYNC_READ_PIXELS_SGIX 0x835E #endif #ifndef GL_ASYNC_TEX_IMAGE_SGIX #define GL_ASYNC_TEX_IMAGE_SGIX 0x835C #endif #ifndef GL_ATTACHED_SHADERS #define GL_ATTACHED_SHADERS 0x8B85 #endif #ifndef GL_ATTENUATION_EXT #define GL_ATTENUATION_EXT 0x834D #endif #ifndef GL_ATTRIB_ARRAY_POINTER_NV #define GL_ATTRIB_ARRAY_POINTER_NV 0x8645 #endif #ifndef GL_ATTRIB_ARRAY_SIZE_NV #define GL_ATTRIB_ARRAY_SIZE_NV 0x8623 #endif #ifndef GL_ATTRIB_ARRAY_STRIDE_NV #define GL_ATTRIB_ARRAY_STRIDE_NV 0x8624 #endif #ifndef GL_ATTRIB_ARRAY_TYPE_NV #define GL_ATTRIB_ARRAY_TYPE_NV 0x8625 #endif #ifndef GL_ATTRIB_STACK_DEPTH #define GL_ATTRIB_STACK_DEPTH 0x0BB0 #endif #ifndef GL_AUTO_NORMAL #define GL_AUTO_NORMAL 0x0D80 #endif #ifndef GL_AUX0 #define GL_AUX0 0x0409 #endif #ifndef GL_AUX1 #define GL_AUX1 0x040A #endif #ifndef GL_AUX2 #define GL_AUX2 0x040B #endif #ifndef GL_AUX3 #define GL_AUX3 0x040C #endif #ifndef GL_AUX_BUFFERS #define GL_AUX_BUFFERS 0x0C00 #endif #ifndef GL_AVERAGE_EXT #define GL_AVERAGE_EXT 0x8335 #endif #ifndef GL_AVERAGE_HP #define GL_AVERAGE_HP 0x8160 #endif #ifndef GL_BACK #define GL_BACK 0x0405 #endif #ifndef GL_BACK_LEFT #define GL_BACK_LEFT 0x0402 #endif #ifndef GL_BACK_NORMALS_HINT_PGI #define GL_BACK_NORMALS_HINT_PGI 0x1A223 #endif #ifndef GL_BACK_PRIMARY_COLOR_NV #define GL_BACK_PRIMARY_COLOR_NV 0x8C77 #endif #ifndef GL_BACK_RIGHT #define GL_BACK_RIGHT 0x0403 #endif #ifndef GL_BACK_SECONDARY_COLOR_NV #define GL_BACK_SECONDARY_COLOR_NV 0x8C78 #endif #ifndef GL_BGR #define GL_BGR 0x80E0 #endif #ifndef GL_BGRA #define GL_BGRA 0x80E1 #endif #ifndef GL_BGRA_EXT #define GL_BGRA_EXT 0x80E1 #endif #ifndef GL_BGRA_INTEGER #define GL_BGRA_INTEGER 0x8D9B #endif #ifndef GL_BGRA_INTEGER_EXT #define GL_BGRA_INTEGER_EXT 0x8D9B #endif #ifndef GL_BGR_EXT #define GL_BGR_EXT 0x80E0 #endif #ifndef GL_BGR_INTEGER #define GL_BGR_INTEGER 0x8D9A #endif #ifndef GL_BGR_INTEGER_EXT #define GL_BGR_INTEGER_EXT 0x8D9A #endif #ifndef GL_BIAS_BIT_ATI #define GL_BIAS_BIT_ATI 0x00000008 #endif #ifndef GL_BIAS_BY_NEGATIVE_ONE_HALF_NV #define GL_BIAS_BY_NEGATIVE_ONE_HALF_NV 0x8541 #endif #ifndef GL_BINORMAL_ARRAY_EXT #define GL_BINORMAL_ARRAY_EXT 0x843A #endif #ifndef GL_BINORMAL_ARRAY_POINTER_EXT #define GL_BINORMAL_ARRAY_POINTER_EXT 0x8443 #endif #ifndef GL_BINORMAL_ARRAY_STRIDE_EXT #define GL_BINORMAL_ARRAY_STRIDE_EXT 0x8441 #endif #ifndef GL_BINORMAL_ARRAY_TYPE_EXT #define GL_BINORMAL_ARRAY_TYPE_EXT 0x8440 #endif #ifndef GL_BITMAP #define GL_BITMAP 0x1A00 #endif #ifndef GL_BITMAP_TOKEN #define GL_BITMAP_TOKEN 0x0704 #endif #ifndef GL_BLEND #define GL_BLEND 0x0BE2 #endif #ifndef GL_BLEND_COLOR #define GL_BLEND_COLOR 0x8005 #endif #ifndef GL_BLEND_COLOR_EXT #define GL_BLEND_COLOR_EXT 0x8005 #endif #ifndef GL_BLEND_DST #define GL_BLEND_DST 0x0BE0 #endif #ifndef GL_BLEND_DST_ALPHA #define GL_BLEND_DST_ALPHA 0x80CA #endif #ifndef GL_BLEND_DST_ALPHA_EXT #define GL_BLEND_DST_ALPHA_EXT 0x80CA #endif #ifndef GL_BLEND_DST_RGB #define GL_BLEND_DST_RGB 0x80C8 #endif #ifndef GL_BLEND_DST_RGB_EXT #define GL_BLEND_DST_RGB_EXT 0x80C8 #endif #ifndef GL_BLEND_EQUATION #define GL_BLEND_EQUATION 0x8009 #endif #ifndef GL_BLEND_EQUATION_ALPHA #define GL_BLEND_EQUATION_ALPHA 0x883D #endif #ifndef GL_BLEND_EQUATION_ALPHA_EXT #define GL_BLEND_EQUATION_ALPHA_EXT 0x883D #endif #ifndef GL_BLEND_EQUATION_EXT #define GL_BLEND_EQUATION_EXT 0x8009 #endif #ifndef GL_BLEND_EQUATION_RGB #define GL_BLEND_EQUATION_RGB GL_BLEND_EQUATION #endif #ifndef GL_BLEND_EQUATION_RGB_EXT #define GL_BLEND_EQUATION_RGB_EXT GL_BLEND_EQUATION #endif #ifndef GL_BLEND_SRC #define GL_BLEND_SRC 0x0BE1 #endif #ifndef GL_BLEND_SRC_ALPHA #define GL_BLEND_SRC_ALPHA 0x80CB #endif #ifndef GL_BLEND_SRC_ALPHA_EXT #define GL_BLEND_SRC_ALPHA_EXT 0x80CB #endif #ifndef GL_BLEND_SRC_RGB #define GL_BLEND_SRC_RGB 0x80C9 #endif #ifndef GL_BLEND_SRC_RGB_EXT #define GL_BLEND_SRC_RGB_EXT 0x80C9 #endif #ifndef GL_BLUE #define GL_BLUE 0x1905 #endif #ifndef GL_BLUE_BIAS #define GL_BLUE_BIAS 0x0D1B #endif #ifndef GL_BLUE_BITS #define GL_BLUE_BITS 0x0D54 #endif #ifndef GL_BLUE_BIT_ATI #define GL_BLUE_BIT_ATI 0x00000004 #endif #ifndef GL_BLUE_INTEGER #define GL_BLUE_INTEGER 0x8D96 #endif #ifndef GL_BLUE_INTEGER_EXT #define GL_BLUE_INTEGER_EXT 0x8D96 #endif #ifndef GL_BLUE_MAX_CLAMP_INGR #define GL_BLUE_MAX_CLAMP_INGR 0x8566 #endif #ifndef GL_BLUE_MIN_CLAMP_INGR #define GL_BLUE_MIN_CLAMP_INGR 0x8562 #endif #ifndef GL_BLUE_SCALE #define GL_BLUE_SCALE 0x0D1A #endif #ifndef GL_BOOL #define GL_BOOL 0x8B56 #endif #ifndef GL_BOOL_ARB #define GL_BOOL_ARB 0x8B56 #endif #ifndef GL_BOOL_VEC2 #define GL_BOOL_VEC2 0x8B57 #endif #ifndef GL_BOOL_VEC2_ARB #define GL_BOOL_VEC2_ARB 0x8B57 #endif #ifndef GL_BOOL_VEC3 #define GL_BOOL_VEC3 0x8B58 #endif #ifndef GL_BOOL_VEC3_ARB #define GL_BOOL_VEC3_ARB 0x8B58 #endif #ifndef GL_BOOL_VEC4 #define GL_BOOL_VEC4 0x8B59 #endif #ifndef GL_BOOL_VEC4_ARB #define GL_BOOL_VEC4_ARB 0x8B59 #endif #ifndef GL_BUFFER_ACCESS #define GL_BUFFER_ACCESS 0x88BB #endif #ifndef GL_BUFFER_ACCESS_ARB #define GL_BUFFER_ACCESS_ARB 0x88BB #endif #ifndef GL_BUFFER_FLUSHING_UNMAP_APPLE #define GL_BUFFER_FLUSHING_UNMAP_APPLE 0x8A13 #endif #ifndef GL_BUFFER_MAPPED #define GL_BUFFER_MAPPED 0x88BC #endif #ifndef GL_BUFFER_MAPPED_ARB #define GL_BUFFER_MAPPED_ARB 0x88BC #endif #ifndef GL_BUFFER_MAP_POINTER #define GL_BUFFER_MAP_POINTER 0x88BD #endif #ifndef GL_BUFFER_MAP_POINTER_ARB #define GL_BUFFER_MAP_POINTER_ARB 0x88BD #endif #ifndef GL_BUFFER_SERIALIZED_MODIFY_APPLE #define GL_BUFFER_SERIALIZED_MODIFY_APPLE 0x8A12 #endif #ifndef GL_BUFFER_SIZE #define GL_BUFFER_SIZE 0x8764 #endif #ifndef GL_BUFFER_SIZE_ARB #define GL_BUFFER_SIZE_ARB 0x8764 #endif #ifndef GL_BUFFER_USAGE #define GL_BUFFER_USAGE 0x8765 #endif #ifndef GL_BUFFER_USAGE_ARB #define GL_BUFFER_USAGE_ARB 0x8765 #endif #ifndef GL_BUMP_ENVMAP_ATI #define GL_BUMP_ENVMAP_ATI 0x877B #endif #ifndef GL_BUMP_NUM_TEX_UNITS_ATI #define GL_BUMP_NUM_TEX_UNITS_ATI 0x8777 #endif #ifndef GL_BUMP_ROT_MATRIX_ATI #define GL_BUMP_ROT_MATRIX_ATI 0x8775 #endif #ifndef GL_BUMP_ROT_MATRIX_SIZE_ATI #define GL_BUMP_ROT_MATRIX_SIZE_ATI 0x8776 #endif #ifndef GL_BUMP_TARGET_ATI #define GL_BUMP_TARGET_ATI 0x877C #endif #ifndef GL_BUMP_TEX_UNITS_ATI #define GL_BUMP_TEX_UNITS_ATI 0x8778 #endif #ifndef GL_BYTE #define GL_BYTE 0x1400 #endif #ifndef GL_C3F_V3F #define GL_C3F_V3F 0x2A24 #endif #ifndef GL_C4F_N3F_V3F #define GL_C4F_N3F_V3F 0x2A26 #endif #ifndef GL_C4UB_V2F #define GL_C4UB_V2F 0x2A22 #endif #ifndef GL_C4UB_V3F #define GL_C4UB_V3F 0x2A23 #endif #ifndef GL_CALLIGRAPHIC_FRAGMENT_SGIX #define GL_CALLIGRAPHIC_FRAGMENT_SGIX 0x8183 #endif #ifndef GL_CCW #define GL_CCW 0x0901 #endif #ifndef GL_CLAMP #define GL_CLAMP 0x2900 #endif #ifndef GL_CLAMP_FRAGMENT_COLOR #define GL_CLAMP_FRAGMENT_COLOR 0x891B #endif #ifndef GL_CLAMP_FRAGMENT_COLOR_ARB #define GL_CLAMP_FRAGMENT_COLOR_ARB 0x891B #endif #ifndef GL_CLAMP_READ_COLOR #define GL_CLAMP_READ_COLOR 0x891C #endif #ifndef GL_CLAMP_READ_COLOR_ARB #define GL_CLAMP_READ_COLOR_ARB 0x891C #endif #ifndef GL_CLAMP_TO_BORDER #define GL_CLAMP_TO_BORDER 0x812D #endif #ifndef GL_CLAMP_TO_BORDER_ARB #define GL_CLAMP_TO_BORDER_ARB 0x812D #endif #ifndef GL_CLAMP_TO_BORDER_SGIS #define GL_CLAMP_TO_BORDER_SGIS 0x812D #endif #ifndef GL_CLAMP_TO_EDGE #define GL_CLAMP_TO_EDGE 0x812F #endif #ifndef GL_CLAMP_TO_EDGE_SGIS #define GL_CLAMP_TO_EDGE_SGIS 0x812F #endif #ifndef GL_CLAMP_VERTEX_COLOR #define GL_CLAMP_VERTEX_COLOR 0x891A #endif #ifndef GL_CLAMP_VERTEX_COLOR_ARB #define GL_CLAMP_VERTEX_COLOR_ARB 0x891A #endif #ifndef GL_CLEAR #define GL_CLEAR 0x1500 #endif #ifndef GL_CLIENT_ACTIVE_TEXTURE #define GL_CLIENT_ACTIVE_TEXTURE 0x84E1 #endif #ifndef GL_CLIENT_ACTIVE_TEXTURE_ARB #define GL_CLIENT_ACTIVE_TEXTURE_ARB 0x84E1 #endif #ifndef GL_CLIENT_ALL_ATTRIB_BITS #define GL_CLIENT_ALL_ATTRIB_BITS 0xFFFFFFFF #endif #ifndef GL_CLIENT_ATTRIB_STACK_DEPTH #define GL_CLIENT_ATTRIB_STACK_DEPTH 0x0BB1 #endif #ifndef GL_CLIENT_PIXEL_STORE_BIT #define GL_CLIENT_PIXEL_STORE_BIT 0x00000001 #endif #ifndef GL_CLIENT_VERTEX_ARRAY_BIT #define GL_CLIENT_VERTEX_ARRAY_BIT 0x00000002 #endif #ifndef GL_CLIP_DISTANCE0 #define GL_CLIP_DISTANCE0 GL_CLIP_PLANE0 #endif #ifndef GL_CLIP_DISTANCE1 #define GL_CLIP_DISTANCE1 GL_CLIP_PLANE1 #endif #ifndef GL_CLIP_DISTANCE2 #define GL_CLIP_DISTANCE2 GL_CLIP_PLANE2 #endif #ifndef GL_CLIP_DISTANCE3 #define GL_CLIP_DISTANCE3 GL_CLIP_PLANE3 #endif #ifndef GL_CLIP_DISTANCE4 #define GL_CLIP_DISTANCE4 GL_CLIP_PLANE4 #endif #ifndef GL_CLIP_DISTANCE5 #define GL_CLIP_DISTANCE5 GL_CLIP_PLANE5 #endif #ifndef GL_CLIP_DISTANCE_NV #define GL_CLIP_DISTANCE_NV 0x8C7A #endif #ifndef GL_CLIP_FAR_HINT_PGI #define GL_CLIP_FAR_HINT_PGI 0x1A221 #endif #ifndef GL_CLIP_NEAR_HINT_PGI #define GL_CLIP_NEAR_HINT_PGI 0x1A220 #endif #ifndef GL_CLIP_PLANE0 #define GL_CLIP_PLANE0 0x3000 #endif #ifndef GL_CLIP_PLANE1 #define GL_CLIP_PLANE1 0x3001 #endif #ifndef GL_CLIP_PLANE2 #define GL_CLIP_PLANE2 0x3002 #endif #ifndef GL_CLIP_PLANE3 #define GL_CLIP_PLANE3 0x3003 #endif #ifndef GL_CLIP_PLANE4 #define GL_CLIP_PLANE4 0x3004 #endif #ifndef GL_CLIP_PLANE5 #define GL_CLIP_PLANE5 0x3005 #endif #ifndef GL_CLIP_VOLUME_CLIPPING_HINT_EXT #define GL_CLIP_VOLUME_CLIPPING_HINT_EXT 0x80F0 #endif #ifndef GL_CMYKA_EXT #define GL_CMYKA_EXT 0x800D #endif #ifndef GL_CMYK_EXT #define GL_CMYK_EXT 0x800C #endif #ifndef GL_CND0_ATI #define GL_CND0_ATI 0x896B #endif #ifndef GL_CND_ATI #define GL_CND_ATI 0x896A #endif #ifndef GL_COEFF #define GL_COEFF 0x0A00 #endif #ifndef GL_COLOR #define GL_COLOR 0x1800 #endif #ifndef GL_COLOR3_BIT_PGI #define GL_COLOR3_BIT_PGI 0x00010000 #endif #ifndef GL_COLOR4_BIT_PGI #define GL_COLOR4_BIT_PGI 0x00020000 #endif #ifndef GL_COLOR_ALPHA_PAIRING_ATI #define GL_COLOR_ALPHA_PAIRING_ATI 0x8975 #endif #ifndef GL_COLOR_ARRAY #define GL_COLOR_ARRAY 0x8076 #endif #ifndef GL_COLOR_ARRAY_BUFFER_BINDING #define GL_COLOR_ARRAY_BUFFER_BINDING 0x8898 #endif #ifndef GL_COLOR_ARRAY_BUFFER_BINDING_ARB #define GL_COLOR_ARRAY_BUFFER_BINDING_ARB 0x8898 #endif #ifndef GL_COLOR_ARRAY_COUNT_EXT #define GL_COLOR_ARRAY_COUNT_EXT 0x8084 #endif #ifndef GL_COLOR_ARRAY_EXT #define GL_COLOR_ARRAY_EXT 0x8076 #endif #ifndef GL_COLOR_ARRAY_LIST_IBM #define GL_COLOR_ARRAY_LIST_IBM 103072 #endif #ifndef GL_COLOR_ARRAY_LIST_STRIDE_IBM #define GL_COLOR_ARRAY_LIST_STRIDE_IBM 103082 #endif #ifndef GL_COLOR_ARRAY_PARALLEL_POINTERS_INTEL #define GL_COLOR_ARRAY_PARALLEL_POINTERS_INTEL 0x83F7 #endif #ifndef GL_COLOR_ARRAY_POINTER #define GL_COLOR_ARRAY_POINTER 0x8090 #endif #ifndef GL_COLOR_ARRAY_POINTER_EXT #define GL_COLOR_ARRAY_POINTER_EXT 0x8090 #endif #ifndef GL_COLOR_ARRAY_SIZE #define GL_COLOR_ARRAY_SIZE 0x8081 #endif #ifndef GL_COLOR_ARRAY_SIZE_EXT #define GL_COLOR_ARRAY_SIZE_EXT 0x8081 #endif #ifndef GL_COLOR_ARRAY_STRIDE #define GL_COLOR_ARRAY_STRIDE 0x8083 #endif #ifndef GL_COLOR_ARRAY_STRIDE_EXT #define GL_COLOR_ARRAY_STRIDE_EXT 0x8083 #endif #ifndef GL_COLOR_ARRAY_TYPE #define GL_COLOR_ARRAY_TYPE 0x8082 #endif #ifndef GL_COLOR_ARRAY_TYPE_EXT #define GL_COLOR_ARRAY_TYPE_EXT 0x8082 #endif #ifndef GL_COLOR_ATTACHMENT0 #define GL_COLOR_ATTACHMENT0 0x8CE0 #endif #ifndef GL_COLOR_ATTACHMENT0_EXT #define GL_COLOR_ATTACHMENT0_EXT 0x8CE0 #endif #ifndef GL_COLOR_ATTACHMENT1 #define GL_COLOR_ATTACHMENT1 0x8CE1 #endif #ifndef GL_COLOR_ATTACHMENT10 #define GL_COLOR_ATTACHMENT10 0x8CEA #endif #ifndef GL_COLOR_ATTACHMENT10_EXT #define GL_COLOR_ATTACHMENT10_EXT 0x8CEA #endif #ifndef GL_COLOR_ATTACHMENT11 #define GL_COLOR_ATTACHMENT11 0x8CEB #endif #ifndef GL_COLOR_ATTACHMENT11_EXT #define GL_COLOR_ATTACHMENT11_EXT 0x8CEB #endif #ifndef GL_COLOR_ATTACHMENT12 #define GL_COLOR_ATTACHMENT12 0x8CEC #endif #ifndef GL_COLOR_ATTACHMENT12_EXT #define GL_COLOR_ATTACHMENT12_EXT 0x8CEC #endif #ifndef GL_COLOR_ATTACHMENT13 #define GL_COLOR_ATTACHMENT13 0x8CED #endif #ifndef GL_COLOR_ATTACHMENT13_EXT #define GL_COLOR_ATTACHMENT13_EXT 0x8CED #endif #ifndef GL_COLOR_ATTACHMENT14 #define GL_COLOR_ATTACHMENT14 0x8CEE #endif #ifndef GL_COLOR_ATTACHMENT14_EXT #define GL_COLOR_ATTACHMENT14_EXT 0x8CEE #endif #ifndef GL_COLOR_ATTACHMENT15 #define GL_COLOR_ATTACHMENT15 0x8CEF #endif #ifndef GL_COLOR_ATTACHMENT15_EXT #define GL_COLOR_ATTACHMENT15_EXT 0x8CEF #endif #ifndef GL_COLOR_ATTACHMENT1_EXT #define GL_COLOR_ATTACHMENT1_EXT 0x8CE1 #endif #ifndef GL_COLOR_ATTACHMENT2 #define GL_COLOR_ATTACHMENT2 0x8CE2 #endif #ifndef GL_COLOR_ATTACHMENT2_EXT #define GL_COLOR_ATTACHMENT2_EXT 0x8CE2 #endif #ifndef GL_COLOR_ATTACHMENT3 #define GL_COLOR_ATTACHMENT3 0x8CE3 #endif #ifndef GL_COLOR_ATTACHMENT3_EXT #define GL_COLOR_ATTACHMENT3_EXT 0x8CE3 #endif #ifndef GL_COLOR_ATTACHMENT4 #define GL_COLOR_ATTACHMENT4 0x8CE4 #endif #ifndef GL_COLOR_ATTACHMENT4_EXT #define GL_COLOR_ATTACHMENT4_EXT 0x8CE4 #endif #ifndef GL_COLOR_ATTACHMENT5 #define GL_COLOR_ATTACHMENT5 0x8CE5 #endif #ifndef GL_COLOR_ATTACHMENT5_EXT #define GL_COLOR_ATTACHMENT5_EXT 0x8CE5 #endif #ifndef GL_COLOR_ATTACHMENT6 #define GL_COLOR_ATTACHMENT6 0x8CE6 #endif #ifndef GL_COLOR_ATTACHMENT6_EXT #define GL_COLOR_ATTACHMENT6_EXT 0x8CE6 #endif #ifndef GL_COLOR_ATTACHMENT7 #define GL_COLOR_ATTACHMENT7 0x8CE7 #endif #ifndef GL_COLOR_ATTACHMENT7_EXT #define GL_COLOR_ATTACHMENT7_EXT 0x8CE7 #endif #ifndef GL_COLOR_ATTACHMENT8 #define GL_COLOR_ATTACHMENT8 0x8CE8 #endif #ifndef GL_COLOR_ATTACHMENT8_EXT #define GL_COLOR_ATTACHMENT8_EXT 0x8CE8 #endif #ifndef GL_COLOR_ATTACHMENT9 #define GL_COLOR_ATTACHMENT9 0x8CE9 #endif #ifndef GL_COLOR_ATTACHMENT9_EXT #define GL_COLOR_ATTACHMENT9_EXT 0x8CE9 #endif #ifndef GL_COLOR_BUFFER_BIT #define GL_COLOR_BUFFER_BIT 0x00004000 #endif #ifndef GL_COLOR_CLEAR_UNCLAMPED_VALUE_ATI #define GL_COLOR_CLEAR_UNCLAMPED_VALUE_ATI 0x8835 #endif #ifndef GL_COLOR_CLEAR_VALUE #define GL_COLOR_CLEAR_VALUE 0x0C22 #endif #ifndef GL_COLOR_INDEX #define GL_COLOR_INDEX 0x1900 #endif #ifndef GL_COLOR_INDEX12_EXT #define GL_COLOR_INDEX12_EXT 0x80E6 #endif #ifndef GL_COLOR_INDEX16_EXT #define GL_COLOR_INDEX16_EXT 0x80E7 #endif #ifndef GL_COLOR_INDEX1_EXT #define GL_COLOR_INDEX1_EXT 0x80E2 #endif #ifndef GL_COLOR_INDEX2_EXT #define GL_COLOR_INDEX2_EXT 0x80E3 #endif #ifndef GL_COLOR_INDEX4_EXT #define GL_COLOR_INDEX4_EXT 0x80E4 #endif #ifndef GL_COLOR_INDEX8_EXT #define GL_COLOR_INDEX8_EXT 0x80E5 #endif #ifndef GL_COLOR_INDEXES #define GL_COLOR_INDEXES 0x1603 #endif #ifndef GL_COLOR_LOGIC_OP #define GL_COLOR_LOGIC_OP 0x0BF2 #endif #ifndef GL_COLOR_MATERIAL #define GL_COLOR_MATERIAL 0x0B57 #endif #ifndef GL_COLOR_MATERIAL_FACE #define GL_COLOR_MATERIAL_FACE 0x0B55 #endif #ifndef GL_COLOR_MATERIAL_PARAMETER #define GL_COLOR_MATERIAL_PARAMETER 0x0B56 #endif #ifndef GL_COLOR_MATRIX #define GL_COLOR_MATRIX 0x80B1 #endif #ifndef GL_COLOR_MATRIX_SGI #define GL_COLOR_MATRIX_SGI 0x80B1 #endif #ifndef GL_COLOR_MATRIX_STACK_DEPTH #define GL_COLOR_MATRIX_STACK_DEPTH 0x80B2 #endif #ifndef GL_COLOR_MATRIX_STACK_DEPTH_SGI #define GL_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B2 #endif #ifndef GL_COLOR_SUM #define GL_COLOR_SUM 0x8458 #endif #ifndef GL_COLOR_SUM_ARB #define GL_COLOR_SUM_ARB 0x8458 #endif #ifndef GL_COLOR_SUM_CLAMP_NV #define GL_COLOR_SUM_CLAMP_NV 0x854F #endif #ifndef GL_COLOR_SUM_EXT #define GL_COLOR_SUM_EXT 0x8458 #endif #ifndef GL_COLOR_TABLE #define GL_COLOR_TABLE 0x80D0 #endif #ifndef GL_COLOR_TABLE_ALPHA_SIZE #define GL_COLOR_TABLE_ALPHA_SIZE 0x80DD #endif #ifndef GL_COLOR_TABLE_ALPHA_SIZE_SGI #define GL_COLOR_TABLE_ALPHA_SIZE_SGI 0x80DD #endif #ifndef GL_COLOR_TABLE_BIAS #define GL_COLOR_TABLE_BIAS 0x80D7 #endif #ifndef GL_COLOR_TABLE_BIAS_SGI #define GL_COLOR_TABLE_BIAS_SGI 0x80D7 #endif #ifndef GL_COLOR_TABLE_BLUE_SIZE #define GL_COLOR_TABLE_BLUE_SIZE 0x80DC #endif #ifndef GL_COLOR_TABLE_BLUE_SIZE_SGI #define GL_COLOR_TABLE_BLUE_SIZE_SGI 0x80DC #endif #ifndef GL_COLOR_TABLE_FORMAT #define GL_COLOR_TABLE_FORMAT 0x80D8 #endif #ifndef GL_COLOR_TABLE_FORMAT_SGI #define GL_COLOR_TABLE_FORMAT_SGI 0x80D8 #endif #ifndef GL_COLOR_TABLE_GREEN_SIZE #define GL_COLOR_TABLE_GREEN_SIZE 0x80DB #endif #ifndef GL_COLOR_TABLE_GREEN_SIZE_SGI #define GL_COLOR_TABLE_GREEN_SIZE_SGI 0x80DB #endif #ifndef GL_COLOR_TABLE_INTENSITY_SIZE #define GL_COLOR_TABLE_INTENSITY_SIZE 0x80DF #endif #ifndef GL_COLOR_TABLE_INTENSITY_SIZE_SGI #define GL_COLOR_TABLE_INTENSITY_SIZE_SGI 0x80DF #endif #ifndef GL_COLOR_TABLE_LUMINANCE_SIZE #define GL_COLOR_TABLE_LUMINANCE_SIZE 0x80DE #endif #ifndef GL_COLOR_TABLE_LUMINANCE_SIZE_SGI #define GL_COLOR_TABLE_LUMINANCE_SIZE_SGI 0x80DE #endif #ifndef GL_COLOR_TABLE_RED_SIZE #define GL_COLOR_TABLE_RED_SIZE 0x80DA #endif #ifndef GL_COLOR_TABLE_RED_SIZE_SGI #define GL_COLOR_TABLE_RED_SIZE_SGI 0x80DA #endif #ifndef GL_COLOR_TABLE_SCALE #define GL_COLOR_TABLE_SCALE 0x80D6 #endif #ifndef GL_COLOR_TABLE_SCALE_SGI #define GL_COLOR_TABLE_SCALE_SGI 0x80D6 #endif #ifndef GL_COLOR_TABLE_SGI #define GL_COLOR_TABLE_SGI 0x80D0 #endif #ifndef GL_COLOR_TABLE_WIDTH #define GL_COLOR_TABLE_WIDTH 0x80D9 #endif #ifndef GL_COLOR_TABLE_WIDTH_SGI #define GL_COLOR_TABLE_WIDTH_SGI 0x80D9 #endif #ifndef GL_COLOR_WRITEMASK #define GL_COLOR_WRITEMASK 0x0C23 #endif #ifndef GL_COMBINE #define GL_COMBINE 0x8570 #endif #ifndef GL_COMBINE4_NV #define GL_COMBINE4_NV 0x8503 #endif #ifndef GL_COMBINER0_NV #define GL_COMBINER0_NV 0x8550 #endif #ifndef GL_COMBINER1_NV #define GL_COMBINER1_NV 0x8551 #endif #ifndef GL_COMBINER2_NV #define GL_COMBINER2_NV 0x8552 #endif #ifndef GL_COMBINER3_NV #define GL_COMBINER3_NV 0x8553 #endif #ifndef GL_COMBINER4_NV #define GL_COMBINER4_NV 0x8554 #endif #ifndef GL_COMBINER5_NV #define GL_COMBINER5_NV 0x8555 #endif #ifndef GL_COMBINER6_NV #define GL_COMBINER6_NV 0x8556 #endif #ifndef GL_COMBINER7_NV #define GL_COMBINER7_NV 0x8557 #endif #ifndef GL_COMBINER_AB_DOT_PRODUCT_NV #define GL_COMBINER_AB_DOT_PRODUCT_NV 0x8545 #endif #ifndef GL_COMBINER_AB_OUTPUT_NV #define GL_COMBINER_AB_OUTPUT_NV 0x854A #endif #ifndef GL_COMBINER_BIAS_NV #define GL_COMBINER_BIAS_NV 0x8549 #endif #ifndef GL_COMBINER_CD_DOT_PRODUCT_NV #define GL_COMBINER_CD_DOT_PRODUCT_NV 0x8546 #endif #ifndef GL_COMBINER_CD_OUTPUT_NV #define GL_COMBINER_CD_OUTPUT_NV 0x854B #endif #ifndef GL_COMBINER_COMPONENT_USAGE_NV #define GL_COMBINER_COMPONENT_USAGE_NV 0x8544 #endif #ifndef GL_COMBINER_INPUT_NV #define GL_COMBINER_INPUT_NV 0x8542 #endif #ifndef GL_COMBINER_MAPPING_NV #define GL_COMBINER_MAPPING_NV 0x8543 #endif #ifndef GL_COMBINER_MUX_SUM_NV #define GL_COMBINER_MUX_SUM_NV 0x8547 #endif #ifndef GL_COMBINER_SCALE_NV #define GL_COMBINER_SCALE_NV 0x8548 #endif #ifndef GL_COMBINER_SUM_OUTPUT_NV #define GL_COMBINER_SUM_OUTPUT_NV 0x854C #endif #ifndef GL_COMBINE_ALPHA #define GL_COMBINE_ALPHA 0x8572 #endif #ifndef GL_COMBINE_ALPHA_ARB #define GL_COMBINE_ALPHA_ARB 0x8572 #endif #ifndef GL_COMBINE_ALPHA_EXT #define GL_COMBINE_ALPHA_EXT 0x8572 #endif #ifndef GL_COMBINE_ARB #define GL_COMBINE_ARB 0x8570 #endif #ifndef GL_COMBINE_EXT #define GL_COMBINE_EXT 0x8570 #endif #ifndef GL_COMBINE_RGB #define GL_COMBINE_RGB 0x8571 #endif #ifndef GL_COMBINE_RGB_ARB #define GL_COMBINE_RGB_ARB 0x8571 #endif #ifndef GL_COMBINE_RGB_EXT #define GL_COMBINE_RGB_EXT 0x8571 #endif #ifndef GL_COMPARE_REF_DEPTH_TO_TEXTURE_EXT #define GL_COMPARE_REF_DEPTH_TO_TEXTURE_EXT 0x884E #endif #ifndef GL_COMPARE_REF_TO_TEXTURE #define GL_COMPARE_REF_TO_TEXTURE GL_COMPARE_R_TO_TEXTURE_ARB #endif #ifndef GL_COMPARE_R_TO_TEXTURE #define GL_COMPARE_R_TO_TEXTURE 0x884E #endif #ifndef GL_COMPARE_R_TO_TEXTURE_ARB #define GL_COMPARE_R_TO_TEXTURE_ARB 0x884E #endif #ifndef GL_COMPILE #define GL_COMPILE 0x1300 #endif #ifndef GL_COMPILE_AND_EXECUTE #define GL_COMPILE_AND_EXECUTE 0x1301 #endif #ifndef GL_COMPILE_STATUS #define GL_COMPILE_STATUS 0x8B81 #endif #ifndef GL_COMPRESSED_ALPHA #define GL_COMPRESSED_ALPHA 0x84E9 #endif #ifndef GL_COMPRESSED_ALPHA_ARB #define GL_COMPRESSED_ALPHA_ARB 0x84E9 #endif #ifndef GL_COMPRESSED_INTENSITY #define GL_COMPRESSED_INTENSITY 0x84EC #endif #ifndef GL_COMPRESSED_INTENSITY_ARB #define GL_COMPRESSED_INTENSITY_ARB 0x84EC #endif #ifndef GL_COMPRESSED_LUMINANCE #define GL_COMPRESSED_LUMINANCE 0x84EA #endif #ifndef GL_COMPRESSED_LUMINANCE_ALPHA #define GL_COMPRESSED_LUMINANCE_ALPHA 0x84EB #endif #ifndef GL_COMPRESSED_LUMINANCE_ALPHA_ARB #define GL_COMPRESSED_LUMINANCE_ALPHA_ARB 0x84EB #endif #ifndef GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT #define GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT 0x8C72 #endif #ifndef GL_COMPRESSED_LUMINANCE_ARB #define GL_COMPRESSED_LUMINANCE_ARB 0x84EA #endif #ifndef GL_COMPRESSED_LUMINANCE_LATC1_EXT #define GL_COMPRESSED_LUMINANCE_LATC1_EXT 0x8C70 #endif #ifndef GL_COMPRESSED_RED #define GL_COMPRESSED_RED 0x8225 #endif #ifndef GL_COMPRESSED_RED_GREEN_RGTC2_EXT #define GL_COMPRESSED_RED_GREEN_RGTC2_EXT 0x8DBD #endif #ifndef GL_COMPRESSED_RED_RGTC1 #define GL_COMPRESSED_RED_RGTC1 0x8DBB #endif #ifndef GL_COMPRESSED_RED_RGTC1_EXT #define GL_COMPRESSED_RED_RGTC1_EXT 0x8DBB #endif #ifndef GL_COMPRESSED_RG #define GL_COMPRESSED_RG 0x8226 #endif #ifndef GL_COMPRESSED_RGB #define GL_COMPRESSED_RGB 0x84ED #endif #ifndef GL_COMPRESSED_RGBA #define GL_COMPRESSED_RGBA 0x84EE #endif #ifndef GL_COMPRESSED_RGBA_ARB #define GL_COMPRESSED_RGBA_ARB 0x84EE #endif #ifndef GL_COMPRESSED_RGBA_FXT1_3DFX #define GL_COMPRESSED_RGBA_FXT1_3DFX 0x86B1 #endif #ifndef GL_COMPRESSED_RGBA_S3TC_DXT1_EXT #define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1 #endif #ifndef GL_COMPRESSED_RGBA_S3TC_DXT3_EXT #define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2 #endif #ifndef GL_COMPRESSED_RGBA_S3TC_DXT5_EXT #define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3 #endif #ifndef GL_COMPRESSED_RGB_ARB #define GL_COMPRESSED_RGB_ARB 0x84ED #endif #ifndef GL_COMPRESSED_RGB_FXT1_3DFX #define GL_COMPRESSED_RGB_FXT1_3DFX 0x86B0 #endif #ifndef GL_COMPRESSED_RGB_S3TC_DXT1_EXT #define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0 #endif #ifndef GL_COMPRESSED_RG_RGTC2 #define GL_COMPRESSED_RG_RGTC2 0x8DBD #endif #ifndef GL_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT #define GL_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT 0x8C73 #endif #ifndef GL_COMPRESSED_SIGNED_LUMINANCE_LATC1_EXT #define GL_COMPRESSED_SIGNED_LUMINANCE_LATC1_EXT 0x8C71 #endif #ifndef GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT #define GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT 0x8DBE #endif #ifndef GL_COMPRESSED_SIGNED_RED_RGTC1 #define GL_COMPRESSED_SIGNED_RED_RGTC1 0x8DBC #endif #ifndef GL_COMPRESSED_SIGNED_RED_RGTC1_EXT #define GL_COMPRESSED_SIGNED_RED_RGTC1_EXT 0x8DBC #endif #ifndef GL_COMPRESSED_SIGNED_RG_RGTC2 #define GL_COMPRESSED_SIGNED_RG_RGTC2 0x8DBE #endif #ifndef GL_COMPRESSED_SLUMINANCE #define GL_COMPRESSED_SLUMINANCE 0x8C4A #endif #ifndef GL_COMPRESSED_SLUMINANCE_ALPHA #define GL_COMPRESSED_SLUMINANCE_ALPHA 0x8C4B #endif #ifndef GL_COMPRESSED_SLUMINANCE_ALPHA_EXT #define GL_COMPRESSED_SLUMINANCE_ALPHA_EXT 0x8C4B #endif #ifndef GL_COMPRESSED_SLUMINANCE_EXT #define GL_COMPRESSED_SLUMINANCE_EXT 0x8C4A #endif #ifndef GL_COMPRESSED_SRGB #define GL_COMPRESSED_SRGB 0x8C48 #endif #ifndef GL_COMPRESSED_SRGB_ALPHA #define GL_COMPRESSED_SRGB_ALPHA 0x8C49 #endif #ifndef GL_COMPRESSED_SRGB_ALPHA_EXT #define GL_COMPRESSED_SRGB_ALPHA_EXT 0x8C49 #endif #ifndef GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT #define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT 0x8C4D #endif #ifndef GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT #define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT 0x8C4E #endif #ifndef GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT #define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT 0x8C4F #endif #ifndef GL_COMPRESSED_SRGB_EXT #define GL_COMPRESSED_SRGB_EXT 0x8C48 #endif #ifndef GL_COMPRESSED_SRGB_S3TC_DXT1_EXT #define GL_COMPRESSED_SRGB_S3TC_DXT1_EXT 0x8C4C #endif #ifndef GL_COMPRESSED_TEXTURE_FORMATS #define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3 #endif #ifndef GL_COMPRESSED_TEXTURE_FORMATS_ARB #define GL_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A3 #endif #ifndef GL_COMP_BIT_ATI #define GL_COMP_BIT_ATI 0x00000002 #endif #ifndef GL_CONSERVE_MEMORY_HINT_PGI #define GL_CONSERVE_MEMORY_HINT_PGI 0x1A1FD #endif #ifndef GL_CONSTANT #define GL_CONSTANT 0x8576 #endif #ifndef GL_CONSTANT_ALPHA #define GL_CONSTANT_ALPHA 0x8003 #endif #ifndef GL_CONSTANT_ALPHA_EXT #define GL_CONSTANT_ALPHA_EXT 0x8003 #endif #ifndef GL_CONSTANT_ARB #define GL_CONSTANT_ARB 0x8576 #endif #ifndef GL_CONSTANT_ATTENUATION #define GL_CONSTANT_ATTENUATION 0x1207 #endif #ifndef GL_CONSTANT_BORDER #define GL_CONSTANT_BORDER 0x8151 #endif #ifndef GL_CONSTANT_BORDER_HP #define GL_CONSTANT_BORDER_HP 0x8151 #endif #ifndef GL_CONSTANT_COLOR #define GL_CONSTANT_COLOR 0x8001 #endif #ifndef GL_CONSTANT_COLOR0_NV #define GL_CONSTANT_COLOR0_NV 0x852A #endif #ifndef GL_CONSTANT_COLOR1_NV #define GL_CONSTANT_COLOR1_NV 0x852B #endif #ifndef GL_CONSTANT_COLOR_EXT #define GL_CONSTANT_COLOR_EXT 0x8001 #endif #ifndef GL_CONSTANT_EXT #define GL_CONSTANT_EXT 0x8576 #endif #ifndef GL_CONST_EYE_NV #define GL_CONST_EYE_NV 0x86E5 #endif #ifndef GL_CONTEXT_FLAGS #define GL_CONTEXT_FLAGS 0x821E #endif #ifndef GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT #define GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT 0x0001 #endif #ifndef GL_CONVOLUTION_1D #define GL_CONVOLUTION_1D 0x8010 #endif #ifndef GL_CONVOLUTION_1D_EXT #define GL_CONVOLUTION_1D_EXT 0x8010 #endif #ifndef GL_CONVOLUTION_2D #define GL_CONVOLUTION_2D 0x8011 #endif #ifndef GL_CONVOLUTION_2D_EXT #define GL_CONVOLUTION_2D_EXT 0x8011 #endif #ifndef GL_CONVOLUTION_BORDER_COLOR #define GL_CONVOLUTION_BORDER_COLOR 0x8154 #endif #ifndef GL_CONVOLUTION_BORDER_COLOR_HP #define GL_CONVOLUTION_BORDER_COLOR_HP 0x8154 #endif #ifndef GL_CONVOLUTION_BORDER_MODE #define GL_CONVOLUTION_BORDER_MODE 0x8013 #endif #ifndef GL_CONVOLUTION_BORDER_MODE_EXT #define GL_CONVOLUTION_BORDER_MODE_EXT 0x8013 #endif #ifndef GL_CONVOLUTION_FILTER_BIAS #define GL_CONVOLUTION_FILTER_BIAS 0x8015 #endif #ifndef GL_CONVOLUTION_FILTER_BIAS_EXT #define GL_CONVOLUTION_FILTER_BIAS_EXT 0x8015 #endif #ifndef GL_CONVOLUTION_FILTER_SCALE #define GL_CONVOLUTION_FILTER_SCALE 0x8014 #endif #ifndef GL_CONVOLUTION_FILTER_SCALE_EXT #define GL_CONVOLUTION_FILTER_SCALE_EXT 0x8014 #endif #ifndef GL_CONVOLUTION_FORMAT #define GL_CONVOLUTION_FORMAT 0x8017 #endif #ifndef GL_CONVOLUTION_FORMAT_EXT #define GL_CONVOLUTION_FORMAT_EXT 0x8017 #endif #ifndef GL_CONVOLUTION_HEIGHT #define GL_CONVOLUTION_HEIGHT 0x8019 #endif #ifndef GL_CONVOLUTION_HEIGHT_EXT #define GL_CONVOLUTION_HEIGHT_EXT 0x8019 #endif #ifndef GL_CONVOLUTION_HINT_SGIX #define GL_CONVOLUTION_HINT_SGIX 0x8316 #endif #ifndef GL_CONVOLUTION_WIDTH #define GL_CONVOLUTION_WIDTH 0x8018 #endif #ifndef GL_CONVOLUTION_WIDTH_EXT #define GL_CONVOLUTION_WIDTH_EXT 0x8018 #endif #ifndef GL_CON_0_ATI #define GL_CON_0_ATI 0x8941 #endif #ifndef GL_CON_10_ATI #define GL_CON_10_ATI 0x894B #endif #ifndef GL_CON_11_ATI #define GL_CON_11_ATI 0x894C #endif #ifndef GL_CON_12_ATI #define GL_CON_12_ATI 0x894D #endif #ifndef GL_CON_13_ATI #define GL_CON_13_ATI 0x894E #endif #ifndef GL_CON_14_ATI #define GL_CON_14_ATI 0x894F #endif #ifndef GL_CON_15_ATI #define GL_CON_15_ATI 0x8950 #endif #ifndef GL_CON_16_ATI #define GL_CON_16_ATI 0x8951 #endif #ifndef GL_CON_17_ATI #define GL_CON_17_ATI 0x8952 #endif #ifndef GL_CON_18_ATI #define GL_CON_18_ATI 0x8953 #endif #ifndef GL_CON_19_ATI #define GL_CON_19_ATI 0x8954 #endif #ifndef GL_CON_1_ATI #define GL_CON_1_ATI 0x8942 #endif #ifndef GL_CON_20_ATI #define GL_CON_20_ATI 0x8955 #endif #ifndef GL_CON_21_ATI #define GL_CON_21_ATI 0x8956 #endif #ifndef GL_CON_22_ATI #define GL_CON_22_ATI 0x8957 #endif #ifndef GL_CON_23_ATI #define GL_CON_23_ATI 0x8958 #endif #ifndef GL_CON_24_ATI #define GL_CON_24_ATI 0x8959 #endif #ifndef GL_CON_25_ATI #define GL_CON_25_ATI 0x895A #endif #ifndef GL_CON_26_ATI #define GL_CON_26_ATI 0x895B #endif #ifndef GL_CON_27_ATI #define GL_CON_27_ATI 0x895C #endif #ifndef GL_CON_28_ATI #define GL_CON_28_ATI 0x895D #endif #ifndef GL_CON_29_ATI #define GL_CON_29_ATI 0x895E #endif #ifndef GL_CON_2_ATI #define GL_CON_2_ATI 0x8943 #endif #ifndef GL_CON_30_ATI #define GL_CON_30_ATI 0x895F #endif #ifndef GL_CON_31_ATI #define GL_CON_31_ATI 0x8960 #endif #ifndef GL_CON_3_ATI #define GL_CON_3_ATI 0x8944 #endif #ifndef GL_CON_4_ATI #define GL_CON_4_ATI 0x8945 #endif #ifndef GL_CON_5_ATI #define GL_CON_5_ATI 0x8946 #endif #ifndef GL_CON_6_ATI #define GL_CON_6_ATI 0x8947 #endif #ifndef GL_CON_7_ATI #define GL_CON_7_ATI 0x8948 #endif #ifndef GL_CON_8_ATI #define GL_CON_8_ATI 0x8949 #endif #ifndef GL_CON_9_ATI #define GL_CON_9_ATI 0x894A #endif #ifndef GL_COORD_REPLACE #define GL_COORD_REPLACE 0x8862 #endif #ifndef GL_COORD_REPLACE_ARB #define GL_COORD_REPLACE_ARB 0x8862 #endif #ifndef GL_COORD_REPLACE_NV #define GL_COORD_REPLACE_NV 0x8862 #endif #ifndef GL_COPY #define GL_COPY 0x1503 #endif #ifndef GL_COPY_INVERTED #define GL_COPY_INVERTED 0x150C #endif #ifndef GL_COPY_PIXEL_TOKEN #define GL_COPY_PIXEL_TOKEN 0x0706 #endif #ifndef GL_CUBIC_EXT #define GL_CUBIC_EXT 0x8334 #endif #ifndef GL_CUBIC_HP #define GL_CUBIC_HP 0x815F #endif #ifndef GL_CULL_FACE #define GL_CULL_FACE 0x0B44 #endif #ifndef GL_CULL_FACE_MODE #define GL_CULL_FACE_MODE 0x0B45 #endif #ifndef GL_CULL_FRAGMENT_NV #define GL_CULL_FRAGMENT_NV 0x86E7 #endif #ifndef GL_CULL_MODES_NV #define GL_CULL_MODES_NV 0x86E0 #endif #ifndef GL_CULL_VERTEX_EXT #define GL_CULL_VERTEX_EXT 0x81AA #endif #ifndef GL_CULL_VERTEX_EYE_POSITION_EXT #define GL_CULL_VERTEX_EYE_POSITION_EXT 0x81AB #endif #ifndef GL_CULL_VERTEX_IBM #define GL_CULL_VERTEX_IBM 103050 #endif #ifndef GL_CULL_VERTEX_OBJECT_POSITION_EXT #define GL_CULL_VERTEX_OBJECT_POSITION_EXT 0x81AC #endif #ifndef GL_CURRENT_ATTRIB_NV #define GL_CURRENT_ATTRIB_NV 0x8626 #endif #ifndef GL_CURRENT_BINORMAL_EXT #define GL_CURRENT_BINORMAL_EXT 0x843C #endif #ifndef GL_CURRENT_BIT #define GL_CURRENT_BIT 0x00000001 #endif #ifndef GL_CURRENT_COLOR #define GL_CURRENT_COLOR 0x0B00 #endif #ifndef GL_CURRENT_FOG_COORD #define GL_CURRENT_FOG_COORD GL_CURRENT_FOG_COORDINATE #endif #ifndef GL_CURRENT_FOG_COORDINATE #define GL_CURRENT_FOG_COORDINATE 0x8453 #endif #ifndef GL_CURRENT_FOG_COORDINATE_EXT #define GL_CURRENT_FOG_COORDINATE_EXT 0x8453 #endif #ifndef GL_CURRENT_INDEX #define GL_CURRENT_INDEX 0x0B01 #endif #ifndef GL_CURRENT_MATRIX_ARB #define GL_CURRENT_MATRIX_ARB 0x8641 #endif #ifndef GL_CURRENT_MATRIX_INDEX_ARB #define GL_CURRENT_MATRIX_INDEX_ARB 0x8845 #endif #ifndef GL_CURRENT_MATRIX_NV #define GL_CURRENT_MATRIX_NV 0x8641 #endif #ifndef GL_CURRENT_MATRIX_STACK_DEPTH_ARB #define GL_CURRENT_MATRIX_STACK_DEPTH_ARB 0x8640 #endif #ifndef GL_CURRENT_MATRIX_STACK_DEPTH_NV #define GL_CURRENT_MATRIX_STACK_DEPTH_NV 0x8640 #endif #ifndef GL_CURRENT_NORMAL #define GL_CURRENT_NORMAL 0x0B02 #endif #ifndef GL_CURRENT_OCCLUSION_QUERY_ID_NV #define GL_CURRENT_OCCLUSION_QUERY_ID_NV 0x8865 #endif #ifndef GL_CURRENT_PALETTE_MATRIX_ARB #define GL_CURRENT_PALETTE_MATRIX_ARB 0x8843 #endif #ifndef GL_CURRENT_PROGRAM #define GL_CURRENT_PROGRAM 0x8B8D #endif #ifndef GL_CURRENT_QUERY #define GL_CURRENT_QUERY 0x8865 #endif #ifndef GL_CURRENT_QUERY_ARB #define GL_CURRENT_QUERY_ARB 0x8865 #endif #ifndef GL_CURRENT_RASTER_COLOR #define GL_CURRENT_RASTER_COLOR 0x0B04 #endif #ifndef GL_CURRENT_RASTER_DISTANCE #define GL_CURRENT_RASTER_DISTANCE 0x0B09 #endif #ifndef GL_CURRENT_RASTER_INDEX #define GL_CURRENT_RASTER_INDEX 0x0B05 #endif #ifndef GL_CURRENT_RASTER_NORMAL_SGIX #define GL_CURRENT_RASTER_NORMAL_SGIX 0x8406 #endif #ifndef GL_CURRENT_RASTER_POSITION #define GL_CURRENT_RASTER_POSITION 0x0B07 #endif #ifndef GL_CURRENT_RASTER_POSITION_VALID #define GL_CURRENT_RASTER_POSITION_VALID 0x0B08 #endif #ifndef GL_CURRENT_RASTER_SECONDARY_COLOR #define GL_CURRENT_RASTER_SECONDARY_COLOR 0x845F #endif #ifndef GL_CURRENT_RASTER_TEXTURE_COORDS #define GL_CURRENT_RASTER_TEXTURE_COORDS 0x0B06 #endif #ifndef GL_CURRENT_SECONDARY_COLOR #define GL_CURRENT_SECONDARY_COLOR 0x8459 #endif #ifndef GL_CURRENT_SECONDARY_COLOR_EXT #define GL_CURRENT_SECONDARY_COLOR_EXT 0x8459 #endif #ifndef GL_CURRENT_TANGENT_EXT #define GL_CURRENT_TANGENT_EXT 0x843B #endif #ifndef GL_CURRENT_TEXTURE_COORDS #define GL_CURRENT_TEXTURE_COORDS 0x0B03 #endif #ifndef GL_CURRENT_TIME_NV #define GL_CURRENT_TIME_NV 0x8E28 #endif #ifndef GL_CURRENT_VERTEX_ATTRIB #define GL_CURRENT_VERTEX_ATTRIB 0x8626 #endif #ifndef GL_CURRENT_VERTEX_ATTRIB_ARB #define GL_CURRENT_VERTEX_ATTRIB_ARB 0x8626 #endif #ifndef GL_CURRENT_VERTEX_EXT #define GL_CURRENT_VERTEX_EXT 0x87E2 #endif #ifndef GL_CURRENT_VERTEX_WEIGHT_EXT #define GL_CURRENT_VERTEX_WEIGHT_EXT 0x850B #endif #ifndef GL_CURRENT_WEIGHT_ARB #define GL_CURRENT_WEIGHT_ARB 0x86A8 #endif #ifndef GL_CW #define GL_CW 0x0900 #endif #ifndef GL_DECAL #define GL_DECAL 0x2101 #endif #ifndef GL_DECR #define GL_DECR 0x1E03 #endif #ifndef GL_DECR_WRAP #define GL_DECR_WRAP 0x8508 #endif #ifndef GL_DECR_WRAP_EXT #define GL_DECR_WRAP_EXT 0x8508 #endif #ifndef GL_DEFORMATIONS_MASK_SGIX #define GL_DEFORMATIONS_MASK_SGIX 0x8196 #endif #ifndef GL_DELETE_STATUS #define GL_DELETE_STATUS 0x8B80 #endif #ifndef GL_DEPENDENT_AR_TEXTURE_2D_NV #define GL_DEPENDENT_AR_TEXTURE_2D_NV 0x86E9 #endif #ifndef GL_DEPENDENT_GB_TEXTURE_2D_NV #define GL_DEPENDENT_GB_TEXTURE_2D_NV 0x86EA #endif #ifndef GL_DEPENDENT_HILO_TEXTURE_2D_NV #define GL_DEPENDENT_HILO_TEXTURE_2D_NV 0x8858 #endif #ifndef GL_DEPENDENT_RGB_TEXTURE_3D_NV #define GL_DEPENDENT_RGB_TEXTURE_3D_NV 0x8859 #endif #ifndef GL_DEPENDENT_RGB_TEXTURE_CUBE_MAP_NV #define GL_DEPENDENT_RGB_TEXTURE_CUBE_MAP_NV 0x885A #endif #ifndef GL_DEPTH #define GL_DEPTH 0x1801 #endif #ifndef GL_DEPTH24_STENCIL8 #define GL_DEPTH24_STENCIL8 0x88F0 #endif #ifndef GL_DEPTH24_STENCIL8_EXT #define GL_DEPTH24_STENCIL8_EXT 0x88F0 #endif #ifndef GL_DEPTH32F_STENCIL8 #define GL_DEPTH32F_STENCIL8 0x8CAD #endif #ifndef GL_DEPTH32F_STENCIL8_NV #define GL_DEPTH32F_STENCIL8_NV 0x8DAC #endif #ifndef GL_DEPTH_ATTACHMENT #define GL_DEPTH_ATTACHMENT 0x8D00 #endif #ifndef GL_DEPTH_ATTACHMENT_EXT #define GL_DEPTH_ATTACHMENT_EXT 0x8D00 #endif #ifndef GL_DEPTH_BIAS #define GL_DEPTH_BIAS 0x0D1F #endif #ifndef GL_DEPTH_BITS #define GL_DEPTH_BITS 0x0D56 #endif #ifndef GL_DEPTH_BOUNDS_EXT #define GL_DEPTH_BOUNDS_EXT 0x8891 #endif #ifndef GL_DEPTH_BOUNDS_TEST_EXT #define GL_DEPTH_BOUNDS_TEST_EXT 0x8890 #endif #ifndef GL_DEPTH_BUFFER #define GL_DEPTH_BUFFER 0x8223 #endif #ifndef GL_DEPTH_BUFFER_BIT #define GL_DEPTH_BUFFER_BIT 0x00000100 #endif #ifndef GL_DEPTH_BUFFER_FLOAT_MODE_NV #define GL_DEPTH_BUFFER_FLOAT_MODE_NV 0x8DAF #endif #ifndef GL_DEPTH_CLAMP_NV #define GL_DEPTH_CLAMP_NV 0x864F #endif #ifndef GL_DEPTH_CLEAR_VALUE #define GL_DEPTH_CLEAR_VALUE 0x0B73 #endif #ifndef GL_DEPTH_COMPONENT #define GL_DEPTH_COMPONENT 0x1902 #endif #ifndef GL_DEPTH_COMPONENT16 #define GL_DEPTH_COMPONENT16 0x81A5 #endif #ifndef GL_DEPTH_COMPONENT16_ARB #define GL_DEPTH_COMPONENT16_ARB 0x81A5 #endif #ifndef GL_DEPTH_COMPONENT16_SGIX #define GL_DEPTH_COMPONENT16_SGIX 0x81A5 #endif #ifndef GL_DEPTH_COMPONENT24 #define GL_DEPTH_COMPONENT24 0x81A6 #endif #ifndef GL_DEPTH_COMPONENT24_ARB #define GL_DEPTH_COMPONENT24_ARB 0x81A6 #endif #ifndef GL_DEPTH_COMPONENT24_SGIX #define GL_DEPTH_COMPONENT24_SGIX 0x81A6 #endif #ifndef GL_DEPTH_COMPONENT32 #define GL_DEPTH_COMPONENT32 0x81A7 #endif #ifndef GL_DEPTH_COMPONENT32F #define GL_DEPTH_COMPONENT32F 0x8CAC #endif #ifndef GL_DEPTH_COMPONENT32F_NV #define GL_DEPTH_COMPONENT32F_NV 0x8DAB #endif #ifndef GL_DEPTH_COMPONENT32_ARB #define GL_DEPTH_COMPONENT32_ARB 0x81A7 #endif #ifndef GL_DEPTH_COMPONENT32_SGIX #define GL_DEPTH_COMPONENT32_SGIX 0x81A7 #endif #ifndef GL_DEPTH_FUNC #define GL_DEPTH_FUNC 0x0B74 #endif #ifndef GL_DEPTH_PASS_INSTRUMENT_COUNTERS_SGIX #define GL_DEPTH_PASS_INSTRUMENT_COUNTERS_SGIX 0x8311 #endif #ifndef GL_DEPTH_PASS_INSTRUMENT_MAX_SGIX #define GL_DEPTH_PASS_INSTRUMENT_MAX_SGIX 0x8312 #endif #ifndef GL_DEPTH_PASS_INSTRUMENT_SGIX #define GL_DEPTH_PASS_INSTRUMENT_SGIX 0x8310 #endif #ifndef GL_DEPTH_RANGE #define GL_DEPTH_RANGE 0x0B70 #endif #ifndef GL_DEPTH_SCALE #define GL_DEPTH_SCALE 0x0D1E #endif #ifndef GL_DEPTH_STENCIL #define GL_DEPTH_STENCIL 0x84F9 #endif #ifndef GL_DEPTH_STENCIL_ATTACHMENT #define GL_DEPTH_STENCIL_ATTACHMENT 0x821A #endif #ifndef GL_DEPTH_STENCIL_EXT #define GL_DEPTH_STENCIL_EXT 0x84F9 #endif #ifndef GL_DEPTH_STENCIL_NV #define GL_DEPTH_STENCIL_NV 0x84F9 #endif #ifndef GL_DEPTH_STENCIL_TO_BGRA_NV #define GL_DEPTH_STENCIL_TO_BGRA_NV 0x886F #endif #ifndef GL_DEPTH_STENCIL_TO_RGBA_NV #define GL_DEPTH_STENCIL_TO_RGBA_NV 0x886E #endif #ifndef GL_DEPTH_TEST #define GL_DEPTH_TEST 0x0B71 #endif #ifndef GL_DEPTH_TEXTURE_MODE #define GL_DEPTH_TEXTURE_MODE 0x884B #endif #ifndef GL_DEPTH_TEXTURE_MODE_ARB #define GL_DEPTH_TEXTURE_MODE_ARB 0x884B #endif #ifndef GL_DEPTH_WRITEMASK #define GL_DEPTH_WRITEMASK 0x0B72 #endif #ifndef GL_DETAIL_TEXTURE_2D_BINDING_SGIS #define GL_DETAIL_TEXTURE_2D_BINDING_SGIS 0x8096 #endif #ifndef GL_DETAIL_TEXTURE_2D_SGIS #define GL_DETAIL_TEXTURE_2D_SGIS 0x8095 #endif #ifndef GL_DETAIL_TEXTURE_FUNC_POINTS_SGIS #define GL_DETAIL_TEXTURE_FUNC_POINTS_SGIS 0x809C #endif #ifndef GL_DETAIL_TEXTURE_LEVEL_SGIS #define GL_DETAIL_TEXTURE_LEVEL_SGIS 0x809A #endif #ifndef GL_DETAIL_TEXTURE_MODE_SGIS #define GL_DETAIL_TEXTURE_MODE_SGIS 0x809B #endif #ifndef GL_DIFFUSE #define GL_DIFFUSE 0x1201 #endif #ifndef GL_DISCARD_ATI #define GL_DISCARD_ATI 0x8763 #endif #ifndef GL_DISCARD_NV #define GL_DISCARD_NV 0x8530 #endif #ifndef GL_DISTANCE_ATTENUATION_EXT #define GL_DISTANCE_ATTENUATION_EXT 0x8129 #endif #ifndef GL_DISTANCE_ATTENUATION_SGIS #define GL_DISTANCE_ATTENUATION_SGIS 0x8129 #endif #ifndef GL_DITHER #define GL_DITHER 0x0BD0 #endif #ifndef GL_DOMAIN #define GL_DOMAIN 0x0A02 #endif #ifndef GL_DONT_CARE #define GL_DONT_CARE 0x1100 #endif #ifndef GL_DOT2_ADD_ATI #define GL_DOT2_ADD_ATI 0x896C #endif #ifndef GL_DOT3_ATI #define GL_DOT3_ATI 0x8966 #endif #ifndef GL_DOT3_RGB #define GL_DOT3_RGB 0x86AE #endif #ifndef GL_DOT3_RGBA #define GL_DOT3_RGBA 0x86AF #endif #ifndef GL_DOT3_RGBA_ARB #define GL_DOT3_RGBA_ARB 0x86AF #endif #ifndef GL_DOT3_RGBA_EXT #define GL_DOT3_RGBA_EXT 0x8741 #endif #ifndef GL_DOT3_RGB_ARB #define GL_DOT3_RGB_ARB 0x86AE #endif #ifndef GL_DOT3_RGB_EXT #define GL_DOT3_RGB_EXT 0x8740 #endif #ifndef GL_DOT4_ATI #define GL_DOT4_ATI 0x8967 #endif #ifndef GL_DOT_PRODUCT_AFFINE_DEPTH_REPLACE_NV #define GL_DOT_PRODUCT_AFFINE_DEPTH_REPLACE_NV 0x885D #endif #ifndef GL_DOT_PRODUCT_CONST_EYE_REFLECT_CUBE_MAP_NV #define GL_DOT_PRODUCT_CONST_EYE_REFLECT_CUBE_MAP_NV 0x86F3 #endif #ifndef GL_DOT_PRODUCT_DEPTH_REPLACE_NV #define GL_DOT_PRODUCT_DEPTH_REPLACE_NV 0x86ED #endif #ifndef GL_DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV #define GL_DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV 0x86F1 #endif #ifndef GL_DOT_PRODUCT_NV #define GL_DOT_PRODUCT_NV 0x86EC #endif #ifndef GL_DOT_PRODUCT_PASS_THROUGH_NV #define GL_DOT_PRODUCT_PASS_THROUGH_NV 0x885B #endif #ifndef GL_DOT_PRODUCT_REFLECT_CUBE_MAP_NV #define GL_DOT_PRODUCT_REFLECT_CUBE_MAP_NV 0x86F2 #endif #ifndef GL_DOT_PRODUCT_TEXTURE_1D_NV #define GL_DOT_PRODUCT_TEXTURE_1D_NV 0x885C #endif #ifndef GL_DOT_PRODUCT_TEXTURE_2D_NV #define GL_DOT_PRODUCT_TEXTURE_2D_NV 0x86EE #endif #ifndef GL_DOT_PRODUCT_TEXTURE_3D_NV #define GL_DOT_PRODUCT_TEXTURE_3D_NV 0x86EF #endif #ifndef GL_DOT_PRODUCT_TEXTURE_CUBE_MAP_NV #define GL_DOT_PRODUCT_TEXTURE_CUBE_MAP_NV 0x86F0 #endif #ifndef GL_DOT_PRODUCT_TEXTURE_RECTANGLE_NV #define GL_DOT_PRODUCT_TEXTURE_RECTANGLE_NV 0x864E #endif #ifndef GL_DOUBLE #define GL_DOUBLE 0x140A #endif #ifndef GL_DOUBLEBUFFER #define GL_DOUBLEBUFFER 0x0C32 #endif #ifndef GL_DOUBLE_EXT #define GL_DOUBLE_EXT 0x140A #endif #ifndef GL_DRAW_BUFFER #define GL_DRAW_BUFFER 0x0C01 #endif #ifndef GL_DRAW_BUFFER0 #define GL_DRAW_BUFFER0 0x8825 #endif #ifndef GL_DRAW_BUFFER0_ARB #define GL_DRAW_BUFFER0_ARB 0x8825 #endif #ifndef GL_DRAW_BUFFER0_ATI #define GL_DRAW_BUFFER0_ATI 0x8825 #endif #ifndef GL_DRAW_BUFFER1 #define GL_DRAW_BUFFER1 0x8826 #endif #ifndef GL_DRAW_BUFFER10 #define GL_DRAW_BUFFER10 0x882F #endif #ifndef GL_DRAW_BUFFER10_ARB #define GL_DRAW_BUFFER10_ARB 0x882F #endif #ifndef GL_DRAW_BUFFER10_ATI #define GL_DRAW_BUFFER10_ATI 0x882F #endif #ifndef GL_DRAW_BUFFER11 #define GL_DRAW_BUFFER11 0x8830 #endif #ifndef GL_DRAW_BUFFER11_ARB #define GL_DRAW_BUFFER11_ARB 0x8830 #endif #ifndef GL_DRAW_BUFFER11_ATI #define GL_DRAW_BUFFER11_ATI 0x8830 #endif #ifndef GL_DRAW_BUFFER12 #define GL_DRAW_BUFFER12 0x8831 #endif #ifndef GL_DRAW_BUFFER12_ARB #define GL_DRAW_BUFFER12_ARB 0x8831 #endif #ifndef GL_DRAW_BUFFER12_ATI #define GL_DRAW_BUFFER12_ATI 0x8831 #endif #ifndef GL_DRAW_BUFFER13 #define GL_DRAW_BUFFER13 0x8832 #endif #ifndef GL_DRAW_BUFFER13_ARB #define GL_DRAW_BUFFER13_ARB 0x8832 #endif #ifndef GL_DRAW_BUFFER13_ATI #define GL_DRAW_BUFFER13_ATI 0x8832 #endif #ifndef GL_DRAW_BUFFER14 #define GL_DRAW_BUFFER14 0x8833 #endif #ifndef GL_DRAW_BUFFER14_ARB #define GL_DRAW_BUFFER14_ARB 0x8833 #endif #ifndef GL_DRAW_BUFFER14_ATI #define GL_DRAW_BUFFER14_ATI 0x8833 #endif #ifndef GL_DRAW_BUFFER15 #define GL_DRAW_BUFFER15 0x8834 #endif #ifndef GL_DRAW_BUFFER15_ARB #define GL_DRAW_BUFFER15_ARB 0x8834 #endif #ifndef GL_DRAW_BUFFER15_ATI #define GL_DRAW_BUFFER15_ATI 0x8834 #endif #ifndef GL_DRAW_BUFFER1_ARB #define GL_DRAW_BUFFER1_ARB 0x8826 #endif #ifndef GL_DRAW_BUFFER1_ATI #define GL_DRAW_BUFFER1_ATI 0x8826 #endif #ifndef GL_DRAW_BUFFER2 #define GL_DRAW_BUFFER2 0x8827 #endif #ifndef GL_DRAW_BUFFER2_ARB #define GL_DRAW_BUFFER2_ARB 0x8827 #endif #ifndef GL_DRAW_BUFFER2_ATI #define GL_DRAW_BUFFER2_ATI 0x8827 #endif #ifndef GL_DRAW_BUFFER3 #define GL_DRAW_BUFFER3 0x8828 #endif #ifndef GL_DRAW_BUFFER3_ARB #define GL_DRAW_BUFFER3_ARB 0x8828 #endif #ifndef GL_DRAW_BUFFER3_ATI #define GL_DRAW_BUFFER3_ATI 0x8828 #endif #ifndef GL_DRAW_BUFFER4 #define GL_DRAW_BUFFER4 0x8829 #endif #ifndef GL_DRAW_BUFFER4_ARB #define GL_DRAW_BUFFER4_ARB 0x8829 #endif #ifndef GL_DRAW_BUFFER4_ATI #define GL_DRAW_BUFFER4_ATI 0x8829 #endif #ifndef GL_DRAW_BUFFER5 #define GL_DRAW_BUFFER5 0x882A #endif #ifndef GL_DRAW_BUFFER5_ARB #define GL_DRAW_BUFFER5_ARB 0x882A #endif #ifndef GL_DRAW_BUFFER5_ATI #define GL_DRAW_BUFFER5_ATI 0x882A #endif #ifndef GL_DRAW_BUFFER6 #define GL_DRAW_BUFFER6 0x882B #endif #ifndef GL_DRAW_BUFFER6_ARB #define GL_DRAW_BUFFER6_ARB 0x882B #endif #ifndef GL_DRAW_BUFFER6_ATI #define GL_DRAW_BUFFER6_ATI 0x882B #endif #ifndef GL_DRAW_BUFFER7 #define GL_DRAW_BUFFER7 0x882C #endif #ifndef GL_DRAW_BUFFER7_ARB #define GL_DRAW_BUFFER7_ARB 0x882C #endif #ifndef GL_DRAW_BUFFER7_ATI #define GL_DRAW_BUFFER7_ATI 0x882C #endif #ifndef GL_DRAW_BUFFER8 #define GL_DRAW_BUFFER8 0x882D #endif #ifndef GL_DRAW_BUFFER8_ARB #define GL_DRAW_BUFFER8_ARB 0x882D #endif #ifndef GL_DRAW_BUFFER8_ATI #define GL_DRAW_BUFFER8_ATI 0x882D #endif #ifndef GL_DRAW_BUFFER9 #define GL_DRAW_BUFFER9 0x882E #endif #ifndef GL_DRAW_BUFFER9_ARB #define GL_DRAW_BUFFER9_ARB 0x882E #endif #ifndef GL_DRAW_BUFFER9_ATI #define GL_DRAW_BUFFER9_ATI 0x882E #endif #ifndef GL_DRAW_FRAMEBUFFER #define GL_DRAW_FRAMEBUFFER 0x8CA9 #endif #ifndef GL_DRAW_FRAMEBUFFER_BINDING #define GL_DRAW_FRAMEBUFFER_BINDING GL_FRAMEBUFFER_BINDING #endif #ifndef GL_DRAW_FRAMEBUFFER_BINDING_EXT #define GL_DRAW_FRAMEBUFFER_BINDING_EXT GL_FRAMEBUFFER_BINDING_EXT #endif #ifndef GL_DRAW_FRAMEBUFFER_EXT #define GL_DRAW_FRAMEBUFFER_EXT 0x8CA9 #endif #ifndef GL_DRAW_PIXELS_APPLE #define GL_DRAW_PIXELS_APPLE 0x8A0A #endif #ifndef GL_DRAW_PIXEL_TOKEN #define GL_DRAW_PIXEL_TOKEN 0x0705 #endif #ifndef GL_DSDT8_MAG8_INTENSITY8_NV #define GL_DSDT8_MAG8_INTENSITY8_NV 0x870B #endif #ifndef GL_DSDT8_MAG8_NV #define GL_DSDT8_MAG8_NV 0x870A #endif #ifndef GL_DSDT8_NV #define GL_DSDT8_NV 0x8709 #endif #ifndef GL_DSDT_MAG_INTENSITY_NV #define GL_DSDT_MAG_INTENSITY_NV 0x86DC #endif #ifndef GL_DSDT_MAG_NV #define GL_DSDT_MAG_NV 0x86F6 #endif #ifndef GL_DSDT_MAG_VIB_NV #define GL_DSDT_MAG_VIB_NV 0x86F7 #endif #ifndef GL_DSDT_NV #define GL_DSDT_NV 0x86F5 #endif #ifndef GL_DST_ALPHA #define GL_DST_ALPHA 0x0304 #endif #ifndef GL_DST_COLOR #define GL_DST_COLOR 0x0306 #endif #ifndef GL_DS_BIAS_NV #define GL_DS_BIAS_NV 0x8716 #endif #ifndef GL_DS_SCALE_NV #define GL_DS_SCALE_NV 0x8710 #endif #ifndef GL_DT_BIAS_NV #define GL_DT_BIAS_NV 0x8717 #endif #ifndef GL_DT_SCALE_NV #define GL_DT_SCALE_NV 0x8711 #endif #ifndef GL_DU8DV8_ATI #define GL_DU8DV8_ATI 0x877A #endif #ifndef GL_DUAL_ALPHA12_SGIS #define GL_DUAL_ALPHA12_SGIS 0x8112 #endif #ifndef GL_DUAL_ALPHA16_SGIS #define GL_DUAL_ALPHA16_SGIS 0x8113 #endif #ifndef GL_DUAL_ALPHA4_SGIS #define GL_DUAL_ALPHA4_SGIS 0x8110 #endif #ifndef GL_DUAL_ALPHA8_SGIS #define GL_DUAL_ALPHA8_SGIS 0x8111 #endif #ifndef GL_DUAL_INTENSITY12_SGIS #define GL_DUAL_INTENSITY12_SGIS 0x811A #endif #ifndef GL_DUAL_INTENSITY16_SGIS #define GL_DUAL_INTENSITY16_SGIS 0x811B #endif #ifndef GL_DUAL_INTENSITY4_SGIS #define GL_DUAL_INTENSITY4_SGIS 0x8118 #endif #ifndef GL_DUAL_INTENSITY8_SGIS #define GL_DUAL_INTENSITY8_SGIS 0x8119 #endif #ifndef GL_DUAL_LUMINANCE12_SGIS #define GL_DUAL_LUMINANCE12_SGIS 0x8116 #endif #ifndef GL_DUAL_LUMINANCE16_SGIS #define GL_DUAL_LUMINANCE16_SGIS 0x8117 #endif #ifndef GL_DUAL_LUMINANCE4_SGIS #define GL_DUAL_LUMINANCE4_SGIS 0x8114 #endif #ifndef GL_DUAL_LUMINANCE8_SGIS #define GL_DUAL_LUMINANCE8_SGIS 0x8115 #endif #ifndef GL_DUAL_LUMINANCE_ALPHA4_SGIS #define GL_DUAL_LUMINANCE_ALPHA4_SGIS 0x811C #endif #ifndef GL_DUAL_LUMINANCE_ALPHA8_SGIS #define GL_DUAL_LUMINANCE_ALPHA8_SGIS 0x811D #endif #ifndef GL_DUAL_TEXTURE_SELECT_SGIS #define GL_DUAL_TEXTURE_SELECT_SGIS 0x8124 #endif #ifndef GL_DUDV_ATI #define GL_DUDV_ATI 0x8779 #endif #ifndef GL_DYNAMIC_ATI #define GL_DYNAMIC_ATI 0x8761 #endif #ifndef GL_DYNAMIC_COPY #define GL_DYNAMIC_COPY 0x88EA #endif #ifndef GL_DYNAMIC_COPY_ARB #define GL_DYNAMIC_COPY_ARB 0x88EA #endif #ifndef GL_DYNAMIC_DRAW #define GL_DYNAMIC_DRAW 0x88E8 #endif #ifndef GL_DYNAMIC_DRAW_ARB #define GL_DYNAMIC_DRAW_ARB 0x88E8 #endif #ifndef GL_DYNAMIC_READ #define GL_DYNAMIC_READ 0x88E9 #endif #ifndef GL_DYNAMIC_READ_ARB #define GL_DYNAMIC_READ_ARB 0x88E9 #endif #ifndef GL_EDGEFLAG_BIT_PGI #define GL_EDGEFLAG_BIT_PGI 0x00040000 #endif #ifndef GL_EDGE_FLAG #define GL_EDGE_FLAG 0x0B43 #endif #ifndef GL_EDGE_FLAG_ARRAY #define GL_EDGE_FLAG_ARRAY 0x8079 #endif #ifndef GL_EDGE_FLAG_ARRAY_BUFFER_BINDING #define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING 0x889B #endif #ifndef GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB #define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB 0x889B #endif #ifndef GL_EDGE_FLAG_ARRAY_COUNT_EXT #define GL_EDGE_FLAG_ARRAY_COUNT_EXT 0x808D #endif #ifndef GL_EDGE_FLAG_ARRAY_EXT #define GL_EDGE_FLAG_ARRAY_EXT 0x8079 #endif #ifndef GL_EDGE_FLAG_ARRAY_LIST_IBM #define GL_EDGE_FLAG_ARRAY_LIST_IBM 103075 #endif #ifndef GL_EDGE_FLAG_ARRAY_LIST_STRIDE_IBM #define GL_EDGE_FLAG_ARRAY_LIST_STRIDE_IBM 103085 #endif #ifndef GL_EDGE_FLAG_ARRAY_POINTER #define GL_EDGE_FLAG_ARRAY_POINTER 0x8093 #endif #ifndef GL_EDGE_FLAG_ARRAY_POINTER_EXT #define GL_EDGE_FLAG_ARRAY_POINTER_EXT 0x8093 #endif #ifndef GL_EDGE_FLAG_ARRAY_STRIDE #define GL_EDGE_FLAG_ARRAY_STRIDE 0x808C #endif #ifndef GL_EDGE_FLAG_ARRAY_STRIDE_EXT #define GL_EDGE_FLAG_ARRAY_STRIDE_EXT 0x808C #endif #ifndef GL_EIGHTH_BIT_ATI #define GL_EIGHTH_BIT_ATI 0x00000020 #endif #ifndef GL_ELEMENT_ARRAY_APPLE #define GL_ELEMENT_ARRAY_APPLE 0x8768 #endif #ifndef GL_ELEMENT_ARRAY_ATI #define GL_ELEMENT_ARRAY_ATI 0x8768 #endif #ifndef GL_ELEMENT_ARRAY_BUFFER #define GL_ELEMENT_ARRAY_BUFFER 0x8893 #endif #ifndef GL_ELEMENT_ARRAY_BUFFER_ARB #define GL_ELEMENT_ARRAY_BUFFER_ARB 0x8893 #endif #ifndef GL_ELEMENT_ARRAY_BUFFER_BINDING #define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895 #endif #ifndef GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB #define GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB 0x8895 #endif #ifndef GL_ELEMENT_ARRAY_POINTER_APPLE #define GL_ELEMENT_ARRAY_POINTER_APPLE 0x876A #endif #ifndef GL_ELEMENT_ARRAY_POINTER_ATI #define GL_ELEMENT_ARRAY_POINTER_ATI 0x876A #endif #ifndef GL_ELEMENT_ARRAY_TYPE_APPLE #define GL_ELEMENT_ARRAY_TYPE_APPLE 0x8769 #endif #ifndef GL_ELEMENT_ARRAY_TYPE_ATI #define GL_ELEMENT_ARRAY_TYPE_ATI 0x8769 #endif #ifndef GL_EMBOSS_CONSTANT_NV #define GL_EMBOSS_CONSTANT_NV 0x855E #endif #ifndef GL_EMBOSS_LIGHT_NV #define GL_EMBOSS_LIGHT_NV 0x855D #endif #ifndef GL_EMBOSS_MAP_NV #define GL_EMBOSS_MAP_NV 0x855F #endif #ifndef GL_EMISSION #define GL_EMISSION 0x1600 #endif #ifndef GL_ENABLE_BIT #define GL_ENABLE_BIT 0x00002000 #endif #ifndef GL_EQUAL #define GL_EQUAL 0x0202 #endif #ifndef GL_EQUIV #define GL_EQUIV 0x1509 #endif #ifndef GL_EVAL_2D_NV #define GL_EVAL_2D_NV 0x86C0 #endif #ifndef GL_EVAL_BIT #define GL_EVAL_BIT 0x00010000 #endif #ifndef GL_EVAL_FRACTIONAL_TESSELLATION_NV #define GL_EVAL_FRACTIONAL_TESSELLATION_NV 0x86C5 #endif #ifndef GL_EVAL_TRIANGULAR_2D_NV #define GL_EVAL_TRIANGULAR_2D_NV 0x86C1 #endif #ifndef GL_EVAL_VERTEX_ATTRIB0_NV #define GL_EVAL_VERTEX_ATTRIB0_NV 0x86C6 #endif #ifndef GL_EVAL_VERTEX_ATTRIB10_NV #define GL_EVAL_VERTEX_ATTRIB10_NV 0x86D0 #endif #ifndef GL_EVAL_VERTEX_ATTRIB11_NV #define GL_EVAL_VERTEX_ATTRIB11_NV 0x86D1 #endif #ifndef GL_EVAL_VERTEX_ATTRIB12_NV #define GL_EVAL_VERTEX_ATTRIB12_NV 0x86D2 #endif #ifndef GL_EVAL_VERTEX_ATTRIB13_NV #define GL_EVAL_VERTEX_ATTRIB13_NV 0x86D3 #endif #ifndef GL_EVAL_VERTEX_ATTRIB14_NV #define GL_EVAL_VERTEX_ATTRIB14_NV 0x86D4 #endif #ifndef GL_EVAL_VERTEX_ATTRIB15_NV #define GL_EVAL_VERTEX_ATTRIB15_NV 0x86D5 #endif #ifndef GL_EVAL_VERTEX_ATTRIB1_NV #define GL_EVAL_VERTEX_ATTRIB1_NV 0x86C7 #endif #ifndef GL_EVAL_VERTEX_ATTRIB2_NV #define GL_EVAL_VERTEX_ATTRIB2_NV 0x86C8 #endif #ifndef GL_EVAL_VERTEX_ATTRIB3_NV #define GL_EVAL_VERTEX_ATTRIB3_NV 0x86C9 #endif #ifndef GL_EVAL_VERTEX_ATTRIB4_NV #define GL_EVAL_VERTEX_ATTRIB4_NV 0x86CA #endif #ifndef GL_EVAL_VERTEX_ATTRIB5_NV #define GL_EVAL_VERTEX_ATTRIB5_NV 0x86CB #endif #ifndef GL_EVAL_VERTEX_ATTRIB6_NV #define GL_EVAL_VERTEX_ATTRIB6_NV 0x86CC #endif #ifndef GL_EVAL_VERTEX_ATTRIB7_NV #define GL_EVAL_VERTEX_ATTRIB7_NV 0x86CD #endif #ifndef GL_EVAL_VERTEX_ATTRIB8_NV #define GL_EVAL_VERTEX_ATTRIB8_NV 0x86CE #endif #ifndef GL_EVAL_VERTEX_ATTRIB9_NV #define GL_EVAL_VERTEX_ATTRIB9_NV 0x86CF #endif #ifndef GL_EXP #define GL_EXP 0x0800 #endif #ifndef GL_EXP2 #define GL_EXP2 0x0801 #endif #ifndef GL_EXPAND_NEGATE_NV #define GL_EXPAND_NEGATE_NV 0x8539 #endif #ifndef GL_EXPAND_NORMAL_NV #define GL_EXPAND_NORMAL_NV 0x8538 #endif #ifndef GL_EXTENSIONS #define GL_EXTENSIONS 0x1F03 #endif #ifndef GL_EXT_abgr #define GL_EXT_abgr 1 #endif #ifndef GL_EXT_blend_color #define GL_EXT_blend_color 1 #endif #ifndef GL_EXT_blend_logic_op #define GL_EXT_blend_logic_op 1 #endif #ifndef GL_EXT_blend_minmax #define GL_EXT_blend_minmax 1 #endif #ifndef GL_EXT_blend_subtract #define GL_EXT_blend_subtract 1 #endif #ifndef GL_EXT_cmyka #define GL_EXT_cmyka 1 #endif #ifndef GL_EXT_convolution #define GL_EXT_convolution 1 #endif #ifndef GL_EXT_copy_texture #define GL_EXT_copy_texture 1 #endif #ifndef GL_EXT_histogram #define GL_EXT_histogram 1 #endif #ifndef GL_EXT_packed_pixels #define GL_EXT_packed_pixels 1 #endif #ifndef GL_EXT_point_parameters #define GL_EXT_point_parameters 1 #endif #ifndef GL_EXT_polygon_offset #define GL_EXT_polygon_offset 1 #endif #ifndef GL_EXT_rescale_normal #define GL_EXT_rescale_normal 1 #endif #ifndef GL_EXT_shared_texture_palette #define GL_EXT_shared_texture_palette 1 #endif #ifndef GL_EXT_subtexture #define GL_EXT_subtexture 1 #endif #ifndef GL_EXT_texture #define GL_EXT_texture 1 #endif #ifndef GL_EXT_texture3D #define GL_EXT_texture3D 1 #endif #ifndef GL_EXT_texture_object #define GL_EXT_texture_object 1 #endif #ifndef GL_EXT_vertex_array #define GL_EXT_vertex_array 1 #endif #ifndef GL_EYE_DISTANCE_TO_LINE_SGIS #define GL_EYE_DISTANCE_TO_LINE_SGIS 0x81F2 #endif #ifndef GL_EYE_DISTANCE_TO_POINT_SGIS #define GL_EYE_DISTANCE_TO_POINT_SGIS 0x81F0 #endif #ifndef GL_EYE_LINEAR #define GL_EYE_LINEAR 0x2400 #endif #ifndef GL_EYE_LINE_SGIS #define GL_EYE_LINE_SGIS 0x81F6 #endif #ifndef GL_EYE_PLANE #define GL_EYE_PLANE 0x2502 #endif #ifndef GL_EYE_PLANE_ABSOLUTE_NV #define GL_EYE_PLANE_ABSOLUTE_NV 0x855C #endif #ifndef GL_EYE_POINT_SGIS #define GL_EYE_POINT_SGIS 0x81F4 #endif #ifndef GL_EYE_RADIAL_NV #define GL_EYE_RADIAL_NV 0x855B #endif #ifndef GL_E_TIMES_F_NV #define GL_E_TIMES_F_NV 0x8531 #endif #ifndef GL_FASTEST #define GL_FASTEST 0x1101 #endif #ifndef GL_FEEDBACK #define GL_FEEDBACK 0x1C01 #endif #ifndef GL_FEEDBACK_BUFFER_POINTER #define GL_FEEDBACK_BUFFER_POINTER 0x0DF0 #endif #ifndef GL_FEEDBACK_BUFFER_SIZE #define GL_FEEDBACK_BUFFER_SIZE 0x0DF1 #endif #ifndef GL_FEEDBACK_BUFFER_TYPE #define GL_FEEDBACK_BUFFER_TYPE 0x0DF2 #endif #ifndef GL_FENCE_APPLE #define GL_FENCE_APPLE 0x8A0B #endif #ifndef GL_FENCE_CONDITION_NV #define GL_FENCE_CONDITION_NV 0x84F4 #endif #ifndef GL_FENCE_STATUS_NV #define GL_FENCE_STATUS_NV 0x84F3 #endif #ifndef GL_FIELDS_NV #define GL_FIELDS_NV 0x8E27 #endif #ifndef GL_FILL #define GL_FILL 0x1B02 #endif #ifndef GL_FILTER4_SGIS #define GL_FILTER4_SGIS 0x8146 #endif #ifndef GL_FIXED_ONLY #define GL_FIXED_ONLY 0x891D #endif #ifndef GL_FIXED_ONLY_ARB #define GL_FIXED_ONLY_ARB 0x891D #endif #ifndef GL_FLAT #define GL_FLAT 0x1D00 #endif #ifndef GL_FLOAT #define GL_FLOAT 0x1406 #endif #ifndef GL_FLOAT_32_UNSIGNED_INT_24_8_REV #define GL_FLOAT_32_UNSIGNED_INT_24_8_REV 0x8DAD #endif #ifndef GL_FLOAT_32_UNSIGNED_INT_24_8_REV_NV #define GL_FLOAT_32_UNSIGNED_INT_24_8_REV_NV 0x8DAD #endif #ifndef GL_FLOAT_CLEAR_COLOR_VALUE_NV #define GL_FLOAT_CLEAR_COLOR_VALUE_NV 0x888D #endif #ifndef GL_FLOAT_MAT2 #define GL_FLOAT_MAT2 0x8B5A #endif #ifndef GL_FLOAT_MAT2_ARB #define GL_FLOAT_MAT2_ARB 0x8B5A #endif #ifndef GL_FLOAT_MAT2x3 #define GL_FLOAT_MAT2x3 0x8B65 #endif #ifndef GL_FLOAT_MAT2x4 #define GL_FLOAT_MAT2x4 0x8B66 #endif #ifndef GL_FLOAT_MAT3 #define GL_FLOAT_MAT3 0x8B5B #endif #ifndef GL_FLOAT_MAT3_ARB #define GL_FLOAT_MAT3_ARB 0x8B5B #endif #ifndef GL_FLOAT_MAT3x2 #define GL_FLOAT_MAT3x2 0x8B67 #endif #ifndef GL_FLOAT_MAT3x4 #define GL_FLOAT_MAT3x4 0x8B68 #endif #ifndef GL_FLOAT_MAT4 #define GL_FLOAT_MAT4 0x8B5C #endif #ifndef GL_FLOAT_MAT4_ARB #define GL_FLOAT_MAT4_ARB 0x8B5C #endif #ifndef GL_FLOAT_MAT4x2 #define GL_FLOAT_MAT4x2 0x8B69 #endif #ifndef GL_FLOAT_MAT4x3 #define GL_FLOAT_MAT4x3 0x8B6A #endif #ifndef GL_FLOAT_R16_NV #define GL_FLOAT_R16_NV 0x8884 #endif #ifndef GL_FLOAT_R32_NV #define GL_FLOAT_R32_NV 0x8885 #endif #ifndef GL_FLOAT_RG16_NV #define GL_FLOAT_RG16_NV 0x8886 #endif #ifndef GL_FLOAT_RG32_NV #define GL_FLOAT_RG32_NV 0x8887 #endif #ifndef GL_FLOAT_RGB16_NV #define GL_FLOAT_RGB16_NV 0x8888 #endif #ifndef GL_FLOAT_RGB32_NV #define GL_FLOAT_RGB32_NV 0x8889 #endif #ifndef GL_FLOAT_RGBA16_NV #define GL_FLOAT_RGBA16_NV 0x888A #endif #ifndef GL_FLOAT_RGBA32_NV #define GL_FLOAT_RGBA32_NV 0x888B #endif #ifndef GL_FLOAT_RGBA_MODE_NV #define GL_FLOAT_RGBA_MODE_NV 0x888E #endif #ifndef GL_FLOAT_RGBA_NV #define GL_FLOAT_RGBA_NV 0x8883 #endif #ifndef GL_FLOAT_RGB_NV #define GL_FLOAT_RGB_NV 0x8882 #endif #ifndef GL_FLOAT_RG_NV #define GL_FLOAT_RG_NV 0x8881 #endif #ifndef GL_FLOAT_R_NV #define GL_FLOAT_R_NV 0x8880 #endif #ifndef GL_FLOAT_VEC2 #define GL_FLOAT_VEC2 0x8B50 #endif #ifndef GL_FLOAT_VEC2_ARB #define GL_FLOAT_VEC2_ARB 0x8B50 #endif #ifndef GL_FLOAT_VEC3 #define GL_FLOAT_VEC3 0x8B51 #endif #ifndef GL_FLOAT_VEC3_ARB #define GL_FLOAT_VEC3_ARB 0x8B51 #endif #ifndef GL_FLOAT_VEC4 #define GL_FLOAT_VEC4 0x8B52 #endif #ifndef GL_FLOAT_VEC4_ARB #define GL_FLOAT_VEC4_ARB 0x8B52 #endif #ifndef GL_FOG #define GL_FOG 0x0B60 #endif #ifndef GL_FOG_BIT #define GL_FOG_BIT 0x00000080 #endif #ifndef GL_FOG_COLOR #define GL_FOG_COLOR 0x0B66 #endif #ifndef GL_FOG_COORD #define GL_FOG_COORD GL_FOG_COORDINATE #endif #ifndef GL_FOG_COORDINATE #define GL_FOG_COORDINATE 0x8451 #endif #ifndef GL_FOG_COORDINATE_ARRAY #define GL_FOG_COORDINATE_ARRAY 0x8457 #endif #ifndef GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING #define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING 0x889D #endif #ifndef GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB #define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB 0x889D #endif #ifndef GL_FOG_COORDINATE_ARRAY_EXT #define GL_FOG_COORDINATE_ARRAY_EXT 0x8457 #endif #ifndef GL_FOG_COORDINATE_ARRAY_LIST_IBM #define GL_FOG_COORDINATE_ARRAY_LIST_IBM 103076 #endif #ifndef GL_FOG_COORDINATE_ARRAY_LIST_STRIDE_IBM #define GL_FOG_COORDINATE_ARRAY_LIST_STRIDE_IBM 103086 #endif #ifndef GL_FOG_COORDINATE_ARRAY_POINTER #define GL_FOG_COORDINATE_ARRAY_POINTER 0x8456 #endif #ifndef GL_FOG_COORDINATE_ARRAY_POINTER_EXT #define GL_FOG_COORDINATE_ARRAY_POINTER_EXT 0x8456 #endif #ifndef GL_FOG_COORDINATE_ARRAY_STRIDE #define GL_FOG_COORDINATE_ARRAY_STRIDE 0x8455 #endif #ifndef GL_FOG_COORDINATE_ARRAY_STRIDE_EXT #define GL_FOG_COORDINATE_ARRAY_STRIDE_EXT 0x8455 #endif #ifndef GL_FOG_COORDINATE_ARRAY_TYPE #define GL_FOG_COORDINATE_ARRAY_TYPE 0x8454 #endif #ifndef GL_FOG_COORDINATE_ARRAY_TYPE_EXT #define GL_FOG_COORDINATE_ARRAY_TYPE_EXT 0x8454 #endif #ifndef GL_FOG_COORDINATE_EXT #define GL_FOG_COORDINATE_EXT 0x8451 #endif #ifndef GL_FOG_COORDINATE_SOURCE #define GL_FOG_COORDINATE_SOURCE 0x8450 #endif #ifndef GL_FOG_COORDINATE_SOURCE_EXT #define GL_FOG_COORDINATE_SOURCE_EXT 0x8450 #endif #ifndef GL_FOG_COORD_ARRAY #define GL_FOG_COORD_ARRAY GL_FOG_COORDINATE_ARRAY #endif #ifndef GL_FOG_COORD_ARRAY_BUFFER_BINDING #define GL_FOG_COORD_ARRAY_BUFFER_BINDING GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING #endif #ifndef GL_FOG_COORD_ARRAY_POINTER #define GL_FOG_COORD_ARRAY_POINTER GL_FOG_COORDINATE_ARRAY_POINTER #endif #ifndef GL_FOG_COORD_ARRAY_STRIDE #define GL_FOG_COORD_ARRAY_STRIDE GL_FOG_COORDINATE_ARRAY_STRIDE #endif #ifndef GL_FOG_COORD_ARRAY_TYPE #define GL_FOG_COORD_ARRAY_TYPE GL_FOG_COORDINATE_ARRAY_TYPE #endif #ifndef GL_FOG_COORD_SRC #define GL_FOG_COORD_SRC GL_FOG_COORDINATE_SOURCE #endif #ifndef GL_FOG_DENSITY #define GL_FOG_DENSITY 0x0B62 #endif #ifndef GL_FOG_DISTANCE_MODE_NV #define GL_FOG_DISTANCE_MODE_NV 0x855A #endif #ifndef GL_FOG_END #define GL_FOG_END 0x0B64 #endif #ifndef GL_FOG_FACTOR_TO_ALPHA_SGIX #define GL_FOG_FACTOR_TO_ALPHA_SGIX 0x836F #endif #ifndef GL_FOG_FUNC_POINTS_SGIS #define GL_FOG_FUNC_POINTS_SGIS 0x812B #endif #ifndef GL_FOG_FUNC_SGIS #define GL_FOG_FUNC_SGIS 0x812A #endif #ifndef GL_FOG_HINT #define GL_FOG_HINT 0x0C54 #endif #ifndef GL_FOG_INDEX #define GL_FOG_INDEX 0x0B61 #endif #ifndef GL_FOG_MODE #define GL_FOG_MODE 0x0B65 #endif #ifndef GL_FOG_OFFSET_SGIX #define GL_FOG_OFFSET_SGIX 0x8198 #endif #ifndef GL_FOG_OFFSET_VALUE_SGIX #define GL_FOG_OFFSET_VALUE_SGIX 0x8199 #endif #ifndef GL_FOG_SCALE_SGIX #define GL_FOG_SCALE_SGIX 0x81FC #endif #ifndef GL_FOG_SCALE_VALUE_SGIX #define GL_FOG_SCALE_VALUE_SGIX 0x81FD #endif #ifndef GL_FOG_SPECULAR_TEXTURE_WIN #define GL_FOG_SPECULAR_TEXTURE_WIN 0x80EC #endif #ifndef GL_FOG_START #define GL_FOG_START 0x0B63 #endif #ifndef GL_FORCE_BLUE_TO_ONE_NV #define GL_FORCE_BLUE_TO_ONE_NV 0x8860 #endif #ifndef GL_FORMAT_SUBSAMPLE_244_244_OML #define GL_FORMAT_SUBSAMPLE_244_244_OML 0x8983 #endif #ifndef GL_FORMAT_SUBSAMPLE_24_24_OML #define GL_FORMAT_SUBSAMPLE_24_24_OML 0x8982 #endif #ifndef GL_FRAGMENT_COLOR_EXT #define GL_FRAGMENT_COLOR_EXT 0x834C #endif #ifndef GL_FRAGMENT_COLOR_MATERIAL_FACE_SGIX #define GL_FRAGMENT_COLOR_MATERIAL_FACE_SGIX 0x8402 #endif #ifndef GL_FRAGMENT_COLOR_MATERIAL_PARAMETER_SGIX #define GL_FRAGMENT_COLOR_MATERIAL_PARAMETER_SGIX 0x8403 #endif #ifndef GL_FRAGMENT_COLOR_MATERIAL_SGIX #define GL_FRAGMENT_COLOR_MATERIAL_SGIX 0x8401 #endif #ifndef GL_FRAGMENT_DEPTH #define GL_FRAGMENT_DEPTH 0x8452 #endif #ifndef GL_FRAGMENT_DEPTH_EXT #define GL_FRAGMENT_DEPTH_EXT 0x8452 #endif #ifndef GL_FRAGMENT_LIGHT0_SGIX #define GL_FRAGMENT_LIGHT0_SGIX 0x840C #endif #ifndef GL_FRAGMENT_LIGHT1_SGIX #define GL_FRAGMENT_LIGHT1_SGIX 0x840D #endif #ifndef GL_FRAGMENT_LIGHT2_SGIX #define GL_FRAGMENT_LIGHT2_SGIX 0x840E #endif #ifndef GL_FRAGMENT_LIGHT3_SGIX #define GL_FRAGMENT_LIGHT3_SGIX 0x840F #endif #ifndef GL_FRAGMENT_LIGHT4_SGIX #define GL_FRAGMENT_LIGHT4_SGIX 0x8410 #endif #ifndef GL_FRAGMENT_LIGHT5_SGIX #define GL_FRAGMENT_LIGHT5_SGIX 0x8411 #endif #ifndef GL_FRAGMENT_LIGHT6_SGIX #define GL_FRAGMENT_LIGHT6_SGIX 0x8412 #endif #ifndef GL_FRAGMENT_LIGHT7_SGIX #define GL_FRAGMENT_LIGHT7_SGIX 0x8413 #endif #ifndef GL_FRAGMENT_LIGHTING_SGIX #define GL_FRAGMENT_LIGHTING_SGIX 0x8400 #endif #ifndef GL_FRAGMENT_LIGHT_MODEL_AMBIENT_SGIX #define GL_FRAGMENT_LIGHT_MODEL_AMBIENT_SGIX 0x840A #endif #ifndef GL_FRAGMENT_LIGHT_MODEL_LOCAL_VIEWER_SGIX #define GL_FRAGMENT_LIGHT_MODEL_LOCAL_VIEWER_SGIX 0x8408 #endif #ifndef GL_FRAGMENT_LIGHT_MODEL_NORMAL_INTERPOLATION_SGIX #define GL_FRAGMENT_LIGHT_MODEL_NORMAL_INTERPOLATION_SGIX 0x840B #endif #ifndef GL_FRAGMENT_LIGHT_MODEL_TWO_SIDE_SGIX #define GL_FRAGMENT_LIGHT_MODEL_TWO_SIDE_SGIX 0x8409 #endif #ifndef GL_FRAGMENT_MATERIAL_EXT #define GL_FRAGMENT_MATERIAL_EXT 0x8349 #endif #ifndef GL_FRAGMENT_NORMAL_EXT #define GL_FRAGMENT_NORMAL_EXT 0x834A #endif #ifndef GL_FRAGMENT_PROGRAM_ARB #define GL_FRAGMENT_PROGRAM_ARB 0x8804 #endif #ifndef GL_FRAGMENT_PROGRAM_BINDING_NV #define GL_FRAGMENT_PROGRAM_BINDING_NV 0x8873 #endif #ifndef GL_FRAGMENT_PROGRAM_NV #define GL_FRAGMENT_PROGRAM_NV 0x8870 #endif #ifndef GL_FRAGMENT_PROGRAM_PARAMETER_BUFFER_NV #define GL_FRAGMENT_PROGRAM_PARAMETER_BUFFER_NV 0x8DA4 #endif #ifndef GL_FRAGMENT_SHADER #define GL_FRAGMENT_SHADER 0x8B30 #endif #ifndef GL_FRAGMENT_SHADER_ARB #define GL_FRAGMENT_SHADER_ARB 0x8B30 #endif #ifndef GL_FRAGMENT_SHADER_ATI #define GL_FRAGMENT_SHADER_ATI 0x8920 #endif #ifndef GL_FRAGMENT_SHADER_DERIVATIVE_HINT #define GL_FRAGMENT_SHADER_DERIVATIVE_HINT 0x8B8B #endif #ifndef GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB #define GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB 0x8B8B #endif #ifndef GL_FRAMEBUFFER #define GL_FRAMEBUFFER 0x8D40 #endif #ifndef GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE #define GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE 0x8215 #endif #ifndef GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE #define GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE 0x8214 #endif #ifndef GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING #define GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING 0x8210 #endif #ifndef GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE #define GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE 0x8211 #endif #ifndef GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE #define GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE 0x8216 #endif #ifndef GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE #define GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE 0x8213 #endif #ifndef GL_FRAMEBUFFER_ATTACHMENT_LAYERED_ARB #define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_ARB 0x8DA7 #endif #ifndef GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT #define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT 0x8DA7 #endif #ifndef GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME #define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1 #endif #ifndef GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT #define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT 0x8CD1 #endif #ifndef GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE #define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0 #endif #ifndef GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT #define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT 0x8CD0 #endif #ifndef GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE #define GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE 0x8212 #endif #ifndef GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE #define GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE 0x8217 #endif #ifndef GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT 0x8CD4 #endif #ifndef GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3 #endif #ifndef GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT 0x8CD3 #endif #ifndef GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER 0x8CD4 #endif #ifndef GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT 0x8CD4 #endif #ifndef GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2 #endif #ifndef GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT 0x8CD2 #endif #ifndef GL_FRAMEBUFFER_BINDING #define GL_FRAMEBUFFER_BINDING 0x8CA6 #endif #ifndef GL_FRAMEBUFFER_BINDING_EXT #define GL_FRAMEBUFFER_BINDING_EXT 0x8CA6 #endif #ifndef GL_FRAMEBUFFER_COMPLETE #define GL_FRAMEBUFFER_COMPLETE 0x8CD5 #endif #ifndef GL_FRAMEBUFFER_COMPLETE_EXT #define GL_FRAMEBUFFER_COMPLETE_EXT 0x8CD5 #endif #ifndef GL_FRAMEBUFFER_DEFAULT #define GL_FRAMEBUFFER_DEFAULT 0x8218 #endif #ifndef GL_FRAMEBUFFER_EXT #define GL_FRAMEBUFFER_EXT 0x8D40 #endif #ifndef GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT #define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6 #endif #ifndef GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT #define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT 0x8CD6 #endif #ifndef GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT #define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT 0x8CD9 #endif #ifndef GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER #define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER 0x8CDB #endif #ifndef GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT #define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT 0x8CDB #endif #ifndef GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT #define GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT 0x8CDA #endif #ifndef GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_ARB #define GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_ARB 0x8DA9 #endif #ifndef GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_EXT #define GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_EXT 0x8DA9 #endif #ifndef GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_ARB #define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_ARB 0x8DA8 #endif #ifndef GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT #define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT 0x8DA8 #endif #ifndef GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT #define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7 #endif #ifndef GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT #define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT 0x8CD7 #endif #ifndef GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE #define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE 0x8D56 #endif #ifndef GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT #define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT 0x8D56 #endif #ifndef GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER #define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER 0x8CDC #endif #ifndef GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT #define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT 0x8CDC #endif #ifndef GL_FRAMEBUFFER_SRGB #define GL_FRAMEBUFFER_SRGB 0x8DB9 #endif #ifndef GL_FRAMEBUFFER_SRGB_CAPABLE_EXT #define GL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x8DBA #endif #ifndef GL_FRAMEBUFFER_SRGB_EXT #define GL_FRAMEBUFFER_SRGB_EXT 0x8DB9 #endif #ifndef GL_FRAMEBUFFER_UNDEFINED #define GL_FRAMEBUFFER_UNDEFINED 0x8219 #endif #ifndef GL_FRAMEBUFFER_UNSUPPORTED #define GL_FRAMEBUFFER_UNSUPPORTED 0x8CDD #endif #ifndef GL_FRAMEBUFFER_UNSUPPORTED_EXT #define GL_FRAMEBUFFER_UNSUPPORTED_EXT 0x8CDD #endif #ifndef GL_FRAMEZOOM_FACTOR_SGIX #define GL_FRAMEZOOM_FACTOR_SGIX 0x818C #endif #ifndef GL_FRAMEZOOM_SGIX #define GL_FRAMEZOOM_SGIX 0x818B #endif #ifndef GL_FRAME_NV #define GL_FRAME_NV 0x8E26 #endif #ifndef GL_FRONT #define GL_FRONT 0x0404 #endif #ifndef GL_FRONT_AND_BACK #define GL_FRONT_AND_BACK 0x0408 #endif #ifndef GL_FRONT_FACE #define GL_FRONT_FACE 0x0B46 #endif #ifndef GL_FRONT_LEFT #define GL_FRONT_LEFT 0x0400 #endif #ifndef GL_FRONT_RIGHT #define GL_FRONT_RIGHT 0x0401 #endif #ifndef GL_FULL_RANGE_EXT #define GL_FULL_RANGE_EXT 0x87E1 #endif #ifndef GL_FULL_STIPPLE_HINT_PGI #define GL_FULL_STIPPLE_HINT_PGI 0x1A219 #endif #ifndef GL_FUNC_ADD #define GL_FUNC_ADD 0x8006 #endif #ifndef GL_FUNC_ADD_EXT #define GL_FUNC_ADD_EXT 0x8006 #endif #ifndef GL_FUNC_REVERSE_SUBTRACT #define GL_FUNC_REVERSE_SUBTRACT 0x800B #endif #ifndef GL_FUNC_REVERSE_SUBTRACT_EXT #define GL_FUNC_REVERSE_SUBTRACT_EXT 0x800B #endif #ifndef GL_FUNC_SUBTRACT #define GL_FUNC_SUBTRACT 0x800A #endif #ifndef GL_FUNC_SUBTRACT_EXT #define GL_FUNC_SUBTRACT_EXT 0x800A #endif #ifndef GL_GENERATE_MIPMAP #define GL_GENERATE_MIPMAP 0x8191 #endif #ifndef GL_GENERATE_MIPMAP_HINT #define GL_GENERATE_MIPMAP_HINT 0x8192 #endif #ifndef GL_GENERATE_MIPMAP_HINT_SGIS #define GL_GENERATE_MIPMAP_HINT_SGIS 0x8192 #endif #ifndef GL_GENERATE_MIPMAP_SGIS #define GL_GENERATE_MIPMAP_SGIS 0x8191 #endif #ifndef GL_GENERIC_ATTRIB_NV #define GL_GENERIC_ATTRIB_NV 0x8C7D #endif #ifndef GL_GEOMETRY_DEFORMATION_BIT_SGIX #define GL_GEOMETRY_DEFORMATION_BIT_SGIX 0x00000002 #endif #ifndef GL_GEOMETRY_DEFORMATION_SGIX #define GL_GEOMETRY_DEFORMATION_SGIX 0x8194 #endif #ifndef GL_GEOMETRY_INPUT_TYPE_ARB #define GL_GEOMETRY_INPUT_TYPE_ARB 0x8DDB #endif #ifndef GL_GEOMETRY_INPUT_TYPE_EXT #define GL_GEOMETRY_INPUT_TYPE_EXT 0x8DDB #endif #ifndef GL_GEOMETRY_OUTPUT_TYPE_ARB #define GL_GEOMETRY_OUTPUT_TYPE_ARB 0x8DDC #endif #ifndef GL_GEOMETRY_OUTPUT_TYPE_EXT #define GL_GEOMETRY_OUTPUT_TYPE_EXT 0x8DDC #endif #ifndef GL_GEOMETRY_PROGRAM_NV #define GL_GEOMETRY_PROGRAM_NV 0x8C26 #endif #ifndef GL_GEOMETRY_PROGRAM_PARAMETER_BUFFER_NV #define GL_GEOMETRY_PROGRAM_PARAMETER_BUFFER_NV 0x8DA3 #endif #ifndef GL_GEOMETRY_SHADER_ARB #define GL_GEOMETRY_SHADER_ARB 0x8DD9 #endif #ifndef GL_GEOMETRY_SHADER_EXT #define GL_GEOMETRY_SHADER_EXT 0x8DD9 #endif #ifndef GL_GEOMETRY_VERTICES_OUT_ARB #define GL_GEOMETRY_VERTICES_OUT_ARB 0x8DDA #endif #ifndef GL_GEOMETRY_VERTICES_OUT_EXT #define GL_GEOMETRY_VERTICES_OUT_EXT 0x8DDA #endif #ifndef GL_GEQUAL #define GL_GEQUAL 0x0206 #endif #ifndef GL_GLOBAL_ALPHA_FACTOR_SUN #define GL_GLOBAL_ALPHA_FACTOR_SUN 0x81DA #endif #ifndef GL_GLOBAL_ALPHA_SUN #define GL_GLOBAL_ALPHA_SUN 0x81D9 #endif #ifndef GL_GREATER #define GL_GREATER 0x0204 #endif #ifndef GL_GREEN #define GL_GREEN 0x1904 #endif #ifndef GL_GREEN_BIAS #define GL_GREEN_BIAS 0x0D19 #endif #ifndef GL_GREEN_BITS #define GL_GREEN_BITS 0x0D53 #endif #ifndef GL_GREEN_BIT_ATI #define GL_GREEN_BIT_ATI 0x00000002 #endif #ifndef GL_GREEN_INTEGER #define GL_GREEN_INTEGER 0x8D95 #endif #ifndef GL_GREEN_INTEGER_EXT #define GL_GREEN_INTEGER_EXT 0x8D95 #endif #ifndef GL_GREEN_MAX_CLAMP_INGR #define GL_GREEN_MAX_CLAMP_INGR 0x8565 #endif #ifndef GL_GREEN_MIN_CLAMP_INGR #define GL_GREEN_MIN_CLAMP_INGR 0x8561 #endif #ifndef GL_GREEN_SCALE #define GL_GREEN_SCALE 0x0D18 #endif #ifndef GL_HALF_BIAS_NEGATE_NV #define GL_HALF_BIAS_NEGATE_NV 0x853B #endif #ifndef GL_HALF_BIAS_NORMAL_NV #define GL_HALF_BIAS_NORMAL_NV 0x853A #endif #ifndef GL_HALF_BIT_ATI #define GL_HALF_BIT_ATI 0x00000008 #endif #ifndef GL_HALF_FLOAT #define GL_HALF_FLOAT 0x140B #endif #ifndef GL_HALF_FLOAT_ARB #define GL_HALF_FLOAT_ARB 0x140B #endif #ifndef GL_HALF_FLOAT_NV #define GL_HALF_FLOAT_NV 0x140B #endif #ifndef GL_HILO16_NV #define GL_HILO16_NV 0x86F8 #endif #ifndef GL_HILO8_NV #define GL_HILO8_NV 0x885E #endif #ifndef GL_HILO_NV #define GL_HILO_NV 0x86F4 #endif #ifndef GL_HINT_BIT #define GL_HINT_BIT 0x00008000 #endif #ifndef GL_HISTOGRAM #define GL_HISTOGRAM 0x8024 #endif #ifndef GL_HISTOGRAM_ALPHA_SIZE #define GL_HISTOGRAM_ALPHA_SIZE 0x802B #endif #ifndef GL_HISTOGRAM_ALPHA_SIZE_EXT #define GL_HISTOGRAM_ALPHA_SIZE_EXT 0x802B #endif #ifndef GL_HISTOGRAM_BLUE_SIZE #define GL_HISTOGRAM_BLUE_SIZE 0x802A #endif #ifndef GL_HISTOGRAM_BLUE_SIZE_EXT #define GL_HISTOGRAM_BLUE_SIZE_EXT 0x802A #endif #ifndef GL_HISTOGRAM_EXT #define GL_HISTOGRAM_EXT 0x8024 #endif #ifndef GL_HISTOGRAM_FORMAT #define GL_HISTOGRAM_FORMAT 0x8027 #endif #ifndef GL_HISTOGRAM_FORMAT_EXT #define GL_HISTOGRAM_FORMAT_EXT 0x8027 #endif #ifndef GL_HISTOGRAM_GREEN_SIZE #define GL_HISTOGRAM_GREEN_SIZE 0x8029 #endif #ifndef GL_HISTOGRAM_GREEN_SIZE_EXT #define GL_HISTOGRAM_GREEN_SIZE_EXT 0x8029 #endif #ifndef GL_HISTOGRAM_LUMINANCE_SIZE #define GL_HISTOGRAM_LUMINANCE_SIZE 0x802C #endif #ifndef GL_HISTOGRAM_LUMINANCE_SIZE_EXT #define GL_HISTOGRAM_LUMINANCE_SIZE_EXT 0x802C #endif #ifndef GL_HISTOGRAM_RED_SIZE #define GL_HISTOGRAM_RED_SIZE 0x8028 #endif #ifndef GL_HISTOGRAM_RED_SIZE_EXT #define GL_HISTOGRAM_RED_SIZE_EXT 0x8028 #endif #ifndef GL_HISTOGRAM_SINK #define GL_HISTOGRAM_SINK 0x802D #endif #ifndef GL_HISTOGRAM_SINK_EXT #define GL_HISTOGRAM_SINK_EXT 0x802D #endif #ifndef GL_HISTOGRAM_WIDTH #define GL_HISTOGRAM_WIDTH 0x8026 #endif #ifndef GL_HISTOGRAM_WIDTH_EXT #define GL_HISTOGRAM_WIDTH_EXT 0x8026 #endif #ifndef GL_HI_BIAS_NV #define GL_HI_BIAS_NV 0x8714 #endif #ifndef GL_HI_SCALE_NV #define GL_HI_SCALE_NV 0x870E #endif #ifndef GL_IDENTITY_NV #define GL_IDENTITY_NV 0x862A #endif #ifndef GL_IGNORE_BORDER_HP #define GL_IGNORE_BORDER_HP 0x8150 #endif #ifndef GL_IMAGE_CUBIC_WEIGHT_HP #define GL_IMAGE_CUBIC_WEIGHT_HP 0x815E #endif #ifndef GL_IMAGE_MAG_FILTER_HP #define GL_IMAGE_MAG_FILTER_HP 0x815C #endif #ifndef GL_IMAGE_MIN_FILTER_HP #define GL_IMAGE_MIN_FILTER_HP 0x815D #endif #ifndef GL_IMAGE_ROTATE_ANGLE_HP #define GL_IMAGE_ROTATE_ANGLE_HP 0x8159 #endif #ifndef GL_IMAGE_ROTATE_ORIGIN_X_HP #define GL_IMAGE_ROTATE_ORIGIN_X_HP 0x815A #endif #ifndef GL_IMAGE_ROTATE_ORIGIN_Y_HP #define GL_IMAGE_ROTATE_ORIGIN_Y_HP 0x815B #endif #ifndef GL_IMAGE_SCALE_X_HP #define GL_IMAGE_SCALE_X_HP 0x8155 #endif #ifndef GL_IMAGE_SCALE_Y_HP #define GL_IMAGE_SCALE_Y_HP 0x8156 #endif #ifndef GL_IMAGE_TRANSFORM_2D_HP #define GL_IMAGE_TRANSFORM_2D_HP 0x8161 #endif #ifndef GL_IMAGE_TRANSLATE_X_HP #define GL_IMAGE_TRANSLATE_X_HP 0x8157 #endif #ifndef GL_IMAGE_TRANSLATE_Y_HP #define GL_IMAGE_TRANSLATE_Y_HP 0x8158 #endif #ifndef GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES #define GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES 0x8B9B #endif #ifndef GL_IMPLEMENTATION_COLOR_READ_TYPE_OES #define GL_IMPLEMENTATION_COLOR_READ_TYPE_OES 0x8B9A #endif #ifndef GL_INCR #define GL_INCR 0x1E02 #endif #ifndef GL_INCR_WRAP #define GL_INCR_WRAP 0x8507 #endif #ifndef GL_INCR_WRAP_EXT #define GL_INCR_WRAP_EXT 0x8507 #endif #ifndef GL_INDEX #define GL_INDEX 0x8222 #endif #ifndef GL_INDEX_ARRAY #define GL_INDEX_ARRAY 0x8077 #endif #ifndef GL_INDEX_ARRAY_BUFFER_BINDING #define GL_INDEX_ARRAY_BUFFER_BINDING 0x8899 #endif #ifndef GL_INDEX_ARRAY_BUFFER_BINDING_ARB #define GL_INDEX_ARRAY_BUFFER_BINDING_ARB 0x8899 #endif #ifndef GL_INDEX_ARRAY_COUNT_EXT #define GL_INDEX_ARRAY_COUNT_EXT 0x8087 #endif #ifndef GL_INDEX_ARRAY_EXT #define GL_INDEX_ARRAY_EXT 0x8077 #endif #ifndef GL_INDEX_ARRAY_LIST_IBM #define GL_INDEX_ARRAY_LIST_IBM 103073 #endif #ifndef GL_INDEX_ARRAY_LIST_STRIDE_IBM #define GL_INDEX_ARRAY_LIST_STRIDE_IBM 103083 #endif #ifndef GL_INDEX_ARRAY_POINTER #define GL_INDEX_ARRAY_POINTER 0x8091 #endif #ifndef GL_INDEX_ARRAY_POINTER_EXT #define GL_INDEX_ARRAY_POINTER_EXT 0x8091 #endif #ifndef GL_INDEX_ARRAY_STRIDE #define GL_INDEX_ARRAY_STRIDE 0x8086 #endif #ifndef GL_INDEX_ARRAY_STRIDE_EXT #define GL_INDEX_ARRAY_STRIDE_EXT 0x8086 #endif #ifndef GL_INDEX_ARRAY_TYPE #define GL_INDEX_ARRAY_TYPE 0x8085 #endif #ifndef GL_INDEX_ARRAY_TYPE_EXT #define GL_INDEX_ARRAY_TYPE_EXT 0x8085 #endif #ifndef GL_INDEX_BITS #define GL_INDEX_BITS 0x0D51 #endif #ifndef GL_INDEX_BIT_PGI #define GL_INDEX_BIT_PGI 0x00080000 #endif #ifndef GL_INDEX_CLEAR_VALUE #define GL_INDEX_CLEAR_VALUE 0x0C20 #endif #ifndef GL_INDEX_LOGIC_OP #define GL_INDEX_LOGIC_OP 0x0BF1 #endif #ifndef GL_INDEX_MATERIAL_EXT #define GL_INDEX_MATERIAL_EXT 0x81B8 #endif #ifndef GL_INDEX_MATERIAL_FACE_EXT #define GL_INDEX_MATERIAL_FACE_EXT 0x81BA #endif #ifndef GL_INDEX_MATERIAL_PARAMETER_EXT #define GL_INDEX_MATERIAL_PARAMETER_EXT 0x81B9 #endif #ifndef GL_INDEX_MODE #define GL_INDEX_MODE 0x0C30 #endif #ifndef GL_INDEX_OFFSET #define GL_INDEX_OFFSET 0x0D13 #endif #ifndef GL_INDEX_SHIFT #define GL_INDEX_SHIFT 0x0D12 #endif #ifndef GL_INDEX_TEST_EXT #define GL_INDEX_TEST_EXT 0x81B5 #endif #ifndef GL_INDEX_TEST_FUNC_EXT #define GL_INDEX_TEST_FUNC_EXT 0x81B6 #endif #ifndef GL_INDEX_TEST_REF_EXT #define GL_INDEX_TEST_REF_EXT 0x81B7 #endif #ifndef GL_INDEX_WRITEMASK #define GL_INDEX_WRITEMASK 0x0C21 #endif #ifndef GL_INFO_LOG_LENGTH #define GL_INFO_LOG_LENGTH 0x8B84 #endif #ifndef GL_INSTRUMENT_BUFFER_POINTER_SGIX #define GL_INSTRUMENT_BUFFER_POINTER_SGIX 0x8180 #endif #ifndef GL_INSTRUMENT_MEASUREMENTS_SGIX #define GL_INSTRUMENT_MEASUREMENTS_SGIX 0x8181 #endif #ifndef GL_INT #define GL_INT 0x1404 #endif #ifndef GL_INTENSITY #define GL_INTENSITY 0x8049 #endif #ifndef GL_INTENSITY12 #define GL_INTENSITY12 0x804C #endif #ifndef GL_INTENSITY12_EXT #define GL_INTENSITY12_EXT 0x804C #endif #ifndef GL_INTENSITY16 #define GL_INTENSITY16 0x804D #endif #ifndef GL_INTENSITY16F_ARB #define GL_INTENSITY16F_ARB 0x881D #endif #ifndef GL_INTENSITY16I_EXT #define GL_INTENSITY16I_EXT 0x8D8B #endif #ifndef GL_INTENSITY16UI_EXT #define GL_INTENSITY16UI_EXT 0x8D79 #endif #ifndef GL_INTENSITY16_EXT #define GL_INTENSITY16_EXT 0x804D #endif #ifndef GL_INTENSITY32F_ARB #define GL_INTENSITY32F_ARB 0x8817 #endif #ifndef GL_INTENSITY32I_EXT #define GL_INTENSITY32I_EXT 0x8D85 #endif #ifndef GL_INTENSITY32UI_EXT #define GL_INTENSITY32UI_EXT 0x8D73 #endif #ifndef GL_INTENSITY4 #define GL_INTENSITY4 0x804A #endif #ifndef GL_INTENSITY4_EXT #define GL_INTENSITY4_EXT 0x804A #endif #ifndef GL_INTENSITY8 #define GL_INTENSITY8 0x804B #endif #ifndef GL_INTENSITY8I_EXT #define GL_INTENSITY8I_EXT 0x8D91 #endif #ifndef GL_INTENSITY8UI_EXT #define GL_INTENSITY8UI_EXT 0x8D7F #endif #ifndef GL_INTENSITY8_EXT #define GL_INTENSITY8_EXT 0x804B #endif #ifndef GL_INTENSITY_EXT #define GL_INTENSITY_EXT 0x8049 #endif #ifndef GL_INTENSITY_FLOAT16_ATI #define GL_INTENSITY_FLOAT16_ATI 0x881D #endif #ifndef GL_INTENSITY_FLOAT32_ATI #define GL_INTENSITY_FLOAT32_ATI 0x8817 #endif #ifndef GL_INTERLACE_OML #define GL_INTERLACE_OML 0x8980 #endif #ifndef GL_INTERLACE_READ_INGR #define GL_INTERLACE_READ_INGR 0x8568 #endif #ifndef GL_INTERLACE_READ_OML #define GL_INTERLACE_READ_OML 0x8981 #endif #ifndef GL_INTERLACE_SGIX #define GL_INTERLACE_SGIX 0x8094 #endif #ifndef GL_INTERLEAVED_ATTRIBS #define GL_INTERLEAVED_ATTRIBS 0x8C8C #endif #ifndef GL_INTERLEAVED_ATTRIBS_EXT #define GL_INTERLEAVED_ATTRIBS_EXT 0x8C8C #endif #ifndef GL_INTERLEAVED_ATTRIBS_NV #define GL_INTERLEAVED_ATTRIBS_NV 0x8C8C #endif #ifndef GL_INTERPOLATE #define GL_INTERPOLATE 0x8575 #endif #ifndef GL_INTERPOLATE_ARB #define GL_INTERPOLATE_ARB 0x8575 #endif #ifndef GL_INTERPOLATE_EXT #define GL_INTERPOLATE_EXT 0x8575 #endif #ifndef GL_INT_SAMPLER_1D #define GL_INT_SAMPLER_1D 0x8DC9 #endif #ifndef GL_INT_SAMPLER_1D_ARRAY #define GL_INT_SAMPLER_1D_ARRAY 0x8DCE #endif #ifndef GL_INT_SAMPLER_1D_ARRAY_EXT #define GL_INT_SAMPLER_1D_ARRAY_EXT 0x8DCE #endif #ifndef GL_INT_SAMPLER_1D_EXT #define GL_INT_SAMPLER_1D_EXT 0x8DC9 #endif #ifndef GL_INT_SAMPLER_2D #define GL_INT_SAMPLER_2D 0x8DCA #endif #ifndef GL_INT_SAMPLER_2D_ARRAY #define GL_INT_SAMPLER_2D_ARRAY 0x8DCF #endif #ifndef GL_INT_SAMPLER_2D_ARRAY_EXT #define GL_INT_SAMPLER_2D_ARRAY_EXT 0x8DCF #endif #ifndef GL_INT_SAMPLER_2D_EXT #define GL_INT_SAMPLER_2D_EXT 0x8DCA #endif #ifndef GL_INT_SAMPLER_2D_RECT_EXT #define GL_INT_SAMPLER_2D_RECT_EXT 0x8DCD #endif #ifndef GL_INT_SAMPLER_3D #define GL_INT_SAMPLER_3D 0x8DCB #endif #ifndef GL_INT_SAMPLER_3D_EXT #define GL_INT_SAMPLER_3D_EXT 0x8DCB #endif #ifndef GL_INT_SAMPLER_BUFFER_EXT #define GL_INT_SAMPLER_BUFFER_EXT 0x8DD0 #endif #ifndef GL_INT_SAMPLER_CUBE #define GL_INT_SAMPLER_CUBE 0x8DCC #endif #ifndef GL_INT_SAMPLER_CUBE_EXT #define GL_INT_SAMPLER_CUBE_EXT 0x8DCC #endif #ifndef GL_INT_SAMPLER_RENDERBUFFER_NV #define GL_INT_SAMPLER_RENDERBUFFER_NV 0x8E57 #endif #ifndef GL_INT_VEC2 #define GL_INT_VEC2 0x8B53 #endif #ifndef GL_INT_VEC2_ARB #define GL_INT_VEC2_ARB 0x8B53 #endif #ifndef GL_INT_VEC3 #define GL_INT_VEC3 0x8B54 #endif #ifndef GL_INT_VEC3_ARB #define GL_INT_VEC3_ARB 0x8B54 #endif #ifndef GL_INT_VEC4 #define GL_INT_VEC4 0x8B55 #endif #ifndef GL_INT_VEC4_ARB #define GL_INT_VEC4_ARB 0x8B55 #endif #ifndef GL_INVALID_ENUM #define GL_INVALID_ENUM 0x0500 #endif #ifndef GL_INVALID_FRAMEBUFFER_OPERATION #define GL_INVALID_FRAMEBUFFER_OPERATION 0x0506 #endif #ifndef GL_INVALID_FRAMEBUFFER_OPERATION_EXT #define GL_INVALID_FRAMEBUFFER_OPERATION_EXT 0x0506 #endif #ifndef GL_INVALID_OPERATION #define GL_INVALID_OPERATION 0x0502 #endif #ifndef GL_INVALID_VALUE #define GL_INVALID_VALUE 0x0501 #endif #ifndef GL_INVARIANT_DATATYPE_EXT #define GL_INVARIANT_DATATYPE_EXT 0x87EB #endif #ifndef GL_INVARIANT_EXT #define GL_INVARIANT_EXT 0x87C2 #endif #ifndef GL_INVARIANT_VALUE_EXT #define GL_INVARIANT_VALUE_EXT 0x87EA #endif #ifndef GL_INVERSE_NV #define GL_INVERSE_NV 0x862B #endif #ifndef GL_INVERSE_TRANSPOSE_NV #define GL_INVERSE_TRANSPOSE_NV 0x862D #endif #ifndef GL_INVERT #define GL_INVERT 0x150A #endif #ifndef GL_INVERTED_SCREEN_W_REND #define GL_INVERTED_SCREEN_W_REND 0x8491 #endif #ifndef GL_IR_INSTRUMENT1_SGIX #define GL_IR_INSTRUMENT1_SGIX 0x817F #endif #ifndef GL_IUI_N3F_V2F_EXT #define GL_IUI_N3F_V2F_EXT 0x81AF #endif #ifndef GL_IUI_N3F_V3F_EXT #define GL_IUI_N3F_V3F_EXT 0x81B0 #endif #ifndef GL_IUI_V2F_EXT #define GL_IUI_V2F_EXT 0x81AD #endif #ifndef GL_IUI_V3F_EXT #define GL_IUI_V3F_EXT 0x81AE #endif #ifndef GL_KEEP #define GL_KEEP 0x1E00 #endif #ifndef GL_LEFT #define GL_LEFT 0x0406 #endif #ifndef GL_LEQUAL #define GL_LEQUAL 0x0203 #endif #ifndef GL_LERP_ATI #define GL_LERP_ATI 0x8969 #endif #ifndef GL_LESS #define GL_LESS 0x0201 #endif #ifndef GL_LIGHT0 #define GL_LIGHT0 0x4000 #endif #ifndef GL_LIGHT1 #define GL_LIGHT1 0x4001 #endif #ifndef GL_LIGHT2 #define GL_LIGHT2 0x4002 #endif #ifndef GL_LIGHT3 #define GL_LIGHT3 0x4003 #endif #ifndef GL_LIGHT4 #define GL_LIGHT4 0x4004 #endif #ifndef GL_LIGHT5 #define GL_LIGHT5 0x4005 #endif #ifndef GL_LIGHT6 #define GL_LIGHT6 0x4006 #endif #ifndef GL_LIGHT7 #define GL_LIGHT7 0x4007 #endif #ifndef GL_LIGHTING #define GL_LIGHTING 0x0B50 #endif #ifndef GL_LIGHTING_BIT #define GL_LIGHTING_BIT 0x00000040 #endif #ifndef GL_LIGHT_ENV_MODE_SGIX #define GL_LIGHT_ENV_MODE_SGIX 0x8407 #endif #ifndef GL_LIGHT_MODEL_AMBIENT #define GL_LIGHT_MODEL_AMBIENT 0x0B53 #endif #ifndef GL_LIGHT_MODEL_COLOR_CONTROL #define GL_LIGHT_MODEL_COLOR_CONTROL 0x81F8 #endif #ifndef GL_LIGHT_MODEL_COLOR_CONTROL_EXT #define GL_LIGHT_MODEL_COLOR_CONTROL_EXT 0x81F8 #endif #ifndef GL_LIGHT_MODEL_LOCAL_VIEWER #define GL_LIGHT_MODEL_LOCAL_VIEWER 0x0B51 #endif #ifndef GL_LIGHT_MODEL_SPECULAR_VECTOR_APPLE #define GL_LIGHT_MODEL_SPECULAR_VECTOR_APPLE 0x85B0 #endif #ifndef GL_LIGHT_MODEL_TWO_SIDE #define GL_LIGHT_MODEL_TWO_SIDE 0x0B52 #endif #ifndef GL_LINE #define GL_LINE 0x1B01 #endif #ifndef GL_LINEAR #define GL_LINEAR 0x2601 #endif #ifndef GL_LINEAR_ATTENUATION #define GL_LINEAR_ATTENUATION 0x1208 #endif #ifndef GL_LINEAR_CLIPMAP_LINEAR_SGIX #define GL_LINEAR_CLIPMAP_LINEAR_SGIX 0x8170 #endif #ifndef GL_LINEAR_CLIPMAP_NEAREST_SGIX #define GL_LINEAR_CLIPMAP_NEAREST_SGIX 0x844F #endif #ifndef GL_LINEAR_DETAIL_ALPHA_SGIS #define GL_LINEAR_DETAIL_ALPHA_SGIS 0x8098 #endif #ifndef GL_LINEAR_DETAIL_COLOR_SGIS #define GL_LINEAR_DETAIL_COLOR_SGIS 0x8099 #endif #ifndef GL_LINEAR_DETAIL_SGIS #define GL_LINEAR_DETAIL_SGIS 0x8097 #endif #ifndef GL_LINEAR_MIPMAP_LINEAR #define GL_LINEAR_MIPMAP_LINEAR 0x2703 #endif #ifndef GL_LINEAR_MIPMAP_NEAREST #define GL_LINEAR_MIPMAP_NEAREST 0x2701 #endif #ifndef GL_LINEAR_SHARPEN_ALPHA_SGIS #define GL_LINEAR_SHARPEN_ALPHA_SGIS 0x80AE #endif #ifndef GL_LINEAR_SHARPEN_COLOR_SGIS #define GL_LINEAR_SHARPEN_COLOR_SGIS 0x80AF #endif #ifndef GL_LINEAR_SHARPEN_SGIS #define GL_LINEAR_SHARPEN_SGIS 0x80AD #endif #ifndef GL_LINES #define GL_LINES 0x0001 #endif #ifndef GL_LINES_ADJACENCY_ARB #define GL_LINES_ADJACENCY_ARB 0x000A #endif #ifndef GL_LINES_ADJACENCY_EXT #define GL_LINES_ADJACENCY_EXT 0x000A #endif #ifndef GL_LINE_BIT #define GL_LINE_BIT 0x00000004 #endif #ifndef GL_LINE_LOOP #define GL_LINE_LOOP 0x0002 #endif #ifndef GL_LINE_RESET_TOKEN #define GL_LINE_RESET_TOKEN 0x0707 #endif #ifndef GL_LINE_SMOOTH #define GL_LINE_SMOOTH 0x0B20 #endif #ifndef GL_LINE_SMOOTH_HINT #define GL_LINE_SMOOTH_HINT 0x0C52 #endif #ifndef GL_LINE_STIPPLE #define GL_LINE_STIPPLE 0x0B24 #endif #ifndef GL_LINE_STIPPLE_PATTERN #define GL_LINE_STIPPLE_PATTERN 0x0B25 #endif #ifndef GL_LINE_STIPPLE_REPEAT #define GL_LINE_STIPPLE_REPEAT 0x0B26 #endif #ifndef GL_LINE_STRIP #define GL_LINE_STRIP 0x0003 #endif #ifndef GL_LINE_STRIP_ADJACENCY_ARB #define GL_LINE_STRIP_ADJACENCY_ARB 0x000B #endif #ifndef GL_LINE_STRIP_ADJACENCY_EXT #define GL_LINE_STRIP_ADJACENCY_EXT 0x000B #endif #ifndef GL_LINE_TOKEN #define GL_LINE_TOKEN 0x0702 #endif #ifndef GL_LINE_WIDTH #define GL_LINE_WIDTH 0x0B21 #endif #ifndef GL_LINE_WIDTH_GRANULARITY #define GL_LINE_WIDTH_GRANULARITY 0x0B23 #endif #ifndef GL_LINE_WIDTH_RANGE #define GL_LINE_WIDTH_RANGE 0x0B22 #endif #ifndef GL_LINK_STATUS #define GL_LINK_STATUS 0x8B82 #endif #ifndef GL_LIST_BASE #define GL_LIST_BASE 0x0B32 #endif #ifndef GL_LIST_BIT #define GL_LIST_BIT 0x00020000 #endif #ifndef GL_LIST_INDEX #define GL_LIST_INDEX 0x0B33 #endif #ifndef GL_LIST_MODE #define GL_LIST_MODE 0x0B30 #endif #ifndef GL_LIST_PRIORITY_SGIX #define GL_LIST_PRIORITY_SGIX 0x8182 #endif #ifndef GL_LOAD #define GL_LOAD 0x0101 #endif #ifndef GL_LOCAL_CONSTANT_DATATYPE_EXT #define GL_LOCAL_CONSTANT_DATATYPE_EXT 0x87ED #endif #ifndef GL_LOCAL_CONSTANT_EXT #define GL_LOCAL_CONSTANT_EXT 0x87C3 #endif #ifndef GL_LOCAL_CONSTANT_VALUE_EXT #define GL_LOCAL_CONSTANT_VALUE_EXT 0x87EC #endif #ifndef GL_LOCAL_EXT #define GL_LOCAL_EXT 0x87C4 #endif #ifndef GL_LOGIC_OP #define GL_LOGIC_OP 0x0BF1 #endif #ifndef GL_LOGIC_OP_MODE #define GL_LOGIC_OP_MODE 0x0BF0 #endif #ifndef GL_LOWER_LEFT #define GL_LOWER_LEFT 0x8CA1 #endif #ifndef GL_LO_BIAS_NV #define GL_LO_BIAS_NV 0x8715 #endif #ifndef GL_LO_SCALE_NV #define GL_LO_SCALE_NV 0x870F #endif #ifndef GL_LUMINANCE #define GL_LUMINANCE 0x1909 #endif #ifndef GL_LUMINANCE12 #define GL_LUMINANCE12 0x8041 #endif #ifndef GL_LUMINANCE12_ALPHA12 #define GL_LUMINANCE12_ALPHA12 0x8047 #endif #ifndef GL_LUMINANCE12_ALPHA12_EXT #define GL_LUMINANCE12_ALPHA12_EXT 0x8047 #endif #ifndef GL_LUMINANCE12_ALPHA4 #define GL_LUMINANCE12_ALPHA4 0x8046 #endif #ifndef GL_LUMINANCE12_ALPHA4_EXT #define GL_LUMINANCE12_ALPHA4_EXT 0x8046 #endif #ifndef GL_LUMINANCE12_EXT #define GL_LUMINANCE12_EXT 0x8041 #endif #ifndef GL_LUMINANCE16 #define GL_LUMINANCE16 0x8042 #endif #ifndef GL_LUMINANCE16F_ARB #define GL_LUMINANCE16F_ARB 0x881E #endif #ifndef GL_LUMINANCE16I_EXT #define GL_LUMINANCE16I_EXT 0x8D8C #endif #ifndef GL_LUMINANCE16UI_EXT #define GL_LUMINANCE16UI_EXT 0x8D7A #endif #ifndef GL_LUMINANCE16_ALPHA16 #define GL_LUMINANCE16_ALPHA16 0x8048 #endif #ifndef GL_LUMINANCE16_ALPHA16_EXT #define GL_LUMINANCE16_ALPHA16_EXT 0x8048 #endif #ifndef GL_LUMINANCE16_EXT #define GL_LUMINANCE16_EXT 0x8042 #endif #ifndef GL_LUMINANCE32F_ARB #define GL_LUMINANCE32F_ARB 0x8818 #endif #ifndef GL_LUMINANCE32I_EXT #define GL_LUMINANCE32I_EXT 0x8D86 #endif #ifndef GL_LUMINANCE32UI_EXT #define GL_LUMINANCE32UI_EXT 0x8D74 #endif #ifndef GL_LUMINANCE4 #define GL_LUMINANCE4 0x803F #endif #ifndef GL_LUMINANCE4_ALPHA4 #define GL_LUMINANCE4_ALPHA4 0x8043 #endif #ifndef GL_LUMINANCE4_ALPHA4_EXT #define GL_LUMINANCE4_ALPHA4_EXT 0x8043 #endif #ifndef GL_LUMINANCE4_EXT #define GL_LUMINANCE4_EXT 0x803F #endif #ifndef GL_LUMINANCE6_ALPHA2 #define GL_LUMINANCE6_ALPHA2 0x8044 #endif #ifndef GL_LUMINANCE6_ALPHA2_EXT #define GL_LUMINANCE6_ALPHA2_EXT 0x8044 #endif #ifndef GL_LUMINANCE8 #define GL_LUMINANCE8 0x8040 #endif #ifndef GL_LUMINANCE8I_EXT #define GL_LUMINANCE8I_EXT 0x8D92 #endif #ifndef GL_LUMINANCE8UI_EXT #define GL_LUMINANCE8UI_EXT 0x8D80 #endif #ifndef GL_LUMINANCE8_ALPHA8 #define GL_LUMINANCE8_ALPHA8 0x8045 #endif #ifndef GL_LUMINANCE8_ALPHA8_EXT #define GL_LUMINANCE8_ALPHA8_EXT 0x8045 #endif #ifndef GL_LUMINANCE8_EXT #define GL_LUMINANCE8_EXT 0x8040 #endif #ifndef GL_LUMINANCE_ALPHA #define GL_LUMINANCE_ALPHA 0x190A #endif #ifndef GL_LUMINANCE_ALPHA16F_ARB #define GL_LUMINANCE_ALPHA16F_ARB 0x881F #endif #ifndef GL_LUMINANCE_ALPHA16I_EXT #define GL_LUMINANCE_ALPHA16I_EXT 0x8D8D #endif #ifndef GL_LUMINANCE_ALPHA16UI_EXT #define GL_LUMINANCE_ALPHA16UI_EXT 0x8D7B #endif #ifndef GL_LUMINANCE_ALPHA32F_ARB #define GL_LUMINANCE_ALPHA32F_ARB 0x8819 #endif #ifndef GL_LUMINANCE_ALPHA32I_EXT #define GL_LUMINANCE_ALPHA32I_EXT 0x8D87 #endif #ifndef GL_LUMINANCE_ALPHA32UI_EXT #define GL_LUMINANCE_ALPHA32UI_EXT 0x8D75 #endif #ifndef GL_LUMINANCE_ALPHA8I_EXT #define GL_LUMINANCE_ALPHA8I_EXT 0x8D93 #endif #ifndef GL_LUMINANCE_ALPHA8UI_EXT #define GL_LUMINANCE_ALPHA8UI_EXT 0x8D81 #endif #ifndef GL_LUMINANCE_ALPHA_FLOAT16_ATI #define GL_LUMINANCE_ALPHA_FLOAT16_ATI 0x881F #endif #ifndef GL_LUMINANCE_ALPHA_FLOAT32_ATI #define GL_LUMINANCE_ALPHA_FLOAT32_ATI 0x8819 #endif #ifndef GL_LUMINANCE_ALPHA_INTEGER_EXT #define GL_LUMINANCE_ALPHA_INTEGER_EXT 0x8D9D #endif #ifndef GL_LUMINANCE_FLOAT16_ATI #define GL_LUMINANCE_FLOAT16_ATI 0x881E #endif #ifndef GL_LUMINANCE_FLOAT32_ATI #define GL_LUMINANCE_FLOAT32_ATI 0x8818 #endif #ifndef GL_LUMINANCE_INTEGER_EXT #define GL_LUMINANCE_INTEGER_EXT 0x8D9C #endif #ifndef GL_MAD_ATI #define GL_MAD_ATI 0x8968 #endif #ifndef GL_MAGNITUDE_BIAS_NV #define GL_MAGNITUDE_BIAS_NV 0x8718 #endif #ifndef GL_MAGNITUDE_SCALE_NV #define GL_MAGNITUDE_SCALE_NV 0x8712 #endif #ifndef GL_MAJOR_VERSION #define GL_MAJOR_VERSION 0x821B #endif #ifndef GL_MAP1_BINORMAL_EXT #define GL_MAP1_BINORMAL_EXT 0x8446 #endif #ifndef GL_MAP1_COLOR_4 #define GL_MAP1_COLOR_4 0x0D90 #endif #ifndef GL_MAP1_GRID_DOMAIN #define GL_MAP1_GRID_DOMAIN 0x0DD0 #endif #ifndef GL_MAP1_GRID_SEGMENTS #define GL_MAP1_GRID_SEGMENTS 0x0DD1 #endif #ifndef GL_MAP1_INDEX #define GL_MAP1_INDEX 0x0D91 #endif #ifndef GL_MAP1_NORMAL #define GL_MAP1_NORMAL 0x0D92 #endif #ifndef GL_MAP1_TANGENT_EXT #define GL_MAP1_TANGENT_EXT 0x8444 #endif #ifndef GL_MAP1_TEXTURE_COORD_1 #define GL_MAP1_TEXTURE_COORD_1 0x0D93 #endif #ifndef GL_MAP1_TEXTURE_COORD_2 #define GL_MAP1_TEXTURE_COORD_2 0x0D94 #endif #ifndef GL_MAP1_TEXTURE_COORD_3 #define GL_MAP1_TEXTURE_COORD_3 0x0D95 #endif #ifndef GL_MAP1_TEXTURE_COORD_4 #define GL_MAP1_TEXTURE_COORD_4 0x0D96 #endif #ifndef GL_MAP1_VERTEX_3 #define GL_MAP1_VERTEX_3 0x0D97 #endif #ifndef GL_MAP1_VERTEX_4 #define GL_MAP1_VERTEX_4 0x0D98 #endif #ifndef GL_MAP1_VERTEX_ATTRIB0_4_NV #define GL_MAP1_VERTEX_ATTRIB0_4_NV 0x8660 #endif #ifndef GL_MAP1_VERTEX_ATTRIB10_4_NV #define GL_MAP1_VERTEX_ATTRIB10_4_NV 0x866A #endif #ifndef GL_MAP1_VERTEX_ATTRIB11_4_NV #define GL_MAP1_VERTEX_ATTRIB11_4_NV 0x866B #endif #ifndef GL_MAP1_VERTEX_ATTRIB12_4_NV #define GL_MAP1_VERTEX_ATTRIB12_4_NV 0x866C #endif #ifndef GL_MAP1_VERTEX_ATTRIB13_4_NV #define GL_MAP1_VERTEX_ATTRIB13_4_NV 0x866D #endif #ifndef GL_MAP1_VERTEX_ATTRIB14_4_NV #define GL_MAP1_VERTEX_ATTRIB14_4_NV 0x866E #endif #ifndef GL_MAP1_VERTEX_ATTRIB15_4_NV #define GL_MAP1_VERTEX_ATTRIB15_4_NV 0x866F #endif #ifndef GL_MAP1_VERTEX_ATTRIB1_4_NV #define GL_MAP1_VERTEX_ATTRIB1_4_NV 0x8661 #endif #ifndef GL_MAP1_VERTEX_ATTRIB2_4_NV #define GL_MAP1_VERTEX_ATTRIB2_4_NV 0x8662 #endif #ifndef GL_MAP1_VERTEX_ATTRIB3_4_NV #define GL_MAP1_VERTEX_ATTRIB3_4_NV 0x8663 #endif #ifndef GL_MAP1_VERTEX_ATTRIB4_4_NV #define GL_MAP1_VERTEX_ATTRIB4_4_NV 0x8664 #endif #ifndef GL_MAP1_VERTEX_ATTRIB5_4_NV #define GL_MAP1_VERTEX_ATTRIB5_4_NV 0x8665 #endif #ifndef GL_MAP1_VERTEX_ATTRIB6_4_NV #define GL_MAP1_VERTEX_ATTRIB6_4_NV 0x8666 #endif #ifndef GL_MAP1_VERTEX_ATTRIB7_4_NV #define GL_MAP1_VERTEX_ATTRIB7_4_NV 0x8667 #endif #ifndef GL_MAP1_VERTEX_ATTRIB8_4_NV #define GL_MAP1_VERTEX_ATTRIB8_4_NV 0x8668 #endif #ifndef GL_MAP1_VERTEX_ATTRIB9_4_NV #define GL_MAP1_VERTEX_ATTRIB9_4_NV 0x8669 #endif #ifndef GL_MAP2_BINORMAL_EXT #define GL_MAP2_BINORMAL_EXT 0x8447 #endif #ifndef GL_MAP2_COLOR_4 #define GL_MAP2_COLOR_4 0x0DB0 #endif #ifndef GL_MAP2_GRID_DOMAIN #define GL_MAP2_GRID_DOMAIN 0x0DD2 #endif #ifndef GL_MAP2_GRID_SEGMENTS #define GL_MAP2_GRID_SEGMENTS 0x0DD3 #endif #ifndef GL_MAP2_INDEX #define GL_MAP2_INDEX 0x0DB1 #endif #ifndef GL_MAP2_NORMAL #define GL_MAP2_NORMAL 0x0DB2 #endif #ifndef GL_MAP2_TANGENT_EXT #define GL_MAP2_TANGENT_EXT 0x8445 #endif #ifndef GL_MAP2_TEXTURE_COORD_1 #define GL_MAP2_TEXTURE_COORD_1 0x0DB3 #endif #ifndef GL_MAP2_TEXTURE_COORD_2 #define GL_MAP2_TEXTURE_COORD_2 0x0DB4 #endif #ifndef GL_MAP2_TEXTURE_COORD_3 #define GL_MAP2_TEXTURE_COORD_3 0x0DB5 #endif #ifndef GL_MAP2_TEXTURE_COORD_4 #define GL_MAP2_TEXTURE_COORD_4 0x0DB6 #endif #ifndef GL_MAP2_VERTEX_3 #define GL_MAP2_VERTEX_3 0x0DB7 #endif #ifndef GL_MAP2_VERTEX_4 #define GL_MAP2_VERTEX_4 0x0DB8 #endif #ifndef GL_MAP2_VERTEX_ATTRIB0_4_NV #define GL_MAP2_VERTEX_ATTRIB0_4_NV 0x8670 #endif #ifndef GL_MAP2_VERTEX_ATTRIB10_4_NV #define GL_MAP2_VERTEX_ATTRIB10_4_NV 0x867A #endif #ifndef GL_MAP2_VERTEX_ATTRIB11_4_NV #define GL_MAP2_VERTEX_ATTRIB11_4_NV 0x867B #endif #ifndef GL_MAP2_VERTEX_ATTRIB12_4_NV #define GL_MAP2_VERTEX_ATTRIB12_4_NV 0x867C #endif #ifndef GL_MAP2_VERTEX_ATTRIB13_4_NV #define GL_MAP2_VERTEX_ATTRIB13_4_NV 0x867D #endif #ifndef GL_MAP2_VERTEX_ATTRIB14_4_NV #define GL_MAP2_VERTEX_ATTRIB14_4_NV 0x867E #endif #ifndef GL_MAP2_VERTEX_ATTRIB15_4_NV #define GL_MAP2_VERTEX_ATTRIB15_4_NV 0x867F #endif #ifndef GL_MAP2_VERTEX_ATTRIB1_4_NV #define GL_MAP2_VERTEX_ATTRIB1_4_NV 0x8671 #endif #ifndef GL_MAP2_VERTEX_ATTRIB2_4_NV #define GL_MAP2_VERTEX_ATTRIB2_4_NV 0x8672 #endif #ifndef GL_MAP2_VERTEX_ATTRIB3_4_NV #define GL_MAP2_VERTEX_ATTRIB3_4_NV 0x8673 #endif #ifndef GL_MAP2_VERTEX_ATTRIB4_4_NV #define GL_MAP2_VERTEX_ATTRIB4_4_NV 0x8674 #endif #ifndef GL_MAP2_VERTEX_ATTRIB5_4_NV #define GL_MAP2_VERTEX_ATTRIB5_4_NV 0x8675 #endif #ifndef GL_MAP2_VERTEX_ATTRIB6_4_NV #define GL_MAP2_VERTEX_ATTRIB6_4_NV 0x8676 #endif #ifndef GL_MAP2_VERTEX_ATTRIB7_4_NV #define GL_MAP2_VERTEX_ATTRIB7_4_NV 0x8677 #endif #ifndef GL_MAP2_VERTEX_ATTRIB8_4_NV #define GL_MAP2_VERTEX_ATTRIB8_4_NV 0x8678 #endif #ifndef GL_MAP2_VERTEX_ATTRIB9_4_NV #define GL_MAP2_VERTEX_ATTRIB9_4_NV 0x8679 #endif #ifndef GL_MAP_ATTRIB_U_ORDER_NV #define GL_MAP_ATTRIB_U_ORDER_NV 0x86C3 #endif #ifndef GL_MAP_ATTRIB_V_ORDER_NV #define GL_MAP_ATTRIB_V_ORDER_NV 0x86C4 #endif #ifndef GL_MAP_COLOR #define GL_MAP_COLOR 0x0D10 #endif #ifndef GL_MAP_FLUSH_EXPLICIT_BIT #define GL_MAP_FLUSH_EXPLICIT_BIT 0x0010 #endif #ifndef GL_MAP_INVALIDATE_BUFFER_BIT #define GL_MAP_INVALIDATE_BUFFER_BIT 0x0008 #endif #ifndef GL_MAP_INVALIDATE_RANGE_BIT #define GL_MAP_INVALIDATE_RANGE_BIT 0x0004 #endif #ifndef GL_MAP_READ_BIT #define GL_MAP_READ_BIT 0x0001 #endif #ifndef GL_MAP_STENCIL #define GL_MAP_STENCIL 0x0D11 #endif #ifndef GL_MAP_TESSELLATION_NV #define GL_MAP_TESSELLATION_NV 0x86C2 #endif #ifndef GL_MAP_UNSYNCHRONIZED_BIT #define GL_MAP_UNSYNCHRONIZED_BIT 0x0020 #endif #ifndef GL_MAP_WRITE_BIT #define GL_MAP_WRITE_BIT 0x0002 #endif #ifndef GL_MATERIAL_SIDE_HINT_PGI #define GL_MATERIAL_SIDE_HINT_PGI 0x1A22C #endif #ifndef GL_MATRIX0_ARB #define GL_MATRIX0_ARB 0x88C0 #endif #ifndef GL_MATRIX0_NV #define GL_MATRIX0_NV 0x8630 #endif #ifndef GL_MATRIX10_ARB #define GL_MATRIX10_ARB 0x88CA #endif #ifndef GL_MATRIX11_ARB #define GL_MATRIX11_ARB 0x88CB #endif #ifndef GL_MATRIX12_ARB #define GL_MATRIX12_ARB 0x88CC #endif #ifndef GL_MATRIX13_ARB #define GL_MATRIX13_ARB 0x88CD #endif #ifndef GL_MATRIX14_ARB #define GL_MATRIX14_ARB 0x88CE #endif #ifndef GL_MATRIX15_ARB #define GL_MATRIX15_ARB 0x88CF #endif #ifndef GL_MATRIX16_ARB #define GL_MATRIX16_ARB 0x88D0 #endif #ifndef GL_MATRIX17_ARB #define GL_MATRIX17_ARB 0x88D1 #endif #ifndef GL_MATRIX18_ARB #define GL_MATRIX18_ARB 0x88D2 #endif #ifndef GL_MATRIX19_ARB #define GL_MATRIX19_ARB 0x88D3 #endif #ifndef GL_MATRIX1_ARB #define GL_MATRIX1_ARB 0x88C1 #endif #ifndef GL_MATRIX1_NV #define GL_MATRIX1_NV 0x8631 #endif #ifndef GL_MATRIX20_ARB #define GL_MATRIX20_ARB 0x88D4 #endif #ifndef GL_MATRIX21_ARB #define GL_MATRIX21_ARB 0x88D5 #endif #ifndef GL_MATRIX22_ARB #define GL_MATRIX22_ARB 0x88D6 #endif #ifndef GL_MATRIX23_ARB #define GL_MATRIX23_ARB 0x88D7 #endif #ifndef GL_MATRIX24_ARB #define GL_MATRIX24_ARB 0x88D8 #endif #ifndef GL_MATRIX25_ARB #define GL_MATRIX25_ARB 0x88D9 #endif #ifndef GL_MATRIX26_ARB #define GL_MATRIX26_ARB 0x88DA #endif #ifndef GL_MATRIX27_ARB #define GL_MATRIX27_ARB 0x88DB #endif #ifndef GL_MATRIX28_ARB #define GL_MATRIX28_ARB 0x88DC #endif #ifndef GL_MATRIX29_ARB #define GL_MATRIX29_ARB 0x88DD #endif #ifndef GL_MATRIX2_ARB #define GL_MATRIX2_ARB 0x88C2 #endif #ifndef GL_MATRIX2_NV #define GL_MATRIX2_NV 0x8632 #endif #ifndef GL_MATRIX30_ARB #define GL_MATRIX30_ARB 0x88DE #endif #ifndef GL_MATRIX31_ARB #define GL_MATRIX31_ARB 0x88DF #endif #ifndef GL_MATRIX3_ARB #define GL_MATRIX3_ARB 0x88C3 #endif #ifndef GL_MATRIX3_NV #define GL_MATRIX3_NV 0x8633 #endif #ifndef GL_MATRIX4_ARB #define GL_MATRIX4_ARB 0x88C4 #endif #ifndef GL_MATRIX4_NV #define GL_MATRIX4_NV 0x8634 #endif #ifndef GL_MATRIX5_ARB #define GL_MATRIX5_ARB 0x88C5 #endif #ifndef GL_MATRIX5_NV #define GL_MATRIX5_NV 0x8635 #endif #ifndef GL_MATRIX6_ARB #define GL_MATRIX6_ARB 0x88C6 #endif #ifndef GL_MATRIX6_NV #define GL_MATRIX6_NV 0x8636 #endif #ifndef GL_MATRIX7_ARB #define GL_MATRIX7_ARB 0x88C7 #endif #ifndef GL_MATRIX7_NV #define GL_MATRIX7_NV 0x8637 #endif #ifndef GL_MATRIX8_ARB #define GL_MATRIX8_ARB 0x88C8 #endif #ifndef GL_MATRIX9_ARB #define GL_MATRIX9_ARB 0x88C9 #endif #ifndef GL_MATRIX_EXT #define GL_MATRIX_EXT 0x87C0 #endif #ifndef GL_MATRIX_INDEX_ARRAY_ARB #define GL_MATRIX_INDEX_ARRAY_ARB 0x8844 #endif #ifndef GL_MATRIX_INDEX_ARRAY_POINTER_ARB #define GL_MATRIX_INDEX_ARRAY_POINTER_ARB 0x8849 #endif #ifndef GL_MATRIX_INDEX_ARRAY_SIZE_ARB #define GL_MATRIX_INDEX_ARRAY_SIZE_ARB 0x8846 #endif #ifndef GL_MATRIX_INDEX_ARRAY_STRIDE_ARB #define GL_MATRIX_INDEX_ARRAY_STRIDE_ARB 0x8848 #endif #ifndef GL_MATRIX_INDEX_ARRAY_TYPE_ARB #define GL_MATRIX_INDEX_ARRAY_TYPE_ARB 0x8847 #endif #ifndef GL_MATRIX_MODE #define GL_MATRIX_MODE 0x0BA0 #endif #ifndef GL_MATRIX_PALETTE_ARB #define GL_MATRIX_PALETTE_ARB 0x8840 #endif #ifndef GL_MAT_AMBIENT_AND_DIFFUSE_BIT_PGI #define GL_MAT_AMBIENT_AND_DIFFUSE_BIT_PGI 0x00200000 #endif #ifndef GL_MAT_AMBIENT_BIT_PGI #define GL_MAT_AMBIENT_BIT_PGI 0x00100000 #endif #ifndef GL_MAT_COLOR_INDEXES_BIT_PGI #define GL_MAT_COLOR_INDEXES_BIT_PGI 0x01000000 #endif #ifndef GL_MAT_DIFFUSE_BIT_PGI #define GL_MAT_DIFFUSE_BIT_PGI 0x00400000 #endif #ifndef GL_MAT_EMISSION_BIT_PGI #define GL_MAT_EMISSION_BIT_PGI 0x00800000 #endif #ifndef GL_MAT_SHININESS_BIT_PGI #define GL_MAT_SHININESS_BIT_PGI 0x02000000 #endif #ifndef GL_MAT_SPECULAR_BIT_PGI #define GL_MAT_SPECULAR_BIT_PGI 0x04000000 #endif #ifndef GL_MAX #define GL_MAX 0x8008 #endif #ifndef GL_MAX_3D_TEXTURE_SIZE #define GL_MAX_3D_TEXTURE_SIZE 0x8073 #endif #ifndef GL_MAX_3D_TEXTURE_SIZE_EXT #define GL_MAX_3D_TEXTURE_SIZE_EXT 0x8073 #endif #ifndef GL_MAX_4D_TEXTURE_SIZE_SGIS #define GL_MAX_4D_TEXTURE_SIZE_SGIS 0x8138 #endif #ifndef GL_MAX_ACTIVE_LIGHTS_SGIX #define GL_MAX_ACTIVE_LIGHTS_SGIX 0x8405 #endif #ifndef GL_MAX_ARRAY_TEXTURE_LAYERS #define GL_MAX_ARRAY_TEXTURE_LAYERS 0x88FF #endif #ifndef GL_MAX_ARRAY_TEXTURE_LAYERS_EXT #define GL_MAX_ARRAY_TEXTURE_LAYERS_EXT 0x88FF #endif #ifndef GL_MAX_ASYNC_DRAW_PIXELS_SGIX #define GL_MAX_ASYNC_DRAW_PIXELS_SGIX 0x8360 #endif #ifndef GL_MAX_ASYNC_HISTOGRAM_SGIX #define GL_MAX_ASYNC_HISTOGRAM_SGIX 0x832D #endif #ifndef GL_MAX_ASYNC_READ_PIXELS_SGIX #define GL_MAX_ASYNC_READ_PIXELS_SGIX 0x8361 #endif #ifndef GL_MAX_ASYNC_TEX_IMAGE_SGIX #define GL_MAX_ASYNC_TEX_IMAGE_SGIX 0x835F #endif #ifndef GL_MAX_ATTRIB_STACK_DEPTH #define GL_MAX_ATTRIB_STACK_DEPTH 0x0D35 #endif #ifndef GL_MAX_BINDABLE_UNIFORM_SIZE_EXT #define GL_MAX_BINDABLE_UNIFORM_SIZE_EXT 0x8DED #endif #ifndef GL_MAX_CLIENT_ATTRIB_STACK_DEPTH #define GL_MAX_CLIENT_ATTRIB_STACK_DEPTH 0x0D3B #endif #ifndef GL_MAX_CLIPMAP_DEPTH_SGIX #define GL_MAX_CLIPMAP_DEPTH_SGIX 0x8177 #endif #ifndef GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX #define GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX 0x8178 #endif #ifndef GL_MAX_CLIP_DISTANCES #define GL_MAX_CLIP_DISTANCES GL_MAX_CLIP_PLANES #endif #ifndef GL_MAX_CLIP_PLANES #define GL_MAX_CLIP_PLANES 0x0D32 #endif #ifndef GL_MAX_COLOR_ATTACHMENTS #define GL_MAX_COLOR_ATTACHMENTS 0x8CDF #endif #ifndef GL_MAX_COLOR_ATTACHMENTS_EXT #define GL_MAX_COLOR_ATTACHMENTS_EXT 0x8CDF #endif #ifndef GL_MAX_COLOR_MATRIX_STACK_DEPTH #define GL_MAX_COLOR_MATRIX_STACK_DEPTH 0x80B3 #endif #ifndef GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI #define GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B3 #endif #ifndef GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS #define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D #endif #ifndef GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB #define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB 0x8B4D #endif #ifndef GL_MAX_CONVOLUTION_HEIGHT #define GL_MAX_CONVOLUTION_HEIGHT 0x801B #endif #ifndef GL_MAX_CONVOLUTION_HEIGHT_EXT #define GL_MAX_CONVOLUTION_HEIGHT_EXT 0x801B #endif #ifndef GL_MAX_CONVOLUTION_WIDTH #define GL_MAX_CONVOLUTION_WIDTH 0x801A #endif #ifndef GL_MAX_CONVOLUTION_WIDTH_EXT #define GL_MAX_CONVOLUTION_WIDTH_EXT 0x801A #endif #ifndef GL_MAX_CUBE_MAP_TEXTURE_SIZE #define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C #endif #ifndef GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB #define GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB 0x851C #endif #ifndef GL_MAX_CUBE_MAP_TEXTURE_SIZE_EXT #define GL_MAX_CUBE_MAP_TEXTURE_SIZE_EXT 0x851C #endif #ifndef GL_MAX_DEFORMATION_ORDER_SGIX #define GL_MAX_DEFORMATION_ORDER_SGIX 0x8197 #endif #ifndef GL_MAX_DRAW_BUFFERS #define GL_MAX_DRAW_BUFFERS 0x8824 #endif #ifndef GL_MAX_DRAW_BUFFERS_ARB #define GL_MAX_DRAW_BUFFERS_ARB 0x8824 #endif #ifndef GL_MAX_DRAW_BUFFERS_ATI #define GL_MAX_DRAW_BUFFERS_ATI 0x8824 #endif #ifndef GL_MAX_ELEMENTS_INDICES #define GL_MAX_ELEMENTS_INDICES 0x80E9 #endif #ifndef GL_MAX_ELEMENTS_INDICES_EXT #define GL_MAX_ELEMENTS_INDICES_EXT 0x80E9 #endif #ifndef GL_MAX_ELEMENTS_VERTICES #define GL_MAX_ELEMENTS_VERTICES 0x80E8 #endif #ifndef GL_MAX_ELEMENTS_VERTICES_EXT #define GL_MAX_ELEMENTS_VERTICES_EXT 0x80E8 #endif #ifndef GL_MAX_EVAL_ORDER #define GL_MAX_EVAL_ORDER 0x0D30 #endif #ifndef GL_MAX_EXT #define GL_MAX_EXT 0x8008 #endif #ifndef GL_MAX_FOG_FUNC_POINTS_SGIS #define GL_MAX_FOG_FUNC_POINTS_SGIS 0x812C #endif #ifndef GL_MAX_FRAGMENT_BINDABLE_UNIFORMS_EXT #define GL_MAX_FRAGMENT_BINDABLE_UNIFORMS_EXT 0x8DE3 #endif #ifndef GL_MAX_FRAGMENT_LIGHTS_SGIX #define GL_MAX_FRAGMENT_LIGHTS_SGIX 0x8404 #endif #ifndef GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV #define GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV 0x8868 #endif #ifndef GL_MAX_FRAGMENT_UNIFORM_COMPONENTS #define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS 0x8B49 #endif #ifndef GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB #define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB 0x8B49 #endif #ifndef GL_MAX_FRAMEZOOM_FACTOR_SGIX #define GL_MAX_FRAMEZOOM_FACTOR_SGIX 0x818D #endif #ifndef GL_MAX_GENERAL_COMBINERS_NV #define GL_MAX_GENERAL_COMBINERS_NV 0x854D #endif #ifndef GL_MAX_GEOMETRY_BINDABLE_UNIFORMS_EXT #define GL_MAX_GEOMETRY_BINDABLE_UNIFORMS_EXT 0x8DE4 #endif #ifndef GL_MAX_GEOMETRY_OUTPUT_VERTICES_ARB #define GL_MAX_GEOMETRY_OUTPUT_VERTICES_ARB 0x8DE0 #endif #ifndef GL_MAX_GEOMETRY_OUTPUT_VERTICES_EXT #define GL_MAX_GEOMETRY_OUTPUT_VERTICES_EXT 0x8DE0 #endif #ifndef GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_ARB #define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_ARB 0x8C29 #endif #ifndef GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT #define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT 0x8C29 #endif #ifndef GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_ARB #define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_ARB 0x8DE1 #endif #ifndef GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_EXT #define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_EXT 0x8DE1 #endif #ifndef GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_ARB #define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_ARB 0x8DDF #endif #ifndef GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_EXT #define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_EXT 0x8DDF #endif #ifndef GL_MAX_GEOMETRY_VARYING_COMPONENTS_ARB #define GL_MAX_GEOMETRY_VARYING_COMPONENTS_ARB 0x8DDD #endif #ifndef GL_MAX_GEOMETRY_VARYING_COMPONENTS_EXT #define GL_MAX_GEOMETRY_VARYING_COMPONENTS_EXT 0x8DDD #endif #ifndef GL_MAX_LIGHTS #define GL_MAX_LIGHTS 0x0D31 #endif #ifndef GL_MAX_LIST_NESTING #define GL_MAX_LIST_NESTING 0x0B31 #endif #ifndef GL_MAX_MAP_TESSELLATION_NV #define GL_MAX_MAP_TESSELLATION_NV 0x86D6 #endif #ifndef GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB #define GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB 0x8841 #endif #ifndef GL_MAX_MODELVIEW_STACK_DEPTH #define GL_MAX_MODELVIEW_STACK_DEPTH 0x0D36 #endif #ifndef GL_MAX_MULTISAMPLE_COVERAGE_MODES_NV #define GL_MAX_MULTISAMPLE_COVERAGE_MODES_NV 0x8E11 #endif #ifndef GL_MAX_NAME_STACK_DEPTH #define GL_MAX_NAME_STACK_DEPTH 0x0D37 #endif #ifndef GL_MAX_OPTIMIZED_VERTEX_SHADER_INSTRUCTIONS_EXT #define GL_MAX_OPTIMIZED_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CA #endif #ifndef GL_MAX_OPTIMIZED_VERTEX_SHADER_INVARIANTS_EXT #define GL_MAX_OPTIMIZED_VERTEX_SHADER_INVARIANTS_EXT 0x87CD #endif #ifndef GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCALS_EXT #define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCALS_EXT 0x87CE #endif #ifndef GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCAL_CONSTANTS_EXT #define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87CC #endif #ifndef GL_MAX_OPTIMIZED_VERTEX_SHADER_VARIANTS_EXT #define GL_MAX_OPTIMIZED_VERTEX_SHADER_VARIANTS_EXT 0x87CB #endif #ifndef GL_MAX_PALETTE_MATRICES_ARB #define GL_MAX_PALETTE_MATRICES_ARB 0x8842 #endif #ifndef GL_MAX_PIXEL_MAP_TABLE #define GL_MAX_PIXEL_MAP_TABLE 0x0D34 #endif #ifndef GL_MAX_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT #define GL_MAX_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8337 #endif #ifndef GL_MAX_PN_TRIANGLES_TESSELATION_LEVEL_ATI #define GL_MAX_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F1 #endif #ifndef GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB #define GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B1 #endif #ifndef GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB #define GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB 0x880B #endif #ifndef GL_MAX_PROGRAM_ATTRIBS_ARB #define GL_MAX_PROGRAM_ATTRIBS_ARB 0x88AD #endif #ifndef GL_MAX_PROGRAM_ATTRIB_COMPONENTS_NV #define GL_MAX_PROGRAM_ATTRIB_COMPONENTS_NV 0x8908 #endif #ifndef GL_MAX_PROGRAM_CALL_DEPTH_NV #define GL_MAX_PROGRAM_CALL_DEPTH_NV 0x88F5 #endif #ifndef GL_MAX_PROGRAM_ENV_PARAMETERS_ARB #define GL_MAX_PROGRAM_ENV_PARAMETERS_ARB 0x88B5 #endif #ifndef GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV #define GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV 0x88F4 #endif #ifndef GL_MAX_PROGRAM_GENERIC_ATTRIBS_NV #define GL_MAX_PROGRAM_GENERIC_ATTRIBS_NV 0x8DA5 #endif #ifndef GL_MAX_PROGRAM_GENERIC_RESULTS_NV #define GL_MAX_PROGRAM_GENERIC_RESULTS_NV 0x8DA6 #endif #ifndef GL_MAX_PROGRAM_IF_DEPTH_NV #define GL_MAX_PROGRAM_IF_DEPTH_NV 0x88F6 #endif #ifndef GL_MAX_PROGRAM_INSTRUCTIONS_ARB #define GL_MAX_PROGRAM_INSTRUCTIONS_ARB 0x88A1 #endif #ifndef GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB #define GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB 0x88B4 #endif #ifndef GL_MAX_PROGRAM_LOOP_COUNT_NV #define GL_MAX_PROGRAM_LOOP_COUNT_NV 0x88F8 #endif #ifndef GL_MAX_PROGRAM_LOOP_DEPTH_NV #define GL_MAX_PROGRAM_LOOP_DEPTH_NV 0x88F7 #endif #ifndef GL_MAX_PROGRAM_MATRICES_ARB #define GL_MAX_PROGRAM_MATRICES_ARB 0x862F #endif #ifndef GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB #define GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB 0x862E #endif #ifndef GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB #define GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B3 #endif #ifndef GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB #define GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x880E #endif #ifndef GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB #define GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AF #endif #ifndef GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB #define GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A3 #endif #ifndef GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB #define GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AB #endif #ifndef GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB #define GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A7 #endif #ifndef GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB #define GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x8810 #endif #ifndef GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB #define GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x880F #endif #ifndef GL_MAX_PROGRAM_OUTPUT_VERTICES_NV #define GL_MAX_PROGRAM_OUTPUT_VERTICES_NV 0x8C27 #endif #ifndef GL_MAX_PROGRAM_PARAMETERS_ARB #define GL_MAX_PROGRAM_PARAMETERS_ARB 0x88A9 #endif #ifndef GL_MAX_PROGRAM_PARAMETER_BUFFER_BINDINGS_NV #define GL_MAX_PROGRAM_PARAMETER_BUFFER_BINDINGS_NV 0x8DA0 #endif #ifndef GL_MAX_PROGRAM_PARAMETER_BUFFER_SIZE_NV #define GL_MAX_PROGRAM_PARAMETER_BUFFER_SIZE_NV 0x8DA1 #endif #ifndef GL_MAX_PROGRAM_RESULT_COMPONENTS_NV #define GL_MAX_PROGRAM_RESULT_COMPONENTS_NV 0x8909 #endif #ifndef GL_MAX_PROGRAM_TEMPORARIES_ARB #define GL_MAX_PROGRAM_TEMPORARIES_ARB 0x88A5 #endif #ifndef GL_MAX_PROGRAM_TEXEL_OFFSET #define GL_MAX_PROGRAM_TEXEL_OFFSET 0x8905 #endif #ifndef GL_MAX_PROGRAM_TEXEL_OFFSET_NV #define GL_MAX_PROGRAM_TEXEL_OFFSET_NV 0x8905 #endif #ifndef GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB #define GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB 0x880D #endif #ifndef GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB #define GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB 0x880C #endif #ifndef GL_MAX_PROGRAM_TOTAL_OUTPUT_COMPONENTS_NV #define GL_MAX_PROGRAM_TOTAL_OUTPUT_COMPONENTS_NV 0x8C28 #endif #ifndef GL_MAX_PROJECTION_STACK_DEPTH #define GL_MAX_PROJECTION_STACK_DEPTH 0x0D38 #endif #ifndef GL_MAX_RATIONAL_EVAL_ORDER_NV #define GL_MAX_RATIONAL_EVAL_ORDER_NV 0x86D7 #endif #ifndef GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB #define GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB 0x84F8 #endif #ifndef GL_MAX_RECTANGLE_TEXTURE_SIZE_NV #define GL_MAX_RECTANGLE_TEXTURE_SIZE_NV 0x84F8 #endif #ifndef GL_MAX_RENDERBUFFER_SIZE #define GL_MAX_RENDERBUFFER_SIZE 0x84E8 #endif #ifndef GL_MAX_RENDERBUFFER_SIZE_EXT #define GL_MAX_RENDERBUFFER_SIZE_EXT 0x84E8 #endif #ifndef GL_MAX_SAMPLES #define GL_MAX_SAMPLES 0x8D57 #endif #ifndef GL_MAX_SAMPLES_EXT #define GL_MAX_SAMPLES_EXT 0x8D57 #endif #ifndef GL_MAX_SAMPLE_MASK_WORDS_NV #define GL_MAX_SAMPLE_MASK_WORDS_NV 0x8E59 #endif #ifndef GL_MAX_SHININESS_NV #define GL_MAX_SHININESS_NV 0x8504 #endif #ifndef GL_MAX_SPOT_EXPONENT_NV #define GL_MAX_SPOT_EXPONENT_NV 0x8505 #endif #ifndef GL_MAX_TEXTURE_BUFFER_SIZE_ARB #define GL_MAX_TEXTURE_BUFFER_SIZE_ARB 0x8C2B #endif #ifndef GL_MAX_TEXTURE_BUFFER_SIZE_EXT #define GL_MAX_TEXTURE_BUFFER_SIZE_EXT 0x8C2B #endif #ifndef GL_MAX_TEXTURE_COORDS #define GL_MAX_TEXTURE_COORDS 0x8871 #endif #ifndef GL_MAX_TEXTURE_COORDS_ARB #define GL_MAX_TEXTURE_COORDS_ARB 0x8871 #endif #ifndef GL_MAX_TEXTURE_COORDS_NV #define GL_MAX_TEXTURE_COORDS_NV 0x8871 #endif #ifndef GL_MAX_TEXTURE_IMAGE_UNITS #define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872 #endif #ifndef GL_MAX_TEXTURE_IMAGE_UNITS_ARB #define GL_MAX_TEXTURE_IMAGE_UNITS_ARB 0x8872 #endif #ifndef GL_MAX_TEXTURE_IMAGE_UNITS_NV #define GL_MAX_TEXTURE_IMAGE_UNITS_NV 0x8872 #endif #ifndef GL_MAX_TEXTURE_LOD_BIAS #define GL_MAX_TEXTURE_LOD_BIAS 0x84FD #endif #ifndef GL_MAX_TEXTURE_LOD_BIAS_EXT #define GL_MAX_TEXTURE_LOD_BIAS_EXT 0x84FD #endif #ifndef GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT #define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF #endif #ifndef GL_MAX_TEXTURE_SIZE #define GL_MAX_TEXTURE_SIZE 0x0D33 #endif #ifndef GL_MAX_TEXTURE_STACK_DEPTH #define GL_MAX_TEXTURE_STACK_DEPTH 0x0D39 #endif #ifndef GL_MAX_TEXTURE_UNITS #define GL_MAX_TEXTURE_UNITS 0x84E2 #endif #ifndef GL_MAX_TEXTURE_UNITS_ARB #define GL_MAX_TEXTURE_UNITS_ARB 0x84E2 #endif #ifndef GL_MAX_TRACK_MATRICES_NV #define GL_MAX_TRACK_MATRICES_NV 0x862F #endif #ifndef GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV #define GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV 0x862E #endif #ifndef GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_ATTRIBS_NV #define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_ATTRIBS_NV 0x8C8A #endif #ifndef GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS #define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS 0x8C8A #endif #ifndef GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_EXT #define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_EXT 0x8C8A #endif #ifndef GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS #define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS 0x8C8B #endif #ifndef GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_EXT #define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_EXT 0x8C8B #endif #ifndef GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_NV #define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_NV 0x8C8B #endif #ifndef GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS #define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS 0x8C80 #endif #ifndef GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_EXT #define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_EXT 0x8C80 #endif #ifndef GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_NV #define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_NV 0x8C80 #endif #ifndef GL_MAX_VARYING_COMPONENTS #define GL_MAX_VARYING_COMPONENTS GL_MAX_VARYING_FLOATS #endif #ifndef GL_MAX_VARYING_COMPONENTS_EXT #define GL_MAX_VARYING_COMPONENTS_EXT 0x8B4B #endif #ifndef GL_MAX_VARYING_FLOATS #define GL_MAX_VARYING_FLOATS 0x8B4B #endif #ifndef GL_MAX_VARYING_FLOATS_ARB #define GL_MAX_VARYING_FLOATS_ARB 0x8B4B #endif #ifndef GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_NV #define GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_NV 0x8520 #endif #ifndef GL_MAX_VERTEX_ATTRIBS #define GL_MAX_VERTEX_ATTRIBS 0x8869 #endif #ifndef GL_MAX_VERTEX_ATTRIBS_ARB #define GL_MAX_VERTEX_ATTRIBS_ARB 0x8869 #endif #ifndef GL_MAX_VERTEX_BINDABLE_UNIFORMS_EXT #define GL_MAX_VERTEX_BINDABLE_UNIFORMS_EXT 0x8DE2 #endif #ifndef GL_MAX_VERTEX_HINT_PGI #define GL_MAX_VERTEX_HINT_PGI 0x1A22D #endif #ifndef GL_MAX_VERTEX_SHADER_INSTRUCTIONS_EXT #define GL_MAX_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87C5 #endif #ifndef GL_MAX_VERTEX_SHADER_INVARIANTS_EXT #define GL_MAX_VERTEX_SHADER_INVARIANTS_EXT 0x87C7 #endif #ifndef GL_MAX_VERTEX_SHADER_LOCALS_EXT #define GL_MAX_VERTEX_SHADER_LOCALS_EXT 0x87C9 #endif #ifndef GL_MAX_VERTEX_SHADER_LOCAL_CONSTANTS_EXT #define GL_MAX_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87C8 #endif #ifndef GL_MAX_VERTEX_SHADER_VARIANTS_EXT #define GL_MAX_VERTEX_SHADER_VARIANTS_EXT 0x87C6 #endif #ifndef GL_MAX_VERTEX_STREAMS_ATI #define GL_MAX_VERTEX_STREAMS_ATI 0x876B #endif #ifndef GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS #define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C #endif #ifndef GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB #define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB 0x8B4C #endif #ifndef GL_MAX_VERTEX_UNIFORM_COMPONENTS #define GL_MAX_VERTEX_UNIFORM_COMPONENTS 0x8B4A #endif #ifndef GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB #define GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB 0x8B4A #endif #ifndef GL_MAX_VERTEX_UNITS_ARB #define GL_MAX_VERTEX_UNITS_ARB 0x86A4 #endif #ifndef GL_MAX_VERTEX_VARYING_COMPONENTS_ARB #define GL_MAX_VERTEX_VARYING_COMPONENTS_ARB 0x8DDE #endif #ifndef GL_MAX_VERTEX_VARYING_COMPONENTS_EXT #define GL_MAX_VERTEX_VARYING_COMPONENTS_EXT 0x8DDE #endif #ifndef GL_MAX_VIEWPORT_DIMS #define GL_MAX_VIEWPORT_DIMS 0x0D3A #endif #ifndef GL_MIN #define GL_MIN 0x8007 #endif #ifndef GL_MINMAX #define GL_MINMAX 0x802E #endif #ifndef GL_MINMAX_EXT #define GL_MINMAX_EXT 0x802E #endif #ifndef GL_MINMAX_FORMAT #define GL_MINMAX_FORMAT 0x802F #endif #ifndef GL_MINMAX_FORMAT_EXT #define GL_MINMAX_FORMAT_EXT 0x802F #endif #ifndef GL_MINMAX_SINK #define GL_MINMAX_SINK 0x8030 #endif #ifndef GL_MINMAX_SINK_EXT #define GL_MINMAX_SINK_EXT 0x8030 #endif #ifndef GL_MINOR_VERSION #define GL_MINOR_VERSION 0x821C #endif #ifndef GL_MIN_EXT #define GL_MIN_EXT 0x8007 #endif #ifndef GL_MIN_PROGRAM_TEXEL_OFFSET #define GL_MIN_PROGRAM_TEXEL_OFFSET 0x8904 #endif #ifndef GL_MIN_PROGRAM_TEXEL_OFFSET_NV #define GL_MIN_PROGRAM_TEXEL_OFFSET_NV 0x8904 #endif #ifndef GL_MIRRORED_REPEAT #define GL_MIRRORED_REPEAT 0x8370 #endif #ifndef GL_MIRRORED_REPEAT_ARB #define GL_MIRRORED_REPEAT_ARB 0x8370 #endif #ifndef GL_MIRRORED_REPEAT_IBM #define GL_MIRRORED_REPEAT_IBM 0x8370 #endif #ifndef GL_MIRROR_CLAMP_ATI #define GL_MIRROR_CLAMP_ATI 0x8742 #endif #ifndef GL_MIRROR_CLAMP_EXT #define GL_MIRROR_CLAMP_EXT 0x8742 #endif #ifndef GL_MIRROR_CLAMP_TO_BORDER_EXT #define GL_MIRROR_CLAMP_TO_BORDER_EXT 0x8912 #endif #ifndef GL_MIRROR_CLAMP_TO_EDGE_ATI #define GL_MIRROR_CLAMP_TO_EDGE_ATI 0x8743 #endif #ifndef GL_MIRROR_CLAMP_TO_EDGE_EXT #define GL_MIRROR_CLAMP_TO_EDGE_EXT 0x8743 #endif #ifndef GL_MODELVIEW #define GL_MODELVIEW 0x1700 #endif #ifndef GL_MODELVIEW0_ARB #define GL_MODELVIEW0_ARB 0x1700 #endif #ifndef GL_MODELVIEW0_EXT #define GL_MODELVIEW0_EXT GL_MODELVIEW #endif #ifndef GL_MODELVIEW0_MATRIX_EXT #define GL_MODELVIEW0_MATRIX_EXT GL_MODELVIEW_MATRIX #endif #ifndef GL_MODELVIEW0_STACK_DEPTH_EXT #define GL_MODELVIEW0_STACK_DEPTH_EXT GL_MODELVIEW_STACK_DEPTH #endif #ifndef GL_MODELVIEW10_ARB #define GL_MODELVIEW10_ARB 0x872A #endif #ifndef GL_MODELVIEW11_ARB #define GL_MODELVIEW11_ARB 0x872B #endif #ifndef GL_MODELVIEW12_ARB #define GL_MODELVIEW12_ARB 0x872C #endif #ifndef GL_MODELVIEW13_ARB #define GL_MODELVIEW13_ARB 0x872D #endif #ifndef GL_MODELVIEW14_ARB #define GL_MODELVIEW14_ARB 0x872E #endif #ifndef GL_MODELVIEW15_ARB #define GL_MODELVIEW15_ARB 0x872F #endif #ifndef GL_MODELVIEW16_ARB #define GL_MODELVIEW16_ARB 0x8730 #endif #ifndef GL_MODELVIEW17_ARB #define GL_MODELVIEW17_ARB 0x8731 #endif #ifndef GL_MODELVIEW18_ARB #define GL_MODELVIEW18_ARB 0x8732 #endif #ifndef GL_MODELVIEW19_ARB #define GL_MODELVIEW19_ARB 0x8733 #endif #ifndef GL_MODELVIEW1_ARB #define GL_MODELVIEW1_ARB 0x850A #endif #ifndef GL_MODELVIEW1_EXT #define GL_MODELVIEW1_EXT 0x850A #endif #ifndef GL_MODELVIEW1_MATRIX_EXT #define GL_MODELVIEW1_MATRIX_EXT 0x8506 #endif #ifndef GL_MODELVIEW1_STACK_DEPTH_EXT #define GL_MODELVIEW1_STACK_DEPTH_EXT 0x8502 #endif #ifndef GL_MODELVIEW20_ARB #define GL_MODELVIEW20_ARB 0x8734 #endif #ifndef GL_MODELVIEW21_ARB #define GL_MODELVIEW21_ARB 0x8735 #endif #ifndef GL_MODELVIEW22_ARB #define GL_MODELVIEW22_ARB 0x8736 #endif #ifndef GL_MODELVIEW23_ARB #define GL_MODELVIEW23_ARB 0x8737 #endif #ifndef GL_MODELVIEW24_ARB #define GL_MODELVIEW24_ARB 0x8738 #endif #ifndef GL_MODELVIEW25_ARB #define GL_MODELVIEW25_ARB 0x8739 #endif #ifndef GL_MODELVIEW26_ARB #define GL_MODELVIEW26_ARB 0x873A #endif #ifndef GL_MODELVIEW27_ARB #define GL_MODELVIEW27_ARB 0x873B #endif #ifndef GL_MODELVIEW28_ARB #define GL_MODELVIEW28_ARB 0x873C #endif #ifndef GL_MODELVIEW29_ARB #define GL_MODELVIEW29_ARB 0x873D #endif #ifndef GL_MODELVIEW2_ARB #define GL_MODELVIEW2_ARB 0x8722 #endif #ifndef GL_MODELVIEW30_ARB #define GL_MODELVIEW30_ARB 0x873E #endif #ifndef GL_MODELVIEW31_ARB #define GL_MODELVIEW31_ARB 0x873F #endif #ifndef GL_MODELVIEW3_ARB #define GL_MODELVIEW3_ARB 0x8723 #endif #ifndef GL_MODELVIEW4_ARB #define GL_MODELVIEW4_ARB 0x8724 #endif #ifndef GL_MODELVIEW5_ARB #define GL_MODELVIEW5_ARB 0x8725 #endif #ifndef GL_MODELVIEW6_ARB #define GL_MODELVIEW6_ARB 0x8726 #endif #ifndef GL_MODELVIEW7_ARB #define GL_MODELVIEW7_ARB 0x8727 #endif #ifndef GL_MODELVIEW8_ARB #define GL_MODELVIEW8_ARB 0x8728 #endif #ifndef GL_MODELVIEW9_ARB #define GL_MODELVIEW9_ARB 0x8729 #endif #ifndef GL_MODELVIEW_MATRIX #define GL_MODELVIEW_MATRIX 0x0BA6 #endif #ifndef GL_MODELVIEW_PROJECTION_NV #define GL_MODELVIEW_PROJECTION_NV 0x8629 #endif #ifndef GL_MODELVIEW_STACK_DEPTH #define GL_MODELVIEW_STACK_DEPTH 0x0BA3 #endif #ifndef GL_MODULATE #define GL_MODULATE 0x2100 #endif #ifndef GL_MODULATE_ADD_ATI #define GL_MODULATE_ADD_ATI 0x8744 #endif #ifndef GL_MODULATE_SIGNED_ADD_ATI #define GL_MODULATE_SIGNED_ADD_ATI 0x8745 #endif #ifndef GL_MODULATE_SUBTRACT_ATI #define GL_MODULATE_SUBTRACT_ATI 0x8746 #endif #ifndef GL_MOV_ATI #define GL_MOV_ATI 0x8961 #endif #ifndef GL_MULT #define GL_MULT 0x0103 #endif #ifndef GL_MULTISAMPLE #define GL_MULTISAMPLE 0x809D #endif #ifndef GL_MULTISAMPLE_3DFX #define GL_MULTISAMPLE_3DFX 0x86B2 #endif #ifndef GL_MULTISAMPLE_ARB #define GL_MULTISAMPLE_ARB 0x809D #endif #ifndef GL_MULTISAMPLE_BIT #define GL_MULTISAMPLE_BIT 0x20000000 #endif #ifndef GL_MULTISAMPLE_BIT_3DFX #define GL_MULTISAMPLE_BIT_3DFX 0x20000000 #endif #ifndef GL_MULTISAMPLE_BIT_ARB #define GL_MULTISAMPLE_BIT_ARB 0x20000000 #endif #ifndef GL_MULTISAMPLE_BIT_EXT #define GL_MULTISAMPLE_BIT_EXT 0x20000000 #endif #ifndef GL_MULTISAMPLE_COVERAGE_MODES_NV #define GL_MULTISAMPLE_COVERAGE_MODES_NV 0x8E12 #endif #ifndef GL_MULTISAMPLE_EXT #define GL_MULTISAMPLE_EXT 0x809D #endif #ifndef GL_MULTISAMPLE_FILTER_HINT_NV #define GL_MULTISAMPLE_FILTER_HINT_NV 0x8534 #endif #ifndef GL_MULTISAMPLE_SGIS #define GL_MULTISAMPLE_SGIS 0x809D #endif #ifndef GL_MUL_ATI #define GL_MUL_ATI 0x8964 #endif #ifndef GL_MVP_MATRIX_EXT #define GL_MVP_MATRIX_EXT 0x87E3 #endif #ifndef GL_N3F_V3F #define GL_N3F_V3F 0x2A25 #endif #ifndef GL_NAME_STACK_DEPTH #define GL_NAME_STACK_DEPTH 0x0D70 #endif #ifndef GL_NAND #define GL_NAND 0x150E #endif #ifndef GL_NATIVE_GRAPHICS_BEGIN_HINT_PGI #define GL_NATIVE_GRAPHICS_BEGIN_HINT_PGI 0x1A203 #endif #ifndef GL_NATIVE_GRAPHICS_END_HINT_PGI #define GL_NATIVE_GRAPHICS_END_HINT_PGI 0x1A204 #endif #ifndef GL_NATIVE_GRAPHICS_HANDLE_PGI #define GL_NATIVE_GRAPHICS_HANDLE_PGI 0x1A202 #endif #ifndef GL_NEAREST #define GL_NEAREST 0x2600 #endif #ifndef GL_NEAREST_CLIPMAP_LINEAR_SGIX #define GL_NEAREST_CLIPMAP_LINEAR_SGIX 0x844E #endif #ifndef GL_NEAREST_CLIPMAP_NEAREST_SGIX #define GL_NEAREST_CLIPMAP_NEAREST_SGIX 0x844D #endif #ifndef GL_NEAREST_MIPMAP_LINEAR #define GL_NEAREST_MIPMAP_LINEAR 0x2702 #endif #ifndef GL_NEAREST_MIPMAP_NEAREST #define GL_NEAREST_MIPMAP_NEAREST 0x2700 #endif #ifndef GL_NEGATE_BIT_ATI #define GL_NEGATE_BIT_ATI 0x00000004 #endif #ifndef GL_NEGATIVE_ONE_EXT #define GL_NEGATIVE_ONE_EXT 0x87DF #endif #ifndef GL_NEGATIVE_W_EXT #define GL_NEGATIVE_W_EXT 0x87DC #endif #ifndef GL_NEGATIVE_X_EXT #define GL_NEGATIVE_X_EXT 0x87D9 #endif #ifndef GL_NEGATIVE_Y_EXT #define GL_NEGATIVE_Y_EXT 0x87DA #endif #ifndef GL_NEGATIVE_Z_EXT #define GL_NEGATIVE_Z_EXT 0x87DB #endif #ifndef GL_NEVER #define GL_NEVER 0x0200 #endif #ifndef GL_NICEST #define GL_NICEST 0x1102 #endif #ifndef GL_NONE #define GL_NONE 0 #endif #ifndef GL_NOOP #define GL_NOOP 0x1505 #endif #ifndef GL_NOR #define GL_NOR 0x1508 #endif #ifndef GL_NORMALIZE #define GL_NORMALIZE 0x0BA1 #endif #ifndef GL_NORMALIZED_RANGE_EXT #define GL_NORMALIZED_RANGE_EXT 0x87E0 #endif #ifndef GL_NORMAL_ARRAY #define GL_NORMAL_ARRAY 0x8075 #endif #ifndef GL_NORMAL_ARRAY_BUFFER_BINDING #define GL_NORMAL_ARRAY_BUFFER_BINDING 0x8897 #endif #ifndef GL_NORMAL_ARRAY_BUFFER_BINDING_ARB #define GL_NORMAL_ARRAY_BUFFER_BINDING_ARB 0x8897 #endif #ifndef GL_NORMAL_ARRAY_COUNT_EXT #define GL_NORMAL_ARRAY_COUNT_EXT 0x8080 #endif #ifndef GL_NORMAL_ARRAY_EXT #define GL_NORMAL_ARRAY_EXT 0x8075 #endif #ifndef GL_NORMAL_ARRAY_LIST_IBM #define GL_NORMAL_ARRAY_LIST_IBM 103071 #endif #ifndef GL_NORMAL_ARRAY_LIST_STRIDE_IBM #define GL_NORMAL_ARRAY_LIST_STRIDE_IBM 103081 #endif #ifndef GL_NORMAL_ARRAY_PARALLEL_POINTERS_INTEL #define GL_NORMAL_ARRAY_PARALLEL_POINTERS_INTEL 0x83F6 #endif #ifndef GL_NORMAL_ARRAY_POINTER #define GL_NORMAL_ARRAY_POINTER 0x808F #endif #ifndef GL_NORMAL_ARRAY_POINTER_EXT #define GL_NORMAL_ARRAY_POINTER_EXT 0x808F #endif #ifndef GL_NORMAL_ARRAY_STRIDE #define GL_NORMAL_ARRAY_STRIDE 0x807F #endif #ifndef GL_NORMAL_ARRAY_STRIDE_EXT #define GL_NORMAL_ARRAY_STRIDE_EXT 0x807F #endif #ifndef GL_NORMAL_ARRAY_TYPE #define GL_NORMAL_ARRAY_TYPE 0x807E #endif #ifndef GL_NORMAL_ARRAY_TYPE_EXT #define GL_NORMAL_ARRAY_TYPE_EXT 0x807E #endif #ifndef GL_NORMAL_BIT_PGI #define GL_NORMAL_BIT_PGI 0x08000000 #endif #ifndef GL_NORMAL_MAP #define GL_NORMAL_MAP 0x8511 #endif #ifndef GL_NORMAL_MAP_ARB #define GL_NORMAL_MAP_ARB 0x8511 #endif #ifndef GL_NORMAL_MAP_EXT #define GL_NORMAL_MAP_EXT 0x8511 #endif #ifndef GL_NORMAL_MAP_NV #define GL_NORMAL_MAP_NV 0x8511 #endif #ifndef GL_NOTEQUAL #define GL_NOTEQUAL 0x0205 #endif #ifndef GL_NO_ERROR #define GL_NO_ERROR 0 #endif #ifndef GL_NUM_COMPRESSED_TEXTURE_FORMATS #define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2 #endif #ifndef GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB #define GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A2 #endif #ifndef GL_NUM_EXTENSIONS #define GL_NUM_EXTENSIONS 0x821D #endif #ifndef GL_NUM_FILL_STREAMS_NV #define GL_NUM_FILL_STREAMS_NV 0x8E29 #endif #ifndef GL_NUM_FRAGMENT_CONSTANTS_ATI #define GL_NUM_FRAGMENT_CONSTANTS_ATI 0x896F #endif #ifndef GL_NUM_FRAGMENT_REGISTERS_ATI #define GL_NUM_FRAGMENT_REGISTERS_ATI 0x896E #endif #ifndef GL_NUM_GENERAL_COMBINERS_NV #define GL_NUM_GENERAL_COMBINERS_NV 0x854E #endif #ifndef GL_NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI #define GL_NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI 0x8973 #endif #ifndef GL_NUM_INSTRUCTIONS_PER_PASS_ATI #define GL_NUM_INSTRUCTIONS_PER_PASS_ATI 0x8971 #endif #ifndef GL_NUM_INSTRUCTIONS_TOTAL_ATI #define GL_NUM_INSTRUCTIONS_TOTAL_ATI 0x8972 #endif #ifndef GL_NUM_LOOPBACK_COMPONENTS_ATI #define GL_NUM_LOOPBACK_COMPONENTS_ATI 0x8974 #endif #ifndef GL_NUM_PASSES_ATI #define GL_NUM_PASSES_ATI 0x8970 #endif #ifndef GL_OBJECT_ACTIVE_ATTRIBUTES_ARB #define GL_OBJECT_ACTIVE_ATTRIBUTES_ARB 0x8B89 #endif #ifndef GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB #define GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB 0x8B8A #endif #ifndef GL_OBJECT_ACTIVE_UNIFORMS_ARB #define GL_OBJECT_ACTIVE_UNIFORMS_ARB 0x8B86 #endif #ifndef GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB #define GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB 0x8B87 #endif #ifndef GL_OBJECT_ATTACHED_OBJECTS_ARB #define GL_OBJECT_ATTACHED_OBJECTS_ARB 0x8B85 #endif #ifndef GL_OBJECT_BUFFER_SIZE_ATI #define GL_OBJECT_BUFFER_SIZE_ATI 0x8764 #endif #ifndef GL_OBJECT_BUFFER_USAGE_ATI #define GL_OBJECT_BUFFER_USAGE_ATI 0x8765 #endif #ifndef GL_OBJECT_COMPILE_STATUS_ARB #define GL_OBJECT_COMPILE_STATUS_ARB 0x8B81 #endif #ifndef GL_OBJECT_DELETE_STATUS_ARB #define GL_OBJECT_DELETE_STATUS_ARB 0x8B80 #endif #ifndef GL_OBJECT_DISTANCE_TO_LINE_SGIS #define GL_OBJECT_DISTANCE_TO_LINE_SGIS 0x81F3 #endif #ifndef GL_OBJECT_DISTANCE_TO_POINT_SGIS #define GL_OBJECT_DISTANCE_TO_POINT_SGIS 0x81F1 #endif #ifndef GL_OBJECT_INFO_LOG_LENGTH_ARB #define GL_OBJECT_INFO_LOG_LENGTH_ARB 0x8B84 #endif #ifndef GL_OBJECT_LINEAR #define GL_OBJECT_LINEAR 0x2401 #endif #ifndef GL_OBJECT_LINE_SGIS #define GL_OBJECT_LINE_SGIS 0x81F7 #endif #ifndef GL_OBJECT_LINK_STATUS_ARB #define GL_OBJECT_LINK_STATUS_ARB 0x8B82 #endif #ifndef GL_OBJECT_PLANE #define GL_OBJECT_PLANE 0x2501 #endif #ifndef GL_OBJECT_POINT_SGIS #define GL_OBJECT_POINT_SGIS 0x81F5 #endif #ifndef GL_OBJECT_SHADER_SOURCE_LENGTH_ARB #define GL_OBJECT_SHADER_SOURCE_LENGTH_ARB 0x8B88 #endif #ifndef GL_OBJECT_SUBTYPE_ARB #define GL_OBJECT_SUBTYPE_ARB 0x8B4F #endif #ifndef GL_OBJECT_TYPE_ARB #define GL_OBJECT_TYPE_ARB 0x8B4E #endif #ifndef GL_OBJECT_VALIDATE_STATUS_ARB #define GL_OBJECT_VALIDATE_STATUS_ARB 0x8B83 #endif #ifndef GL_OCCLUSION_TEST_HP #define GL_OCCLUSION_TEST_HP 0x8165 #endif #ifndef GL_OCCLUSION_TEST_RESULT_HP #define GL_OCCLUSION_TEST_RESULT_HP 0x8166 #endif #ifndef GL_OFFSET_HILO_PROJECTIVE_TEXTURE_2D_NV #define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_2D_NV 0x8856 #endif #ifndef GL_OFFSET_HILO_PROJECTIVE_TEXTURE_RECTANGLE_NV #define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8857 #endif #ifndef GL_OFFSET_HILO_TEXTURE_2D_NV #define GL_OFFSET_HILO_TEXTURE_2D_NV 0x8854 #endif #ifndef GL_OFFSET_HILO_TEXTURE_RECTANGLE_NV #define GL_OFFSET_HILO_TEXTURE_RECTANGLE_NV 0x8855 #endif #ifndef GL_OFFSET_PROJECTIVE_TEXTURE_2D_NV #define GL_OFFSET_PROJECTIVE_TEXTURE_2D_NV 0x8850 #endif #ifndef GL_OFFSET_PROJECTIVE_TEXTURE_2D_SCALE_NV #define GL_OFFSET_PROJECTIVE_TEXTURE_2D_SCALE_NV 0x8851 #endif #ifndef GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_NV #define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8852 #endif #ifndef GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_SCALE_NV #define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_SCALE_NV 0x8853 #endif #ifndef GL_OFFSET_TEXTURE_2D_BIAS_NV #define GL_OFFSET_TEXTURE_2D_BIAS_NV GL_OFFSET_TEXTURE_BIAS_NV #endif #ifndef GL_OFFSET_TEXTURE_2D_MATRIX_NV #define GL_OFFSET_TEXTURE_2D_MATRIX_NV GL_OFFSET_TEXTURE_MATRIX_NV #endif #ifndef GL_OFFSET_TEXTURE_2D_NV #define GL_OFFSET_TEXTURE_2D_NV 0x86E8 #endif #ifndef GL_OFFSET_TEXTURE_2D_SCALE_NV #define GL_OFFSET_TEXTURE_2D_SCALE_NV GL_OFFSET_TEXTURE_SCALE_NV #endif #ifndef GL_OFFSET_TEXTURE_BIAS_NV #define GL_OFFSET_TEXTURE_BIAS_NV 0x86E3 #endif #ifndef GL_OFFSET_TEXTURE_MATRIX_NV #define GL_OFFSET_TEXTURE_MATRIX_NV 0x86E1 #endif #ifndef GL_OFFSET_TEXTURE_RECTANGLE_NV #define GL_OFFSET_TEXTURE_RECTANGLE_NV 0x864C #endif #ifndef GL_OFFSET_TEXTURE_RECTANGLE_SCALE_NV #define GL_OFFSET_TEXTURE_RECTANGLE_SCALE_NV 0x864D #endif #ifndef GL_OFFSET_TEXTURE_SCALE_NV #define GL_OFFSET_TEXTURE_SCALE_NV 0x86E2 #endif #ifndef GL_ONE #define GL_ONE 1 #endif #ifndef GL_ONE_EXT #define GL_ONE_EXT 0x87DE #endif #ifndef GL_ONE_MINUS_CONSTANT_ALPHA #define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004 #endif #ifndef GL_ONE_MINUS_CONSTANT_ALPHA_EXT #define GL_ONE_MINUS_CONSTANT_ALPHA_EXT 0x8004 #endif #ifndef GL_ONE_MINUS_CONSTANT_COLOR #define GL_ONE_MINUS_CONSTANT_COLOR 0x8002 #endif #ifndef GL_ONE_MINUS_CONSTANT_COLOR_EXT #define GL_ONE_MINUS_CONSTANT_COLOR_EXT 0x8002 #endif #ifndef GL_ONE_MINUS_DST_ALPHA #define GL_ONE_MINUS_DST_ALPHA 0x0305 #endif #ifndef GL_ONE_MINUS_DST_COLOR #define GL_ONE_MINUS_DST_COLOR 0x0307 #endif #ifndef GL_ONE_MINUS_SRC_ALPHA #define GL_ONE_MINUS_SRC_ALPHA 0x0303 #endif #ifndef GL_ONE_MINUS_SRC_COLOR #define GL_ONE_MINUS_SRC_COLOR 0x0301 #endif #ifndef GL_OPERAND0_ALPHA #define GL_OPERAND0_ALPHA 0x8598 #endif #ifndef GL_OPERAND0_ALPHA_ARB #define GL_OPERAND0_ALPHA_ARB 0x8598 #endif #ifndef GL_OPERAND0_ALPHA_EXT #define GL_OPERAND0_ALPHA_EXT 0x8598 #endif #ifndef GL_OPERAND0_RGB #define GL_OPERAND0_RGB 0x8590 #endif #ifndef GL_OPERAND0_RGB_ARB #define GL_OPERAND0_RGB_ARB 0x8590 #endif #ifndef GL_OPERAND0_RGB_EXT #define GL_OPERAND0_RGB_EXT 0x8590 #endif #ifndef GL_OPERAND1_ALPHA #define GL_OPERAND1_ALPHA 0x8599 #endif #ifndef GL_OPERAND1_ALPHA_ARB #define GL_OPERAND1_ALPHA_ARB 0x8599 #endif #ifndef GL_OPERAND1_ALPHA_EXT #define GL_OPERAND1_ALPHA_EXT 0x8599 #endif #ifndef GL_OPERAND1_RGB #define GL_OPERAND1_RGB 0x8591 #endif #ifndef GL_OPERAND1_RGB_ARB #define GL_OPERAND1_RGB_ARB 0x8591 #endif #ifndef GL_OPERAND1_RGB_EXT #define GL_OPERAND1_RGB_EXT 0x8591 #endif #ifndef GL_OPERAND2_ALPHA #define GL_OPERAND2_ALPHA 0x859A #endif #ifndef GL_OPERAND2_ALPHA_ARB #define GL_OPERAND2_ALPHA_ARB 0x859A #endif #ifndef GL_OPERAND2_ALPHA_EXT #define GL_OPERAND2_ALPHA_EXT 0x859A #endif #ifndef GL_OPERAND2_RGB #define GL_OPERAND2_RGB 0x8592 #endif #ifndef GL_OPERAND2_RGB_ARB #define GL_OPERAND2_RGB_ARB 0x8592 #endif #ifndef GL_OPERAND2_RGB_EXT #define GL_OPERAND2_RGB_EXT 0x8592 #endif #ifndef GL_OPERAND3_ALPHA_NV #define GL_OPERAND3_ALPHA_NV 0x859B #endif #ifndef GL_OPERAND3_RGB_NV #define GL_OPERAND3_RGB_NV 0x8593 #endif #ifndef GL_OP_ADD_EXT #define GL_OP_ADD_EXT 0x8787 #endif #ifndef GL_OP_CLAMP_EXT #define GL_OP_CLAMP_EXT 0x878E #endif #ifndef GL_OP_CROSS_PRODUCT_EXT #define GL_OP_CROSS_PRODUCT_EXT 0x8797 #endif #ifndef GL_OP_DOT3_EXT #define GL_OP_DOT3_EXT 0x8784 #endif #ifndef GL_OP_DOT4_EXT #define GL_OP_DOT4_EXT 0x8785 #endif #ifndef GL_OP_EXP_BASE_2_EXT #define GL_OP_EXP_BASE_2_EXT 0x8791 #endif #ifndef GL_OP_FLOOR_EXT #define GL_OP_FLOOR_EXT 0x878F #endif #ifndef GL_OP_FRAC_EXT #define GL_OP_FRAC_EXT 0x8789 #endif #ifndef GL_OP_INDEX_EXT #define GL_OP_INDEX_EXT 0x8782 #endif #ifndef GL_OP_LOG_BASE_2_EXT #define GL_OP_LOG_BASE_2_EXT 0x8792 #endif #ifndef GL_OP_MADD_EXT #define GL_OP_MADD_EXT 0x8788 #endif #ifndef GL_OP_MAX_EXT #define GL_OP_MAX_EXT 0x878A #endif #ifndef GL_OP_MIN_EXT #define GL_OP_MIN_EXT 0x878B #endif #ifndef GL_OP_MOV_EXT #define GL_OP_MOV_EXT 0x8799 #endif #ifndef GL_OP_MULTIPLY_MATRIX_EXT #define GL_OP_MULTIPLY_MATRIX_EXT 0x8798 #endif #ifndef GL_OP_MUL_EXT #define GL_OP_MUL_EXT 0x8786 #endif #ifndef GL_OP_NEGATE_EXT #define GL_OP_NEGATE_EXT 0x8783 #endif #ifndef GL_OP_POWER_EXT #define GL_OP_POWER_EXT 0x8793 #endif #ifndef GL_OP_RECIP_EXT #define GL_OP_RECIP_EXT 0x8794 #endif #ifndef GL_OP_RECIP_SQRT_EXT #define GL_OP_RECIP_SQRT_EXT 0x8795 #endif #ifndef GL_OP_ROUND_EXT #define GL_OP_ROUND_EXT 0x8790 #endif #ifndef GL_OP_SET_GE_EXT #define GL_OP_SET_GE_EXT 0x878C #endif #ifndef GL_OP_SET_LT_EXT #define GL_OP_SET_LT_EXT 0x878D #endif #ifndef GL_OP_SUB_EXT #define GL_OP_SUB_EXT 0x8796 #endif #ifndef GL_OR #define GL_OR 0x1507 #endif #ifndef GL_ORDER #define GL_ORDER 0x0A01 #endif #ifndef GL_OR_INVERTED #define GL_OR_INVERTED 0x150D #endif #ifndef GL_OR_REVERSE #define GL_OR_REVERSE 0x150B #endif #ifndef GL_OUTPUT_COLOR0_EXT #define GL_OUTPUT_COLOR0_EXT 0x879B #endif #ifndef GL_OUTPUT_COLOR1_EXT #define GL_OUTPUT_COLOR1_EXT 0x879C #endif #ifndef GL_OUTPUT_FOG_EXT #define GL_OUTPUT_FOG_EXT 0x87BD #endif #ifndef GL_OUTPUT_TEXTURE_COORD0_EXT #define GL_OUTPUT_TEXTURE_COORD0_EXT 0x879D #endif #ifndef GL_OUTPUT_TEXTURE_COORD10_EXT #define GL_OUTPUT_TEXTURE_COORD10_EXT 0x87A7 #endif #ifndef GL_OUTPUT_TEXTURE_COORD11_EXT #define GL_OUTPUT_TEXTURE_COORD11_EXT 0x87A8 #endif #ifndef GL_OUTPUT_TEXTURE_COORD12_EXT #define GL_OUTPUT_TEXTURE_COORD12_EXT 0x87A9 #endif #ifndef GL_OUTPUT_TEXTURE_COORD13_EXT #define GL_OUTPUT_TEXTURE_COORD13_EXT 0x87AA #endif #ifndef GL_OUTPUT_TEXTURE_COORD14_EXT #define GL_OUTPUT_TEXTURE_COORD14_EXT 0x87AB #endif #ifndef GL_OUTPUT_TEXTURE_COORD15_EXT #define GL_OUTPUT_TEXTURE_COORD15_EXT 0x87AC #endif #ifndef GL_OUTPUT_TEXTURE_COORD16_EXT #define GL_OUTPUT_TEXTURE_COORD16_EXT 0x87AD #endif #ifndef GL_OUTPUT_TEXTURE_COORD17_EXT #define GL_OUTPUT_TEXTURE_COORD17_EXT 0x87AE #endif #ifndef GL_OUTPUT_TEXTURE_COORD18_EXT #define GL_OUTPUT_TEXTURE_COORD18_EXT 0x87AF #endif #ifndef GL_OUTPUT_TEXTURE_COORD19_EXT #define GL_OUTPUT_TEXTURE_COORD19_EXT 0x87B0 #endif #ifndef GL_OUTPUT_TEXTURE_COORD1_EXT #define GL_OUTPUT_TEXTURE_COORD1_EXT 0x879E #endif #ifndef GL_OUTPUT_TEXTURE_COORD20_EXT #define GL_OUTPUT_TEXTURE_COORD20_EXT 0x87B1 #endif #ifndef GL_OUTPUT_TEXTURE_COORD21_EXT #define GL_OUTPUT_TEXTURE_COORD21_EXT 0x87B2 #endif #ifndef GL_OUTPUT_TEXTURE_COORD22_EXT #define GL_OUTPUT_TEXTURE_COORD22_EXT 0x87B3 #endif #ifndef GL_OUTPUT_TEXTURE_COORD23_EXT #define GL_OUTPUT_TEXTURE_COORD23_EXT 0x87B4 #endif #ifndef GL_OUTPUT_TEXTURE_COORD24_EXT #define GL_OUTPUT_TEXTURE_COORD24_EXT 0x87B5 #endif #ifndef GL_OUTPUT_TEXTURE_COORD25_EXT #define GL_OUTPUT_TEXTURE_COORD25_EXT 0x87B6 #endif #ifndef GL_OUTPUT_TEXTURE_COORD26_EXT #define GL_OUTPUT_TEXTURE_COORD26_EXT 0x87B7 #endif #ifndef GL_OUTPUT_TEXTURE_COORD27_EXT #define GL_OUTPUT_TEXTURE_COORD27_EXT 0x87B8 #endif #ifndef GL_OUTPUT_TEXTURE_COORD28_EXT #define GL_OUTPUT_TEXTURE_COORD28_EXT 0x87B9 #endif #ifndef GL_OUTPUT_TEXTURE_COORD29_EXT #define GL_OUTPUT_TEXTURE_COORD29_EXT 0x87BA #endif #ifndef GL_OUTPUT_TEXTURE_COORD2_EXT #define GL_OUTPUT_TEXTURE_COORD2_EXT 0x879F #endif #ifndef GL_OUTPUT_TEXTURE_COORD30_EXT #define GL_OUTPUT_TEXTURE_COORD30_EXT 0x87BB #endif #ifndef GL_OUTPUT_TEXTURE_COORD31_EXT #define GL_OUTPUT_TEXTURE_COORD31_EXT 0x87BC #endif #ifndef GL_OUTPUT_TEXTURE_COORD3_EXT #define GL_OUTPUT_TEXTURE_COORD3_EXT 0x87A0 #endif #ifndef GL_OUTPUT_TEXTURE_COORD4_EXT #define GL_OUTPUT_TEXTURE_COORD4_EXT 0x87A1 #endif #ifndef GL_OUTPUT_TEXTURE_COORD5_EXT #define GL_OUTPUT_TEXTURE_COORD5_EXT 0x87A2 #endif #ifndef GL_OUTPUT_TEXTURE_COORD6_EXT #define GL_OUTPUT_TEXTURE_COORD6_EXT 0x87A3 #endif #ifndef GL_OUTPUT_TEXTURE_COORD7_EXT #define GL_OUTPUT_TEXTURE_COORD7_EXT 0x87A4 #endif #ifndef GL_OUTPUT_TEXTURE_COORD8_EXT #define GL_OUTPUT_TEXTURE_COORD8_EXT 0x87A5 #endif #ifndef GL_OUTPUT_TEXTURE_COORD9_EXT #define GL_OUTPUT_TEXTURE_COORD9_EXT 0x87A6 #endif #ifndef GL_OUTPUT_VERTEX_EXT #define GL_OUTPUT_VERTEX_EXT 0x879A #endif #ifndef GL_OUT_OF_MEMORY #define GL_OUT_OF_MEMORY 0x0505 #endif #ifndef GL_PACK_ALIGNMENT #define GL_PACK_ALIGNMENT 0x0D05 #endif #ifndef GL_PACK_CMYK_HINT_EXT #define GL_PACK_CMYK_HINT_EXT 0x800E #endif #ifndef GL_PACK_IMAGE_DEPTH_SGIS #define GL_PACK_IMAGE_DEPTH_SGIS 0x8131 #endif #ifndef GL_PACK_IMAGE_HEIGHT #define GL_PACK_IMAGE_HEIGHT 0x806C #endif #ifndef GL_PACK_IMAGE_HEIGHT_EXT #define GL_PACK_IMAGE_HEIGHT_EXT 0x806C #endif #ifndef GL_PACK_INVERT_MESA #define GL_PACK_INVERT_MESA 0x8758 #endif #ifndef GL_PACK_LSB_FIRST #define GL_PACK_LSB_FIRST 0x0D01 #endif #ifndef GL_PACK_RESAMPLE_OML #define GL_PACK_RESAMPLE_OML 0x8984 #endif #ifndef GL_PACK_RESAMPLE_SGIX #define GL_PACK_RESAMPLE_SGIX 0x842C #endif #ifndef GL_PACK_ROW_LENGTH #define GL_PACK_ROW_LENGTH 0x0D02 #endif #ifndef GL_PACK_SKIP_IMAGES #define GL_PACK_SKIP_IMAGES 0x806B #endif #ifndef GL_PACK_SKIP_IMAGES_EXT #define GL_PACK_SKIP_IMAGES_EXT 0x806B #endif #ifndef GL_PACK_SKIP_PIXELS #define GL_PACK_SKIP_PIXELS 0x0D04 #endif #ifndef GL_PACK_SKIP_ROWS #define GL_PACK_SKIP_ROWS 0x0D03 #endif #ifndef GL_PACK_SKIP_VOLUMES_SGIS #define GL_PACK_SKIP_VOLUMES_SGIS 0x8130 #endif #ifndef GL_PACK_SUBSAMPLE_RATE_SGIX #define GL_PACK_SUBSAMPLE_RATE_SGIX 0x85A0 #endif #ifndef GL_PACK_SWAP_BYTES #define GL_PACK_SWAP_BYTES 0x0D00 #endif #ifndef GL_PARALLEL_ARRAYS_INTEL #define GL_PARALLEL_ARRAYS_INTEL 0x83F4 #endif #ifndef GL_PASS_THROUGH_NV #define GL_PASS_THROUGH_NV 0x86E6 #endif #ifndef GL_PASS_THROUGH_TOKEN #define GL_PASS_THROUGH_TOKEN 0x0700 #endif #ifndef GL_PERSPECTIVE_CORRECTION_HINT #define GL_PERSPECTIVE_CORRECTION_HINT 0x0C50 #endif #ifndef GL_PERTURB_EXT #define GL_PERTURB_EXT 0x85AE #endif #ifndef GL_PER_STAGE_CONSTANTS_NV #define GL_PER_STAGE_CONSTANTS_NV 0x8535 #endif #ifndef GL_PHONG_HINT_WIN #define GL_PHONG_HINT_WIN 0x80EB #endif #ifndef GL_PHONG_WIN #define GL_PHONG_WIN 0x80EA #endif #ifndef GL_PIXEL_COUNTER_BITS_NV #define GL_PIXEL_COUNTER_BITS_NV 0x8864 #endif #ifndef GL_PIXEL_COUNT_AVAILABLE_NV #define GL_PIXEL_COUNT_AVAILABLE_NV 0x8867 #endif #ifndef GL_PIXEL_COUNT_NV #define GL_PIXEL_COUNT_NV 0x8866 #endif #ifndef GL_PIXEL_CUBIC_WEIGHT_EXT #define GL_PIXEL_CUBIC_WEIGHT_EXT 0x8333 #endif #ifndef GL_PIXEL_FRAGMENT_ALPHA_SOURCE_SGIS #define GL_PIXEL_FRAGMENT_ALPHA_SOURCE_SGIS 0x8355 #endif #ifndef GL_PIXEL_FRAGMENT_RGB_SOURCE_SGIS #define GL_PIXEL_FRAGMENT_RGB_SOURCE_SGIS 0x8354 #endif #ifndef GL_PIXEL_GROUP_COLOR_SGIS #define GL_PIXEL_GROUP_COLOR_SGIS 0x8356 #endif #ifndef GL_PIXEL_MAG_FILTER_EXT #define GL_PIXEL_MAG_FILTER_EXT 0x8331 #endif #ifndef GL_PIXEL_MAP_A_TO_A #define GL_PIXEL_MAP_A_TO_A 0x0C79 #endif #ifndef GL_PIXEL_MAP_A_TO_A_SIZE #define GL_PIXEL_MAP_A_TO_A_SIZE 0x0CB9 #endif #ifndef GL_PIXEL_MAP_B_TO_B #define GL_PIXEL_MAP_B_TO_B 0x0C78 #endif #ifndef GL_PIXEL_MAP_B_TO_B_SIZE #define GL_PIXEL_MAP_B_TO_B_SIZE 0x0CB8 #endif #ifndef GL_PIXEL_MAP_G_TO_G #define GL_PIXEL_MAP_G_TO_G 0x0C77 #endif #ifndef GL_PIXEL_MAP_G_TO_G_SIZE #define GL_PIXEL_MAP_G_TO_G_SIZE 0x0CB7 #endif #ifndef GL_PIXEL_MAP_I_TO_A #define GL_PIXEL_MAP_I_TO_A 0x0C75 #endif #ifndef GL_PIXEL_MAP_I_TO_A_SIZE #define GL_PIXEL_MAP_I_TO_A_SIZE 0x0CB5 #endif #ifndef GL_PIXEL_MAP_I_TO_B #define GL_PIXEL_MAP_I_TO_B 0x0C74 #endif #ifndef GL_PIXEL_MAP_I_TO_B_SIZE #define GL_PIXEL_MAP_I_TO_B_SIZE 0x0CB4 #endif #ifndef GL_PIXEL_MAP_I_TO_G #define GL_PIXEL_MAP_I_TO_G 0x0C73 #endif #ifndef GL_PIXEL_MAP_I_TO_G_SIZE #define GL_PIXEL_MAP_I_TO_G_SIZE 0x0CB3 #endif #ifndef GL_PIXEL_MAP_I_TO_I #define GL_PIXEL_MAP_I_TO_I 0x0C70 #endif #ifndef GL_PIXEL_MAP_I_TO_I_SIZE #define GL_PIXEL_MAP_I_TO_I_SIZE 0x0CB0 #endif #ifndef GL_PIXEL_MAP_I_TO_R #define GL_PIXEL_MAP_I_TO_R 0x0C72 #endif #ifndef GL_PIXEL_MAP_I_TO_R_SIZE #define GL_PIXEL_MAP_I_TO_R_SIZE 0x0CB2 #endif #ifndef GL_PIXEL_MAP_R_TO_R #define GL_PIXEL_MAP_R_TO_R 0x0C76 #endif #ifndef GL_PIXEL_MAP_R_TO_R_SIZE #define GL_PIXEL_MAP_R_TO_R_SIZE 0x0CB6 #endif #ifndef GL_PIXEL_MAP_S_TO_S #define GL_PIXEL_MAP_S_TO_S 0x0C71 #endif #ifndef GL_PIXEL_MAP_S_TO_S_SIZE #define GL_PIXEL_MAP_S_TO_S_SIZE 0x0CB1 #endif #ifndef GL_PIXEL_MIN_FILTER_EXT #define GL_PIXEL_MIN_FILTER_EXT 0x8332 #endif #ifndef GL_PIXEL_MODE_BIT #define GL_PIXEL_MODE_BIT 0x00000020 #endif #ifndef GL_PIXEL_PACK_BUFFER #define GL_PIXEL_PACK_BUFFER 0x88EB #endif #ifndef GL_PIXEL_PACK_BUFFER_ARB #define GL_PIXEL_PACK_BUFFER_ARB 0x88EB #endif #ifndef GL_PIXEL_PACK_BUFFER_BINDING #define GL_PIXEL_PACK_BUFFER_BINDING 0x88ED #endif #ifndef GL_PIXEL_PACK_BUFFER_BINDING_ARB #define GL_PIXEL_PACK_BUFFER_BINDING_ARB 0x88ED #endif #ifndef GL_PIXEL_PACK_BUFFER_BINDING_EXT #define GL_PIXEL_PACK_BUFFER_BINDING_EXT 0x88ED #endif #ifndef GL_PIXEL_PACK_BUFFER_EXT #define GL_PIXEL_PACK_BUFFER_EXT 0x88EB #endif #ifndef GL_PIXEL_SUBSAMPLE_2424_SGIX #define GL_PIXEL_SUBSAMPLE_2424_SGIX 0x85A3 #endif #ifndef GL_PIXEL_SUBSAMPLE_4242_SGIX #define GL_PIXEL_SUBSAMPLE_4242_SGIX 0x85A4 #endif #ifndef GL_PIXEL_SUBSAMPLE_4444_SGIX #define GL_PIXEL_SUBSAMPLE_4444_SGIX 0x85A2 #endif #ifndef GL_PIXEL_TEXTURE_SGIS #define GL_PIXEL_TEXTURE_SGIS 0x8353 #endif #ifndef GL_PIXEL_TEX_GEN_ALPHA_LS_SGIX #define GL_PIXEL_TEX_GEN_ALPHA_LS_SGIX 0x8189 #endif #ifndef GL_PIXEL_TEX_GEN_ALPHA_MS_SGIX #define GL_PIXEL_TEX_GEN_ALPHA_MS_SGIX 0x818A #endif #ifndef GL_PIXEL_TEX_GEN_ALPHA_NO_REPLACE_SGIX #define GL_PIXEL_TEX_GEN_ALPHA_NO_REPLACE_SGIX 0x8188 #endif #ifndef GL_PIXEL_TEX_GEN_ALPHA_REPLACE_SGIX #define GL_PIXEL_TEX_GEN_ALPHA_REPLACE_SGIX 0x8187 #endif #ifndef GL_PIXEL_TEX_GEN_MODE_SGIX #define GL_PIXEL_TEX_GEN_MODE_SGIX 0x832B #endif #ifndef GL_PIXEL_TEX_GEN_Q_CEILING_SGIX #define GL_PIXEL_TEX_GEN_Q_CEILING_SGIX 0x8184 #endif #ifndef GL_PIXEL_TEX_GEN_Q_FLOOR_SGIX #define GL_PIXEL_TEX_GEN_Q_FLOOR_SGIX 0x8186 #endif #ifndef GL_PIXEL_TEX_GEN_Q_ROUND_SGIX #define GL_PIXEL_TEX_GEN_Q_ROUND_SGIX 0x8185 #endif #ifndef GL_PIXEL_TEX_GEN_SGIX #define GL_PIXEL_TEX_GEN_SGIX 0x8139 #endif #ifndef GL_PIXEL_TILE_BEST_ALIGNMENT_SGIX #define GL_PIXEL_TILE_BEST_ALIGNMENT_SGIX 0x813E #endif #ifndef GL_PIXEL_TILE_CACHE_INCREMENT_SGIX #define GL_PIXEL_TILE_CACHE_INCREMENT_SGIX 0x813F #endif #ifndef GL_PIXEL_TILE_CACHE_SIZE_SGIX #define GL_PIXEL_TILE_CACHE_SIZE_SGIX 0x8145 #endif #ifndef GL_PIXEL_TILE_GRID_DEPTH_SGIX #define GL_PIXEL_TILE_GRID_DEPTH_SGIX 0x8144 #endif #ifndef GL_PIXEL_TILE_GRID_HEIGHT_SGIX #define GL_PIXEL_TILE_GRID_HEIGHT_SGIX 0x8143 #endif #ifndef GL_PIXEL_TILE_GRID_WIDTH_SGIX #define GL_PIXEL_TILE_GRID_WIDTH_SGIX 0x8142 #endif #ifndef GL_PIXEL_TILE_HEIGHT_SGIX #define GL_PIXEL_TILE_HEIGHT_SGIX 0x8141 #endif #ifndef GL_PIXEL_TILE_WIDTH_SGIX #define GL_PIXEL_TILE_WIDTH_SGIX 0x8140 #endif #ifndef GL_PIXEL_TRANSFORM_2D_EXT #define GL_PIXEL_TRANSFORM_2D_EXT 0x8330 #endif #ifndef GL_PIXEL_TRANSFORM_2D_MATRIX_EXT #define GL_PIXEL_TRANSFORM_2D_MATRIX_EXT 0x8338 #endif #ifndef GL_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT #define GL_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8336 #endif #ifndef GL_PIXEL_UNPACK_BUFFER #define GL_PIXEL_UNPACK_BUFFER 0x88EC #endif #ifndef GL_PIXEL_UNPACK_BUFFER_ARB #define GL_PIXEL_UNPACK_BUFFER_ARB 0x88EC #endif #ifndef GL_PIXEL_UNPACK_BUFFER_BINDING #define GL_PIXEL_UNPACK_BUFFER_BINDING 0x88EF #endif #ifndef GL_PIXEL_UNPACK_BUFFER_BINDING_ARB #define GL_PIXEL_UNPACK_BUFFER_BINDING_ARB 0x88EF #endif #ifndef GL_PIXEL_UNPACK_BUFFER_BINDING_EXT #define GL_PIXEL_UNPACK_BUFFER_BINDING_EXT 0x88EF #endif #ifndef GL_PIXEL_UNPACK_BUFFER_EXT #define GL_PIXEL_UNPACK_BUFFER_EXT 0x88EC #endif #ifndef GL_PN_TRIANGLES_ATI #define GL_PN_TRIANGLES_ATI 0x87F0 #endif #ifndef GL_PN_TRIANGLES_NORMAL_MODE_ATI #define GL_PN_TRIANGLES_NORMAL_MODE_ATI 0x87F3 #endif #ifndef GL_PN_TRIANGLES_NORMAL_MODE_LINEAR_ATI #define GL_PN_TRIANGLES_NORMAL_MODE_LINEAR_ATI 0x87F7 #endif #ifndef GL_PN_TRIANGLES_NORMAL_MODE_QUADRATIC_ATI #define GL_PN_TRIANGLES_NORMAL_MODE_QUADRATIC_ATI 0x87F8 #endif #ifndef GL_PN_TRIANGLES_POINT_MODE_ATI #define GL_PN_TRIANGLES_POINT_MODE_ATI 0x87F2 #endif #ifndef GL_PN_TRIANGLES_POINT_MODE_CUBIC_ATI #define GL_PN_TRIANGLES_POINT_MODE_CUBIC_ATI 0x87F6 #endif #ifndef GL_PN_TRIANGLES_POINT_MODE_LINEAR_ATI #define GL_PN_TRIANGLES_POINT_MODE_LINEAR_ATI 0x87F5 #endif #ifndef GL_PN_TRIANGLES_TESSELATION_LEVEL_ATI #define GL_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F4 #endif #ifndef GL_POINT #define GL_POINT 0x1B00 #endif #ifndef GL_POINTS #define GL_POINTS 0x0000 #endif #ifndef GL_POINT_BIT #define GL_POINT_BIT 0x00000002 #endif #ifndef GL_POINT_DISTANCE_ATTENUATION #define GL_POINT_DISTANCE_ATTENUATION 0x8129 #endif #ifndef GL_POINT_DISTANCE_ATTENUATION_ARB #define GL_POINT_DISTANCE_ATTENUATION_ARB 0x8129 #endif #ifndef GL_POINT_FADE_THRESHOLD_SIZE #define GL_POINT_FADE_THRESHOLD_SIZE 0x8128 #endif #ifndef GL_POINT_FADE_THRESHOLD_SIZE_ARB #define GL_POINT_FADE_THRESHOLD_SIZE_ARB 0x8128 #endif #ifndef GL_POINT_FADE_THRESHOLD_SIZE_EXT #define GL_POINT_FADE_THRESHOLD_SIZE_EXT 0x8128 #endif #ifndef GL_POINT_FADE_THRESHOLD_SIZE_SGIS #define GL_POINT_FADE_THRESHOLD_SIZE_SGIS 0x8128 #endif #ifndef GL_POINT_SIZE #define GL_POINT_SIZE 0x0B11 #endif #ifndef GL_POINT_SIZE_GRANULARITY #define GL_POINT_SIZE_GRANULARITY 0x0B13 #endif #ifndef GL_POINT_SIZE_MAX #define GL_POINT_SIZE_MAX 0x8127 #endif #ifndef GL_POINT_SIZE_MAX_ARB #define GL_POINT_SIZE_MAX_ARB 0x8127 #endif #ifndef GL_POINT_SIZE_MAX_EXT #define GL_POINT_SIZE_MAX_EXT 0x8127 #endif #ifndef GL_POINT_SIZE_MAX_SGIS #define GL_POINT_SIZE_MAX_SGIS 0x8127 #endif #ifndef GL_POINT_SIZE_MIN #define GL_POINT_SIZE_MIN 0x8126 #endif #ifndef GL_POINT_SIZE_MIN_ARB #define GL_POINT_SIZE_MIN_ARB 0x8126 #endif #ifndef GL_POINT_SIZE_MIN_EXT #define GL_POINT_SIZE_MIN_EXT 0x8126 #endif #ifndef GL_POINT_SIZE_MIN_SGIS #define GL_POINT_SIZE_MIN_SGIS 0x8126 #endif #ifndef GL_POINT_SIZE_RANGE #define GL_POINT_SIZE_RANGE 0x0B12 #endif #ifndef GL_POINT_SMOOTH #define GL_POINT_SMOOTH 0x0B10 #endif #ifndef GL_POINT_SMOOTH_HINT #define GL_POINT_SMOOTH_HINT 0x0C51 #endif #ifndef GL_POINT_SPRITE #define GL_POINT_SPRITE 0x8861 #endif #ifndef GL_POINT_SPRITE_ARB #define GL_POINT_SPRITE_ARB 0x8861 #endif #ifndef GL_POINT_SPRITE_COORD_ORIGIN #define GL_POINT_SPRITE_COORD_ORIGIN 0x8CA0 #endif #ifndef GL_POINT_SPRITE_NV #define GL_POINT_SPRITE_NV 0x8861 #endif #ifndef GL_POINT_SPRITE_R_MODE_NV #define GL_POINT_SPRITE_R_MODE_NV 0x8863 #endif #ifndef GL_POINT_TOKEN #define GL_POINT_TOKEN 0x0701 #endif #ifndef GL_POLYGON #define GL_POLYGON 0x0009 #endif #ifndef GL_POLYGON_BIT #define GL_POLYGON_BIT 0x00000008 #endif #ifndef GL_POLYGON_MODE #define GL_POLYGON_MODE 0x0B40 #endif #ifndef GL_POLYGON_OFFSET_BIAS_EXT #define GL_POLYGON_OFFSET_BIAS_EXT 0x8039 #endif #ifndef GL_POLYGON_OFFSET_EXT #define GL_POLYGON_OFFSET_EXT 0x8037 #endif #ifndef GL_POLYGON_OFFSET_FACTOR #define GL_POLYGON_OFFSET_FACTOR 0x8038 #endif #ifndef GL_POLYGON_OFFSET_FACTOR_EXT #define GL_POLYGON_OFFSET_FACTOR_EXT 0x8038 #endif #ifndef GL_POLYGON_OFFSET_FILL #define GL_POLYGON_OFFSET_FILL 0x8037 #endif #ifndef GL_POLYGON_OFFSET_LINE #define GL_POLYGON_OFFSET_LINE 0x2A02 #endif #ifndef GL_POLYGON_OFFSET_POINT #define GL_POLYGON_OFFSET_POINT 0x2A01 #endif #ifndef GL_POLYGON_OFFSET_UNITS #define GL_POLYGON_OFFSET_UNITS 0x2A00 #endif #ifndef GL_POLYGON_SMOOTH #define GL_POLYGON_SMOOTH 0x0B41 #endif #ifndef GL_POLYGON_SMOOTH_HINT #define GL_POLYGON_SMOOTH_HINT 0x0C53 #endif #ifndef GL_POLYGON_STIPPLE #define GL_POLYGON_STIPPLE 0x0B42 #endif #ifndef GL_POLYGON_STIPPLE_BIT #define GL_POLYGON_STIPPLE_BIT 0x00000010 #endif #ifndef GL_POLYGON_TOKEN #define GL_POLYGON_TOKEN 0x0703 #endif #ifndef GL_POSITION #define GL_POSITION 0x1203 #endif #ifndef GL_POST_COLOR_MATRIX_ALPHA_BIAS #define GL_POST_COLOR_MATRIX_ALPHA_BIAS 0x80BB #endif #ifndef GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI #define GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI 0x80BB #endif #ifndef GL_POST_COLOR_MATRIX_ALPHA_SCALE #define GL_POST_COLOR_MATRIX_ALPHA_SCALE 0x80B7 #endif #ifndef GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI #define GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI 0x80B7 #endif #ifndef GL_POST_COLOR_MATRIX_BLUE_BIAS #define GL_POST_COLOR_MATRIX_BLUE_BIAS 0x80BA #endif #ifndef GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI #define GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI 0x80BA #endif #ifndef GL_POST_COLOR_MATRIX_BLUE_SCALE #define GL_POST_COLOR_MATRIX_BLUE_SCALE 0x80B6 #endif #ifndef GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI #define GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI 0x80B6 #endif #ifndef GL_POST_COLOR_MATRIX_COLOR_TABLE #define GL_POST_COLOR_MATRIX_COLOR_TABLE 0x80D2 #endif #ifndef GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI #define GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D2 #endif #ifndef GL_POST_COLOR_MATRIX_GREEN_BIAS #define GL_POST_COLOR_MATRIX_GREEN_BIAS 0x80B9 #endif #ifndef GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI #define GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI 0x80B9 #endif #ifndef GL_POST_COLOR_MATRIX_GREEN_SCALE #define GL_POST_COLOR_MATRIX_GREEN_SCALE 0x80B5 #endif #ifndef GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI #define GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI 0x80B5 #endif #ifndef GL_POST_COLOR_MATRIX_RED_BIAS #define GL_POST_COLOR_MATRIX_RED_BIAS 0x80B8 #endif #ifndef GL_POST_COLOR_MATRIX_RED_BIAS_SGI #define GL_POST_COLOR_MATRIX_RED_BIAS_SGI 0x80B8 #endif #ifndef GL_POST_COLOR_MATRIX_RED_SCALE #define GL_POST_COLOR_MATRIX_RED_SCALE 0x80B4 #endif #ifndef GL_POST_COLOR_MATRIX_RED_SCALE_SGI #define GL_POST_COLOR_MATRIX_RED_SCALE_SGI 0x80B4 #endif #ifndef GL_POST_CONVOLUTION_ALPHA_BIAS #define GL_POST_CONVOLUTION_ALPHA_BIAS 0x8023 #endif #ifndef GL_POST_CONVOLUTION_ALPHA_BIAS_EXT #define GL_POST_CONVOLUTION_ALPHA_BIAS_EXT 0x8023 #endif #ifndef GL_POST_CONVOLUTION_ALPHA_SCALE #define GL_POST_CONVOLUTION_ALPHA_SCALE 0x801F #endif #ifndef GL_POST_CONVOLUTION_ALPHA_SCALE_EXT #define GL_POST_CONVOLUTION_ALPHA_SCALE_EXT 0x801F #endif #ifndef GL_POST_CONVOLUTION_BLUE_BIAS #define GL_POST_CONVOLUTION_BLUE_BIAS 0x8022 #endif #ifndef GL_POST_CONVOLUTION_BLUE_BIAS_EXT #define GL_POST_CONVOLUTION_BLUE_BIAS_EXT 0x8022 #endif #ifndef GL_POST_CONVOLUTION_BLUE_SCALE #define GL_POST_CONVOLUTION_BLUE_SCALE 0x801E #endif #ifndef GL_POST_CONVOLUTION_BLUE_SCALE_EXT #define GL_POST_CONVOLUTION_BLUE_SCALE_EXT 0x801E #endif #ifndef GL_POST_CONVOLUTION_COLOR_TABLE #define GL_POST_CONVOLUTION_COLOR_TABLE 0x80D1 #endif #ifndef GL_POST_CONVOLUTION_COLOR_TABLE_SGI #define GL_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D1 #endif #ifndef GL_POST_CONVOLUTION_GREEN_BIAS #define GL_POST_CONVOLUTION_GREEN_BIAS 0x8021 #endif #ifndef GL_POST_CONVOLUTION_GREEN_BIAS_EXT #define GL_POST_CONVOLUTION_GREEN_BIAS_EXT 0x8021 #endif #ifndef GL_POST_CONVOLUTION_GREEN_SCALE #define GL_POST_CONVOLUTION_GREEN_SCALE 0x801D #endif #ifndef GL_POST_CONVOLUTION_GREEN_SCALE_EXT #define GL_POST_CONVOLUTION_GREEN_SCALE_EXT 0x801D #endif #ifndef GL_POST_CONVOLUTION_RED_BIAS #define GL_POST_CONVOLUTION_RED_BIAS 0x8020 #endif #ifndef GL_POST_CONVOLUTION_RED_BIAS_EXT #define GL_POST_CONVOLUTION_RED_BIAS_EXT 0x8020 #endif #ifndef GL_POST_CONVOLUTION_RED_SCALE #define GL_POST_CONVOLUTION_RED_SCALE 0x801C #endif #ifndef GL_POST_CONVOLUTION_RED_SCALE_EXT #define GL_POST_CONVOLUTION_RED_SCALE_EXT 0x801C #endif #ifndef GL_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP #define GL_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP 0x8162 #endif #ifndef GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX #define GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX 0x817B #endif #ifndef GL_POST_TEXTURE_FILTER_BIAS_SGIX #define GL_POST_TEXTURE_FILTER_BIAS_SGIX 0x8179 #endif #ifndef GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX #define GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX 0x817C #endif #ifndef GL_POST_TEXTURE_FILTER_SCALE_SGIX #define GL_POST_TEXTURE_FILTER_SCALE_SGIX 0x817A #endif #ifndef GL_PREFER_DOUBLEBUFFER_HINT_PGI #define GL_PREFER_DOUBLEBUFFER_HINT_PGI 0x1A1F8 #endif #ifndef GL_PRESENT_DURATION_NV #define GL_PRESENT_DURATION_NV 0x8E2B #endif #ifndef GL_PRESENT_TIME_NV #define GL_PRESENT_TIME_NV 0x8E2A #endif #ifndef GL_PRESERVE_ATI #define GL_PRESERVE_ATI 0x8762 #endif #ifndef GL_PREVIOUS #define GL_PREVIOUS 0x8578 #endif #ifndef GL_PREVIOUS_ARB #define GL_PREVIOUS_ARB 0x8578 #endif #ifndef GL_PREVIOUS_EXT #define GL_PREVIOUS_EXT 0x8578 #endif #ifndef GL_PREVIOUS_TEXTURE_INPUT_NV #define GL_PREVIOUS_TEXTURE_INPUT_NV 0x86E4 #endif #ifndef GL_PRIMARY_COLOR #define GL_PRIMARY_COLOR 0x8577 #endif #ifndef GL_PRIMARY_COLOR_ARB #define GL_PRIMARY_COLOR_ARB 0x8577 #endif #ifndef GL_PRIMARY_COLOR_EXT #define GL_PRIMARY_COLOR_EXT 0x8577 #endif #ifndef GL_PRIMARY_COLOR_NV #define GL_PRIMARY_COLOR_NV 0x852C #endif #ifndef GL_PRIMITIVES_GENERATED #define GL_PRIMITIVES_GENERATED 0x8C87 #endif #ifndef GL_PRIMITIVES_GENERATED_EXT #define GL_PRIMITIVES_GENERATED_EXT 0x8C87 #endif #ifndef GL_PRIMITIVES_GENERATED_NV #define GL_PRIMITIVES_GENERATED_NV 0x8C87 #endif #ifndef GL_PRIMITIVE_ID_NV #define GL_PRIMITIVE_ID_NV 0x8C7C #endif #ifndef GL_PRIMITIVE_RESTART_INDEX_NV #define GL_PRIMITIVE_RESTART_INDEX_NV 0x8559 #endif #ifndef GL_PRIMITIVE_RESTART_NV #define GL_PRIMITIVE_RESTART_NV 0x8558 #endif #ifndef GL_PROGRAM_ADDRESS_REGISTERS_ARB #define GL_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B0 #endif #ifndef GL_PROGRAM_ALU_INSTRUCTIONS_ARB #define GL_PROGRAM_ALU_INSTRUCTIONS_ARB 0x8805 #endif #ifndef GL_PROGRAM_ATTRIBS_ARB #define GL_PROGRAM_ATTRIBS_ARB 0x88AC #endif #ifndef GL_PROGRAM_ATTRIB_COMPONENTS_NV #define GL_PROGRAM_ATTRIB_COMPONENTS_NV 0x8906 #endif #ifndef GL_PROGRAM_BINDING_ARB #define GL_PROGRAM_BINDING_ARB 0x8677 #endif #ifndef GL_PROGRAM_ERROR_POSITION_ARB #define GL_PROGRAM_ERROR_POSITION_ARB 0x864B #endif #ifndef GL_PROGRAM_ERROR_POSITION_NV #define GL_PROGRAM_ERROR_POSITION_NV 0x864B #endif #ifndef GL_PROGRAM_ERROR_STRING_ARB #define GL_PROGRAM_ERROR_STRING_ARB 0x8874 #endif #ifndef GL_PROGRAM_ERROR_STRING_NV #define GL_PROGRAM_ERROR_STRING_NV 0x8874 #endif #ifndef GL_PROGRAM_FORMAT_ARB #define GL_PROGRAM_FORMAT_ARB 0x8876 #endif #ifndef GL_PROGRAM_FORMAT_ASCII_ARB #define GL_PROGRAM_FORMAT_ASCII_ARB 0x8875 #endif #ifndef GL_PROGRAM_INSTRUCTIONS_ARB #define GL_PROGRAM_INSTRUCTIONS_ARB 0x88A0 #endif #ifndef GL_PROGRAM_LENGTH_ARB #define GL_PROGRAM_LENGTH_ARB 0x8627 #endif #ifndef GL_PROGRAM_LENGTH_NV #define GL_PROGRAM_LENGTH_NV 0x8627 #endif #ifndef GL_PROGRAM_MATRIX_EXT #define GL_PROGRAM_MATRIX_EXT 0x8E2D #endif #ifndef GL_PROGRAM_MATRIX_STACK_DEPTH_EXT #define GL_PROGRAM_MATRIX_STACK_DEPTH_EXT 0x8E2F #endif #ifndef GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB #define GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B2 #endif #ifndef GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB #define GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x8808 #endif #ifndef GL_PROGRAM_NATIVE_ATTRIBS_ARB #define GL_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AE #endif #ifndef GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB #define GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A2 #endif #ifndef GL_PROGRAM_NATIVE_PARAMETERS_ARB #define GL_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AA #endif #ifndef GL_PROGRAM_NATIVE_TEMPORARIES_ARB #define GL_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A6 #endif #ifndef GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB #define GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x880A #endif #ifndef GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB #define GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x8809 #endif #ifndef GL_PROGRAM_OBJECT_ARB #define GL_PROGRAM_OBJECT_ARB 0x8B40 #endif #ifndef GL_PROGRAM_PARAMETERS_ARB #define GL_PROGRAM_PARAMETERS_ARB 0x88A8 #endif #ifndef GL_PROGRAM_PARAMETER_NV #define GL_PROGRAM_PARAMETER_NV 0x8644 #endif #ifndef GL_PROGRAM_POINT_SIZE_ARB #define GL_PROGRAM_POINT_SIZE_ARB 0x8642 #endif #ifndef GL_PROGRAM_POINT_SIZE_EXT #define GL_PROGRAM_POINT_SIZE_EXT 0x8642 #endif #ifndef GL_PROGRAM_RESIDENT_NV #define GL_PROGRAM_RESIDENT_NV 0x8647 #endif #ifndef GL_PROGRAM_RESULT_COMPONENTS_NV #define GL_PROGRAM_RESULT_COMPONENTS_NV 0x8907 #endif #ifndef GL_PROGRAM_STRING_ARB #define GL_PROGRAM_STRING_ARB 0x8628 #endif #ifndef GL_PROGRAM_STRING_NV #define GL_PROGRAM_STRING_NV 0x8628 #endif #ifndef GL_PROGRAM_TARGET_NV #define GL_PROGRAM_TARGET_NV 0x8646 #endif #ifndef GL_PROGRAM_TEMPORARIES_ARB #define GL_PROGRAM_TEMPORARIES_ARB 0x88A4 #endif #ifndef GL_PROGRAM_TEX_INDIRECTIONS_ARB #define GL_PROGRAM_TEX_INDIRECTIONS_ARB 0x8807 #endif #ifndef GL_PROGRAM_TEX_INSTRUCTIONS_ARB #define GL_PROGRAM_TEX_INSTRUCTIONS_ARB 0x8806 #endif #ifndef GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB #define GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB 0x88B6 #endif #ifndef GL_PROJECTION #define GL_PROJECTION 0x1701 #endif #ifndef GL_PROJECTION_MATRIX #define GL_PROJECTION_MATRIX 0x0BA7 #endif #ifndef GL_PROJECTION_STACK_DEPTH #define GL_PROJECTION_STACK_DEPTH 0x0BA4 #endif #ifndef GL_PROXY_COLOR_TABLE #define GL_PROXY_COLOR_TABLE 0x80D3 #endif #ifndef GL_PROXY_COLOR_TABLE_SGI #define GL_PROXY_COLOR_TABLE_SGI 0x80D3 #endif #ifndef GL_PROXY_HISTOGRAM #define GL_PROXY_HISTOGRAM 0x8025 #endif #ifndef GL_PROXY_HISTOGRAM_EXT #define GL_PROXY_HISTOGRAM_EXT 0x8025 #endif #ifndef GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE #define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE 0x80D5 #endif #ifndef GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE_SGI #define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D5 #endif #ifndef GL_PROXY_POST_CONVOLUTION_COLOR_TABLE #define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE 0x80D4 #endif #ifndef GL_PROXY_POST_CONVOLUTION_COLOR_TABLE_SGI #define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D4 #endif #ifndef GL_PROXY_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP #define GL_PROXY_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP 0x8163 #endif #ifndef GL_PROXY_TEXTURE_1D #define GL_PROXY_TEXTURE_1D 0x8063 #endif #ifndef GL_PROXY_TEXTURE_1D_ARRAY #define GL_PROXY_TEXTURE_1D_ARRAY 0x8C19 #endif #ifndef GL_PROXY_TEXTURE_1D_ARRAY_EXT #define GL_PROXY_TEXTURE_1D_ARRAY_EXT 0x8C19 #endif #ifndef GL_PROXY_TEXTURE_1D_EXT #define GL_PROXY_TEXTURE_1D_EXT 0x8063 #endif #ifndef GL_PROXY_TEXTURE_1D_STACK_MESAX #define GL_PROXY_TEXTURE_1D_STACK_MESAX 0x875B #endif #ifndef GL_PROXY_TEXTURE_2D #define GL_PROXY_TEXTURE_2D 0x8064 #endif #ifndef GL_PROXY_TEXTURE_2D_ARRAY #define GL_PROXY_TEXTURE_2D_ARRAY 0x8C1B #endif #ifndef GL_PROXY_TEXTURE_2D_ARRAY_EXT #define GL_PROXY_TEXTURE_2D_ARRAY_EXT 0x8C1B #endif #ifndef GL_PROXY_TEXTURE_2D_EXT #define GL_PROXY_TEXTURE_2D_EXT 0x8064 #endif #ifndef GL_PROXY_TEXTURE_2D_STACK_MESAX #define GL_PROXY_TEXTURE_2D_STACK_MESAX 0x875C #endif #ifndef GL_PROXY_TEXTURE_3D #define GL_PROXY_TEXTURE_3D 0x8070 #endif #ifndef GL_PROXY_TEXTURE_3D_EXT #define GL_PROXY_TEXTURE_3D_EXT 0x8070 #endif #ifndef GL_PROXY_TEXTURE_4D_SGIS #define GL_PROXY_TEXTURE_4D_SGIS 0x8135 #endif #ifndef GL_PROXY_TEXTURE_COLOR_TABLE_SGI #define GL_PROXY_TEXTURE_COLOR_TABLE_SGI 0x80BD #endif #ifndef GL_PROXY_TEXTURE_CUBE_MAP #define GL_PROXY_TEXTURE_CUBE_MAP 0x851B #endif #ifndef GL_PROXY_TEXTURE_CUBE_MAP_ARB #define GL_PROXY_TEXTURE_CUBE_MAP_ARB 0x851B #endif #ifndef GL_PROXY_TEXTURE_CUBE_MAP_EXT #define GL_PROXY_TEXTURE_CUBE_MAP_EXT 0x851B #endif #ifndef GL_PROXY_TEXTURE_RECTANGLE_ARB #define GL_PROXY_TEXTURE_RECTANGLE_ARB 0x84F7 #endif #ifndef GL_PROXY_TEXTURE_RECTANGLE_NV #define GL_PROXY_TEXTURE_RECTANGLE_NV 0x84F7 #endif #ifndef GL_Q #define GL_Q 0x2003 #endif #ifndef GL_QUADRATIC_ATTENUATION #define GL_QUADRATIC_ATTENUATION 0x1209 #endif #ifndef GL_QUADS #define GL_QUADS 0x0007 #endif #ifndef GL_QUAD_ALPHA4_SGIS #define GL_QUAD_ALPHA4_SGIS 0x811E #endif #ifndef GL_QUAD_ALPHA8_SGIS #define GL_QUAD_ALPHA8_SGIS 0x811F #endif #ifndef GL_QUAD_INTENSITY4_SGIS #define GL_QUAD_INTENSITY4_SGIS 0x8122 #endif #ifndef GL_QUAD_INTENSITY8_SGIS #define GL_QUAD_INTENSITY8_SGIS 0x8123 #endif #ifndef GL_QUAD_LUMINANCE4_SGIS #define GL_QUAD_LUMINANCE4_SGIS 0x8120 #endif #ifndef GL_QUAD_LUMINANCE8_SGIS #define GL_QUAD_LUMINANCE8_SGIS 0x8121 #endif #ifndef GL_QUAD_MESH_SUN #define GL_QUAD_MESH_SUN 0x8614 #endif #ifndef GL_QUAD_STRIP #define GL_QUAD_STRIP 0x0008 #endif #ifndef GL_QUAD_TEXTURE_SELECT_SGIS #define GL_QUAD_TEXTURE_SELECT_SGIS 0x8125 #endif #ifndef GL_QUARTER_BIT_ATI #define GL_QUARTER_BIT_ATI 0x00000010 #endif #ifndef GL_QUERY_BY_REGION_NO_WAIT #define GL_QUERY_BY_REGION_NO_WAIT 0x8E16 #endif #ifndef GL_QUERY_BY_REGION_NO_WAIT_NV #define GL_QUERY_BY_REGION_NO_WAIT_NV 0x8E16 #endif #ifndef GL_QUERY_BY_REGION_WAIT #define GL_QUERY_BY_REGION_WAIT 0x8E15 #endif #ifndef GL_QUERY_BY_REGION_WAIT_NV #define GL_QUERY_BY_REGION_WAIT_NV 0x8E15 #endif #ifndef GL_QUERY_COUNTER_BITS #define GL_QUERY_COUNTER_BITS 0x8864 #endif #ifndef GL_QUERY_COUNTER_BITS_ARB #define GL_QUERY_COUNTER_BITS_ARB 0x8864 #endif #ifndef GL_QUERY_NO_WAIT #define GL_QUERY_NO_WAIT 0x8E14 #endif #ifndef GL_QUERY_NO_WAIT_NV #define GL_QUERY_NO_WAIT_NV 0x8E14 #endif #ifndef GL_QUERY_RESULT #define GL_QUERY_RESULT 0x8866 #endif #ifndef GL_QUERY_RESULT_ARB #define GL_QUERY_RESULT_ARB 0x8866 #endif #ifndef GL_QUERY_RESULT_AVAILABLE #define GL_QUERY_RESULT_AVAILABLE 0x8867 #endif #ifndef GL_QUERY_RESULT_AVAILABLE_ARB #define GL_QUERY_RESULT_AVAILABLE_ARB 0x8867 #endif #ifndef GL_QUERY_WAIT #define GL_QUERY_WAIT 0x8E13 #endif #ifndef GL_QUERY_WAIT_NV #define GL_QUERY_WAIT_NV 0x8E13 #endif #ifndef GL_R #define GL_R 0x2002 #endif #ifndef GL_R11F_G11F_B10F #define GL_R11F_G11F_B10F 0x8C3A #endif #ifndef GL_R11F_G11F_B10F_EXT #define GL_R11F_G11F_B10F_EXT 0x8C3A #endif #ifndef GL_R16 #define GL_R16 0x822A #endif #ifndef GL_R16F #define GL_R16F 0x822D #endif #ifndef GL_R16I #define GL_R16I 0x8233 #endif #ifndef GL_R16UI #define GL_R16UI 0x8234 #endif #ifndef GL_R1UI_C3F_V3F_SUN #define GL_R1UI_C3F_V3F_SUN 0x85C6 #endif #ifndef GL_R1UI_C4F_N3F_V3F_SUN #define GL_R1UI_C4F_N3F_V3F_SUN 0x85C8 #endif #ifndef GL_R1UI_C4UB_V3F_SUN #define GL_R1UI_C4UB_V3F_SUN 0x85C5 #endif #ifndef GL_R1UI_N3F_V3F_SUN #define GL_R1UI_N3F_V3F_SUN 0x85C7 #endif #ifndef GL_R1UI_T2F_C4F_N3F_V3F_SUN #define GL_R1UI_T2F_C4F_N3F_V3F_SUN 0x85CB #endif #ifndef GL_R1UI_T2F_N3F_V3F_SUN #define GL_R1UI_T2F_N3F_V3F_SUN 0x85CA #endif #ifndef GL_R1UI_T2F_V3F_SUN #define GL_R1UI_T2F_V3F_SUN 0x85C9 #endif #ifndef GL_R1UI_V3F_SUN #define GL_R1UI_V3F_SUN 0x85C4 #endif #ifndef GL_R32F #define GL_R32F 0x822E #endif #ifndef GL_R32I #define GL_R32I 0x8235 #endif #ifndef GL_R32UI #define GL_R32UI 0x8236 #endif #ifndef GL_R3_G3_B2 #define GL_R3_G3_B2 0x2A10 #endif #ifndef GL_R8 #define GL_R8 0x8229 #endif #ifndef GL_R8I #define GL_R8I 0x8231 #endif #ifndef GL_R8UI #define GL_R8UI 0x8232 #endif #ifndef GL_RASTERIZER_DISCARD #define GL_RASTERIZER_DISCARD 0x8C89 #endif #ifndef GL_RASTERIZER_DISCARD_EXT #define GL_RASTERIZER_DISCARD_EXT 0x8C89 #endif #ifndef GL_RASTERIZER_DISCARD_NV #define GL_RASTERIZER_DISCARD_NV 0x8C89 #endif #ifndef GL_RASTER_POSITION_UNCLIPPED_IBM #define GL_RASTER_POSITION_UNCLIPPED_IBM 0x19262 #endif #ifndef GL_READ_BUFFER #define GL_READ_BUFFER 0x0C02 #endif #ifndef GL_READ_FRAMEBUFFER #define GL_READ_FRAMEBUFFER 0x8CA8 #endif #ifndef GL_READ_FRAMEBUFFER_BINDING #define GL_READ_FRAMEBUFFER_BINDING 0x8CAA #endif #ifndef GL_READ_FRAMEBUFFER_BINDING_EXT #define GL_READ_FRAMEBUFFER_BINDING_EXT 0x8CAA #endif #ifndef GL_READ_FRAMEBUFFER_EXT #define GL_READ_FRAMEBUFFER_EXT 0x8CA8 #endif #ifndef GL_READ_ONLY #define GL_READ_ONLY 0x88B8 #endif #ifndef GL_READ_ONLY_ARB #define GL_READ_ONLY_ARB 0x88B8 #endif #ifndef GL_READ_PIXEL_DATA_RANGE_LENGTH_NV #define GL_READ_PIXEL_DATA_RANGE_LENGTH_NV 0x887B #endif #ifndef GL_READ_PIXEL_DATA_RANGE_NV #define GL_READ_PIXEL_DATA_RANGE_NV 0x8879 #endif #ifndef GL_READ_PIXEL_DATA_RANGE_POINTER_NV #define GL_READ_PIXEL_DATA_RANGE_POINTER_NV 0x887D #endif #ifndef GL_READ_WRITE #define GL_READ_WRITE 0x88BA #endif #ifndef GL_READ_WRITE_ARB #define GL_READ_WRITE_ARB 0x88BA #endif #ifndef GL_RECLAIM_MEMORY_HINT_PGI #define GL_RECLAIM_MEMORY_HINT_PGI 0x1A1FE #endif #ifndef GL_RED #define GL_RED 0x1903 #endif #ifndef GL_REDUCE #define GL_REDUCE 0x8016 #endif #ifndef GL_REDUCE_EXT #define GL_REDUCE_EXT 0x8016 #endif #ifndef GL_RED_BIAS #define GL_RED_BIAS 0x0D15 #endif #ifndef GL_RED_BITS #define GL_RED_BITS 0x0D52 #endif #ifndef GL_RED_BIT_ATI #define GL_RED_BIT_ATI 0x00000001 #endif #ifndef GL_RED_INTEGER #define GL_RED_INTEGER 0x8D94 #endif #ifndef GL_RED_INTEGER_EXT #define GL_RED_INTEGER_EXT 0x8D94 #endif #ifndef GL_RED_MAX_CLAMP_INGR #define GL_RED_MAX_CLAMP_INGR 0x8564 #endif #ifndef GL_RED_MIN_CLAMP_INGR #define GL_RED_MIN_CLAMP_INGR 0x8560 #endif #ifndef GL_RED_SCALE #define GL_RED_SCALE 0x0D14 #endif #ifndef GL_REFERENCE_PLANE_EQUATION_SGIX #define GL_REFERENCE_PLANE_EQUATION_SGIX 0x817E #endif #ifndef GL_REFERENCE_PLANE_SGIX #define GL_REFERENCE_PLANE_SGIX 0x817D #endif #ifndef GL_REFLECTION_MAP #define GL_REFLECTION_MAP 0x8512 #endif #ifndef GL_REFLECTION_MAP_ARB #define GL_REFLECTION_MAP_ARB 0x8512 #endif #ifndef GL_REFLECTION_MAP_EXT #define GL_REFLECTION_MAP_EXT 0x8512 #endif #ifndef GL_REFLECTION_MAP_NV #define GL_REFLECTION_MAP_NV 0x8512 #endif #ifndef GL_REGISTER_COMBINERS_NV #define GL_REGISTER_COMBINERS_NV 0x8522 #endif #ifndef GL_REG_0_ATI #define GL_REG_0_ATI 0x8921 #endif #ifndef GL_REG_10_ATI #define GL_REG_10_ATI 0x892B #endif #ifndef GL_REG_11_ATI #define GL_REG_11_ATI 0x892C #endif #ifndef GL_REG_12_ATI #define GL_REG_12_ATI 0x892D #endif #ifndef GL_REG_13_ATI #define GL_REG_13_ATI 0x892E #endif #ifndef GL_REG_14_ATI #define GL_REG_14_ATI 0x892F #endif #ifndef GL_REG_15_ATI #define GL_REG_15_ATI 0x8930 #endif #ifndef GL_REG_16_ATI #define GL_REG_16_ATI 0x8931 #endif #ifndef GL_REG_17_ATI #define GL_REG_17_ATI 0x8932 #endif #ifndef GL_REG_18_ATI #define GL_REG_18_ATI 0x8933 #endif #ifndef GL_REG_19_ATI #define GL_REG_19_ATI 0x8934 #endif #ifndef GL_REG_1_ATI #define GL_REG_1_ATI 0x8922 #endif #ifndef GL_REG_20_ATI #define GL_REG_20_ATI 0x8935 #endif #ifndef GL_REG_21_ATI #define GL_REG_21_ATI 0x8936 #endif #ifndef GL_REG_22_ATI #define GL_REG_22_ATI 0x8937 #endif #ifndef GL_REG_23_ATI #define GL_REG_23_ATI 0x8938 #endif #ifndef GL_REG_24_ATI #define GL_REG_24_ATI 0x8939 #endif #ifndef GL_REG_25_ATI #define GL_REG_25_ATI 0x893A #endif #ifndef GL_REG_26_ATI #define GL_REG_26_ATI 0x893B #endif #ifndef GL_REG_27_ATI #define GL_REG_27_ATI 0x893C #endif #ifndef GL_REG_28_ATI #define GL_REG_28_ATI 0x893D #endif #ifndef GL_REG_29_ATI #define GL_REG_29_ATI 0x893E #endif #ifndef GL_REG_2_ATI #define GL_REG_2_ATI 0x8923 #endif #ifndef GL_REG_30_ATI #define GL_REG_30_ATI 0x893F #endif #ifndef GL_REG_31_ATI #define GL_REG_31_ATI 0x8940 #endif #ifndef GL_REG_3_ATI #define GL_REG_3_ATI 0x8924 #endif #ifndef GL_REG_4_ATI #define GL_REG_4_ATI 0x8925 #endif #ifndef GL_REG_5_ATI #define GL_REG_5_ATI 0x8926 #endif #ifndef GL_REG_6_ATI #define GL_REG_6_ATI 0x8927 #endif #ifndef GL_REG_7_ATI #define GL_REG_7_ATI 0x8928 #endif #ifndef GL_REG_8_ATI #define GL_REG_8_ATI 0x8929 #endif #ifndef GL_REG_9_ATI #define GL_REG_9_ATI 0x892A #endif #ifndef GL_RENDER #define GL_RENDER 0x1C00 #endif #ifndef GL_RENDERBUFFER #define GL_RENDERBUFFER 0x8D41 #endif #ifndef GL_RENDERBUFFER_ALPHA_SIZE #define GL_RENDERBUFFER_ALPHA_SIZE 0x8D53 #endif #ifndef GL_RENDERBUFFER_ALPHA_SIZE_EXT #define GL_RENDERBUFFER_ALPHA_SIZE_EXT 0x8D53 #endif #ifndef GL_RENDERBUFFER_BINDING #define GL_RENDERBUFFER_BINDING 0x8CA7 #endif #ifndef GL_RENDERBUFFER_BINDING_EXT #define GL_RENDERBUFFER_BINDING_EXT 0x8CA7 #endif #ifndef GL_RENDERBUFFER_BLUE_SIZE #define GL_RENDERBUFFER_BLUE_SIZE 0x8D52 #endif #ifndef GL_RENDERBUFFER_BLUE_SIZE_EXT #define GL_RENDERBUFFER_BLUE_SIZE_EXT 0x8D52 #endif #ifndef GL_RENDERBUFFER_COLOR_SAMPLES_NV #define GL_RENDERBUFFER_COLOR_SAMPLES_NV 0x8E10 #endif #ifndef GL_RENDERBUFFER_COVERAGE_SAMPLES_NV #define GL_RENDERBUFFER_COVERAGE_SAMPLES_NV 0x8CAB #endif #ifndef GL_RENDERBUFFER_DEPTH_SIZE #define GL_RENDERBUFFER_DEPTH_SIZE 0x8D54 #endif #ifndef GL_RENDERBUFFER_DEPTH_SIZE_EXT #define GL_RENDERBUFFER_DEPTH_SIZE_EXT 0x8D54 #endif #ifndef GL_RENDERBUFFER_EXT #define GL_RENDERBUFFER_EXT 0x8D41 #endif #ifndef GL_RENDERBUFFER_GREEN_SIZE #define GL_RENDERBUFFER_GREEN_SIZE 0x8D51 #endif #ifndef GL_RENDERBUFFER_GREEN_SIZE_EXT #define GL_RENDERBUFFER_GREEN_SIZE_EXT 0x8D51 #endif #ifndef GL_RENDERBUFFER_HEIGHT #define GL_RENDERBUFFER_HEIGHT 0x8D43 #endif #ifndef GL_RENDERBUFFER_HEIGHT_EXT #define GL_RENDERBUFFER_HEIGHT_EXT 0x8D43 #endif #ifndef GL_RENDERBUFFER_INTERNAL_FORMAT #define GL_RENDERBUFFER_INTERNAL_FORMAT 0x8D44 #endif #ifndef GL_RENDERBUFFER_INTERNAL_FORMAT_EXT #define GL_RENDERBUFFER_INTERNAL_FORMAT_EXT 0x8D44 #endif #ifndef GL_RENDERBUFFER_RED_SIZE #define GL_RENDERBUFFER_RED_SIZE 0x8D50 #endif #ifndef GL_RENDERBUFFER_RED_SIZE_EXT #define GL_RENDERBUFFER_RED_SIZE_EXT 0x8D50 #endif #ifndef GL_RENDERBUFFER_SAMPLES #define GL_RENDERBUFFER_SAMPLES 0x8CAB #endif #ifndef GL_RENDERBUFFER_SAMPLES_EXT #define GL_RENDERBUFFER_SAMPLES_EXT 0x8CAB #endif #ifndef GL_RENDERBUFFER_STENCIL_SIZE #define GL_RENDERBUFFER_STENCIL_SIZE 0x8D55 #endif #ifndef GL_RENDERBUFFER_STENCIL_SIZE_EXT #define GL_RENDERBUFFER_STENCIL_SIZE_EXT 0x8D55 #endif #ifndef GL_RENDERBUFFER_WIDTH #define GL_RENDERBUFFER_WIDTH 0x8D42 #endif #ifndef GL_RENDERBUFFER_WIDTH_EXT #define GL_RENDERBUFFER_WIDTH_EXT 0x8D42 #endif #ifndef GL_RENDERER #define GL_RENDERER 0x1F01 #endif #ifndef GL_RENDER_MODE #define GL_RENDER_MODE 0x0C40 #endif #ifndef GL_REPEAT #define GL_REPEAT 0x2901 #endif #ifndef GL_REPLACE #define GL_REPLACE 0x1E01 #endif #ifndef GL_REPLACEMENT_CODE_ARRAY_POINTER_SUN #define GL_REPLACEMENT_CODE_ARRAY_POINTER_SUN 0x85C3 #endif #ifndef GL_REPLACEMENT_CODE_ARRAY_STRIDE_SUN #define GL_REPLACEMENT_CODE_ARRAY_STRIDE_SUN 0x85C2 #endif #ifndef GL_REPLACEMENT_CODE_ARRAY_SUN #define GL_REPLACEMENT_CODE_ARRAY_SUN 0x85C0 #endif #ifndef GL_REPLACEMENT_CODE_ARRAY_TYPE_SUN #define GL_REPLACEMENT_CODE_ARRAY_TYPE_SUN 0x85C1 #endif #ifndef GL_REPLACEMENT_CODE_SUN #define GL_REPLACEMENT_CODE_SUN 0x81D8 #endif #ifndef GL_REPLACE_EXT #define GL_REPLACE_EXT 0x8062 #endif #ifndef GL_REPLACE_MIDDLE_SUN #define GL_REPLACE_MIDDLE_SUN 0x0002 #endif #ifndef GL_REPLACE_OLDEST_SUN #define GL_REPLACE_OLDEST_SUN 0x0003 #endif #ifndef GL_REPLICATE_BORDER #define GL_REPLICATE_BORDER 0x8153 #endif #ifndef GL_REPLICATE_BORDER_HP #define GL_REPLICATE_BORDER_HP 0x8153 #endif #ifndef GL_RESAMPLE_AVERAGE_OML #define GL_RESAMPLE_AVERAGE_OML 0x8988 #endif #ifndef GL_RESAMPLE_DECIMATE_OML #define GL_RESAMPLE_DECIMATE_OML 0x8989 #endif #ifndef GL_RESAMPLE_DECIMATE_SGIX #define GL_RESAMPLE_DECIMATE_SGIX 0x8430 #endif #ifndef GL_RESAMPLE_REPLICATE_OML #define GL_RESAMPLE_REPLICATE_OML 0x8986 #endif #ifndef GL_RESAMPLE_REPLICATE_SGIX #define GL_RESAMPLE_REPLICATE_SGIX 0x842E #endif #ifndef GL_RESAMPLE_ZERO_FILL_OML #define GL_RESAMPLE_ZERO_FILL_OML 0x8987 #endif #ifndef GL_RESAMPLE_ZERO_FILL_SGIX #define GL_RESAMPLE_ZERO_FILL_SGIX 0x842F #endif #ifndef GL_RESCALE_NORMAL #define GL_RESCALE_NORMAL 0x803A #endif #ifndef GL_RESCALE_NORMAL_EXT #define GL_RESCALE_NORMAL_EXT 0x803A #endif #ifndef GL_RESTART_SUN #define GL_RESTART_SUN 0x0001 #endif #ifndef GL_RETURN #define GL_RETURN 0x0102 #endif #ifndef GL_RG #define GL_RG 0x8227 #endif #ifndef GL_RG16 #define GL_RG16 0x822C #endif #ifndef GL_RG16F #define GL_RG16F 0x822F #endif #ifndef GL_RG16I #define GL_RG16I 0x8239 #endif #ifndef GL_RG16UI #define GL_RG16UI 0x823A #endif #ifndef GL_RG32F #define GL_RG32F 0x8230 #endif #ifndef GL_RG32I #define GL_RG32I 0x823B #endif #ifndef GL_RG32UI #define GL_RG32UI 0x823C #endif #ifndef GL_RG8 #define GL_RG8 0x822B #endif #ifndef GL_RG8I #define GL_RG8I 0x8237 #endif #ifndef GL_RG8UI #define GL_RG8UI 0x8238 #endif #ifndef GL_RGB #define GL_RGB 0x1907 #endif #ifndef GL_RGB10 #define GL_RGB10 0x8052 #endif #ifndef GL_RGB10_A2 #define GL_RGB10_A2 0x8059 #endif #ifndef GL_RGB10_A2_EXT #define GL_RGB10_A2_EXT 0x8059 #endif #ifndef GL_RGB10_EXT #define GL_RGB10_EXT 0x8052 #endif #ifndef GL_RGB12 #define GL_RGB12 0x8053 #endif #ifndef GL_RGB12_EXT #define GL_RGB12_EXT 0x8053 #endif #ifndef GL_RGB16 #define GL_RGB16 0x8054 #endif #ifndef GL_RGB16F #define GL_RGB16F 0x881B #endif #ifndef GL_RGB16F_ARB #define GL_RGB16F_ARB 0x881B #endif #ifndef GL_RGB16I #define GL_RGB16I 0x8D89 #endif #ifndef GL_RGB16I_EXT #define GL_RGB16I_EXT 0x8D89 #endif #ifndef GL_RGB16UI #define GL_RGB16UI 0x8D77 #endif #ifndef GL_RGB16UI_EXT #define GL_RGB16UI_EXT 0x8D77 #endif #ifndef GL_RGB16_EXT #define GL_RGB16_EXT 0x8054 #endif #ifndef GL_RGB2_EXT #define GL_RGB2_EXT 0x804E #endif #ifndef GL_RGB32F #define GL_RGB32F 0x8815 #endif #ifndef GL_RGB32F_ARB #define GL_RGB32F_ARB 0x8815 #endif #ifndef GL_RGB32I #define GL_RGB32I 0x8D83 #endif #ifndef GL_RGB32I_EXT #define GL_RGB32I_EXT 0x8D83 #endif #ifndef GL_RGB32UI #define GL_RGB32UI 0x8D71 #endif #ifndef GL_RGB32UI_EXT #define GL_RGB32UI_EXT 0x8D71 #endif #ifndef GL_RGB4 #define GL_RGB4 0x804F #endif #ifndef GL_RGB4_EXT #define GL_RGB4_EXT 0x804F #endif #ifndef GL_RGB4_S3TC #define GL_RGB4_S3TC 0x83A1 #endif #ifndef GL_RGB5 #define GL_RGB5 0x8050 #endif #ifndef GL_RGB5_A1 #define GL_RGB5_A1 0x8057 #endif #ifndef GL_RGB5_A1_EXT #define GL_RGB5_A1_EXT 0x8057 #endif #ifndef GL_RGB5_EXT #define GL_RGB5_EXT 0x8050 #endif #ifndef GL_RGB8 #define GL_RGB8 0x8051 #endif #ifndef GL_RGB8I #define GL_RGB8I 0x8D8F #endif #ifndef GL_RGB8I_EXT #define GL_RGB8I_EXT 0x8D8F #endif #ifndef GL_RGB8UI #define GL_RGB8UI 0x8D7D #endif #ifndef GL_RGB8UI_EXT #define GL_RGB8UI_EXT 0x8D7D #endif #ifndef GL_RGB8_EXT #define GL_RGB8_EXT 0x8051 #endif #ifndef GL_RGB9_E5 #define GL_RGB9_E5 0x8C3D #endif #ifndef GL_RGB9_E5_EXT #define GL_RGB9_E5_EXT 0x8C3D #endif #ifndef GL_RGBA #define GL_RGBA 0x1908 #endif #ifndef GL_RGBA12 #define GL_RGBA12 0x805A #endif #ifndef GL_RGBA12_EXT #define GL_RGBA12_EXT 0x805A #endif #ifndef GL_RGBA16 #define GL_RGBA16 0x805B #endif #ifndef GL_RGBA16F #define GL_RGBA16F 0x881A #endif #ifndef GL_RGBA16F_ARB #define GL_RGBA16F_ARB 0x881A #endif #ifndef GL_RGBA16I #define GL_RGBA16I 0x8D88 #endif #ifndef GL_RGBA16I_EXT #define GL_RGBA16I_EXT 0x8D88 #endif #ifndef GL_RGBA16UI #define GL_RGBA16UI 0x8D76 #endif #ifndef GL_RGBA16UI_EXT #define GL_RGBA16UI_EXT 0x8D76 #endif #ifndef GL_RGBA16_EXT #define GL_RGBA16_EXT 0x805B #endif #ifndef GL_RGBA2 #define GL_RGBA2 0x8055 #endif #ifndef GL_RGBA2_EXT #define GL_RGBA2_EXT 0x8055 #endif #ifndef GL_RGBA32F #define GL_RGBA32F 0x8814 #endif #ifndef GL_RGBA32F_ARB #define GL_RGBA32F_ARB 0x8814 #endif #ifndef GL_RGBA32I #define GL_RGBA32I 0x8D82 #endif #ifndef GL_RGBA32I_EXT #define GL_RGBA32I_EXT 0x8D82 #endif #ifndef GL_RGBA32UI #define GL_RGBA32UI 0x8D70 #endif #ifndef GL_RGBA32UI_EXT #define GL_RGBA32UI_EXT 0x8D70 #endif #ifndef GL_RGBA4 #define GL_RGBA4 0x8056 #endif #ifndef GL_RGBA4_EXT #define GL_RGBA4_EXT 0x8056 #endif #ifndef GL_RGBA4_S3TC #define GL_RGBA4_S3TC 0x83A3 #endif #ifndef GL_RGBA8 #define GL_RGBA8 0x8058 #endif #ifndef GL_RGBA8I #define GL_RGBA8I 0x8D8E #endif #ifndef GL_RGBA8I_EXT #define GL_RGBA8I_EXT 0x8D8E #endif #ifndef GL_RGBA8UI #define GL_RGBA8UI 0x8D7C #endif #ifndef GL_RGBA8UI_EXT #define GL_RGBA8UI_EXT 0x8D7C #endif #ifndef GL_RGBA8_EXT #define GL_RGBA8_EXT 0x8058 #endif #ifndef GL_RGBA_FLOAT16_ATI #define GL_RGBA_FLOAT16_ATI 0x881A #endif #ifndef GL_RGBA_FLOAT32_ATI #define GL_RGBA_FLOAT32_ATI 0x8814 #endif #ifndef GL_RGBA_FLOAT_MODE_ARB #define GL_RGBA_FLOAT_MODE_ARB 0x8820 #endif #ifndef GL_RGBA_INTEGER #define GL_RGBA_INTEGER 0x8D99 #endif #ifndef GL_RGBA_INTEGER_EXT #define GL_RGBA_INTEGER_EXT 0x8D99 #endif #ifndef GL_RGBA_INTEGER_MODE_EXT #define GL_RGBA_INTEGER_MODE_EXT 0x8D9E #endif #ifndef GL_RGBA_MODE #define GL_RGBA_MODE 0x0C31 #endif #ifndef GL_RGBA_S3TC #define GL_RGBA_S3TC 0x83A2 #endif #ifndef GL_RGBA_SIGNED_COMPONENTS_EXT #define GL_RGBA_SIGNED_COMPONENTS_EXT 0x8C3C #endif #ifndef GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV #define GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV 0x86D9 #endif #ifndef GL_RGB_FLOAT16_ATI #define GL_RGB_FLOAT16_ATI 0x881B #endif #ifndef GL_RGB_FLOAT32_ATI #define GL_RGB_FLOAT32_ATI 0x8815 #endif #ifndef GL_RGB_INTEGER #define GL_RGB_INTEGER 0x8D98 #endif #ifndef GL_RGB_INTEGER_EXT #define GL_RGB_INTEGER_EXT 0x8D98 #endif #ifndef GL_RGB_S3TC #define GL_RGB_S3TC 0x83A0 #endif #ifndef GL_RGB_SCALE #define GL_RGB_SCALE 0x8573 #endif #ifndef GL_RGB_SCALE_ARB #define GL_RGB_SCALE_ARB 0x8573 #endif #ifndef GL_RGB_SCALE_EXT #define GL_RGB_SCALE_EXT 0x8573 #endif #ifndef GL_RG_INTEGER #define GL_RG_INTEGER 0x8228 #endif #ifndef GL_RIGHT #define GL_RIGHT 0x0407 #endif #ifndef GL_S #define GL_S 0x2000 #endif #ifndef GL_SAMPLER_1D #define GL_SAMPLER_1D 0x8B5D #endif #ifndef GL_SAMPLER_1D_ARB #define GL_SAMPLER_1D_ARB 0x8B5D #endif #ifndef GL_SAMPLER_1D_ARRAY #define GL_SAMPLER_1D_ARRAY 0x8DC0 #endif #ifndef GL_SAMPLER_1D_ARRAY_EXT #define GL_SAMPLER_1D_ARRAY_EXT 0x8DC0 #endif #ifndef GL_SAMPLER_1D_ARRAY_SHADOW #define GL_SAMPLER_1D_ARRAY_SHADOW 0x8DC3 #endif #ifndef GL_SAMPLER_1D_ARRAY_SHADOW_EXT #define GL_SAMPLER_1D_ARRAY_SHADOW_EXT 0x8DC3 #endif #ifndef GL_SAMPLER_1D_SHADOW #define GL_SAMPLER_1D_SHADOW 0x8B61 #endif #ifndef GL_SAMPLER_1D_SHADOW_ARB #define GL_SAMPLER_1D_SHADOW_ARB 0x8B61 #endif #ifndef GL_SAMPLER_2D #define GL_SAMPLER_2D 0x8B5E #endif #ifndef GL_SAMPLER_2D_ARB #define GL_SAMPLER_2D_ARB 0x8B5E #endif #ifndef GL_SAMPLER_2D_ARRAY #define GL_SAMPLER_2D_ARRAY 0x8DC1 #endif #ifndef GL_SAMPLER_2D_ARRAY_EXT #define GL_SAMPLER_2D_ARRAY_EXT 0x8DC1 #endif #ifndef GL_SAMPLER_2D_ARRAY_SHADOW #define GL_SAMPLER_2D_ARRAY_SHADOW 0x8DC4 #endif #ifndef GL_SAMPLER_2D_ARRAY_SHADOW_EXT #define GL_SAMPLER_2D_ARRAY_SHADOW_EXT 0x8DC4 #endif #ifndef GL_SAMPLER_2D_RECT_ARB #define GL_SAMPLER_2D_RECT_ARB 0x8B63 #endif #ifndef GL_SAMPLER_2D_RECT_SHADOW_ARB #define GL_SAMPLER_2D_RECT_SHADOW_ARB 0x8B64 #endif #ifndef GL_SAMPLER_2D_SHADOW #define GL_SAMPLER_2D_SHADOW 0x8B62 #endif #ifndef GL_SAMPLER_2D_SHADOW_ARB #define GL_SAMPLER_2D_SHADOW_ARB 0x8B62 #endif #ifndef GL_SAMPLER_3D #define GL_SAMPLER_3D 0x8B5F #endif #ifndef GL_SAMPLER_3D_ARB #define GL_SAMPLER_3D_ARB 0x8B5F #endif #ifndef GL_SAMPLER_BUFFER_EXT #define GL_SAMPLER_BUFFER_EXT 0x8DC2 #endif #ifndef GL_SAMPLER_CUBE #define GL_SAMPLER_CUBE 0x8B60 #endif #ifndef GL_SAMPLER_CUBE_ARB #define GL_SAMPLER_CUBE_ARB 0x8B60 #endif #ifndef GL_SAMPLER_CUBE_SHADOW #define GL_SAMPLER_CUBE_SHADOW 0x8DC5 #endif #ifndef GL_SAMPLER_CUBE_SHADOW_EXT #define GL_SAMPLER_CUBE_SHADOW_EXT 0x8DC5 #endif #ifndef GL_SAMPLER_RENDERBUFFER_NV #define GL_SAMPLER_RENDERBUFFER_NV 0x8E56 #endif #ifndef GL_SAMPLES #define GL_SAMPLES 0x80A9 #endif #ifndef GL_SAMPLES_3DFX #define GL_SAMPLES_3DFX 0x86B4 #endif #ifndef GL_SAMPLES_ARB #define GL_SAMPLES_ARB 0x80A9 #endif #ifndef GL_SAMPLES_EXT #define GL_SAMPLES_EXT 0x80A9 #endif #ifndef GL_SAMPLES_PASSED #define GL_SAMPLES_PASSED 0x8914 #endif #ifndef GL_SAMPLES_PASSED_ARB #define GL_SAMPLES_PASSED_ARB 0x8914 #endif #ifndef GL_SAMPLES_SGIS #define GL_SAMPLES_SGIS 0x80A9 #endif #ifndef GL_SAMPLE_ALPHA_TO_COVERAGE #define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E #endif #ifndef GL_SAMPLE_ALPHA_TO_COVERAGE_ARB #define GL_SAMPLE_ALPHA_TO_COVERAGE_ARB 0x809E #endif #ifndef GL_SAMPLE_ALPHA_TO_MASK_EXT #define GL_SAMPLE_ALPHA_TO_MASK_EXT 0x809E #endif #ifndef GL_SAMPLE_ALPHA_TO_MASK_SGIS #define GL_SAMPLE_ALPHA_TO_MASK_SGIS 0x809E #endif #ifndef GL_SAMPLE_ALPHA_TO_ONE #define GL_SAMPLE_ALPHA_TO_ONE 0x809F #endif #ifndef GL_SAMPLE_ALPHA_TO_ONE_ARB #define GL_SAMPLE_ALPHA_TO_ONE_ARB 0x809F #endif #ifndef GL_SAMPLE_ALPHA_TO_ONE_EXT #define GL_SAMPLE_ALPHA_TO_ONE_EXT 0x809F #endif #ifndef GL_SAMPLE_ALPHA_TO_ONE_SGIS #define GL_SAMPLE_ALPHA_TO_ONE_SGIS 0x809F #endif #ifndef GL_SAMPLE_BUFFERS #define GL_SAMPLE_BUFFERS 0x80A8 #endif #ifndef GL_SAMPLE_BUFFERS_3DFX #define GL_SAMPLE_BUFFERS_3DFX 0x86B3 #endif #ifndef GL_SAMPLE_BUFFERS_ARB #define GL_SAMPLE_BUFFERS_ARB 0x80A8 #endif #ifndef GL_SAMPLE_BUFFERS_EXT #define GL_SAMPLE_BUFFERS_EXT 0x80A8 #endif #ifndef GL_SAMPLE_BUFFERS_SGIS #define GL_SAMPLE_BUFFERS_SGIS 0x80A8 #endif #ifndef GL_SAMPLE_COVERAGE #define GL_SAMPLE_COVERAGE 0x80A0 #endif #ifndef GL_SAMPLE_COVERAGE_ARB #define GL_SAMPLE_COVERAGE_ARB 0x80A0 #endif #ifndef GL_SAMPLE_COVERAGE_INVERT #define GL_SAMPLE_COVERAGE_INVERT 0x80AB #endif #ifndef GL_SAMPLE_COVERAGE_INVERT_ARB #define GL_SAMPLE_COVERAGE_INVERT_ARB 0x80AB #endif #ifndef GL_SAMPLE_COVERAGE_VALUE #define GL_SAMPLE_COVERAGE_VALUE 0x80AA #endif #ifndef GL_SAMPLE_COVERAGE_VALUE_ARB #define GL_SAMPLE_COVERAGE_VALUE_ARB 0x80AA #endif #ifndef GL_SAMPLE_MASK_EXT #define GL_SAMPLE_MASK_EXT 0x80A0 #endif #ifndef GL_SAMPLE_MASK_INVERT_EXT #define GL_SAMPLE_MASK_INVERT_EXT 0x80AB #endif #ifndef GL_SAMPLE_MASK_INVERT_SGIS #define GL_SAMPLE_MASK_INVERT_SGIS 0x80AB #endif #ifndef GL_SAMPLE_MASK_NV #define GL_SAMPLE_MASK_NV 0x8E51 #endif #ifndef GL_SAMPLE_MASK_SGIS #define GL_SAMPLE_MASK_SGIS 0x80A0 #endif #ifndef GL_SAMPLE_MASK_VALUE_EXT #define GL_SAMPLE_MASK_VALUE_EXT 0x80AA #endif #ifndef GL_SAMPLE_MASK_VALUE_NV #define GL_SAMPLE_MASK_VALUE_NV 0x8E52 #endif #ifndef GL_SAMPLE_MASK_VALUE_SGIS #define GL_SAMPLE_MASK_VALUE_SGIS 0x80AA #endif #ifndef GL_SAMPLE_PATTERN_EXT #define GL_SAMPLE_PATTERN_EXT 0x80AC #endif #ifndef GL_SAMPLE_PATTERN_SGIS #define GL_SAMPLE_PATTERN_SGIS 0x80AC #endif #ifndef GL_SAMPLE_POSITION_NV #define GL_SAMPLE_POSITION_NV 0x8E50 #endif #ifndef GL_SATURATE_BIT_ATI #define GL_SATURATE_BIT_ATI 0x00000040 #endif #ifndef GL_SCALAR_EXT #define GL_SCALAR_EXT 0x87BE #endif #ifndef GL_SCALEBIAS_HINT_SGIX #define GL_SCALEBIAS_HINT_SGIX 0x8322 #endif #ifndef GL_SCALE_BY_FOUR_NV #define GL_SCALE_BY_FOUR_NV 0x853F #endif #ifndef GL_SCALE_BY_ONE_HALF_NV #define GL_SCALE_BY_ONE_HALF_NV 0x8540 #endif #ifndef GL_SCALE_BY_TWO_NV #define GL_SCALE_BY_TWO_NV 0x853E #endif #ifndef GL_SCISSOR_BIT #define GL_SCISSOR_BIT 0x00080000 #endif #ifndef GL_SCISSOR_BOX #define GL_SCISSOR_BOX 0x0C10 #endif #ifndef GL_SCISSOR_TEST #define GL_SCISSOR_TEST 0x0C11 #endif #ifndef GL_SCREEN_COORDINATES_REND #define GL_SCREEN_COORDINATES_REND 0x8490 #endif #ifndef GL_SECONDARY_COLOR_ARRAY #define GL_SECONDARY_COLOR_ARRAY 0x845E #endif #ifndef GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING #define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING 0x889C #endif #ifndef GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB #define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB 0x889C #endif #ifndef GL_SECONDARY_COLOR_ARRAY_EXT #define GL_SECONDARY_COLOR_ARRAY_EXT 0x845E #endif #ifndef GL_SECONDARY_COLOR_ARRAY_LIST_IBM #define GL_SECONDARY_COLOR_ARRAY_LIST_IBM 103077 #endif #ifndef GL_SECONDARY_COLOR_ARRAY_LIST_STRIDE_IBM #define GL_SECONDARY_COLOR_ARRAY_LIST_STRIDE_IBM 103087 #endif #ifndef GL_SECONDARY_COLOR_ARRAY_POINTER #define GL_SECONDARY_COLOR_ARRAY_POINTER 0x845D #endif #ifndef GL_SECONDARY_COLOR_ARRAY_POINTER_EXT #define GL_SECONDARY_COLOR_ARRAY_POINTER_EXT 0x845D #endif #ifndef GL_SECONDARY_COLOR_ARRAY_SIZE #define GL_SECONDARY_COLOR_ARRAY_SIZE 0x845A #endif #ifndef GL_SECONDARY_COLOR_ARRAY_SIZE_EXT #define GL_SECONDARY_COLOR_ARRAY_SIZE_EXT 0x845A #endif #ifndef GL_SECONDARY_COLOR_ARRAY_STRIDE #define GL_SECONDARY_COLOR_ARRAY_STRIDE 0x845C #endif #ifndef GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT #define GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT 0x845C #endif #ifndef GL_SECONDARY_COLOR_ARRAY_TYPE #define GL_SECONDARY_COLOR_ARRAY_TYPE 0x845B #endif #ifndef GL_SECONDARY_COLOR_ARRAY_TYPE_EXT #define GL_SECONDARY_COLOR_ARRAY_TYPE_EXT 0x845B #endif #ifndef GL_SECONDARY_COLOR_NV #define GL_SECONDARY_COLOR_NV 0x852D #endif #ifndef GL_SECONDARY_INTERPOLATOR_ATI #define GL_SECONDARY_INTERPOLATOR_ATI 0x896D #endif #ifndef GL_SELECT #define GL_SELECT 0x1C02 #endif #ifndef GL_SELECTION_BUFFER_POINTER #define GL_SELECTION_BUFFER_POINTER 0x0DF3 #endif #ifndef GL_SELECTION_BUFFER_SIZE #define GL_SELECTION_BUFFER_SIZE 0x0DF4 #endif #ifndef GL_SEPARABLE_2D #define GL_SEPARABLE_2D 0x8012 #endif #ifndef GL_SEPARABLE_2D_EXT #define GL_SEPARABLE_2D_EXT 0x8012 #endif #ifndef GL_SEPARATE_ATTRIBS #define GL_SEPARATE_ATTRIBS 0x8C8D #endif #ifndef GL_SEPARATE_ATTRIBS_EXT #define GL_SEPARATE_ATTRIBS_EXT 0x8C8D #endif #ifndef GL_SEPARATE_ATTRIBS_NV #define GL_SEPARATE_ATTRIBS_NV 0x8C8D #endif #ifndef GL_SEPARATE_SPECULAR_COLOR #define GL_SEPARATE_SPECULAR_COLOR 0x81FA #endif #ifndef GL_SEPARATE_SPECULAR_COLOR_EXT #define GL_SEPARATE_SPECULAR_COLOR_EXT 0x81FA #endif #ifndef GL_SET #define GL_SET 0x150F #endif #ifndef GL_SGIS_detail_texture #define GL_SGIS_detail_texture 1 #endif #ifndef GL_SGIS_fog_function #define GL_SGIS_fog_function 1 #endif #ifndef GL_SGIS_generate_mipmap #define GL_SGIS_generate_mipmap 1 #endif #ifndef GL_SGIS_multisample #define GL_SGIS_multisample 1 #endif #ifndef GL_SGIS_pixel_texture #define GL_SGIS_pixel_texture 1 #endif #ifndef GL_SGIS_point_line_texgen #define GL_SGIS_point_line_texgen 1 #endif #ifndef GL_SGIS_point_parameters #define GL_SGIS_point_parameters 1 #endif #ifndef GL_SGIS_sharpen_texture #define GL_SGIS_sharpen_texture 1 #endif #ifndef GL_SGIS_texture4D #define GL_SGIS_texture4D 1 #endif #ifndef GL_SGIS_texture_border_clamp #define GL_SGIS_texture_border_clamp 1 #endif #ifndef GL_SGIS_texture_edge_clamp #define GL_SGIS_texture_edge_clamp 1 #endif #ifndef GL_SGIS_texture_filter4 #define GL_SGIS_texture_filter4 1 #endif #ifndef GL_SGIS_texture_lod #define GL_SGIS_texture_lod 1 #endif #ifndef GL_SGIS_texture_select #define GL_SGIS_texture_select 1 #endif #ifndef GL_SGIX_async #define GL_SGIX_async 1 #endif #ifndef GL_SGIX_async_histogram #define GL_SGIX_async_histogram 1 #endif #ifndef GL_SGIX_async_pixel #define GL_SGIX_async_pixel 1 #endif #ifndef GL_SGIX_blend_alpha_minmax #define GL_SGIX_blend_alpha_minmax 1 #endif #ifndef GL_SGIX_calligraphic_fragment #define GL_SGIX_calligraphic_fragment 1 #endif #ifndef GL_SGIX_clipmap #define GL_SGIX_clipmap 1 #endif #ifndef GL_SGIX_convolution_accuracy #define GL_SGIX_convolution_accuracy 1 #endif #ifndef GL_SGIX_depth_texture #define GL_SGIX_depth_texture 1 #endif #ifndef GL_SGIX_flush_raster #define GL_SGIX_flush_raster 1 #endif #ifndef GL_SGIX_fog_offset #define GL_SGIX_fog_offset 1 #endif #ifndef GL_SGIX_fragment_lighting #define GL_SGIX_fragment_lighting 1 #endif #ifndef GL_SGIX_framezoom #define GL_SGIX_framezoom 1 #endif #ifndef GL_SGIX_icc_texture #define GL_SGIX_icc_texture 1 #endif #ifndef GL_SGIX_impact_pixel_texture #define GL_SGIX_impact_pixel_texture 1 #endif #ifndef GL_SGIX_instruments #define GL_SGIX_instruments 1 #endif #ifndef GL_SGIX_interlace #define GL_SGIX_interlace 1 #endif #ifndef GL_SGIX_ir_instrument1 #define GL_SGIX_ir_instrument1 1 #endif #ifndef GL_SGIX_list_priority #define GL_SGIX_list_priority 1 #endif #ifndef GL_SGIX_pixel_texture #define GL_SGIX_pixel_texture 1 #endif #ifndef GL_SGIX_pixel_tiles #define GL_SGIX_pixel_tiles 1 #endif #ifndef GL_SGIX_polynomial_ffd #define GL_SGIX_polynomial_ffd 1 #endif #ifndef GL_SGIX_reference_plane #define GL_SGIX_reference_plane 1 #endif #ifndef GL_SGIX_resample #define GL_SGIX_resample 1 #endif #ifndef GL_SGIX_scalebias_hint #define GL_SGIX_scalebias_hint 1 #endif #ifndef GL_SGIX_shadow #define GL_SGIX_shadow 1 #endif #ifndef GL_SGIX_shadow_ambient #define GL_SGIX_shadow_ambient 1 #endif #ifndef GL_SGIX_sprite #define GL_SGIX_sprite 1 #endif #ifndef GL_SGIX_subsample #define GL_SGIX_subsample 1 #endif #ifndef GL_SGIX_tag_sample_buffer #define GL_SGIX_tag_sample_buffer 1 #endif #ifndef GL_SGIX_texture_add_env #define GL_SGIX_texture_add_env 1 #endif #ifndef GL_SGIX_texture_coordinate_clamp #define GL_SGIX_texture_coordinate_clamp 1 #endif #ifndef GL_SGIX_texture_lod_bias #define GL_SGIX_texture_lod_bias 1 #endif #ifndef GL_SGIX_texture_multi_buffer #define GL_SGIX_texture_multi_buffer 1 #endif #ifndef GL_SGIX_texture_scale_bias #define GL_SGIX_texture_scale_bias 1 #endif #ifndef GL_SGIX_vertex_preclip #define GL_SGIX_vertex_preclip 1 #endif #ifndef GL_SGIX_ycrcb #define GL_SGIX_ycrcb 1 #endif #ifndef GL_SGI_color_matrix #define GL_SGI_color_matrix 1 #endif #ifndef GL_SGI_color_table #define GL_SGI_color_table 1 #endif #ifndef GL_SGI_texture_color_table #define GL_SGI_texture_color_table 1 #endif #ifndef GL_SHADER_CONSISTENT_NV #define GL_SHADER_CONSISTENT_NV 0x86DD #endif #ifndef GL_SHADER_OBJECT_ARB #define GL_SHADER_OBJECT_ARB 0x8B48 #endif #ifndef GL_SHADER_OPERATION_NV #define GL_SHADER_OPERATION_NV 0x86DF #endif #ifndef GL_SHADER_SOURCE_LENGTH #define GL_SHADER_SOURCE_LENGTH 0x8B88 #endif #ifndef GL_SHADER_TYPE #define GL_SHADER_TYPE 0x8B4F #endif #ifndef GL_SHADE_MODEL #define GL_SHADE_MODEL 0x0B54 #endif #ifndef GL_SHADING_LANGUAGE_VERSION #define GL_SHADING_LANGUAGE_VERSION 0x8B8C #endif #ifndef GL_SHADING_LANGUAGE_VERSION_ARB #define GL_SHADING_LANGUAGE_VERSION_ARB 0x8B8C #endif #ifndef GL_SHADOW_AMBIENT_SGIX #define GL_SHADOW_AMBIENT_SGIX 0x80BF #endif #ifndef GL_SHADOW_ATTENUATION_EXT #define GL_SHADOW_ATTENUATION_EXT 0x834E #endif #ifndef GL_SHARED_TEXTURE_PALETTE_EXT #define GL_SHARED_TEXTURE_PALETTE_EXT 0x81FB #endif #ifndef GL_SHARPEN_TEXTURE_FUNC_POINTS_SGIS #define GL_SHARPEN_TEXTURE_FUNC_POINTS_SGIS 0x80B0 #endif #ifndef GL_SHININESS #define GL_SHININESS 0x1601 #endif #ifndef GL_SHORT #define GL_SHORT 0x1402 #endif #ifndef GL_SIGNED_ALPHA8_NV #define GL_SIGNED_ALPHA8_NV 0x8706 #endif #ifndef GL_SIGNED_ALPHA_NV #define GL_SIGNED_ALPHA_NV 0x8705 #endif #ifndef GL_SIGNED_HILO16_NV #define GL_SIGNED_HILO16_NV 0x86FA #endif #ifndef GL_SIGNED_HILO8_NV #define GL_SIGNED_HILO8_NV 0x885F #endif #ifndef GL_SIGNED_HILO_NV #define GL_SIGNED_HILO_NV 0x86F9 #endif #ifndef GL_SIGNED_IDENTITY_NV #define GL_SIGNED_IDENTITY_NV 0x853C #endif #ifndef GL_SIGNED_INTENSITY8_NV #define GL_SIGNED_INTENSITY8_NV 0x8708 #endif #ifndef GL_SIGNED_INTENSITY_NV #define GL_SIGNED_INTENSITY_NV 0x8707 #endif #ifndef GL_SIGNED_LUMINANCE8_ALPHA8_NV #define GL_SIGNED_LUMINANCE8_ALPHA8_NV 0x8704 #endif #ifndef GL_SIGNED_LUMINANCE8_NV #define GL_SIGNED_LUMINANCE8_NV 0x8702 #endif #ifndef GL_SIGNED_LUMINANCE_ALPHA_NV #define GL_SIGNED_LUMINANCE_ALPHA_NV 0x8703 #endif #ifndef GL_SIGNED_LUMINANCE_NV #define GL_SIGNED_LUMINANCE_NV 0x8701 #endif #ifndef GL_SIGNED_NEGATE_NV #define GL_SIGNED_NEGATE_NV 0x853D #endif #ifndef GL_SIGNED_RGB8_NV #define GL_SIGNED_RGB8_NV 0x86FF #endif #ifndef GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV #define GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV 0x870D #endif #ifndef GL_SIGNED_RGBA8_NV #define GL_SIGNED_RGBA8_NV 0x86FC #endif #ifndef GL_SIGNED_RGBA_NV #define GL_SIGNED_RGBA_NV 0x86FB #endif #ifndef GL_SIGNED_RGB_NV #define GL_SIGNED_RGB_NV 0x86FE #endif #ifndef GL_SIGNED_RGB_UNSIGNED_ALPHA_NV #define GL_SIGNED_RGB_UNSIGNED_ALPHA_NV 0x870C #endif #ifndef GL_SINGLE_COLOR #define GL_SINGLE_COLOR 0x81F9 #endif #ifndef GL_SINGLE_COLOR_EXT #define GL_SINGLE_COLOR_EXT 0x81F9 #endif #ifndef GL_SLICE_ACCUM_SUN #define GL_SLICE_ACCUM_SUN 0x85CC #endif #ifndef GL_SLUMINANCE #define GL_SLUMINANCE 0x8C46 #endif #ifndef GL_SLUMINANCE8 #define GL_SLUMINANCE8 0x8C47 #endif #ifndef GL_SLUMINANCE8_ALPHA8 #define GL_SLUMINANCE8_ALPHA8 0x8C45 #endif #ifndef GL_SLUMINANCE8_ALPHA8_EXT #define GL_SLUMINANCE8_ALPHA8_EXT 0x8C45 #endif #ifndef GL_SLUMINANCE8_EXT #define GL_SLUMINANCE8_EXT 0x8C47 #endif #ifndef GL_SLUMINANCE_ALPHA #define GL_SLUMINANCE_ALPHA 0x8C44 #endif #ifndef GL_SLUMINANCE_ALPHA_EXT #define GL_SLUMINANCE_ALPHA_EXT 0x8C44 #endif #ifndef GL_SLUMINANCE_EXT #define GL_SLUMINANCE_EXT 0x8C46 #endif #ifndef GL_SMOOTH #define GL_SMOOTH 0x1D01 #endif #ifndef GL_SMOOTH_LINE_WIDTH_GRANULARITY #define GL_SMOOTH_LINE_WIDTH_GRANULARITY 0x0B23 #endif #ifndef GL_SMOOTH_LINE_WIDTH_RANGE #define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22 #endif #ifndef GL_SMOOTH_POINT_SIZE_GRANULARITY #define GL_SMOOTH_POINT_SIZE_GRANULARITY 0x0B13 #endif #ifndef GL_SMOOTH_POINT_SIZE_RANGE #define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12 #endif #ifndef GL_SOURCE0_ALPHA #define GL_SOURCE0_ALPHA 0x8588 #endif #ifndef GL_SOURCE0_ALPHA_ARB #define GL_SOURCE0_ALPHA_ARB 0x8588 #endif #ifndef GL_SOURCE0_ALPHA_EXT #define GL_SOURCE0_ALPHA_EXT 0x8588 #endif #ifndef GL_SOURCE0_RGB #define GL_SOURCE0_RGB 0x8580 #endif #ifndef GL_SOURCE0_RGB_ARB #define GL_SOURCE0_RGB_ARB 0x8580 #endif #ifndef GL_SOURCE0_RGB_EXT #define GL_SOURCE0_RGB_EXT 0x8580 #endif #ifndef GL_SOURCE1_ALPHA #define GL_SOURCE1_ALPHA 0x8589 #endif #ifndef GL_SOURCE1_ALPHA_ARB #define GL_SOURCE1_ALPHA_ARB 0x8589 #endif #ifndef GL_SOURCE1_ALPHA_EXT #define GL_SOURCE1_ALPHA_EXT 0x8589 #endif #ifndef GL_SOURCE1_RGB #define GL_SOURCE1_RGB 0x8581 #endif #ifndef GL_SOURCE1_RGB_ARB #define GL_SOURCE1_RGB_ARB 0x8581 #endif #ifndef GL_SOURCE1_RGB_EXT #define GL_SOURCE1_RGB_EXT 0x8581 #endif #ifndef GL_SOURCE2_ALPHA #define GL_SOURCE2_ALPHA 0x858A #endif #ifndef GL_SOURCE2_ALPHA_ARB #define GL_SOURCE2_ALPHA_ARB 0x858A #endif #ifndef GL_SOURCE2_ALPHA_EXT #define GL_SOURCE2_ALPHA_EXT 0x858A #endif #ifndef GL_SOURCE2_RGB #define GL_SOURCE2_RGB 0x8582 #endif #ifndef GL_SOURCE2_RGB_ARB #define GL_SOURCE2_RGB_ARB 0x8582 #endif #ifndef GL_SOURCE2_RGB_EXT #define GL_SOURCE2_RGB_EXT 0x8582 #endif #ifndef GL_SOURCE3_ALPHA_NV #define GL_SOURCE3_ALPHA_NV 0x858B #endif #ifndef GL_SOURCE3_RGB_NV #define GL_SOURCE3_RGB_NV 0x8583 #endif #ifndef GL_SPARE0_NV #define GL_SPARE0_NV 0x852E #endif #ifndef GL_SPARE0_PLUS_SECONDARY_COLOR_NV #define GL_SPARE0_PLUS_SECONDARY_COLOR_NV 0x8532 #endif #ifndef GL_SPARE1_NV #define GL_SPARE1_NV 0x852F #endif #ifndef GL_SPECULAR #define GL_SPECULAR 0x1202 #endif #ifndef GL_SPHERE_MAP #define GL_SPHERE_MAP 0x2402 #endif #ifndef GL_SPOT_CUTOFF #define GL_SPOT_CUTOFF 0x1206 #endif #ifndef GL_SPOT_DIRECTION #define GL_SPOT_DIRECTION 0x1204 #endif #ifndef GL_SPOT_EXPONENT #define GL_SPOT_EXPONENT 0x1205 #endif #ifndef GL_SPRITE_AXIAL_SGIX #define GL_SPRITE_AXIAL_SGIX 0x814C #endif #ifndef GL_SPRITE_AXIS_SGIX #define GL_SPRITE_AXIS_SGIX 0x814A #endif #ifndef GL_SPRITE_EYE_ALIGNED_SGIX #define GL_SPRITE_EYE_ALIGNED_SGIX 0x814E #endif #ifndef GL_SPRITE_MODE_SGIX #define GL_SPRITE_MODE_SGIX 0x8149 #endif #ifndef GL_SPRITE_OBJECT_ALIGNED_SGIX #define GL_SPRITE_OBJECT_ALIGNED_SGIX 0x814D #endif #ifndef GL_SPRITE_SGIX #define GL_SPRITE_SGIX 0x8148 #endif #ifndef GL_SPRITE_TRANSLATION_SGIX #define GL_SPRITE_TRANSLATION_SGIX 0x814B #endif #ifndef GL_SRC0_ALPHA #define GL_SRC0_ALPHA GL_SOURCE0_ALPHA #endif #ifndef GL_SRC0_RGB #define GL_SRC0_RGB GL_SOURCE0_RGB #endif #ifndef GL_SRC1_ALPHA #define GL_SRC1_ALPHA GL_SOURCE1_ALPHA #endif #ifndef GL_SRC1_RGB #define GL_SRC1_RGB GL_SOURCE1_RGB #endif #ifndef GL_SRC2_ALPHA #define GL_SRC2_ALPHA GL_SOURCE2_ALPHA #endif #ifndef GL_SRC2_RGB #define GL_SRC2_RGB GL_SOURCE2_RGB #endif #ifndef GL_SRC_ALPHA #define GL_SRC_ALPHA 0x0302 #endif #ifndef GL_SRC_ALPHA_SATURATE #define GL_SRC_ALPHA_SATURATE 0x0308 #endif #ifndef GL_SRC_COLOR #define GL_SRC_COLOR 0x0300 #endif #ifndef GL_SRGB #define GL_SRGB 0x8C40 #endif #ifndef GL_SRGB8 #define GL_SRGB8 0x8C41 #endif #ifndef GL_SRGB8_ALPHA8 #define GL_SRGB8_ALPHA8 0x8C43 #endif #ifndef GL_SRGB8_ALPHA8_EXT #define GL_SRGB8_ALPHA8_EXT 0x8C43 #endif #ifndef GL_SRGB8_EXT #define GL_SRGB8_EXT 0x8C41 #endif #ifndef GL_SRGB_ALPHA #define GL_SRGB_ALPHA 0x8C42 #endif #ifndef GL_SRGB_ALPHA_EXT #define GL_SRGB_ALPHA_EXT 0x8C42 #endif #ifndef GL_SRGB_EXT #define GL_SRGB_EXT 0x8C40 #endif #ifndef GL_STACK_OVERFLOW #define GL_STACK_OVERFLOW 0x0503 #endif #ifndef GL_STACK_UNDERFLOW #define GL_STACK_UNDERFLOW 0x0504 #endif #ifndef GL_STATIC_ATI #define GL_STATIC_ATI 0x8760 #endif #ifndef GL_STATIC_COPY #define GL_STATIC_COPY 0x88E6 #endif #ifndef GL_STATIC_COPY_ARB #define GL_STATIC_COPY_ARB 0x88E6 #endif #ifndef GL_STATIC_DRAW #define GL_STATIC_DRAW 0x88E4 #endif #ifndef GL_STATIC_DRAW_ARB #define GL_STATIC_DRAW_ARB 0x88E4 #endif #ifndef GL_STATIC_READ #define GL_STATIC_READ 0x88E5 #endif #ifndef GL_STATIC_READ_ARB #define GL_STATIC_READ_ARB 0x88E5 #endif #ifndef GL_STENCIL #define GL_STENCIL 0x1802 #endif #ifndef GL_STENCIL_ATTACHMENT #define GL_STENCIL_ATTACHMENT 0x8D20 #endif #ifndef GL_STENCIL_ATTACHMENT_EXT #define GL_STENCIL_ATTACHMENT_EXT 0x8D20 #endif #ifndef GL_STENCIL_BACK_FAIL #define GL_STENCIL_BACK_FAIL 0x8801 #endif #ifndef GL_STENCIL_BACK_FAIL_ATI #define GL_STENCIL_BACK_FAIL_ATI 0x8801 #endif #ifndef GL_STENCIL_BACK_FUNC #define GL_STENCIL_BACK_FUNC 0x8800 #endif #ifndef GL_STENCIL_BACK_FUNC_ATI #define GL_STENCIL_BACK_FUNC_ATI 0x8800 #endif #ifndef GL_STENCIL_BACK_PASS_DEPTH_FAIL #define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802 #endif #ifndef GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI #define GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI 0x8802 #endif #ifndef GL_STENCIL_BACK_PASS_DEPTH_PASS #define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803 #endif #ifndef GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI #define GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI 0x8803 #endif #ifndef GL_STENCIL_BACK_REF #define GL_STENCIL_BACK_REF 0x8CA3 #endif #ifndef GL_STENCIL_BACK_VALUE_MASK #define GL_STENCIL_BACK_VALUE_MASK 0x8CA4 #endif #ifndef GL_STENCIL_BACK_WRITEMASK #define GL_STENCIL_BACK_WRITEMASK 0x8CA5 #endif #ifndef GL_STENCIL_BITS #define GL_STENCIL_BITS 0x0D57 #endif #ifndef GL_STENCIL_BUFFER #define GL_STENCIL_BUFFER 0x8224 #endif #ifndef GL_STENCIL_BUFFER_BIT #define GL_STENCIL_BUFFER_BIT 0x00000400 #endif #ifndef GL_STENCIL_CLEAR_TAG_VALUE_EXT #define GL_STENCIL_CLEAR_TAG_VALUE_EXT 0x88F3 #endif #ifndef GL_STENCIL_CLEAR_VALUE #define GL_STENCIL_CLEAR_VALUE 0x0B91 #endif #ifndef GL_STENCIL_FAIL #define GL_STENCIL_FAIL 0x0B94 #endif #ifndef GL_STENCIL_FUNC #define GL_STENCIL_FUNC 0x0B92 #endif #ifndef GL_STENCIL_INDEX #define GL_STENCIL_INDEX 0x1901 #endif #ifndef GL_STENCIL_INDEX1 #define GL_STENCIL_INDEX1 0x8D46 #endif #ifndef GL_STENCIL_INDEX16 #define GL_STENCIL_INDEX16 0x8D49 #endif #ifndef GL_STENCIL_INDEX16_EXT #define GL_STENCIL_INDEX16_EXT 0x8D49 #endif #ifndef GL_STENCIL_INDEX1_EXT #define GL_STENCIL_INDEX1_EXT 0x8D46 #endif #ifndef GL_STENCIL_INDEX4 #define GL_STENCIL_INDEX4 0x8D47 #endif #ifndef GL_STENCIL_INDEX4_EXT #define GL_STENCIL_INDEX4_EXT 0x8D47 #endif #ifndef GL_STENCIL_INDEX8 #define GL_STENCIL_INDEX8 0x8D48 #endif #ifndef GL_STENCIL_INDEX8_EXT #define GL_STENCIL_INDEX8_EXT 0x8D48 #endif #ifndef GL_STENCIL_PASS_DEPTH_FAIL #define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95 #endif #ifndef GL_STENCIL_PASS_DEPTH_PASS #define GL_STENCIL_PASS_DEPTH_PASS 0x0B96 #endif #ifndef GL_STENCIL_REF #define GL_STENCIL_REF 0x0B97 #endif #ifndef GL_STENCIL_TAG_BITS_EXT #define GL_STENCIL_TAG_BITS_EXT 0x88F2 #endif #ifndef GL_STENCIL_TEST #define GL_STENCIL_TEST 0x0B90 #endif #ifndef GL_STENCIL_TEST_TWO_SIDE_EXT #define GL_STENCIL_TEST_TWO_SIDE_EXT 0x8910 #endif #ifndef GL_STENCIL_VALUE_MASK #define GL_STENCIL_VALUE_MASK 0x0B93 #endif #ifndef GL_STENCIL_WRITEMASK #define GL_STENCIL_WRITEMASK 0x0B98 #endif #ifndef GL_STEREO #define GL_STEREO 0x0C33 #endif #ifndef GL_STORAGE_CACHED_APPLE #define GL_STORAGE_CACHED_APPLE 0x85BE #endif #ifndef GL_STORAGE_SHARED_APPLE #define GL_STORAGE_SHARED_APPLE 0x85BF #endif #ifndef GL_STREAM_COPY #define GL_STREAM_COPY 0x88E2 #endif #ifndef GL_STREAM_COPY_ARB #define GL_STREAM_COPY_ARB 0x88E2 #endif #ifndef GL_STREAM_DRAW #define GL_STREAM_DRAW 0x88E0 #endif #ifndef GL_STREAM_DRAW_ARB #define GL_STREAM_DRAW_ARB 0x88E0 #endif #ifndef GL_STREAM_READ #define GL_STREAM_READ 0x88E1 #endif #ifndef GL_STREAM_READ_ARB #define GL_STREAM_READ_ARB 0x88E1 #endif #ifndef GL_STRICT_DEPTHFUNC_HINT_PGI #define GL_STRICT_DEPTHFUNC_HINT_PGI 0x1A216 #endif #ifndef GL_STRICT_LIGHTING_HINT_PGI #define GL_STRICT_LIGHTING_HINT_PGI 0x1A217 #endif #ifndef GL_STRICT_SCISSOR_HINT_PGI #define GL_STRICT_SCISSOR_HINT_PGI 0x1A218 #endif #ifndef GL_SUBPIXEL_BITS #define GL_SUBPIXEL_BITS 0x0D50 #endif #ifndef GL_SUBTRACT #define GL_SUBTRACT 0x84E7 #endif #ifndef GL_SUBTRACT_ARB #define GL_SUBTRACT_ARB 0x84E7 #endif #ifndef GL_SUB_ATI #define GL_SUB_ATI 0x8965 #endif #ifndef GL_SWIZZLE_STQ_ATI #define GL_SWIZZLE_STQ_ATI 0x8977 #endif #ifndef GL_SWIZZLE_STQ_DQ_ATI #define GL_SWIZZLE_STQ_DQ_ATI 0x8979 #endif #ifndef GL_SWIZZLE_STRQ_ATI #define GL_SWIZZLE_STRQ_ATI 0x897A #endif #ifndef GL_SWIZZLE_STRQ_DQ_ATI #define GL_SWIZZLE_STRQ_DQ_ATI 0x897B #endif #ifndef GL_SWIZZLE_STR_ATI #define GL_SWIZZLE_STR_ATI 0x8976 #endif #ifndef GL_SWIZZLE_STR_DR_ATI #define GL_SWIZZLE_STR_DR_ATI 0x8978 #endif #ifndef GL_T #define GL_T 0x2001 #endif #ifndef GL_T2F_C3F_V3F #define GL_T2F_C3F_V3F 0x2A2A #endif #ifndef GL_T2F_C4F_N3F_V3F #define GL_T2F_C4F_N3F_V3F 0x2A2C #endif #ifndef GL_T2F_C4UB_V3F #define GL_T2F_C4UB_V3F 0x2A29 #endif #ifndef GL_T2F_IUI_N3F_V2F_EXT #define GL_T2F_IUI_N3F_V2F_EXT 0x81B3 #endif #ifndef GL_T2F_IUI_N3F_V3F_EXT #define GL_T2F_IUI_N3F_V3F_EXT 0x81B4 #endif #ifndef GL_T2F_IUI_V2F_EXT #define GL_T2F_IUI_V2F_EXT 0x81B1 #endif #ifndef GL_T2F_IUI_V3F_EXT #define GL_T2F_IUI_V3F_EXT 0x81B2 #endif #ifndef GL_T2F_N3F_V3F #define GL_T2F_N3F_V3F 0x2A2B #endif #ifndef GL_T2F_V3F #define GL_T2F_V3F 0x2A27 #endif #ifndef GL_T4F_C4F_N3F_V4F #define GL_T4F_C4F_N3F_V4F 0x2A2D #endif #ifndef GL_T4F_V4F #define GL_T4F_V4F 0x2A28 #endif #ifndef GL_TABLE_TOO_LARGE #define GL_TABLE_TOO_LARGE 0x8031 #endif #ifndef GL_TABLE_TOO_LARGE_EXT #define GL_TABLE_TOO_LARGE_EXT 0x8031 #endif #ifndef GL_TANGENT_ARRAY_EXT #define GL_TANGENT_ARRAY_EXT 0x8439 #endif #ifndef GL_TANGENT_ARRAY_POINTER_EXT #define GL_TANGENT_ARRAY_POINTER_EXT 0x8442 #endif #ifndef GL_TANGENT_ARRAY_STRIDE_EXT #define GL_TANGENT_ARRAY_STRIDE_EXT 0x843F #endif #ifndef GL_TANGENT_ARRAY_TYPE_EXT #define GL_TANGENT_ARRAY_TYPE_EXT 0x843E #endif #ifndef GL_TEXCOORD1_BIT_PGI #define GL_TEXCOORD1_BIT_PGI 0x10000000 #endif #ifndef GL_TEXCOORD2_BIT_PGI #define GL_TEXCOORD2_BIT_PGI 0x20000000 #endif #ifndef GL_TEXCOORD3_BIT_PGI #define GL_TEXCOORD3_BIT_PGI 0x40000000 #endif #ifndef GL_TEXCOORD4_BIT_PGI #define GL_TEXCOORD4_BIT_PGI 0x80000000 #endif #ifndef GL_TEXTURE #define GL_TEXTURE 0x1702 #endif #ifndef GL_TEXTURE0 #define GL_TEXTURE0 0x84C0 #endif #ifndef GL_TEXTURE0_ARB #define GL_TEXTURE0_ARB 0x84C0 #endif #ifndef GL_TEXTURE1 #define GL_TEXTURE1 0x84C1 #endif #ifndef GL_TEXTURE10 #define GL_TEXTURE10 0x84CA #endif #ifndef GL_TEXTURE10_ARB #define GL_TEXTURE10_ARB 0x84CA #endif #ifndef GL_TEXTURE11 #define GL_TEXTURE11 0x84CB #endif #ifndef GL_TEXTURE11_ARB #define GL_TEXTURE11_ARB 0x84CB #endif #ifndef GL_TEXTURE12 #define GL_TEXTURE12 0x84CC #endif #ifndef GL_TEXTURE12_ARB #define GL_TEXTURE12_ARB 0x84CC #endif #ifndef GL_TEXTURE13 #define GL_TEXTURE13 0x84CD #endif #ifndef GL_TEXTURE13_ARB #define GL_TEXTURE13_ARB 0x84CD #endif #ifndef GL_TEXTURE14 #define GL_TEXTURE14 0x84CE #endif #ifndef GL_TEXTURE14_ARB #define GL_TEXTURE14_ARB 0x84CE #endif #ifndef GL_TEXTURE15 #define GL_TEXTURE15 0x84CF #endif #ifndef GL_TEXTURE15_ARB #define GL_TEXTURE15_ARB 0x84CF #endif #ifndef GL_TEXTURE16 #define GL_TEXTURE16 0x84D0 #endif #ifndef GL_TEXTURE16_ARB #define GL_TEXTURE16_ARB 0x84D0 #endif #ifndef GL_TEXTURE17 #define GL_TEXTURE17 0x84D1 #endif #ifndef GL_TEXTURE17_ARB #define GL_TEXTURE17_ARB 0x84D1 #endif #ifndef GL_TEXTURE18 #define GL_TEXTURE18 0x84D2 #endif #ifndef GL_TEXTURE18_ARB #define GL_TEXTURE18_ARB 0x84D2 #endif #ifndef GL_TEXTURE19 #define GL_TEXTURE19 0x84D3 #endif #ifndef GL_TEXTURE19_ARB #define GL_TEXTURE19_ARB 0x84D3 #endif #ifndef GL_TEXTURE1_ARB #define GL_TEXTURE1_ARB 0x84C1 #endif #ifndef GL_TEXTURE2 #define GL_TEXTURE2 0x84C2 #endif #ifndef GL_TEXTURE20 #define GL_TEXTURE20 0x84D4 #endif #ifndef GL_TEXTURE20_ARB #define GL_TEXTURE20_ARB 0x84D4 #endif #ifndef GL_TEXTURE21 #define GL_TEXTURE21 0x84D5 #endif #ifndef GL_TEXTURE21_ARB #define GL_TEXTURE21_ARB 0x84D5 #endif #ifndef GL_TEXTURE22 #define GL_TEXTURE22 0x84D6 #endif #ifndef GL_TEXTURE22_ARB #define GL_TEXTURE22_ARB 0x84D6 #endif #ifndef GL_TEXTURE23 #define GL_TEXTURE23 0x84D7 #endif #ifndef GL_TEXTURE23_ARB #define GL_TEXTURE23_ARB 0x84D7 #endif #ifndef GL_TEXTURE24 #define GL_TEXTURE24 0x84D8 #endif #ifndef GL_TEXTURE24_ARB #define GL_TEXTURE24_ARB 0x84D8 #endif #ifndef GL_TEXTURE25 #define GL_TEXTURE25 0x84D9 #endif #ifndef GL_TEXTURE25_ARB #define GL_TEXTURE25_ARB 0x84D9 #endif #ifndef GL_TEXTURE26 #define GL_TEXTURE26 0x84DA #endif #ifndef GL_TEXTURE26_ARB #define GL_TEXTURE26_ARB 0x84DA #endif #ifndef GL_TEXTURE27 #define GL_TEXTURE27 0x84DB #endif #ifndef GL_TEXTURE27_ARB #define GL_TEXTURE27_ARB 0x84DB #endif #ifndef GL_TEXTURE28 #define GL_TEXTURE28 0x84DC #endif #ifndef GL_TEXTURE28_ARB #define GL_TEXTURE28_ARB 0x84DC #endif #ifndef GL_TEXTURE29 #define GL_TEXTURE29 0x84DD #endif #ifndef GL_TEXTURE29_ARB #define GL_TEXTURE29_ARB 0x84DD #endif #ifndef GL_TEXTURE2_ARB #define GL_TEXTURE2_ARB 0x84C2 #endif #ifndef GL_TEXTURE3 #define GL_TEXTURE3 0x84C3 #endif #ifndef GL_TEXTURE30 #define GL_TEXTURE30 0x84DE #endif #ifndef GL_TEXTURE30_ARB #define GL_TEXTURE30_ARB 0x84DE #endif #ifndef GL_TEXTURE31 #define GL_TEXTURE31 0x84DF #endif #ifndef GL_TEXTURE31_ARB #define GL_TEXTURE31_ARB 0x84DF #endif #ifndef GL_TEXTURE3_ARB #define GL_TEXTURE3_ARB 0x84C3 #endif #ifndef GL_TEXTURE4 #define GL_TEXTURE4 0x84C4 #endif #ifndef GL_TEXTURE4_ARB #define GL_TEXTURE4_ARB 0x84C4 #endif #ifndef GL_TEXTURE5 #define GL_TEXTURE5 0x84C5 #endif #ifndef GL_TEXTURE5_ARB #define GL_TEXTURE5_ARB 0x84C5 #endif #ifndef GL_TEXTURE6 #define GL_TEXTURE6 0x84C6 #endif #ifndef GL_TEXTURE6_ARB #define GL_TEXTURE6_ARB 0x84C6 #endif #ifndef GL_TEXTURE7 #define GL_TEXTURE7 0x84C7 #endif #ifndef GL_TEXTURE7_ARB #define GL_TEXTURE7_ARB 0x84C7 #endif #ifndef GL_TEXTURE8 #define GL_TEXTURE8 0x84C8 #endif #ifndef GL_TEXTURE8_ARB #define GL_TEXTURE8_ARB 0x84C8 #endif #ifndef GL_TEXTURE9 #define GL_TEXTURE9 0x84C9 #endif #ifndef GL_TEXTURE9_ARB #define GL_TEXTURE9_ARB 0x84C9 #endif #ifndef GL_TEXTURE_1D #define GL_TEXTURE_1D 0x0DE0 #endif #ifndef GL_TEXTURE_1D_ARRAY #define GL_TEXTURE_1D_ARRAY 0x8C18 #endif #ifndef GL_TEXTURE_1D_ARRAY_EXT #define GL_TEXTURE_1D_ARRAY_EXT 0x8C18 #endif #ifndef GL_TEXTURE_1D_BINDING_EXT #define GL_TEXTURE_1D_BINDING_EXT 0x8068 #endif #ifndef GL_TEXTURE_1D_STACK_BINDING_MESAX #define GL_TEXTURE_1D_STACK_BINDING_MESAX 0x875D #endif #ifndef GL_TEXTURE_1D_STACK_MESAX #define GL_TEXTURE_1D_STACK_MESAX 0x8759 #endif #ifndef GL_TEXTURE_2D #define GL_TEXTURE_2D 0x0DE1 #endif #ifndef GL_TEXTURE_2D_ARRAY #define GL_TEXTURE_2D_ARRAY 0x8C1A #endif #ifndef GL_TEXTURE_2D_ARRAY_EXT #define GL_TEXTURE_2D_ARRAY_EXT 0x8C1A #endif #ifndef GL_TEXTURE_2D_BINDING_EXT #define GL_TEXTURE_2D_BINDING_EXT 0x8069 #endif #ifndef GL_TEXTURE_2D_STACK_BINDING_MESAX #define GL_TEXTURE_2D_STACK_BINDING_MESAX 0x875E #endif #ifndef GL_TEXTURE_2D_STACK_MESAX #define GL_TEXTURE_2D_STACK_MESAX 0x875A #endif #ifndef GL_TEXTURE_3D #define GL_TEXTURE_3D 0x806F #endif #ifndef GL_TEXTURE_3D_BINDING_EXT #define GL_TEXTURE_3D_BINDING_EXT 0x806A #endif #ifndef GL_TEXTURE_3D_EXT #define GL_TEXTURE_3D_EXT 0x806F #endif #ifndef GL_TEXTURE_4DSIZE_SGIS #define GL_TEXTURE_4DSIZE_SGIS 0x8136 #endif #ifndef GL_TEXTURE_4D_BINDING_SGIS #define GL_TEXTURE_4D_BINDING_SGIS 0x814F #endif #ifndef GL_TEXTURE_4D_SGIS #define GL_TEXTURE_4D_SGIS 0x8134 #endif #ifndef GL_TEXTURE_ALPHA_SIZE #define GL_TEXTURE_ALPHA_SIZE 0x805F #endif #ifndef GL_TEXTURE_ALPHA_SIZE_EXT #define GL_TEXTURE_ALPHA_SIZE_EXT 0x805F #endif #ifndef GL_TEXTURE_ALPHA_TYPE #define GL_TEXTURE_ALPHA_TYPE 0x8C13 #endif #ifndef GL_TEXTURE_ALPHA_TYPE_ARB #define GL_TEXTURE_ALPHA_TYPE_ARB 0x8C13 #endif #ifndef GL_TEXTURE_APPLICATION_MODE_EXT #define GL_TEXTURE_APPLICATION_MODE_EXT 0x834F #endif #ifndef GL_TEXTURE_BASE_LEVEL #define GL_TEXTURE_BASE_LEVEL 0x813C #endif #ifndef GL_TEXTURE_BASE_LEVEL_SGIS #define GL_TEXTURE_BASE_LEVEL_SGIS 0x813C #endif #ifndef GL_TEXTURE_BINDING_1D #define GL_TEXTURE_BINDING_1D 0x8068 #endif #ifndef GL_TEXTURE_BINDING_1D_ARRAY #define GL_TEXTURE_BINDING_1D_ARRAY 0x8C1C #endif #ifndef GL_TEXTURE_BINDING_1D_ARRAY_EXT #define GL_TEXTURE_BINDING_1D_ARRAY_EXT 0x8C1C #endif #ifndef GL_TEXTURE_BINDING_2D #define GL_TEXTURE_BINDING_2D 0x8069 #endif #ifndef GL_TEXTURE_BINDING_2D_ARRAY #define GL_TEXTURE_BINDING_2D_ARRAY 0x8C1D #endif #ifndef GL_TEXTURE_BINDING_2D_ARRAY_EXT #define GL_TEXTURE_BINDING_2D_ARRAY_EXT 0x8C1D #endif #ifndef GL_TEXTURE_BINDING_3D #define GL_TEXTURE_BINDING_3D 0x806A #endif #ifndef GL_TEXTURE_BINDING_BUFFER_ARB #define GL_TEXTURE_BINDING_BUFFER_ARB 0x8C2C #endif #ifndef GL_TEXTURE_BINDING_BUFFER_EXT #define GL_TEXTURE_BINDING_BUFFER_EXT 0x8C2C #endif #ifndef GL_TEXTURE_BINDING_CUBE_MAP #define GL_TEXTURE_BINDING_CUBE_MAP 0x8514 #endif #ifndef GL_TEXTURE_BINDING_CUBE_MAP_ARB #define GL_TEXTURE_BINDING_CUBE_MAP_ARB 0x8514 #endif #ifndef GL_TEXTURE_BINDING_CUBE_MAP_EXT #define GL_TEXTURE_BINDING_CUBE_MAP_EXT 0x8514 #endif #ifndef GL_TEXTURE_BINDING_RECTANGLE_ARB #define GL_TEXTURE_BINDING_RECTANGLE_ARB 0x84F6 #endif #ifndef GL_TEXTURE_BINDING_RECTANGLE_NV #define GL_TEXTURE_BINDING_RECTANGLE_NV 0x84F6 #endif #ifndef GL_TEXTURE_BINDING_RENDERBUFFER_NV #define GL_TEXTURE_BINDING_RENDERBUFFER_NV 0x8E53 #endif #ifndef GL_TEXTURE_BIT #define GL_TEXTURE_BIT 0x00040000 #endif #ifndef GL_TEXTURE_BLUE_SIZE #define GL_TEXTURE_BLUE_SIZE 0x805E #endif #ifndef GL_TEXTURE_BLUE_SIZE_EXT #define GL_TEXTURE_BLUE_SIZE_EXT 0x805E #endif #ifndef GL_TEXTURE_BLUE_TYPE #define GL_TEXTURE_BLUE_TYPE 0x8C12 #endif #ifndef GL_TEXTURE_BLUE_TYPE_ARB #define GL_TEXTURE_BLUE_TYPE_ARB 0x8C12 #endif #ifndef GL_TEXTURE_BORDER #define GL_TEXTURE_BORDER 0x1005 #endif #ifndef GL_TEXTURE_BORDER_COLOR #define GL_TEXTURE_BORDER_COLOR 0x1004 #endif #ifndef GL_TEXTURE_BORDER_VALUES_NV #define GL_TEXTURE_BORDER_VALUES_NV 0x871A #endif #ifndef GL_TEXTURE_BUFFER_ARB #define GL_TEXTURE_BUFFER_ARB 0x8C2A #endif #ifndef GL_TEXTURE_BUFFER_DATA_STORE_BINDING_ARB #define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_ARB 0x8C2D #endif #ifndef GL_TEXTURE_BUFFER_DATA_STORE_BINDING_EXT #define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_EXT 0x8C2D #endif #ifndef GL_TEXTURE_BUFFER_EXT #define GL_TEXTURE_BUFFER_EXT 0x8C2A #endif #ifndef GL_TEXTURE_BUFFER_FORMAT_ARB #define GL_TEXTURE_BUFFER_FORMAT_ARB 0x8C2E #endif #ifndef GL_TEXTURE_BUFFER_FORMAT_EXT #define GL_TEXTURE_BUFFER_FORMAT_EXT 0x8C2E #endif #ifndef GL_TEXTURE_CLIPMAP_CENTER_SGIX #define GL_TEXTURE_CLIPMAP_CENTER_SGIX 0x8171 #endif #ifndef GL_TEXTURE_CLIPMAP_DEPTH_SGIX #define GL_TEXTURE_CLIPMAP_DEPTH_SGIX 0x8176 #endif #ifndef GL_TEXTURE_CLIPMAP_FRAME_SGIX #define GL_TEXTURE_CLIPMAP_FRAME_SGIX 0x8172 #endif #ifndef GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX #define GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX 0x8175 #endif #ifndef GL_TEXTURE_CLIPMAP_OFFSET_SGIX #define GL_TEXTURE_CLIPMAP_OFFSET_SGIX 0x8173 #endif #ifndef GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX #define GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX 0x8174 #endif #ifndef GL_TEXTURE_COLOR_TABLE_SGI #define GL_TEXTURE_COLOR_TABLE_SGI 0x80BC #endif #ifndef GL_TEXTURE_COLOR_WRITEMASK_SGIS #define GL_TEXTURE_COLOR_WRITEMASK_SGIS 0x81EF #endif #ifndef GL_TEXTURE_COMPARE_FAIL_VALUE_ARB #define GL_TEXTURE_COMPARE_FAIL_VALUE_ARB 0x80BF #endif #ifndef GL_TEXTURE_COMPARE_FUNC #define GL_TEXTURE_COMPARE_FUNC 0x884D #endif #ifndef GL_TEXTURE_COMPARE_FUNC_ARB #define GL_TEXTURE_COMPARE_FUNC_ARB 0x884D #endif #ifndef GL_TEXTURE_COMPARE_MODE #define GL_TEXTURE_COMPARE_MODE 0x884C #endif #ifndef GL_TEXTURE_COMPARE_MODE_ARB #define GL_TEXTURE_COMPARE_MODE_ARB 0x884C #endif #ifndef GL_TEXTURE_COMPARE_OPERATOR_SGIX #define GL_TEXTURE_COMPARE_OPERATOR_SGIX 0x819B #endif #ifndef GL_TEXTURE_COMPARE_SGIX #define GL_TEXTURE_COMPARE_SGIX 0x819A #endif #ifndef GL_TEXTURE_COMPONENTS #define GL_TEXTURE_COMPONENTS 0x1003 #endif #ifndef GL_TEXTURE_COMPRESSED #define GL_TEXTURE_COMPRESSED 0x86A1 #endif #ifndef GL_TEXTURE_COMPRESSED_ARB #define GL_TEXTURE_COMPRESSED_ARB 0x86A1 #endif #ifndef GL_TEXTURE_COMPRESSED_IMAGE_SIZE #define GL_TEXTURE_COMPRESSED_IMAGE_SIZE 0x86A0 #endif #ifndef GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB #define GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB 0x86A0 #endif #ifndef GL_TEXTURE_COMPRESSION_HINT #define GL_TEXTURE_COMPRESSION_HINT 0x84EF #endif #ifndef GL_TEXTURE_COMPRESSION_HINT_ARB #define GL_TEXTURE_COMPRESSION_HINT_ARB 0x84EF #endif #ifndef GL_TEXTURE_CONSTANT_DATA_SUNX #define GL_TEXTURE_CONSTANT_DATA_SUNX 0x81D6 #endif #ifndef GL_TEXTURE_COORD_ARRAY #define GL_TEXTURE_COORD_ARRAY 0x8078 #endif #ifndef GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING #define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING 0x889A #endif #ifndef GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB #define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB 0x889A #endif #ifndef GL_TEXTURE_COORD_ARRAY_COUNT_EXT #define GL_TEXTURE_COORD_ARRAY_COUNT_EXT 0x808B #endif #ifndef GL_TEXTURE_COORD_ARRAY_EXT #define GL_TEXTURE_COORD_ARRAY_EXT 0x8078 #endif #ifndef GL_TEXTURE_COORD_ARRAY_LIST_IBM #define GL_TEXTURE_COORD_ARRAY_LIST_IBM 103074 #endif #ifndef GL_TEXTURE_COORD_ARRAY_LIST_STRIDE_IBM #define GL_TEXTURE_COORD_ARRAY_LIST_STRIDE_IBM 103084 #endif #ifndef GL_TEXTURE_COORD_ARRAY_PARALLEL_POINTERS_INTEL #define GL_TEXTURE_COORD_ARRAY_PARALLEL_POINTERS_INTEL 0x83F8 #endif #ifndef GL_TEXTURE_COORD_ARRAY_POINTER #define GL_TEXTURE_COORD_ARRAY_POINTER 0x8092 #endif #ifndef GL_TEXTURE_COORD_ARRAY_POINTER_EXT #define GL_TEXTURE_COORD_ARRAY_POINTER_EXT 0x8092 #endif #ifndef GL_TEXTURE_COORD_ARRAY_SIZE #define GL_TEXTURE_COORD_ARRAY_SIZE 0x8088 #endif #ifndef GL_TEXTURE_COORD_ARRAY_SIZE_EXT #define GL_TEXTURE_COORD_ARRAY_SIZE_EXT 0x8088 #endif #ifndef GL_TEXTURE_COORD_ARRAY_STRIDE #define GL_TEXTURE_COORD_ARRAY_STRIDE 0x808A #endif #ifndef GL_TEXTURE_COORD_ARRAY_STRIDE_EXT #define GL_TEXTURE_COORD_ARRAY_STRIDE_EXT 0x808A #endif #ifndef GL_TEXTURE_COORD_ARRAY_TYPE #define GL_TEXTURE_COORD_ARRAY_TYPE 0x8089 #endif #ifndef GL_TEXTURE_COORD_ARRAY_TYPE_EXT #define GL_TEXTURE_COORD_ARRAY_TYPE_EXT 0x8089 #endif #ifndef GL_TEXTURE_COORD_NV #define GL_TEXTURE_COORD_NV 0x8C79 #endif #ifndef GL_TEXTURE_CUBE_MAP #define GL_TEXTURE_CUBE_MAP 0x8513 #endif #ifndef GL_TEXTURE_CUBE_MAP_ARB #define GL_TEXTURE_CUBE_MAP_ARB 0x8513 #endif #ifndef GL_TEXTURE_CUBE_MAP_EXT #define GL_TEXTURE_CUBE_MAP_EXT 0x8513 #endif #ifndef GL_TEXTURE_CUBE_MAP_NEGATIVE_X #define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516 #endif #ifndef GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB #define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x8516 #endif #ifndef GL_TEXTURE_CUBE_MAP_NEGATIVE_X_EXT #define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_EXT 0x8516 #endif #ifndef GL_TEXTURE_CUBE_MAP_NEGATIVE_Y #define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518 #endif #ifndef GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB #define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x8518 #endif #ifndef GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_EXT #define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_EXT 0x8518 #endif #ifndef GL_TEXTURE_CUBE_MAP_NEGATIVE_Z #define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A #endif #ifndef GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB #define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x851A #endif #ifndef GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_EXT #define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_EXT 0x851A #endif #ifndef GL_TEXTURE_CUBE_MAP_POSITIVE_X #define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515 #endif #ifndef GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB #define GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x8515 #endif #ifndef GL_TEXTURE_CUBE_MAP_POSITIVE_X_EXT #define GL_TEXTURE_CUBE_MAP_POSITIVE_X_EXT 0x8515 #endif #ifndef GL_TEXTURE_CUBE_MAP_POSITIVE_Y #define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517 #endif #ifndef GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB #define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x8517 #endif #ifndef GL_TEXTURE_CUBE_MAP_POSITIVE_Y_EXT #define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_EXT 0x8517 #endif #ifndef GL_TEXTURE_CUBE_MAP_POSITIVE_Z #define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519 #endif #ifndef GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB #define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x8519 #endif #ifndef GL_TEXTURE_CUBE_MAP_POSITIVE_Z_EXT #define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_EXT 0x8519 #endif #ifndef GL_TEXTURE_DEFORMATION_BIT_SGIX #define GL_TEXTURE_DEFORMATION_BIT_SGIX 0x00000001 #endif #ifndef GL_TEXTURE_DEFORMATION_SGIX #define GL_TEXTURE_DEFORMATION_SGIX 0x8195 #endif #ifndef GL_TEXTURE_DEPTH #define GL_TEXTURE_DEPTH 0x8071 #endif #ifndef GL_TEXTURE_DEPTH_EXT #define GL_TEXTURE_DEPTH_EXT 0x8071 #endif #ifndef GL_TEXTURE_DEPTH_SIZE #define GL_TEXTURE_DEPTH_SIZE 0x884A #endif #ifndef GL_TEXTURE_DEPTH_SIZE_ARB #define GL_TEXTURE_DEPTH_SIZE_ARB 0x884A #endif #ifndef GL_TEXTURE_DEPTH_TYPE #define GL_TEXTURE_DEPTH_TYPE 0x8C16 #endif #ifndef GL_TEXTURE_DEPTH_TYPE_ARB #define GL_TEXTURE_DEPTH_TYPE_ARB 0x8C16 #endif #ifndef GL_TEXTURE_DS_SIZE_NV #define GL_TEXTURE_DS_SIZE_NV 0x871D #endif #ifndef GL_TEXTURE_DT_SIZE_NV #define GL_TEXTURE_DT_SIZE_NV 0x871E #endif #ifndef GL_TEXTURE_ENV #define GL_TEXTURE_ENV 0x2300 #endif #ifndef GL_TEXTURE_ENV_BIAS_SGIX #define GL_TEXTURE_ENV_BIAS_SGIX 0x80BE #endif #ifndef GL_TEXTURE_ENV_COLOR #define GL_TEXTURE_ENV_COLOR 0x2201 #endif #ifndef GL_TEXTURE_ENV_MODE #define GL_TEXTURE_ENV_MODE 0x2200 #endif #ifndef GL_TEXTURE_FILTER4_SIZE_SGIS #define GL_TEXTURE_FILTER4_SIZE_SGIS 0x8147 #endif #ifndef GL_TEXTURE_FILTER_CONTROL #define GL_TEXTURE_FILTER_CONTROL 0x8500 #endif #ifndef GL_TEXTURE_FILTER_CONTROL_EXT #define GL_TEXTURE_FILTER_CONTROL_EXT 0x8500 #endif #ifndef GL_TEXTURE_FLOAT_COMPONENTS_NV #define GL_TEXTURE_FLOAT_COMPONENTS_NV 0x888C #endif #ifndef GL_TEXTURE_GEN_MODE #define GL_TEXTURE_GEN_MODE 0x2500 #endif #ifndef GL_TEXTURE_GEN_Q #define GL_TEXTURE_GEN_Q 0x0C63 #endif #ifndef GL_TEXTURE_GEN_R #define GL_TEXTURE_GEN_R 0x0C62 #endif #ifndef GL_TEXTURE_GEN_S #define GL_TEXTURE_GEN_S 0x0C60 #endif #ifndef GL_TEXTURE_GEN_T #define GL_TEXTURE_GEN_T 0x0C61 #endif #ifndef GL_TEXTURE_GEQUAL_R_SGIX #define GL_TEXTURE_GEQUAL_R_SGIX 0x819D #endif #ifndef GL_TEXTURE_GREEN_SIZE #define GL_TEXTURE_GREEN_SIZE 0x805D #endif #ifndef GL_TEXTURE_GREEN_SIZE_EXT #define GL_TEXTURE_GREEN_SIZE_EXT 0x805D #endif #ifndef GL_TEXTURE_GREEN_TYPE #define GL_TEXTURE_GREEN_TYPE 0x8C11 #endif #ifndef GL_TEXTURE_GREEN_TYPE_ARB #define GL_TEXTURE_GREEN_TYPE_ARB 0x8C11 #endif #ifndef GL_TEXTURE_HEIGHT #define GL_TEXTURE_HEIGHT 0x1001 #endif #ifndef GL_TEXTURE_HI_SIZE_NV #define GL_TEXTURE_HI_SIZE_NV 0x871B #endif #ifndef GL_TEXTURE_INDEX_SIZE_EXT #define GL_TEXTURE_INDEX_SIZE_EXT 0x80ED #endif #ifndef GL_TEXTURE_INTENSITY_SIZE #define GL_TEXTURE_INTENSITY_SIZE 0x8061 #endif #ifndef GL_TEXTURE_INTENSITY_SIZE_EXT #define GL_TEXTURE_INTENSITY_SIZE_EXT 0x8061 #endif #ifndef GL_TEXTURE_INTENSITY_TYPE #define GL_TEXTURE_INTENSITY_TYPE 0x8C15 #endif #ifndef GL_TEXTURE_INTENSITY_TYPE_ARB #define GL_TEXTURE_INTENSITY_TYPE_ARB 0x8C15 #endif #ifndef GL_TEXTURE_INTERNAL_FORMAT #define GL_TEXTURE_INTERNAL_FORMAT 0x1003 #endif #ifndef GL_TEXTURE_LEQUAL_R_SGIX #define GL_TEXTURE_LEQUAL_R_SGIX 0x819C #endif #ifndef GL_TEXTURE_LIGHTING_MODE_HP #define GL_TEXTURE_LIGHTING_MODE_HP 0x8167 #endif #ifndef GL_TEXTURE_LIGHT_EXT #define GL_TEXTURE_LIGHT_EXT 0x8350 #endif #ifndef GL_TEXTURE_LOD_BIAS #define GL_TEXTURE_LOD_BIAS 0x8501 #endif #ifndef GL_TEXTURE_LOD_BIAS_EXT #define GL_TEXTURE_LOD_BIAS_EXT 0x8501 #endif #ifndef GL_TEXTURE_LOD_BIAS_R_SGIX #define GL_TEXTURE_LOD_BIAS_R_SGIX 0x8190 #endif #ifndef GL_TEXTURE_LOD_BIAS_S_SGIX #define GL_TEXTURE_LOD_BIAS_S_SGIX 0x818E #endif #ifndef GL_TEXTURE_LOD_BIAS_T_SGIX #define GL_TEXTURE_LOD_BIAS_T_SGIX 0x818F #endif #ifndef GL_TEXTURE_LO_SIZE_NV #define GL_TEXTURE_LO_SIZE_NV 0x871C #endif #ifndef GL_TEXTURE_LUMINANCE_SIZE #define GL_TEXTURE_LUMINANCE_SIZE 0x8060 #endif #ifndef GL_TEXTURE_LUMINANCE_SIZE_EXT #define GL_TEXTURE_LUMINANCE_SIZE_EXT 0x8060 #endif #ifndef GL_TEXTURE_LUMINANCE_TYPE #define GL_TEXTURE_LUMINANCE_TYPE 0x8C14 #endif #ifndef GL_TEXTURE_LUMINANCE_TYPE_ARB #define GL_TEXTURE_LUMINANCE_TYPE_ARB 0x8C14 #endif #ifndef GL_TEXTURE_MAG_FILTER #define GL_TEXTURE_MAG_FILTER 0x2800 #endif #ifndef GL_TEXTURE_MAG_SIZE_NV #define GL_TEXTURE_MAG_SIZE_NV 0x871F #endif #ifndef GL_TEXTURE_MATERIAL_FACE_EXT #define GL_TEXTURE_MATERIAL_FACE_EXT 0x8351 #endif #ifndef GL_TEXTURE_MATERIAL_PARAMETER_EXT #define GL_TEXTURE_MATERIAL_PARAMETER_EXT 0x8352 #endif #ifndef GL_TEXTURE_MATRIX #define GL_TEXTURE_MATRIX 0x0BA8 #endif #ifndef GL_TEXTURE_MAX_ANISOTROPY_EXT #define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE #endif #ifndef GL_TEXTURE_MAX_CLAMP_R_SGIX #define GL_TEXTURE_MAX_CLAMP_R_SGIX 0x836B #endif #ifndef GL_TEXTURE_MAX_CLAMP_S_SGIX #define GL_TEXTURE_MAX_CLAMP_S_SGIX 0x8369 #endif #ifndef GL_TEXTURE_MAX_CLAMP_T_SGIX #define GL_TEXTURE_MAX_CLAMP_T_SGIX 0x836A #endif #ifndef GL_TEXTURE_MAX_LEVEL #define GL_TEXTURE_MAX_LEVEL 0x813D #endif #ifndef GL_TEXTURE_MAX_LEVEL_SGIS #define GL_TEXTURE_MAX_LEVEL_SGIS 0x813D #endif #ifndef GL_TEXTURE_MAX_LOD #define GL_TEXTURE_MAX_LOD 0x813B #endif #ifndef GL_TEXTURE_MAX_LOD_SGIS #define GL_TEXTURE_MAX_LOD_SGIS 0x813B #endif #ifndef GL_TEXTURE_MIN_FILTER #define GL_TEXTURE_MIN_FILTER 0x2801 #endif #ifndef GL_TEXTURE_MIN_LOD #define GL_TEXTURE_MIN_LOD 0x813A #endif #ifndef GL_TEXTURE_MIN_LOD_SGIS #define GL_TEXTURE_MIN_LOD_SGIS 0x813A #endif #ifndef GL_TEXTURE_MULTI_BUFFER_HINT_SGIX #define GL_TEXTURE_MULTI_BUFFER_HINT_SGIX 0x812E #endif #ifndef GL_TEXTURE_NORMAL_EXT #define GL_TEXTURE_NORMAL_EXT 0x85AF #endif #ifndef GL_TEXTURE_POST_SPECULAR_HP #define GL_TEXTURE_POST_SPECULAR_HP 0x8168 #endif #ifndef GL_TEXTURE_PRE_SPECULAR_HP #define GL_TEXTURE_PRE_SPECULAR_HP 0x8169 #endif #ifndef GL_TEXTURE_PRIORITY #define GL_TEXTURE_PRIORITY 0x8066 #endif #ifndef GL_TEXTURE_PRIORITY_EXT #define GL_TEXTURE_PRIORITY_EXT 0x8066 #endif #ifndef GL_TEXTURE_RECTANGLE_ARB #define GL_TEXTURE_RECTANGLE_ARB 0x84F5 #endif #ifndef GL_TEXTURE_RECTANGLE_NV #define GL_TEXTURE_RECTANGLE_NV 0x84F5 #endif #ifndef GL_TEXTURE_RED_SIZE #define GL_TEXTURE_RED_SIZE 0x805C #endif #ifndef GL_TEXTURE_RED_SIZE_EXT #define GL_TEXTURE_RED_SIZE_EXT 0x805C #endif #ifndef GL_TEXTURE_RED_TYPE #define GL_TEXTURE_RED_TYPE 0x8C10 #endif #ifndef GL_TEXTURE_RED_TYPE_ARB #define GL_TEXTURE_RED_TYPE_ARB 0x8C10 #endif #ifndef GL_TEXTURE_RENDERBUFFER_DATA_STORE_BINDING_NV #define GL_TEXTURE_RENDERBUFFER_DATA_STORE_BINDING_NV 0x8E54 #endif #ifndef GL_TEXTURE_RENDERBUFFER_NV #define GL_TEXTURE_RENDERBUFFER_NV 0x8E55 #endif #ifndef GL_TEXTURE_RESIDENT #define GL_TEXTURE_RESIDENT 0x8067 #endif #ifndef GL_TEXTURE_RESIDENT_EXT #define GL_TEXTURE_RESIDENT_EXT 0x8067 #endif #ifndef GL_TEXTURE_SHADER_NV #define GL_TEXTURE_SHADER_NV 0x86DE #endif #ifndef GL_TEXTURE_SHARED_SIZE #define GL_TEXTURE_SHARED_SIZE 0x8C3F #endif #ifndef GL_TEXTURE_SHARED_SIZE_EXT #define GL_TEXTURE_SHARED_SIZE_EXT 0x8C3F #endif #ifndef GL_TEXTURE_STACK_DEPTH #define GL_TEXTURE_STACK_DEPTH 0x0BA5 #endif #ifndef GL_TEXTURE_STENCIL_SIZE #define GL_TEXTURE_STENCIL_SIZE 0x88F1 #endif #ifndef GL_TEXTURE_STENCIL_SIZE_EXT #define GL_TEXTURE_STENCIL_SIZE_EXT 0x88F1 #endif #ifndef GL_TEXTURE_SWIZZLE_A_EXT #define GL_TEXTURE_SWIZZLE_A_EXT 0x8E45 #endif #ifndef GL_TEXTURE_SWIZZLE_B_EXT #define GL_TEXTURE_SWIZZLE_B_EXT 0x8E44 #endif #ifndef GL_TEXTURE_SWIZZLE_G_EXT #define GL_TEXTURE_SWIZZLE_G_EXT 0x8E43 #endif #ifndef GL_TEXTURE_SWIZZLE_RGBA_EXT #define GL_TEXTURE_SWIZZLE_RGBA_EXT 0x8E46 #endif #ifndef GL_TEXTURE_SWIZZLE_R_EXT #define GL_TEXTURE_SWIZZLE_R_EXT 0x8E42 #endif #ifndef GL_TEXTURE_TOO_LARGE_EXT #define GL_TEXTURE_TOO_LARGE_EXT 0x8065 #endif #ifndef GL_TEXTURE_UNSIGNED_REMAP_MODE_NV #define GL_TEXTURE_UNSIGNED_REMAP_MODE_NV 0x888F #endif #ifndef GL_TEXTURE_WIDTH #define GL_TEXTURE_WIDTH 0x1000 #endif #ifndef GL_TEXTURE_WRAP_Q_SGIS #define GL_TEXTURE_WRAP_Q_SGIS 0x8137 #endif #ifndef GL_TEXTURE_WRAP_R #define GL_TEXTURE_WRAP_R 0x8072 #endif #ifndef GL_TEXTURE_WRAP_R_EXT #define GL_TEXTURE_WRAP_R_EXT 0x8072 #endif #ifndef GL_TEXTURE_WRAP_S #define GL_TEXTURE_WRAP_S 0x2802 #endif #ifndef GL_TEXTURE_WRAP_T #define GL_TEXTURE_WRAP_T 0x2803 #endif #ifndef GL_TEXT_FRAGMENT_SHADER_ATI #define GL_TEXT_FRAGMENT_SHADER_ATI 0x8200 #endif #ifndef GL_TIME_ELAPSED_EXT #define GL_TIME_ELAPSED_EXT 0x88BF #endif #ifndef GL_TRACK_MATRIX_NV #define GL_TRACK_MATRIX_NV 0x8648 #endif #ifndef GL_TRACK_MATRIX_TRANSFORM_NV #define GL_TRACK_MATRIX_TRANSFORM_NV 0x8649 #endif #ifndef GL_TRANSFORM_BIT #define GL_TRANSFORM_BIT 0x00001000 #endif #ifndef GL_TRANSFORM_FEEDBACK_ATTRIBS_NV #define GL_TRANSFORM_FEEDBACK_ATTRIBS_NV 0x8C7E #endif #ifndef GL_TRANSFORM_FEEDBACK_BINDING_NV #define GL_TRANSFORM_FEEDBACK_BINDING_NV 0x8E25 #endif #ifndef GL_TRANSFORM_FEEDBACK_BUFFER #define GL_TRANSFORM_FEEDBACK_BUFFER 0x8C8E #endif #ifndef GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE_NV #define GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE_NV 0x8E24 #endif #ifndef GL_TRANSFORM_FEEDBACK_BUFFER_BINDING #define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING 0x8C8F #endif #ifndef GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_EXT #define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_EXT 0x8C8F #endif #ifndef GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_NV #define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_NV 0x8C8F #endif #ifndef GL_TRANSFORM_FEEDBACK_BUFFER_EXT #define GL_TRANSFORM_FEEDBACK_BUFFER_EXT 0x8C8E #endif #ifndef GL_TRANSFORM_FEEDBACK_BUFFER_MODE #define GL_TRANSFORM_FEEDBACK_BUFFER_MODE 0x8C7F #endif #ifndef GL_TRANSFORM_FEEDBACK_BUFFER_MODE_EXT #define GL_TRANSFORM_FEEDBACK_BUFFER_MODE_EXT 0x8C7F #endif #ifndef GL_TRANSFORM_FEEDBACK_BUFFER_MODE_NV #define GL_TRANSFORM_FEEDBACK_BUFFER_MODE_NV 0x8C7F #endif #ifndef GL_TRANSFORM_FEEDBACK_BUFFER_NV #define GL_TRANSFORM_FEEDBACK_BUFFER_NV 0x8C8E #endif #ifndef GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED_NV #define GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED_NV 0x8E23 #endif #ifndef GL_TRANSFORM_FEEDBACK_BUFFER_SIZE #define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE 0x8C85 #endif #ifndef GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_EXT #define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_EXT 0x8C85 #endif #ifndef GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_NV #define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_NV 0x8C85 #endif #ifndef GL_TRANSFORM_FEEDBACK_BUFFER_START #define GL_TRANSFORM_FEEDBACK_BUFFER_START 0x8C84 #endif #ifndef GL_TRANSFORM_FEEDBACK_BUFFER_START_EXT #define GL_TRANSFORM_FEEDBACK_BUFFER_START_EXT 0x8C84 #endif #ifndef GL_TRANSFORM_FEEDBACK_BUFFER_START_NV #define GL_TRANSFORM_FEEDBACK_BUFFER_START_NV 0x8C84 #endif #ifndef GL_TRANSFORM_FEEDBACK_NV #define GL_TRANSFORM_FEEDBACK_NV 0x8E22 #endif #ifndef GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN #define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN 0x8C88 #endif #ifndef GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_EXT #define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_EXT 0x8C88 #endif #ifndef GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_NV #define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_NV 0x8C88 #endif #ifndef GL_TRANSFORM_FEEDBACK_RECORD_NV #define GL_TRANSFORM_FEEDBACK_RECORD_NV 0x8C86 #endif #ifndef GL_TRANSFORM_FEEDBACK_VARYINGS #define GL_TRANSFORM_FEEDBACK_VARYINGS 0x8C83 #endif #ifndef GL_TRANSFORM_FEEDBACK_VARYINGS_EXT #define GL_TRANSFORM_FEEDBACK_VARYINGS_EXT 0x8C83 #endif #ifndef GL_TRANSFORM_FEEDBACK_VARYINGS_NV #define GL_TRANSFORM_FEEDBACK_VARYINGS_NV 0x8C83 #endif #ifndef GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH #define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH 0x8C76 #endif #ifndef GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH_EXT #define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH_EXT 0x8C76 #endif #ifndef GL_TRANSFORM_HINT_APPLE #define GL_TRANSFORM_HINT_APPLE 0x85B1 #endif #ifndef GL_TRANSPOSE_COLOR_MATRIX #define GL_TRANSPOSE_COLOR_MATRIX 0x84E6 #endif #ifndef GL_TRANSPOSE_COLOR_MATRIX_ARB #define GL_TRANSPOSE_COLOR_MATRIX_ARB 0x84E6 #endif #ifndef GL_TRANSPOSE_CURRENT_MATRIX_ARB #define GL_TRANSPOSE_CURRENT_MATRIX_ARB 0x88B7 #endif #ifndef GL_TRANSPOSE_MODELVIEW_MATRIX #define GL_TRANSPOSE_MODELVIEW_MATRIX 0x84E3 #endif #ifndef GL_TRANSPOSE_MODELVIEW_MATRIX_ARB #define GL_TRANSPOSE_MODELVIEW_MATRIX_ARB 0x84E3 #endif #ifndef GL_TRANSPOSE_NV #define GL_TRANSPOSE_NV 0x862C #endif #ifndef GL_TRANSPOSE_PROGRAM_MATRIX_EXT #define GL_TRANSPOSE_PROGRAM_MATRIX_EXT 0x8E2E #endif #ifndef GL_TRANSPOSE_PROJECTION_MATRIX #define GL_TRANSPOSE_PROJECTION_MATRIX 0x84E4 #endif #ifndef GL_TRANSPOSE_PROJECTION_MATRIX_ARB #define GL_TRANSPOSE_PROJECTION_MATRIX_ARB 0x84E4 #endif #ifndef GL_TRANSPOSE_TEXTURE_MATRIX #define GL_TRANSPOSE_TEXTURE_MATRIX 0x84E5 #endif #ifndef GL_TRANSPOSE_TEXTURE_MATRIX_ARB #define GL_TRANSPOSE_TEXTURE_MATRIX_ARB 0x84E5 #endif #ifndef GL_TRIANGLES #define GL_TRIANGLES 0x0004 #endif #ifndef GL_TRIANGLES_ADJACENCY_ARB #define GL_TRIANGLES_ADJACENCY_ARB 0x000C #endif #ifndef GL_TRIANGLES_ADJACENCY_EXT #define GL_TRIANGLES_ADJACENCY_EXT 0x000C #endif #ifndef GL_TRIANGLE_FAN #define GL_TRIANGLE_FAN 0x0006 #endif #ifndef GL_TRIANGLE_LIST_SUN #define GL_TRIANGLE_LIST_SUN 0x81D7 #endif #ifndef GL_TRIANGLE_MESH_SUN #define GL_TRIANGLE_MESH_SUN 0x8615 #endif #ifndef GL_TRIANGLE_STRIP #define GL_TRIANGLE_STRIP 0x0005 #endif #ifndef GL_TRIANGLE_STRIP_ADJACENCY_ARB #define GL_TRIANGLE_STRIP_ADJACENCY_ARB 0x000D #endif #ifndef GL_TRIANGLE_STRIP_ADJACENCY_EXT #define GL_TRIANGLE_STRIP_ADJACENCY_EXT 0x000D #endif #ifndef GL_TYPE_RGBA_FLOAT_ATI #define GL_TYPE_RGBA_FLOAT_ATI 0x8820 #endif #ifndef GL_UNIFORM_BUFFER_BINDING_EXT #define GL_UNIFORM_BUFFER_BINDING_EXT 0x8DEF #endif #ifndef GL_UNIFORM_BUFFER_EXT #define GL_UNIFORM_BUFFER_EXT 0x8DEE #endif #ifndef GL_UNPACK_ALIGNMENT #define GL_UNPACK_ALIGNMENT 0x0CF5 #endif #ifndef GL_UNPACK_CLIENT_STORAGE_APPLE #define GL_UNPACK_CLIENT_STORAGE_APPLE 0x85B2 #endif #ifndef GL_UNPACK_CMYK_HINT_EXT #define GL_UNPACK_CMYK_HINT_EXT 0x800F #endif #ifndef GL_UNPACK_CONSTANT_DATA_SUNX #define GL_UNPACK_CONSTANT_DATA_SUNX 0x81D5 #endif #ifndef GL_UNPACK_IMAGE_DEPTH_SGIS #define GL_UNPACK_IMAGE_DEPTH_SGIS 0x8133 #endif #ifndef GL_UNPACK_IMAGE_HEIGHT #define GL_UNPACK_IMAGE_HEIGHT 0x806E #endif #ifndef GL_UNPACK_IMAGE_HEIGHT_EXT #define GL_UNPACK_IMAGE_HEIGHT_EXT 0x806E #endif #ifndef GL_UNPACK_LSB_FIRST #define GL_UNPACK_LSB_FIRST 0x0CF1 #endif #ifndef GL_UNPACK_RESAMPLE_OML #define GL_UNPACK_RESAMPLE_OML 0x8985 #endif #ifndef GL_UNPACK_RESAMPLE_SGIX #define GL_UNPACK_RESAMPLE_SGIX 0x842D #endif #ifndef GL_UNPACK_ROW_LENGTH #define GL_UNPACK_ROW_LENGTH 0x0CF2 #endif #ifndef GL_UNPACK_SKIP_IMAGES #define GL_UNPACK_SKIP_IMAGES 0x806D #endif #ifndef GL_UNPACK_SKIP_IMAGES_EXT #define GL_UNPACK_SKIP_IMAGES_EXT 0x806D #endif #ifndef GL_UNPACK_SKIP_PIXELS #define GL_UNPACK_SKIP_PIXELS 0x0CF4 #endif #ifndef GL_UNPACK_SKIP_ROWS #define GL_UNPACK_SKIP_ROWS 0x0CF3 #endif #ifndef GL_UNPACK_SKIP_VOLUMES_SGIS #define GL_UNPACK_SKIP_VOLUMES_SGIS 0x8132 #endif #ifndef GL_UNPACK_SUBSAMPLE_RATE_SGIX #define GL_UNPACK_SUBSAMPLE_RATE_SGIX 0x85A1 #endif #ifndef GL_UNPACK_SWAP_BYTES #define GL_UNPACK_SWAP_BYTES 0x0CF0 #endif #ifndef GL_UNSIGNED_BYTE #define GL_UNSIGNED_BYTE 0x1401 #endif #ifndef GL_UNSIGNED_BYTE_2_3_3_REV #define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362 #endif #ifndef GL_UNSIGNED_BYTE_2_3_3_REV_EXT #define GL_UNSIGNED_BYTE_2_3_3_REV_EXT 0x8362 #endif #ifndef GL_UNSIGNED_BYTE_3_3_2 #define GL_UNSIGNED_BYTE_3_3_2 0x8032 #endif #ifndef GL_UNSIGNED_BYTE_3_3_2_EXT #define GL_UNSIGNED_BYTE_3_3_2_EXT 0x8032 #endif #ifndef GL_UNSIGNED_IDENTITY_NV #define GL_UNSIGNED_IDENTITY_NV 0x8536 #endif #ifndef GL_UNSIGNED_INT #define GL_UNSIGNED_INT 0x1405 #endif #ifndef GL_UNSIGNED_INT_10F_11F_11F_REV #define GL_UNSIGNED_INT_10F_11F_11F_REV 0x8C3B #endif #ifndef GL_UNSIGNED_INT_10F_11F_11F_REV_EXT #define GL_UNSIGNED_INT_10F_11F_11F_REV_EXT 0x8C3B #endif #ifndef GL_UNSIGNED_INT_10_10_10_2 #define GL_UNSIGNED_INT_10_10_10_2 0x8036 #endif #ifndef GL_UNSIGNED_INT_10_10_10_2_EXT #define GL_UNSIGNED_INT_10_10_10_2_EXT 0x8036 #endif #ifndef GL_UNSIGNED_INT_24_8 #define GL_UNSIGNED_INT_24_8 0x84FA #endif #ifndef GL_UNSIGNED_INT_24_8_EXT #define GL_UNSIGNED_INT_24_8_EXT 0x84FA #endif #ifndef GL_UNSIGNED_INT_24_8_NV #define GL_UNSIGNED_INT_24_8_NV 0x84FA #endif #ifndef GL_UNSIGNED_INT_2_10_10_10_REV #define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368 #endif #ifndef GL_UNSIGNED_INT_2_10_10_10_REV_EXT #define GL_UNSIGNED_INT_2_10_10_10_REV_EXT 0x8368 #endif #ifndef GL_UNSIGNED_INT_5_9_9_9_REV #define GL_UNSIGNED_INT_5_9_9_9_REV 0x8C3E #endif #ifndef GL_UNSIGNED_INT_5_9_9_9_REV_EXT #define GL_UNSIGNED_INT_5_9_9_9_REV_EXT 0x8C3E #endif #ifndef GL_UNSIGNED_INT_8_8_8_8 #define GL_UNSIGNED_INT_8_8_8_8 0x8035 #endif #ifndef GL_UNSIGNED_INT_8_8_8_8_EXT #define GL_UNSIGNED_INT_8_8_8_8_EXT 0x8035 #endif #ifndef GL_UNSIGNED_INT_8_8_8_8_REV #define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367 #endif #ifndef GL_UNSIGNED_INT_8_8_8_8_REV_EXT #define GL_UNSIGNED_INT_8_8_8_8_REV_EXT 0x8367 #endif #ifndef GL_UNSIGNED_INT_8_8_S8_S8_REV_NV #define GL_UNSIGNED_INT_8_8_S8_S8_REV_NV 0x86DB #endif #ifndef GL_UNSIGNED_INT_S8_S8_8_8_NV #define GL_UNSIGNED_INT_S8_S8_8_8_NV 0x86DA #endif #ifndef GL_UNSIGNED_INT_SAMPLER_1D #define GL_UNSIGNED_INT_SAMPLER_1D 0x8DD1 #endif #ifndef GL_UNSIGNED_INT_SAMPLER_1D_ARRAY #define GL_UNSIGNED_INT_SAMPLER_1D_ARRAY 0x8DD6 #endif #ifndef GL_UNSIGNED_INT_SAMPLER_1D_ARRAY_EXT #define GL_UNSIGNED_INT_SAMPLER_1D_ARRAY_EXT 0x8DD6 #endif #ifndef GL_UNSIGNED_INT_SAMPLER_1D_EXT #define GL_UNSIGNED_INT_SAMPLER_1D_EXT 0x8DD1 #endif #ifndef GL_UNSIGNED_INT_SAMPLER_2D #define GL_UNSIGNED_INT_SAMPLER_2D 0x8DD2 #endif #ifndef GL_UNSIGNED_INT_SAMPLER_2D_ARRAY #define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY 0x8DD7 #endif #ifndef GL_UNSIGNED_INT_SAMPLER_2D_ARRAY_EXT #define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY_EXT 0x8DD7 #endif #ifndef GL_UNSIGNED_INT_SAMPLER_2D_EXT #define GL_UNSIGNED_INT_SAMPLER_2D_EXT 0x8DD2 #endif #ifndef GL_UNSIGNED_INT_SAMPLER_2D_RECT_EXT #define GL_UNSIGNED_INT_SAMPLER_2D_RECT_EXT 0x8DD5 #endif #ifndef GL_UNSIGNED_INT_SAMPLER_3D #define GL_UNSIGNED_INT_SAMPLER_3D 0x8DD3 #endif #ifndef GL_UNSIGNED_INT_SAMPLER_3D_EXT #define GL_UNSIGNED_INT_SAMPLER_3D_EXT 0x8DD3 #endif #ifndef GL_UNSIGNED_INT_SAMPLER_BUFFER_EXT #define GL_UNSIGNED_INT_SAMPLER_BUFFER_EXT 0x8DD8 #endif #ifndef GL_UNSIGNED_INT_SAMPLER_CUBE #define GL_UNSIGNED_INT_SAMPLER_CUBE 0x8DD4 #endif #ifndef GL_UNSIGNED_INT_SAMPLER_CUBE_EXT #define GL_UNSIGNED_INT_SAMPLER_CUBE_EXT 0x8DD4 #endif #ifndef GL_UNSIGNED_INT_SAMPLER_RENDERBUFFER_NV #define GL_UNSIGNED_INT_SAMPLER_RENDERBUFFER_NV 0x8E58 #endif #ifndef GL_UNSIGNED_INT_VEC2 #define GL_UNSIGNED_INT_VEC2 0x8DC6 #endif #ifndef GL_UNSIGNED_INT_VEC2_EXT #define GL_UNSIGNED_INT_VEC2_EXT 0x8DC6 #endif #ifndef GL_UNSIGNED_INT_VEC3 #define GL_UNSIGNED_INT_VEC3 0x8DC7 #endif #ifndef GL_UNSIGNED_INT_VEC3_EXT #define GL_UNSIGNED_INT_VEC3_EXT 0x8DC7 #endif #ifndef GL_UNSIGNED_INT_VEC4 #define GL_UNSIGNED_INT_VEC4 0x8DC8 #endif #ifndef GL_UNSIGNED_INT_VEC4_EXT #define GL_UNSIGNED_INT_VEC4_EXT 0x8DC8 #endif #ifndef GL_UNSIGNED_INVERT_NV #define GL_UNSIGNED_INVERT_NV 0x8537 #endif #ifndef GL_UNSIGNED_NORMALIZED #define GL_UNSIGNED_NORMALIZED 0x8C17 #endif #ifndef GL_UNSIGNED_NORMALIZED_ARB #define GL_UNSIGNED_NORMALIZED_ARB 0x8C17 #endif #ifndef GL_UNSIGNED_SHORT #define GL_UNSIGNED_SHORT 0x1403 #endif #ifndef GL_UNSIGNED_SHORT_1_5_5_5_REV #define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366 #endif #ifndef GL_UNSIGNED_SHORT_1_5_5_5_REV_EXT #define GL_UNSIGNED_SHORT_1_5_5_5_REV_EXT 0x8366 #endif #ifndef GL_UNSIGNED_SHORT_4_4_4_4 #define GL_UNSIGNED_SHORT_4_4_4_4 0x8033 #endif #ifndef GL_UNSIGNED_SHORT_4_4_4_4_EXT #define GL_UNSIGNED_SHORT_4_4_4_4_EXT 0x8033 #endif #ifndef GL_UNSIGNED_SHORT_4_4_4_4_REV #define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365 #endif #ifndef GL_UNSIGNED_SHORT_4_4_4_4_REV_EXT #define GL_UNSIGNED_SHORT_4_4_4_4_REV_EXT 0x8365 #endif #ifndef GL_UNSIGNED_SHORT_5_5_5_1 #define GL_UNSIGNED_SHORT_5_5_5_1 0x8034 #endif #ifndef GL_UNSIGNED_SHORT_5_5_5_1_EXT #define GL_UNSIGNED_SHORT_5_5_5_1_EXT 0x8034 #endif #ifndef GL_UNSIGNED_SHORT_5_6_5 #define GL_UNSIGNED_SHORT_5_6_5 0x8363 #endif #ifndef GL_UNSIGNED_SHORT_5_6_5_EXT #define GL_UNSIGNED_SHORT_5_6_5_EXT 0x8363 #endif #ifndef GL_UNSIGNED_SHORT_5_6_5_REV #define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364 #endif #ifndef GL_UNSIGNED_SHORT_5_6_5_REV_EXT #define GL_UNSIGNED_SHORT_5_6_5_REV_EXT 0x8364 #endif #ifndef GL_UNSIGNED_SHORT_8_8_APPLE #define GL_UNSIGNED_SHORT_8_8_APPLE 0x85BA #endif #ifndef GL_UNSIGNED_SHORT_8_8_MESA #define GL_UNSIGNED_SHORT_8_8_MESA 0x85BA #endif #ifndef GL_UNSIGNED_SHORT_8_8_REV_APPLE #define GL_UNSIGNED_SHORT_8_8_REV_APPLE 0x85BB #endif #ifndef GL_UNSIGNED_SHORT_8_8_REV_MESA #define GL_UNSIGNED_SHORT_8_8_REV_MESA 0x85BB #endif #ifndef GL_UPPER_LEFT #define GL_UPPER_LEFT 0x8CA2 #endif #ifndef GL_V2F #define GL_V2F 0x2A20 #endif #ifndef GL_V3F #define GL_V3F 0x2A21 #endif #ifndef GL_VALIDATE_STATUS #define GL_VALIDATE_STATUS 0x8B83 #endif #ifndef GL_VARIABLE_A_NV #define GL_VARIABLE_A_NV 0x8523 #endif #ifndef GL_VARIABLE_B_NV #define GL_VARIABLE_B_NV 0x8524 #endif #ifndef GL_VARIABLE_C_NV #define GL_VARIABLE_C_NV 0x8525 #endif #ifndef GL_VARIABLE_D_NV #define GL_VARIABLE_D_NV 0x8526 #endif #ifndef GL_VARIABLE_E_NV #define GL_VARIABLE_E_NV 0x8527 #endif #ifndef GL_VARIABLE_F_NV #define GL_VARIABLE_F_NV 0x8528 #endif #ifndef GL_VARIABLE_G_NV #define GL_VARIABLE_G_NV 0x8529 #endif #ifndef GL_VARIANT_ARRAY_EXT #define GL_VARIANT_ARRAY_EXT 0x87E8 #endif #ifndef GL_VARIANT_ARRAY_POINTER_EXT #define GL_VARIANT_ARRAY_POINTER_EXT 0x87E9 #endif #ifndef GL_VARIANT_ARRAY_STRIDE_EXT #define GL_VARIANT_ARRAY_STRIDE_EXT 0x87E6 #endif #ifndef GL_VARIANT_ARRAY_TYPE_EXT #define GL_VARIANT_ARRAY_TYPE_EXT 0x87E7 #endif #ifndef GL_VARIANT_DATATYPE_EXT #define GL_VARIANT_DATATYPE_EXT 0x87E5 #endif #ifndef GL_VARIANT_EXT #define GL_VARIANT_EXT 0x87C1 #endif #ifndef GL_VARIANT_VALUE_EXT #define GL_VARIANT_VALUE_EXT 0x87E4 #endif #ifndef GL_VECTOR_EXT #define GL_VECTOR_EXT 0x87BF #endif #ifndef GL_VENDOR #define GL_VENDOR 0x1F00 #endif #ifndef GL_VERSION #define GL_VERSION 0x1F02 #endif #ifndef GL_VERSION_1_1 #define GL_VERSION_1_1 1 #endif #ifndef GL_VERSION_1_2 #define GL_VERSION_1_2 1 #endif #ifndef GL_VERSION_1_3 #define GL_VERSION_1_3 1 #endif #ifndef GL_VERSION_1_4 #define GL_VERSION_1_4 1 #endif #ifndef GL_VERSION_1_5 #define GL_VERSION_1_5 1 #endif #ifndef GL_VERSION_2_0 #define GL_VERSION_2_0 1 #endif #ifndef GL_VERSION_2_1 #define GL_VERSION_2_1 1 #endif #ifndef GL_VERSION_3_0 #define GL_VERSION_3_0 1 #endif #ifndef GL_VERTEX23_BIT_PGI #define GL_VERTEX23_BIT_PGI 0x00000004 #endif #ifndef GL_VERTEX4_BIT_PGI #define GL_VERTEX4_BIT_PGI 0x00000008 #endif #ifndef GL_VERTEX_ARRAY #define GL_VERTEX_ARRAY 0x8074 #endif #ifndef GL_VERTEX_ARRAY_BINDING #define GL_VERTEX_ARRAY_BINDING 0x85B5 #endif #ifndef GL_VERTEX_ARRAY_BINDING_APPLE #define GL_VERTEX_ARRAY_BINDING_APPLE 0x85B5 #endif #ifndef GL_VERTEX_ARRAY_BUFFER_BINDING #define GL_VERTEX_ARRAY_BUFFER_BINDING 0x8896 #endif #ifndef GL_VERTEX_ARRAY_BUFFER_BINDING_ARB #define GL_VERTEX_ARRAY_BUFFER_BINDING_ARB 0x8896 #endif #ifndef GL_VERTEX_ARRAY_COUNT_EXT #define GL_VERTEX_ARRAY_COUNT_EXT 0x807D #endif #ifndef GL_VERTEX_ARRAY_EXT #define GL_VERTEX_ARRAY_EXT 0x8074 #endif #ifndef GL_VERTEX_ARRAY_LIST_IBM #define GL_VERTEX_ARRAY_LIST_IBM 103070 #endif #ifndef GL_VERTEX_ARRAY_LIST_STRIDE_IBM #define GL_VERTEX_ARRAY_LIST_STRIDE_IBM 103080 #endif #ifndef GL_VERTEX_ARRAY_PARALLEL_POINTERS_INTEL #define GL_VERTEX_ARRAY_PARALLEL_POINTERS_INTEL 0x83F5 #endif #ifndef GL_VERTEX_ARRAY_POINTER #define GL_VERTEX_ARRAY_POINTER 0x808E #endif #ifndef GL_VERTEX_ARRAY_POINTER_EXT #define GL_VERTEX_ARRAY_POINTER_EXT 0x808E #endif #ifndef GL_VERTEX_ARRAY_RANGE_APPLE #define GL_VERTEX_ARRAY_RANGE_APPLE 0x851D #endif #ifndef GL_VERTEX_ARRAY_RANGE_LENGTH_APPLE #define GL_VERTEX_ARRAY_RANGE_LENGTH_APPLE 0x851E #endif #ifndef GL_VERTEX_ARRAY_RANGE_LENGTH_NV #define GL_VERTEX_ARRAY_RANGE_LENGTH_NV 0x851E #endif #ifndef GL_VERTEX_ARRAY_RANGE_NV #define GL_VERTEX_ARRAY_RANGE_NV 0x851D #endif #ifndef GL_VERTEX_ARRAY_RANGE_POINTER_APPLE #define GL_VERTEX_ARRAY_RANGE_POINTER_APPLE 0x8521 #endif #ifndef GL_VERTEX_ARRAY_RANGE_POINTER_NV #define GL_VERTEX_ARRAY_RANGE_POINTER_NV 0x8521 #endif #ifndef GL_VERTEX_ARRAY_RANGE_VALID_NV #define GL_VERTEX_ARRAY_RANGE_VALID_NV 0x851F #endif #ifndef GL_VERTEX_ARRAY_RANGE_WITHOUT_FLUSH_NV #define GL_VERTEX_ARRAY_RANGE_WITHOUT_FLUSH_NV 0x8533 #endif #ifndef GL_VERTEX_ARRAY_SIZE #define GL_VERTEX_ARRAY_SIZE 0x807A #endif #ifndef GL_VERTEX_ARRAY_SIZE_EXT #define GL_VERTEX_ARRAY_SIZE_EXT 0x807A #endif #ifndef GL_VERTEX_ARRAY_STORAGE_HINT_APPLE #define GL_VERTEX_ARRAY_STORAGE_HINT_APPLE 0x851F #endif #ifndef GL_VERTEX_ARRAY_STRIDE #define GL_VERTEX_ARRAY_STRIDE 0x807C #endif #ifndef GL_VERTEX_ARRAY_STRIDE_EXT #define GL_VERTEX_ARRAY_STRIDE_EXT 0x807C #endif #ifndef GL_VERTEX_ARRAY_TYPE #define GL_VERTEX_ARRAY_TYPE 0x807B #endif #ifndef GL_VERTEX_ARRAY_TYPE_EXT #define GL_VERTEX_ARRAY_TYPE_EXT 0x807B #endif #ifndef GL_VERTEX_ATTRIB_ARRAY0_NV #define GL_VERTEX_ATTRIB_ARRAY0_NV 0x8650 #endif #ifndef GL_VERTEX_ATTRIB_ARRAY10_NV #define GL_VERTEX_ATTRIB_ARRAY10_NV 0x865A #endif #ifndef GL_VERTEX_ATTRIB_ARRAY11_NV #define GL_VERTEX_ATTRIB_ARRAY11_NV 0x865B #endif #ifndef GL_VERTEX_ATTRIB_ARRAY12_NV #define GL_VERTEX_ATTRIB_ARRAY12_NV 0x865C #endif #ifndef GL_VERTEX_ATTRIB_ARRAY13_NV #define GL_VERTEX_ATTRIB_ARRAY13_NV 0x865D #endif #ifndef GL_VERTEX_ATTRIB_ARRAY14_NV #define GL_VERTEX_ATTRIB_ARRAY14_NV 0x865E #endif #ifndef GL_VERTEX_ATTRIB_ARRAY15_NV #define GL_VERTEX_ATTRIB_ARRAY15_NV 0x865F #endif #ifndef GL_VERTEX_ATTRIB_ARRAY1_NV #define GL_VERTEX_ATTRIB_ARRAY1_NV 0x8651 #endif #ifndef GL_VERTEX_ATTRIB_ARRAY2_NV #define GL_VERTEX_ATTRIB_ARRAY2_NV 0x8652 #endif #ifndef GL_VERTEX_ATTRIB_ARRAY3_NV #define GL_VERTEX_ATTRIB_ARRAY3_NV 0x8653 #endif #ifndef GL_VERTEX_ATTRIB_ARRAY4_NV #define GL_VERTEX_ATTRIB_ARRAY4_NV 0x8654 #endif #ifndef GL_VERTEX_ATTRIB_ARRAY5_NV #define GL_VERTEX_ATTRIB_ARRAY5_NV 0x8655 #endif #ifndef GL_VERTEX_ATTRIB_ARRAY6_NV #define GL_VERTEX_ATTRIB_ARRAY6_NV 0x8656 #endif #ifndef GL_VERTEX_ATTRIB_ARRAY7_NV #define GL_VERTEX_ATTRIB_ARRAY7_NV 0x8657 #endif #ifndef GL_VERTEX_ATTRIB_ARRAY8_NV #define GL_VERTEX_ATTRIB_ARRAY8_NV 0x8658 #endif #ifndef GL_VERTEX_ATTRIB_ARRAY9_NV #define GL_VERTEX_ATTRIB_ARRAY9_NV 0x8659 #endif #ifndef GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING #define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F #endif #ifndef GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB #define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB 0x889F #endif #ifndef GL_VERTEX_ATTRIB_ARRAY_ENABLED #define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622 #endif #ifndef GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB #define GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB 0x8622 #endif #ifndef GL_VERTEX_ATTRIB_ARRAY_INTEGER #define GL_VERTEX_ATTRIB_ARRAY_INTEGER 0x88FD #endif #ifndef GL_VERTEX_ATTRIB_ARRAY_INTEGER_NV #define GL_VERTEX_ATTRIB_ARRAY_INTEGER_NV 0x88FD #endif #ifndef GL_VERTEX_ATTRIB_ARRAY_NORMALIZED #define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A #endif #ifndef GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB #define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB 0x886A #endif #ifndef GL_VERTEX_ATTRIB_ARRAY_POINTER #define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645 #endif #ifndef GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB #define GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB 0x8645 #endif #ifndef GL_VERTEX_ATTRIB_ARRAY_SIZE #define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623 #endif #ifndef GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB #define GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB 0x8623 #endif #ifndef GL_VERTEX_ATTRIB_ARRAY_STRIDE #define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624 #endif #ifndef GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB #define GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB 0x8624 #endif #ifndef GL_VERTEX_ATTRIB_ARRAY_TYPE #define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625 #endif #ifndef GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB #define GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB 0x8625 #endif #ifndef GL_VERTEX_BLEND_ARB #define GL_VERTEX_BLEND_ARB 0x86A7 #endif #ifndef GL_VERTEX_CONSISTENT_HINT_PGI #define GL_VERTEX_CONSISTENT_HINT_PGI 0x1A22B #endif #ifndef GL_VERTEX_DATA_HINT_PGI #define GL_VERTEX_DATA_HINT_PGI 0x1A22A #endif #ifndef GL_VERTEX_ID_NV #define GL_VERTEX_ID_NV 0x8C7B #endif #ifndef GL_VERTEX_PRECLIP_HINT_SGIX #define GL_VERTEX_PRECLIP_HINT_SGIX 0x83EF #endif #ifndef GL_VERTEX_PRECLIP_SGIX #define GL_VERTEX_PRECLIP_SGIX 0x83EE #endif #ifndef GL_VERTEX_PROGRAM_ARB #define GL_VERTEX_PROGRAM_ARB 0x8620 #endif #ifndef GL_VERTEX_PROGRAM_BINDING_NV #define GL_VERTEX_PROGRAM_BINDING_NV 0x864A #endif #ifndef GL_VERTEX_PROGRAM_NV #define GL_VERTEX_PROGRAM_NV 0x8620 #endif #ifndef GL_VERTEX_PROGRAM_PARAMETER_BUFFER_NV #define GL_VERTEX_PROGRAM_PARAMETER_BUFFER_NV 0x8DA2 #endif #ifndef GL_VERTEX_PROGRAM_POINT_SIZE #define GL_VERTEX_PROGRAM_POINT_SIZE 0x8642 #endif #ifndef GL_VERTEX_PROGRAM_POINT_SIZE_ARB #define GL_VERTEX_PROGRAM_POINT_SIZE_ARB 0x8642 #endif #ifndef GL_VERTEX_PROGRAM_POINT_SIZE_NV #define GL_VERTEX_PROGRAM_POINT_SIZE_NV 0x8642 #endif #ifndef GL_VERTEX_PROGRAM_TWO_SIDE #define GL_VERTEX_PROGRAM_TWO_SIDE 0x8643 #endif #ifndef GL_VERTEX_PROGRAM_TWO_SIDE_ARB #define GL_VERTEX_PROGRAM_TWO_SIDE_ARB 0x8643 #endif #ifndef GL_VERTEX_PROGRAM_TWO_SIDE_NV #define GL_VERTEX_PROGRAM_TWO_SIDE_NV 0x8643 #endif #ifndef GL_VERTEX_SHADER #define GL_VERTEX_SHADER 0x8B31 #endif #ifndef GL_VERTEX_SHADER_ARB #define GL_VERTEX_SHADER_ARB 0x8B31 #endif #ifndef GL_VERTEX_SHADER_BINDING_EXT #define GL_VERTEX_SHADER_BINDING_EXT 0x8781 #endif #ifndef GL_VERTEX_SHADER_EXT #define GL_VERTEX_SHADER_EXT 0x8780 #endif #ifndef GL_VERTEX_SHADER_INSTRUCTIONS_EXT #define GL_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CF #endif #ifndef GL_VERTEX_SHADER_INVARIANTS_EXT #define GL_VERTEX_SHADER_INVARIANTS_EXT 0x87D1 #endif #ifndef GL_VERTEX_SHADER_LOCALS_EXT #define GL_VERTEX_SHADER_LOCALS_EXT 0x87D3 #endif #ifndef GL_VERTEX_SHADER_LOCAL_CONSTANTS_EXT #define GL_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87D2 #endif #ifndef GL_VERTEX_SHADER_OPTIMIZED_EXT #define GL_VERTEX_SHADER_OPTIMIZED_EXT 0x87D4 #endif #ifndef GL_VERTEX_SHADER_VARIANTS_EXT #define GL_VERTEX_SHADER_VARIANTS_EXT 0x87D0 #endif #ifndef GL_VERTEX_SOURCE_ATI #define GL_VERTEX_SOURCE_ATI 0x8774 #endif #ifndef GL_VERTEX_STATE_PROGRAM_NV #define GL_VERTEX_STATE_PROGRAM_NV 0x8621 #endif #ifndef GL_VERTEX_STREAM0_ATI #define GL_VERTEX_STREAM0_ATI 0x876C #endif #ifndef GL_VERTEX_STREAM1_ATI #define GL_VERTEX_STREAM1_ATI 0x876D #endif #ifndef GL_VERTEX_STREAM2_ATI #define GL_VERTEX_STREAM2_ATI 0x876E #endif #ifndef GL_VERTEX_STREAM3_ATI #define GL_VERTEX_STREAM3_ATI 0x876F #endif #ifndef GL_VERTEX_STREAM4_ATI #define GL_VERTEX_STREAM4_ATI 0x8770 #endif #ifndef GL_VERTEX_STREAM5_ATI #define GL_VERTEX_STREAM5_ATI 0x8771 #endif #ifndef GL_VERTEX_STREAM6_ATI #define GL_VERTEX_STREAM6_ATI 0x8772 #endif #ifndef GL_VERTEX_STREAM7_ATI #define GL_VERTEX_STREAM7_ATI 0x8773 #endif #ifndef GL_VERTEX_WEIGHTING_EXT #define GL_VERTEX_WEIGHTING_EXT 0x8509 #endif #ifndef GL_VERTEX_WEIGHT_ARRAY_EXT #define GL_VERTEX_WEIGHT_ARRAY_EXT 0x850C #endif #ifndef GL_VERTEX_WEIGHT_ARRAY_POINTER_EXT #define GL_VERTEX_WEIGHT_ARRAY_POINTER_EXT 0x8510 #endif #ifndef GL_VERTEX_WEIGHT_ARRAY_SIZE_EXT #define GL_VERTEX_WEIGHT_ARRAY_SIZE_EXT 0x850D #endif #ifndef GL_VERTEX_WEIGHT_ARRAY_STRIDE_EXT #define GL_VERTEX_WEIGHT_ARRAY_STRIDE_EXT 0x850F #endif #ifndef GL_VERTEX_WEIGHT_ARRAY_TYPE_EXT #define GL_VERTEX_WEIGHT_ARRAY_TYPE_EXT 0x850E #endif #ifndef GL_VIBRANCE_BIAS_NV #define GL_VIBRANCE_BIAS_NV 0x8719 #endif #ifndef GL_VIBRANCE_SCALE_NV #define GL_VIBRANCE_SCALE_NV 0x8713 #endif #ifndef GL_VIEWPORT #define GL_VIEWPORT 0x0BA2 #endif #ifndef GL_VIEWPORT_BIT #define GL_VIEWPORT_BIT 0x00000800 #endif #ifndef GL_WEIGHT_ARRAY_ARB #define GL_WEIGHT_ARRAY_ARB 0x86AD #endif #ifndef GL_WEIGHT_ARRAY_BUFFER_BINDING #define GL_WEIGHT_ARRAY_BUFFER_BINDING 0x889E #endif #ifndef GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB #define GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB 0x889E #endif #ifndef GL_WEIGHT_ARRAY_POINTER_ARB #define GL_WEIGHT_ARRAY_POINTER_ARB 0x86AC #endif #ifndef GL_WEIGHT_ARRAY_SIZE_ARB #define GL_WEIGHT_ARRAY_SIZE_ARB 0x86AB #endif #ifndef GL_WEIGHT_ARRAY_STRIDE_ARB #define GL_WEIGHT_ARRAY_STRIDE_ARB 0x86AA #endif #ifndef GL_WEIGHT_ARRAY_TYPE_ARB #define GL_WEIGHT_ARRAY_TYPE_ARB 0x86A9 #endif #ifndef GL_WEIGHT_SUM_UNITY_ARB #define GL_WEIGHT_SUM_UNITY_ARB 0x86A6 #endif #ifndef GL_WIDE_LINE_HINT_PGI #define GL_WIDE_LINE_HINT_PGI 0x1A222 #endif #ifndef GL_WRAP_BORDER_SUN #define GL_WRAP_BORDER_SUN 0x81D4 #endif #ifndef GL_WRITE_ONLY #define GL_WRITE_ONLY 0x88B9 #endif #ifndef GL_WRITE_ONLY_ARB #define GL_WRITE_ONLY_ARB 0x88B9 #endif #ifndef GL_WRITE_PIXEL_DATA_RANGE_LENGTH_NV #define GL_WRITE_PIXEL_DATA_RANGE_LENGTH_NV 0x887A #endif #ifndef GL_WRITE_PIXEL_DATA_RANGE_NV #define GL_WRITE_PIXEL_DATA_RANGE_NV 0x8878 #endif #ifndef GL_WRITE_PIXEL_DATA_RANGE_POINTER_NV #define GL_WRITE_PIXEL_DATA_RANGE_POINTER_NV 0x887C #endif #ifndef GL_W_EXT #define GL_W_EXT 0x87D8 #endif #ifndef GL_XOR #define GL_XOR 0x1506 #endif #ifndef GL_X_EXT #define GL_X_EXT 0x87D5 #endif #ifndef GL_YCBCR_422_APPLE #define GL_YCBCR_422_APPLE 0x85B9 #endif #ifndef GL_YCBCR_MESA #define GL_YCBCR_MESA 0x8757 #endif #ifndef GL_YCRCBA_SGIX #define GL_YCRCBA_SGIX 0x8319 #endif #ifndef GL_YCRCB_422_SGIX #define GL_YCRCB_422_SGIX 0x81BB #endif #ifndef GL_YCRCB_444_SGIX #define GL_YCRCB_444_SGIX 0x81BC #endif #ifndef GL_YCRCB_SGIX #define GL_YCRCB_SGIX 0x8318 #endif #ifndef GL_Y_EXT #define GL_Y_EXT 0x87D6 #endif #ifndef GL_ZERO #define GL_ZERO 0 #endif #ifndef GL_ZERO_EXT #define GL_ZERO_EXT 0x87DD #endif #ifndef GL_ZOOM_X #define GL_ZOOM_X 0x0D16 #endif #ifndef GL_ZOOM_Y #define GL_ZOOM_Y 0x0D17 #endif #ifndef GL_Z_EXT #define GL_Z_EXT 0x87D7 #endif ruby-opengl-0.60.1.orig/Rakefile0000644000000000000000000001245411377006423015154 0ustar rootroot#-*-ruby-*- # # Copyright (C) 2006 John M. Gabriele # # This program is distributed under the terms of the MIT license. # See the included MIT-LICENSE file for the terms of this license. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. begin require 'rubygems' rescue LoadError nil end require 'rake' require 'rake/clean' require 'rake/gempackagetask' require 'rake/testtask' require 'mkrf/rakehelper' # Generate html docs from the markdown source and upload to the site. # All doc files that are destined for the website have filenames that # end in .txt. WEBSITE_MKDN = FileList['./doc/*.txt'] << 'README.txt' NICE_HTML_DOCS = WEBSITE_MKDN.ext('html') # defines columns in the HTML extension list GLEXT_VERSIONS = ["svn","0.60","0.50"] CLEAN.include("ext/gl*/Rakefile", "ext/*/mkrf.log", "ext/*/*.so", "ext/**/*.bundle", "lib/*.so", "lib/*.bundle", "ext/*/*.o{,bj}", "ext/*/*.lib", "ext/*/*.exp", "ext/*/*.pdb", "pkg") CLOBBER.include("*.plain", "doc/*.plain", "doc/*.snip", "*.html", "doc/*.html", "website/*.html", "website/images/*") # Make sure these files aren't deleted in a clobber op CLOBBER.exclude("website/images/tab_bottom.gif") CLOBBER.exclude("website/images/*.jpg") setup_extension('gl', 'gl') setup_extension('glu', 'glu') setup_extension('glut', 'glut') case RUBY_PLATFORM when /(:?mswin|mingw)/ desc 'Does a full win32 compile' task :default do exts = ["gl","glu","glut"] exts.each do |ext| Dir.chdir("ext\\#{ext}") do sh "ruby mkrf_conf.rb" sh "call rake --nosearch" sh "copy #{ext}.so ..\\..\\lib" end end end else desc 'Does a full compile' task :default => [:gl, :glu, :glut, :fixpermissions] end task :fixpermissions do # fix wrong lib permissions (mkrf bug ?) Dir["lib/*.so","lib/*.bundle"].each do |fname| File.chmod(0755,fname) end end task :extension => :default desc 'Show contents of some variables related to website doc generation.' task :explain_website do puts "WEBSITE_MKDN:" WEBSITE_MKDN.each do |doc| puts "\t#{doc}" end puts "NICE_HTML_DOCS:" NICE_HTML_DOCS.each do |doc| puts "\t#{doc}" end end desc 'Generate supported extension list.' task :gen_glext_list do sh "./utils/extlistgen.rb doc/extensions.txt.in doc/extensions.txt " + GLEXT_VERSIONS.join(" ") end desc 'Generate website html.' task :gen_website => [:gen_glext_list] + NICE_HTML_DOCS do # Now that the website docs have been generated, copy them to ./website. puts sh "cp README.html website/index.html" sh "cp doc/*.html website" end # You'll see some intermediate .plain files get generated. These are html, # but don't yet have their code snippets syntax highlighted. rule '.html' => '.plain' do |t| puts "Turning #{t.source} into #{t.name} ..." sh "./utils/post-mkdn2html.rb #{t.source} #{t.name}" end # Process the markdown docs into plain html. rule '.plain' => '.txt' do |t| puts puts "Turning #{t.source} into #{t.name} ..." sh "./utils/mkdn2html.rb #{t.source} #{t.name}" end desc 'Upload the newly-built site to RubyForge.' task :upload_website => [:gen_website] do sh "scp website/*.html hoanga@rubyforge.org:/var/www/gforge-projects/ruby-opengl" sh "scp website/images/* hoanga@rubyforge.org:/var/www/gforge-projects/ruby-opengl/images/" end desc 'Upload entire site, including stylesheet and the images directory.' task :upload_entire_website => [:gen_website] do sh "scp website/*.html hoanga@rubyforge.org:/var/www/gforge-projects/ruby-opengl" sh "scp website/*.css hoanga@rubyforge.org:/var/www/gforge-projects/ruby-opengl" sh "scp -r website/images hoanga@rubyforge.org:/var/www/gforge-projects/ruby-opengl" end desc 'Runs unit tests.' Rake::TestTask.new do |t| t.libs << "test" t.test_files = FileList['test/tc_*.rb'] t.verbose = true end desc 'Runs unit tests.' task :test_all => [:test] # Define the files that will go into the gem gem_files = FileList["{lib,ext,doc,examples,test}/**/*"] gem_files = gem_files.exclude("**/*.so", "**/*.o{,bj}", "ext/**/*.log", "ext/gl*/Rakefile") spec = Gem::Specification.new do |s| s.name = "ruby-opengl" s.version = "0.60.1" s.authors = [ "Alain Hoang", "Jan Dvorak", "Minh Thu Vo", "James Adam" ] s.homepage = "http://ruby-opengl.rubyforge.org" s.email = "ruby-opengl-devel@rubyforge.org" s.rubyforge_project = 'ruby-opengl' s.platform = Gem::Platform::RUBY s.summary = "OpenGL Interface for Ruby" s.files = gem_files s.extensions << 'Rakefile' s.require_path = "lib" s.autorequire = "gl" s.has_rdoc = false s.add_dependency("mkrf", ">=0.2.0") s.add_dependency("rake") end # Create a task for creating a ruby gem Rake::GemPackageTask.new(spec) do |pkg| pkg.gem_spec = spec pkg.need_tar = true end ruby-opengl-0.60.1.orig/test/0000755000000000000000000000000011377006423014460 5ustar rootrootruby-opengl-0.60.1.orig/test/README0000644000000000000000000000062011377006423015336 0ustar rootrootruby-opengl tests ================= This directory contains the unit tests for ruby-opengl. You should be able to run the test by calling 'rake test' from installation root directory. Note that the tests are meant for purposes of internal development, and depending on your system configuration may not run at all - the purpose is to test the bindings, not the underlying OpenGL implementation. ruby-opengl-0.60.1.orig/test/tc_ext_ati.rb0000644000000000000000000000205511377006423017132 0ustar rootroot# # Copyright (C) 2007 Jan Dvorak # # This program is distributed under the terms of the MIT license. # See the included MIT-LICENSE file for the terms of this license. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # require 'test/unit' class Test_EXT_ATI < Test::Unit::TestCase def setup common_setup() end def teardown common_teardown() end def test_gl_ati_draw_buffers return if not supported?("GL_ATI_draw_buffers") glDrawBuffersATI([GL_BACK_LEFT,GL_FRONT_LEFT]) assert_equal(glGetIntegerv(GL_DRAW_BUFFER0),GL_BACK_LEFT) assert_equal(glGetIntegerv(GL_DRAW_BUFFER1),GL_FRONT_LEFT) end end ruby-opengl-0.60.1.orig/test/tc_ext_arb.rb0000644000000000000000000004536711377006423017136 0ustar rootroot# # Copyright (C) 2007 Jan Dvorak # # This program is distributed under the terms of the MIT license. # See the included MIT-LICENSE file for the terms of this license. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # require 'test/unit' class Test_EXT_ARB < Test::Unit::TestCase def setup common_setup() end def teardown common_teardown() end def test_gl_arb_transpose_matrix return if not supported?("GL_ARB_transpose_matrix") m_a = [[1.0,2.0,3.0,4.0], [0.0,2.0,0.0,0.0], [0.0,0.0,2.0,0.0], [0.0,0.0,0.0,2.0]] m_b = [[1.0,2.0,3.0,4.0], [0.0,3.0,0.0,0.0], [0.0,0.0,3.0,0.0], [0.0,0.0,0.0,3.0]] glMatrixMode(GL_MODELVIEW) glLoadTransposeMatrixfARB(m_a) assert_equal(glGetDoublev(GL_TRANSPOSE_MODELVIEW_MATRIX_ARB), m_a) glLoadTransposeMatrixdARB(m_b) assert_equal(glGetDoublev(GL_TRANSPOSE_MODELVIEW_MATRIX_ARB), m_b) glLoadIdentity() glMultTransposeMatrixfARB(m_a) assert_equal(glGetDoublev(GL_TRANSPOSE_MODELVIEW_MATRIX_ARB), m_a) glLoadIdentity() glMultTransposeMatrixdARB(m_b) assert_equal(glGetDoublev(GL_TRANSPOSE_MODELVIEW_MATRIX_ARB), m_b) # 2 m = Matrix.rows([[1,2,3,4],[5,6,7,8],[9,10,11,12],[13,14,15,16]]) glMatrixMode(GL_MODELVIEW) glLoadTransposeMatrixfARB(m) assert_equal(glGetDoublev(GL_MODELVIEW_MATRIX), m.to_a.transpose) glLoadIdentity() glLoadTransposeMatrixdARB(m) assert_equal(glGetDoublev(GL_MODELVIEW_MATRIX), m.to_a.transpose) glLoadIdentity() glMultTransposeMatrixfARB(m) assert_equal(glGetDoublev(GL_MODELVIEW_MATRIX), m.to_a.transpose) glLoadIdentity() glMultTransposeMatrixdARB(m) assert_equal(glGetDoublev(GL_MODELVIEW_MATRIX), m.to_a.transpose) assert_raise ArgumentError do glLoadTransposeMatrixfARB([1,2,3,4]) end assert_raise ArgumentError do glLoadTransposeMatrixdARB([1,2,3,4]) end assert_raise ArgumentError do glMultTransposeMatrixfARB([1,2,3,4]) end assert_raise ArgumentError do glMultTransposeMatrixdARB([1,2,3,4]) end end def test_gl_arb_multisample return if not supported?("GL_ARB_multisample") glSampleCoverageARB(0.5,GL_FALSE) assert_equal(glGetFloatv(GL_SAMPLE_COVERAGE_VALUE_ARB),0.5) assert_equal(glGetBooleanv(GL_SAMPLE_COVERAGE_INVERT_ARB),false) glSampleCoverageARB(1.0,GL_TRUE) assert_equal(glGetFloatv(GL_SAMPLE_COVERAGE_VALUE_ARB),1.0) assert_equal(glGetBooleanv(GL_SAMPLE_COVERAGE_INVERT_ARB),true) end def test_gl_arb_color_buffer_float return if not supported?("GL_ARB_color_buffer_float") glClampColorARB(GL_CLAMP_VERTEX_COLOR_ARB,GL_FIXED_ONLY_ARB) assert_equal(glGetIntegerv(GL_CLAMP_VERTEX_COLOR_ARB),GL_FIXED_ONLY_ARB) glClampColorARB(GL_CLAMP_VERTEX_COLOR_ARB,GL_TRUE) assert_equal(glGetBooleanv(GL_CLAMP_VERTEX_COLOR_ARB),GL_TRUE) end def test_gl_arb_vertex_program return if not supported?("GL_ARB_vertex_program") assert_equal(glIsProgramARB(0),false) programs = glGenProgramsARB(1) assert_equal(programs.size,1) program = "!!ARBvp1.0\nTEMP vv;\nEND" glBindProgramARB(GL_VERTEX_PROGRAM_ARB, programs[0]) glProgramStringARB(GL_VERTEX_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, program) assert_equal(glGetProgramStringARB(GL_VERTEX_PROGRAM_ARB, GL_PROGRAM_STRING_ARB), program) assert_equal(glIsProgramARB(programs[0]),true) assert_equal(glGetProgramivARB(GL_VERTEX_PROGRAM_ARB,GL_PROGRAM_LENGTH_ARB),program.size) assert_equal(glGetProgramivARB(GL_VERTEX_PROGRAM_ARB,GL_PROGRAM_BINDING_ARB),programs[0]) glEnableVertexAttribArrayARB(1) assert_equal(glGetVertexAttribivARB(1,GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB),GL_TRUE) glDisableVertexAttribArrayARB(1) assert_equal(glGetVertexAttribivARB(1,GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB),GL_FALSE) glVertexAttribPointerARB(1,2,GL_FLOAT,GL_FALSE,0,[1,1].pack("f*")) assert_equal(glGetVertexAttribPointervARB(1),[1,1].pack("f*")) glProgramEnvParameter4dARB(GL_VERTEX_PROGRAM_ARB,1, 1,2,3,4) assert_equal(glGetProgramEnvParameterdvARB(GL_VERTEX_PROGRAM_ARB,1),[1,2,3,4]) glProgramEnvParameter4fARB(GL_VERTEX_PROGRAM_ARB,1, 5,6,7,8) assert_equal(glGetProgramEnvParameterfvARB(GL_VERTEX_PROGRAM_ARB,1),[5,6,7,8]) glProgramEnvParameter4dvARB(GL_VERTEX_PROGRAM_ARB,1, [1,2,3,4]) assert_equal(glGetProgramEnvParameterdvARB(GL_VERTEX_PROGRAM_ARB,1),[1,2,3,4]) glProgramEnvParameter4fvARB(GL_VERTEX_PROGRAM_ARB,1, [5,6,7,8]) assert_equal(glGetProgramEnvParameterfvARB(GL_VERTEX_PROGRAM_ARB,1),[5,6,7,8]) glProgramLocalParameter4dARB(GL_VERTEX_PROGRAM_ARB,1, 1,2,3,4) assert_equal(glGetProgramLocalParameterdvARB(GL_VERTEX_PROGRAM_ARB,1),[1,2,3,4]) glProgramLocalParameter4fARB(GL_VERTEX_PROGRAM_ARB,1, 5,6,7,8) assert_equal(glGetProgramLocalParameterfvARB(GL_VERTEX_PROGRAM_ARB,1),[5,6,7,8]) glProgramLocalParameter4dvARB(GL_VERTEX_PROGRAM_ARB,1, [1,2,3,4]) assert_equal(glGetProgramLocalParameterdvARB(GL_VERTEX_PROGRAM_ARB,1),[1,2,3,4]) glProgramLocalParameter4fvARB(GL_VERTEX_PROGRAM_ARB,1, [5,6,7,8]) assert_equal(glGetProgramLocalParameterfvARB(GL_VERTEX_PROGRAM_ARB,1),[5,6,7,8]) glVertexAttrib1dARB(1,1) assert_equal(glGetVertexAttribdvARB(1,GL_CURRENT_VERTEX_ATTRIB_ARB)[0],1) glVertexAttrib1fARB(1,2) assert_equal(glGetVertexAttribfvARB(1,GL_CURRENT_VERTEX_ATTRIB_ARB)[0],2) glVertexAttrib1sARB(1,3) assert_equal(glGetVertexAttribivARB(1,GL_CURRENT_VERTEX_ATTRIB_ARB)[0],3) glVertexAttrib1dvARB(1,[1]) assert_equal(glGetVertexAttribdvARB(1,GL_CURRENT_VERTEX_ATTRIB_ARB)[0],1) glVertexAttrib1fvARB(1,[2]) assert_equal(glGetVertexAttribfvARB(1,GL_CURRENT_VERTEX_ATTRIB_ARB)[0],2) glVertexAttrib1svARB(1,[3]) assert_equal(glGetVertexAttribivARB(1,GL_CURRENT_VERTEX_ATTRIB_ARB)[0],3) glVertexAttrib2dARB(1,1,2) assert_equal(glGetVertexAttribdvARB(1,GL_CURRENT_VERTEX_ATTRIB_ARB)[0,2],[1,2]) glVertexAttrib2fARB(1,2,3) assert_equal(glGetVertexAttribfvARB(1,GL_CURRENT_VERTEX_ATTRIB_ARB)[0,2],[2,3]) glVertexAttrib2sARB(1,3,4) assert_equal(glGetVertexAttribivARB(1,GL_CURRENT_VERTEX_ATTRIB_ARB)[0,2],[3,4]) glVertexAttrib2dvARB(1,[1,2]) assert_equal(glGetVertexAttribdvARB(1,GL_CURRENT_VERTEX_ATTRIB_ARB)[0,2],[1,2]) glVertexAttrib2fvARB(1,[2,3]) assert_equal(glGetVertexAttribfvARB(1,GL_CURRENT_VERTEX_ATTRIB_ARB)[0,2],[2,3]) glVertexAttrib2svARB(1,[3,4]) assert_equal(glGetVertexAttribivARB(1,GL_CURRENT_VERTEX_ATTRIB_ARB)[0,2],[3,4]) glVertexAttrib3dARB(1,1,2,3) assert_equal(glGetVertexAttribdvARB(1,GL_CURRENT_VERTEX_ATTRIB_ARB)[0,3],[1,2,3]) glVertexAttrib3fARB(1,2,3,4) assert_equal(glGetVertexAttribfvARB(1,GL_CURRENT_VERTEX_ATTRIB_ARB)[0,3],[2,3,4]) glVertexAttrib3sARB(1,3,4,5) assert_equal(glGetVertexAttribivARB(1,GL_CURRENT_VERTEX_ATTRIB_ARB)[0,3],[3,4,5]) glVertexAttrib3dvARB(1,[1,2,3]) assert_equal(glGetVertexAttribdvARB(1,GL_CURRENT_VERTEX_ATTRIB_ARB)[0,3],[1,2,3]) glVertexAttrib3fvARB(1,[2,3,4]) assert_equal(glGetVertexAttribfvARB(1,GL_CURRENT_VERTEX_ATTRIB_ARB)[0,3],[2,3,4]) glVertexAttrib3svARB(1,[3,4,5]) assert_equal(glGetVertexAttribivARB(1,GL_CURRENT_VERTEX_ATTRIB_ARB)[0,3],[3,4,5]) glVertexAttrib4dARB(1,1,2,3,4) assert_equal(glGetVertexAttribdvARB(1,GL_CURRENT_VERTEX_ATTRIB_ARB)[0,4],[1,2,3,4]) glVertexAttrib4fARB(1,2,3,4,5) assert_equal(glGetVertexAttribfvARB(1,GL_CURRENT_VERTEX_ATTRIB_ARB)[0,4],[2,3,4,5]) glVertexAttrib4sARB(1,3,4,5,6) assert_equal(glGetVertexAttribivARB(1,GL_CURRENT_VERTEX_ATTRIB_ARB)[0,4],[3,4,5,6]) glVertexAttrib4dvARB(1,[1,2,3,4]) assert_equal(glGetVertexAttribdvARB(1,GL_CURRENT_VERTEX_ATTRIB_ARB)[0,4],[1,2,3,4]) glVertexAttrib4fvARB(1,[2,3,4,5]) assert_equal(glGetVertexAttribfvARB(1,GL_CURRENT_VERTEX_ATTRIB_ARB)[0,4],[2,3,4,5]) glVertexAttrib4svARB(1,[3,4,5,6]) assert_equal(glGetVertexAttribivARB(1,GL_CURRENT_VERTEX_ATTRIB_ARB)[0,4],[3,4,5,6]) glVertexAttrib4bvARB(1,[1,2,3,4]) assert_equal(glGetVertexAttribivARB(1,GL_CURRENT_VERTEX_ATTRIB_ARB)[0,4],[1,2,3,4]) glVertexAttrib4ivARB(1,[2,3,4,5]) assert_equal(glGetVertexAttribivARB(1,GL_CURRENT_VERTEX_ATTRIB_ARB)[0,4],[2,3,4,5]) glVertexAttrib4ubvARB(1,[3,4,5,6]) assert_equal(glGetVertexAttribivARB(1,GL_CURRENT_VERTEX_ATTRIB_ARB)[0,4],[3,4,5,6]) glVertexAttrib4uivARB(1,[1,2,3,4]) assert_equal(glGetVertexAttribivARB(1,GL_CURRENT_VERTEX_ATTRIB_ARB)[0,4],[1,2,3,4]) glVertexAttrib4usvARB(1,[2,3,4,5]) assert_equal(glGetVertexAttribivARB(1,GL_CURRENT_VERTEX_ATTRIB_ARB)[0,4],[2,3,4,5]) glVertexAttrib4NbvARB(1,[0,2**7-1,0,2**7-1]) assert_equal(glGetVertexAttribivARB(1,GL_CURRENT_VERTEX_ATTRIB_ARB)[0,4],[0,1,0,1]) glVertexAttrib4NivARB(1,[2**31-1,0,2**31-1,0]) assert_equal(glGetVertexAttribivARB(1,GL_CURRENT_VERTEX_ATTRIB_ARB)[0,4],[1,0,1,0]) glVertexAttrib4NsvARB(1,[0,2**15-1,0,2**15-1]) assert_equal(glGetVertexAttribivARB(1,GL_CURRENT_VERTEX_ATTRIB_ARB)[0,4],[0,1,0,1]) glVertexAttrib4NubARB(1,2**8-1,0,2**8-1,0) assert_equal(glGetVertexAttribdvARB(1,GL_CURRENT_VERTEX_ATTRIB_ARB)[0,4],[1,0,1,0]) glVertexAttrib4NubvARB(1,[0,2**8-1,0,2**8-1]) assert_equal(glGetVertexAttribdvARB(1,GL_CURRENT_VERTEX_ATTRIB_ARB)[0,4],[0,1,0,1]) glVertexAttrib4NuivARB(1,[2**32-1,0,2**32-1,0]) assert_equal(glGetVertexAttribivARB(1,GL_CURRENT_VERTEX_ATTRIB_ARB)[0,4],[1,0,1,0]) glVertexAttrib4NusvARB(1,[0,2**16-1,0,2**16-1]) assert_equal(glGetVertexAttribivARB(1,GL_CURRENT_VERTEX_ATTRIB_ARB)[0,4],[0,1,0,1]) glDeleteProgramsARB(programs) end def test_gl_arb_windowpos return if not supported?("GL_ARB_window_pos") # 2 glWindowPos2dARB(1.0,2.0) assert_equal(glGetDoublev(GL_CURRENT_RASTER_POSITION),[1,2,0,1]) glWindowPos2dvARB([2.0,1.0]) assert_equal(glGetDoublev(GL_CURRENT_RASTER_POSITION),[2,1,0,1]) glWindowPos2fARB(1.0,2.0) assert_equal(glGetDoublev(GL_CURRENT_RASTER_POSITION),[1,2,0,1]) glWindowPos2fvARB([2.0,1.0]) assert_equal(glGetDoublev(GL_CURRENT_RASTER_POSITION),[2,1,0,1]) glWindowPos2iARB(1,2) assert_equal(glGetDoublev(GL_CURRENT_RASTER_POSITION),[1,2,0,1]) glWindowPos2ivARB([2,1]) assert_equal(glGetDoublev(GL_CURRENT_RASTER_POSITION),[2,1,0,1]) glWindowPos2sARB(1,2) assert_equal(glGetDoublev(GL_CURRENT_RASTER_POSITION),[1,2,0,1]) glWindowPos2svARB([2,1]) assert_equal(glGetDoublev(GL_CURRENT_RASTER_POSITION),[2,1,0,1]) # 3 glWindowPos3dARB(1.0,2.0,0.5) assert_equal(glGetDoublev(GL_CURRENT_RASTER_POSITION),[1,2,0.5,1]) glWindowPos3dvARB([3.0,2.0,1.0]) assert_equal(glGetDoublev(GL_CURRENT_RASTER_POSITION),[3,2,1,1]) glWindowPos3fARB(1.0,2.0,0.5) assert_equal(glGetDoublev(GL_CURRENT_RASTER_POSITION),[1,2,0.5,1]) glWindowPos3fvARB([3.0,2.0,1.0]) assert_equal(glGetDoublev(GL_CURRENT_RASTER_POSITION),[3,2,1,1]) glWindowPos3iARB(1,2,0) assert_equal(glGetDoublev(GL_CURRENT_RASTER_POSITION),[1,2,0,1]) glWindowPos3ivARB([3,2,1]) assert_equal(glGetDoublev(GL_CURRENT_RASTER_POSITION),[3,2,1,1]) glWindowPos3sARB(1,2,0) assert_equal(glGetDoublev(GL_CURRENT_RASTER_POSITION),[1,2,0,1]) glWindowPos3svARB([3,2,1]) assert_equal(glGetDoublev(GL_CURRENT_RASTER_POSITION),[3,2,1,1]) end def test_gl_arb_pointparameter return if not supported?("GL_ARB_point_parameters") glPointParameterfARB(GL_POINT_SIZE_MIN,1.0) assert_equal(glGetDoublev(GL_POINT_SIZE_MIN),1.0) glPointParameterfvARB(GL_POINT_DISTANCE_ATTENUATION,[1,0,1]) assert_equal(glGetDoublev(GL_POINT_DISTANCE_ATTENUATION),[1,0,1]) end def test_gl_arb_occlusion_query return if not supported?("GL_ARB_occlusion_query") queries = glGenQueriesARB(2) assert_equal(queries.size,2) glBeginQueryARB(GL_SAMPLES_PASSED,queries[1]) assert_equal(glIsQueryARB(queries[1]),true) glEndQueryARB(GL_SAMPLES_PASSED) r = glGetQueryObjectivARB(queries[1],GL_QUERY_RESULT_AVAILABLE) assert(r==GL_TRUE || r==GL_FALSE) assert(glGetQueryObjectuivARB(queries[1],GL_QUERY_RESULT)>=0) glDeleteQueriesARB(queries) assert_equal(glIsQueryARB(queries[1]),false) end def test_gl_arb_shader_objects return if not supported?("GL_ARB_shader_objects") vertex_shader_source = "void main() { gl_Position = ftransform();}" program = glCreateProgramObjectARB() vs = glCreateShaderObjectARB(GL_VERTEX_SHADER) glShaderSourceARB(vs,vertex_shader_source) assert_equal(glGetShaderSourceARB(vs),vertex_shader_source) assert_equal(glGetObjectParameterivARB(vs,GL_OBJECT_TYPE_ARB),GL_SHADER_OBJECT_ARB) assert_equal(glGetObjectParameterfvARB(vs,GL_OBJECT_TYPE_ARB),GL_SHADER_OBJECT_ARB) assert_equal(glGetObjectParameterfvARB(vs,GL_OBJECT_SUBTYPE_ARB),GL_VERTEX_SHADER) glCompileShaderARB(vs) assert_equal(glGetObjectParameterivARB(vs,GL_OBJECT_COMPILE_STATUS_ARB),GL_TRUE) vslog = glGetInfoLogARB(vs) assert_equal(vslog.class,String) glAttachObjectARB(program,vs) assert_equal(glGetAttachedObjectsARB(program),vs) glValidateProgramARB(program) assert_equal(glGetObjectParameterivARB(program,GL_OBJECT_VALIDATE_STATUS_ARB),GL_TRUE) glLinkProgramARB(program) assert_equal(glGetObjectParameterivARB(program,GL_OBJECT_LINK_STATUS_ARB),GL_TRUE) glUseProgramObjectARB(program) assert_equal(glGetIntegerv(GL_CURRENT_PROGRAM),program) assert_equal(glGetHandleARB(GL_PROGRAM_OBJECT_ARB),program) glUseProgramObjectARB(0) glDetachObjectARB(program,vs) glDeleteObjectARB(vs) glDeleteObjectARB(program) end def test_gl_arb_shader_objects_2 return if not supported?("GL_ARB_shader_objects") vertex_shader_source = "attribute vec4 test; uniform float testvec1; uniform vec2 testvec2; uniform vec3 testvec3; uniform vec4 testvec4; uniform int testivec1; uniform ivec2 testivec2; uniform ivec3 testivec3; uniform ivec4 testivec4; void main() { gl_Position = testvec1 * test * testvec2.x * testvec3.x * testivec1 * testivec2.x * testivec3.x * testivec4.x + testvec4;}" program = glCreateProgramObjectARB() vs = glCreateShaderObjectARB(GL_VERTEX_SHADER) glShaderSourceARB(vs,vertex_shader_source) glCompileShaderARB(vs) assert_equal(glGetObjectParameterivARB(vs,GL_OBJECT_COMPILE_STATUS_ARB),GL_TRUE) glAttachObjectARB(program,vs) glLinkProgramARB(program) assert_equal(glGetObjectParameterivARB(program,GL_OBJECT_LINK_STATUS_ARB),GL_TRUE) glUseProgramObjectARB(program) assert((tv1l = glGetUniformLocationARB(program,"testvec1"))>=0) assert((tv2l = glGetUniformLocationARB(program,"testvec2"))>=0) assert((tv3l = glGetUniformLocationARB(program,"testvec3"))>=0) assert((tv4l = glGetUniformLocationARB(program,"testvec4"))>=0) assert((tv1il = glGetUniformLocationARB(program,"testivec1"))>=0) assert((tv2il = glGetUniformLocationARB(program,"testivec2"))>=0) assert((tv3il = glGetUniformLocationARB(program,"testivec3"))>=0) assert((tv4il = glGetUniformLocationARB(program,"testivec4"))>=0) ## assert_equal(glGetActiveUniformARB(program,tv1il),[1,GL_INT,"testivec1"]) ## f glUniform1fARB(tv1l,2.0) assert_equal(glGetUniformfvARB(program,tv1l),2.0) glUniform2fARB(tv2l,2.0,2.0) assert_equal(glGetUniformfvARB(program,tv2l),[2.0,2.0]) glUniform3fARB(tv3l,2.0,2.0,2.0) assert_equal(glGetUniformfvARB(program,tv3l),[2.0,2.0,2.0]) glUniform4fARB(tv4l,2.0,2.0,2.0,2.0) assert_equal(glGetUniformfvARB(program,tv4l),[2.0,2.0,2.0,2.0]) # i glUniform1iARB(tv1il,3) assert_equal(glGetUniformivARB(program,tv1il),3) glUniform2iARB(tv2il,3,3) assert_equal(glGetUniformivARB(program,tv2il),[3,3]) glUniform3iARB(tv3il,3,3,3) assert_equal(glGetUniformivARB(program,tv3il),[3,3,3]) glUniform4iARB(tv4il,3,3,3,3) assert_equal(glGetUniformivARB(program,tv4il),[3,3,3,3]) # fv glUniform1fvARB(tv1l,[3.0]) assert_equal(glGetUniformfvARB(program,tv1l),3.0) glUniform2fvARB(tv2l,[3.0,3.0]) assert_equal(glGetUniformfvARB(program,tv2l),[3.0,3.0]) glUniform3fvARB(tv3l,[3.0,3.0,3.0]) assert_equal(glGetUniformfvARB(program,tv3l),[3.0,3.0,3.0]) glUniform4fvARB(tv4l,[3.0,3.0,3.0,3.0]) assert_equal(glGetUniformfvARB(program,tv4l),[3.0,3.0,3.0,3.0]) # iv glUniform1ivARB(tv1il,[2]) assert_equal(glGetUniformivARB(program,tv1il),2) glUniform2ivARB(tv2il,[2,2]) assert_equal(glGetUniformivARB(program,tv2il),[2,2]) glUniform3ivARB(tv3il,[2,2,2]) assert_equal(glGetUniformivARB(program,tv3il),[2,2,2]) glUniform4ivARB(tv4il,[2,2,2,2]) assert_equal(glGetUniformivARB(program,tv4il),[2,2,2,2]) glDeleteObjectARB(vs) glDeleteObjectARB(program) end def test_gl_arb_shader_objects_3 return if not supported?("GL_ARB_shader_objects") vertex_shader_source = "uniform mat2 testmat2; uniform mat3 testmat3; uniform mat4 testmat4; void main() { gl_Position = gl_Vertex * testmat4[0].x * testmat3[0].x * testmat2[0].x;}" program = glCreateProgramObjectARB() vs = glCreateShaderObjectARB(GL_VERTEX_SHADER) glShaderSourceARB(vs,vertex_shader_source) glCompileShaderARB(vs) assert_equal(glGetObjectParameterivARB(vs,GL_OBJECT_COMPILE_STATUS_ARB),GL_TRUE) glAttachObjectARB(program,vs) glLinkProgramARB(program) assert_equal(glGetObjectParameterivARB(program,GL_OBJECT_LINK_STATUS_ARB),GL_TRUE) glUseProgramObjectARB(program) # assert((tm2l = glGetUniformLocationARB(program,"testmat2"))>=0) assert((tm3l = glGetUniformLocationARB(program,"testmat3"))>=0) assert((tm4l = glGetUniformLocationARB(program,"testmat4"))>=0) glUniformMatrix2fvARB(tm2l, GL_TRUE, [0,1, 1,0]) assert_equal(glGetUniformfvARB(program,tm2l),[0,1,1,0]) glUniformMatrix3fvARB(tm3l, GL_TRUE, [0,1,0, 1,0,1, 0,1,0]) assert_equal(glGetUniformfvARB(program,tm3l),[0,1,0, 1,0,1, 0,1,0]) glUniformMatrix4fvARB(tm4l, GL_TRUE, [0,1,0,1, 1,0,1,0, 0,1,0,1, 1,0,1,0]) assert_equal(glGetUniformfvARB(program,tm4l),[0,1,0,1, 1,0,1,0, 0,1,0,1, 1,0,1,0]) glDeleteObjectARB(vs) glDeleteObjectARB(program) end def test_gl_arb_vertex_shader return if not supported?("GL_ARB_vertex_shader") vertex_shader_source = "attribute vec4 test; uniform float testvec1; uniform vec2 testvec2; uniform vec3 testvec3; uniform vec4 testvec4; uniform int testivec1; uniform ivec2 testivec2; uniform ivec3 testivec3; uniform ivec4 testivec4; void main() { gl_Position = testvec1 * test * testvec2.x * testvec3.x * testivec1 * testivec2.x * testivec3.x * testivec4.x + testvec4;}" program = glCreateProgramObjectARB() vs = glCreateShaderObjectARB(GL_VERTEX_SHADER) glShaderSourceARB(vs,vertex_shader_source) glCompileShaderARB(vs) assert_equal(glGetObjectParameterivARB(vs,GL_OBJECT_COMPILE_STATUS_ARB),GL_TRUE) glAttachObjectARB(program,vs) glBindAttribLocationARB(program,2,"test") glLinkProgramARB(program) assert_equal(glGetObjectParameterivARB(program,GL_OBJECT_LINK_STATUS_ARB),GL_TRUE) glUseProgramObjectARB(program) assert_equal(glGetAttribLocationARB(program,"test"),2) assert_equal(glGetActiveAttribARB(program,0),[1,GL_FLOAT_VEC4,"test"]) glDeleteObjectARB(vs) glDeleteObjectARB(program) end end ruby-opengl-0.60.1.orig/test/tc_func_20.rb0000644000000000000000000003176211377006423016740 0ustar rootroot# # Copyright (C) 2007 Jan Dvorak # # This program is distributed under the terms of the MIT license. # See the included MIT-LICENSE file for the terms of this license. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # require 'test/unit' class Test_20 < Test::Unit::TestCase def setup common_setup() end def teardown common_teardown() end def test_glblendequationseparate return if not supported?(2.0) glBlendEquationSeparate(GL_MIN,GL_MAX) assert_equal(glGetIntegerv(GL_BLEND_EQUATION_RGB),GL_MIN) assert_equal(glGetIntegerv(GL_BLEND_EQUATION_ALPHA),GL_MAX) glBlendEquationSeparate(GL_MAX,GL_MIN) assert_equal(glGetIntegerv(GL_BLEND_EQUATION_RGB),GL_MAX) assert_equal(glGetIntegerv(GL_BLEND_EQUATION_ALPHA),GL_MIN) end def test_stencilops return if not supported?(2.0) glStencilOpSeparate(GL_FRONT, GL_ZERO, GL_INCR, GL_DECR) assert_equal(glGetIntegerv(GL_STENCIL_FAIL), GL_ZERO) assert_equal(glGetIntegerv(GL_STENCIL_PASS_DEPTH_FAIL), GL_INCR) assert_equal(glGetIntegerv(GL_STENCIL_PASS_DEPTH_PASS), GL_DECR) glStencilOpSeparate(GL_FRONT, GL_INCR, GL_DECR, GL_ZERO) assert_equal(glGetIntegerv(GL_STENCIL_FAIL), GL_INCR) assert_equal(glGetIntegerv(GL_STENCIL_PASS_DEPTH_FAIL), GL_DECR) assert_equal(glGetIntegerv(GL_STENCIL_PASS_DEPTH_PASS), GL_ZERO) glStencilFuncSeparate(GL_FRONT, GL_LEQUAL, 1, 0) assert_equal(glGetIntegerv(GL_STENCIL_FUNC),GL_LEQUAL) assert_equal(glGetIntegerv(GL_STENCIL_REF),1) assert_equal(glGetIntegerv(GL_STENCIL_VALUE_MASK),0) glStencilFuncSeparate(GL_FRONT, GL_GEQUAL, 0, 1) assert_equal(glGetIntegerv(GL_STENCIL_FUNC),GL_GEQUAL) assert_equal(glGetIntegerv(GL_STENCIL_REF),0) assert_equal(glGetIntegerv(GL_STENCIL_VALUE_MASK),1) glStencilMaskSeparate(GL_FRONT,1) assert_equal(glGetIntegerv( GL_STENCIL_WRITEMASK),1) glStencilMaskSeparate(GL_FRONT,0) assert_equal(glGetIntegerv(GL_STENCIL_WRITEMASK),0) end def test_gldrawbuf return if not supported?(2.0) glDrawBuffers([GL_FRONT_LEFT,GL_BACK_LEFT]) assert_equal(glGetIntegerv(GL_DRAW_BUFFER0),GL_FRONT_LEFT) assert_equal(glGetIntegerv(GL_DRAW_BUFFER1),GL_BACK_LEFT) end def test_glvertexattrib return if not supported?(2.0) # 1 glVertexAttrib1d(1,2.0) assert_equal(glGetVertexAttribdv(1,GL_CURRENT_VERTEX_ATTRIB), [2.0,0.0,0.0,1.0]) glVertexAttrib1dv(1,[3.0]) assert_equal(glGetVertexAttribfv(1,GL_CURRENT_VERTEX_ATTRIB), [3.0,0.0,0.0,1.0]) glVertexAttrib1f(1,2.0) assert_equal(glGetVertexAttribiv(1,GL_CURRENT_VERTEX_ATTRIB), [2,0,0,1]) glVertexAttrib1fv(1,[3.0]) assert_equal(glGetVertexAttribfv(1,GL_CURRENT_VERTEX_ATTRIB), [3.0,0.0,0.0,1.0]) glVertexAttrib1s(1,2) assert_equal(glGetVertexAttribfv(1,GL_CURRENT_VERTEX_ATTRIB), [2.0,0.0,0.0,1.0]) glVertexAttrib1sv(1,[3]) assert_equal(glGetVertexAttribfv(1,GL_CURRENT_VERTEX_ATTRIB), [3.0,0.0,0.0,1.0]) # 2 glVertexAttrib2d(1,2.0,2.0) assert_equal(glGetVertexAttribfv(1,GL_CURRENT_VERTEX_ATTRIB), [2.0,2.0,0.0,1.0]) glVertexAttrib2dv(1,[3.0,3.0]) assert_equal(glGetVertexAttribfv(1,GL_CURRENT_VERTEX_ATTRIB), [3.0,3.0,0.0,1.0]) glVertexAttrib2f(1,2.0,2.0) assert_equal(glGetVertexAttribfv(1,GL_CURRENT_VERTEX_ATTRIB), [2.0,2.0,0.0,1.0]) glVertexAttrib2fv(1,[3.0,3.0]) assert_equal(glGetVertexAttribfv(1,GL_CURRENT_VERTEX_ATTRIB), [3.0,3.0,0.0,1.0]) glVertexAttrib2s(1,2,2) assert_equal(glGetVertexAttribfv(1,GL_CURRENT_VERTEX_ATTRIB), [2.0,2.0,0.0,1.0]) glVertexAttrib2sv(1,[3,3]) assert_equal(glGetVertexAttribfv(1,GL_CURRENT_VERTEX_ATTRIB), [3.0,3.0,0.0,1.0]) # 3 glVertexAttrib3d(1,2.0,2.0,2.0) assert_equal(glGetVertexAttribfv(1,GL_CURRENT_VERTEX_ATTRIB), [2.0,2.0,2.0,1.0]) glVertexAttrib3dv(1,[3.0,3.0,3.0]) assert_equal(glGetVertexAttribfv(1,GL_CURRENT_VERTEX_ATTRIB), [3.0,3.0,3.0,1.0]) glVertexAttrib3f(1,2.0,2.0,2.0) assert_equal(glGetVertexAttribfv(1,GL_CURRENT_VERTEX_ATTRIB), [2.0,2.0,2.0,1.0]) glVertexAttrib3fv(1,[3.0,3.0,3.0]) assert_equal(glGetVertexAttribfv(1,GL_CURRENT_VERTEX_ATTRIB), [3.0,3.0,3.0,1.0]) glVertexAttrib3s(1,2,2,2) assert_equal(glGetVertexAttribfv(1,GL_CURRENT_VERTEX_ATTRIB), [2.0,2.0,2.0,1.0]) glVertexAttrib3sv(1,[3,3,3]) assert_equal(glGetVertexAttribfv(1,GL_CURRENT_VERTEX_ATTRIB), [3.0,3.0,3.0,1.0]) # 4N glVertexAttrib4Nbv(1,[2**7-1,2**7-1,2**7-1,2**7-1]) assert(approx_equal(glGetVertexAttribfv(1,GL_CURRENT_VERTEX_ATTRIB), [1,1,1,1])) glVertexAttrib4Niv(1,[0,0,0,0]) assert(approx_equal(glGetVertexAttribfv(1,GL_CURRENT_VERTEX_ATTRIB), [0,0,0,0])) glVertexAttrib4Nsv(1,[2**15-1,2**15-1,2**15-1,2**15-1]) assert(approx_equal(glGetVertexAttribfv(1,GL_CURRENT_VERTEX_ATTRIB), [1,1,1,1])) glVertexAttrib4Nub(1,0,0,0,0) assert(approx_equal(glGetVertexAttribfv(1,GL_CURRENT_VERTEX_ATTRIB), [0,0,0,0])) glVertexAttrib4Nubv(1,[2**8-1,2**8-1,2**8-1,2**8-1]) assert(approx_equal(glGetVertexAttribfv(1,GL_CURRENT_VERTEX_ATTRIB), [1,1,1,1])) glVertexAttrib4Nuiv(1,[0,0,0,0]) assert(approx_equal(glGetVertexAttribfv(1,GL_CURRENT_VERTEX_ATTRIB), [0,0,0,0])) glVertexAttrib4Nusv(1,[2**16-1,2**16-1,2**16-1,2**16-1]) assert(approx_equal(glGetVertexAttribfv(1,GL_CURRENT_VERTEX_ATTRIB), [1,1,1,1])) # 4 glVertexAttrib4bv(1,[0,0,0,0]) assert(approx_equal(glGetVertexAttribfv(1,GL_CURRENT_VERTEX_ATTRIB), [0,0,0,0])) glVertexAttrib4d(1,1,1,1,1) assert(approx_equal(glGetVertexAttribfv(1,GL_CURRENT_VERTEX_ATTRIB), [1,1,1,1])) glVertexAttrib4dv(1,[0,0,0,0]) assert(approx_equal(glGetVertexAttribfv(1,GL_CURRENT_VERTEX_ATTRIB), [0,0,0,0])) glVertexAttrib4f(1,1,1,1,1) assert(approx_equal(glGetVertexAttribfv(1,GL_CURRENT_VERTEX_ATTRIB), [1,1,1,1])) glVertexAttrib4fv(1,[0,0,0,0]) assert(approx_equal(glGetVertexAttribfv(1,GL_CURRENT_VERTEX_ATTRIB), [0,0,0,0])) glVertexAttrib4iv(1,[1,1,1,1]) assert(approx_equal(glGetVertexAttribfv(1,GL_CURRENT_VERTEX_ATTRIB), [1,1,1,1])) glVertexAttrib4s(1,0,0,0,0) assert(approx_equal(glGetVertexAttribfv(1,GL_CURRENT_VERTEX_ATTRIB), [0,0,0,0])) glVertexAttrib4sv(1,[1,1,1,1]) assert(approx_equal(glGetVertexAttribfv(1,GL_CURRENT_VERTEX_ATTRIB), [1,1,1,1])) glVertexAttrib4ubv(1,[0,0,0,0]) assert(approx_equal(glGetVertexAttribfv(1,GL_CURRENT_VERTEX_ATTRIB), [0,0,0,0])) glVertexAttrib4uiv(1,[1,1,1,1]) assert(approx_equal(glGetVertexAttribfv(1,GL_CURRENT_VERTEX_ATTRIB), [1,1,1,1])) glVertexAttrib4usv(1,[0,0,0,0]) assert(approx_equal(glGetVertexAttribfv(1,GL_CURRENT_VERTEX_ATTRIB), [0,0,0,0])) end def test_vertexattribpointer return if not supported?(2.0) vaa = [1,1,1,1, 2,2,2,2].pack("f*") glVertexAttribPointer(1,4,GL_FLOAT,GL_FALSE,0,vaa) assert_equal(glGetVertexAttribPointerv(1),vaa) glEnableVertexAttribArray(1) glBegin(GL_POINTS) glArrayElement(1) glEnd() assert_equal(glGetVertexAttribfv(1,GL_CURRENT_VERTEX_ATTRIB),[2,2,2,2]) glDisableVertexAttribArray(1) end def test_shaders return if not supported?(2.0) vertex_shader_source = "void main() { gl_Position = ftransform();}" program = glCreateProgram() assert_equal(glIsProgram(program),true) vs = glCreateShader(GL_VERTEX_SHADER) assert_equal(glIsShader(vs),true) glShaderSource(vs,vertex_shader_source) assert_equal(glGetShaderSource(vs),vertex_shader_source) assert_equal(glGetShaderiv(vs, GL_SHADER_TYPE),GL_VERTEX_SHADER) glCompileShader(vs) assert_equal(glGetShaderiv(vs,GL_COMPILE_STATUS),GL_TRUE) vslog = glGetShaderInfoLog(vs) assert_equal(vslog.class,String) glAttachShader(program,vs) assert_equal(glGetAttachedShaders(program),vs) glDetachShader(program,vs) assert_equal(glGetAttachedShaders(program),nil) glAttachShader(program,vs) glValidateProgram(program) assert_equal(glGetProgramiv(program,GL_VALIDATE_STATUS),GL_TRUE) prlog = glGetProgramInfoLog(program) assert_equal(prlog.class,String) glLinkProgram(program) assert_equal(glGetProgramiv(program,GL_LINK_STATUS),GL_TRUE) glUseProgram(program) assert_equal(glGetIntegerv(GL_CURRENT_PROGRAM),program) glUseProgram(0) glDetachShader(program,vs) glDeleteShader(vs) assert_equal(glIsShader(vs),false) glDeleteProgram(program) assert_equal(glIsProgram(program),false) end def test_shaders_2 return if not supported?(2.0) vertex_shader_source = "attribute vec4 test; uniform float testvec1; uniform vec2 testvec2; uniform vec3 testvec3; uniform vec4 testvec4; uniform int testivec1; uniform ivec2 testivec2; uniform ivec3 testivec3; uniform ivec4 testivec4; void main() { gl_Position = testvec1 * test * testvec2.x * testvec3.x * testivec1 * testivec2.x * testivec3.x * testivec4.x + testvec4;}" program = glCreateProgram() vs = glCreateShader(GL_VERTEX_SHADER) glShaderSource(vs,vertex_shader_source) glCompileShader(vs) assert_equal(glGetShaderiv(vs,GL_COMPILE_STATUS),GL_TRUE) glAttachShader(program,vs) glBindAttribLocation(program,2,"test") glLinkProgram(program) assert_equal(glGetProgramiv(program,GL_LINK_STATUS),GL_TRUE) glUseProgram(program) assert_equal(glGetAttribLocation(program,"test"),2) assert((tv1l = glGetUniformLocation(program,"testvec1"))>=0) assert((tv2l = glGetUniformLocation(program,"testvec2"))>=0) assert((tv3l = glGetUniformLocation(program,"testvec3"))>=0) assert((tv4l = glGetUniformLocation(program,"testvec4"))>=0) assert((tv1il = glGetUniformLocation(program,"testivec1"))>=0) assert((tv2il = glGetUniformLocation(program,"testivec2"))>=0) assert((tv3il = glGetUniformLocation(program,"testivec3"))>=0) assert((tv4il = glGetUniformLocation(program,"testivec4"))>=0) ## assert_equal(glGetActiveAttrib(program,0),[1,GL_FLOAT_VEC4,"test"]) assert_equal(glGetActiveUniform(program,tv1il),[1,GL_INT,"testivec1"]) # f glUniform1f(tv1l,2.0) assert_equal(glGetUniformfv(program,tv1l),2.0) glUniform2f(tv2l,2.0,2.0) assert_equal(glGetUniformfv(program,tv2l),[2.0,2.0]) glUniform3f(tv3l,2.0,2.0,2.0) assert_equal(glGetUniformfv(program,tv3l),[2.0,2.0,2.0]) glUniform4f(tv4l,2.0,2.0,2.0,2.0) assert_equal(glGetUniformfv(program,tv4l),[2.0,2.0,2.0,2.0]) # i glUniform1i(tv1il,3) assert_equal(glGetUniformiv(program,tv1il),3) glUniform2i(tv2il,3,3) assert_equal(glGetUniformiv(program,tv2il),[3,3]) glUniform3i(tv3il,3,3,3) assert_equal(glGetUniformiv(program,tv3il),[3,3,3]) glUniform4i(tv4il,3,3,3,3) assert_equal(glGetUniformiv(program,tv4il),[3,3,3,3]) # fv glUniform1fv(tv1l,[3.0]) assert_equal(glGetUniformfv(program,tv1l),3.0) glUniform2fv(tv2l,[3.0,3.0]) assert_equal(glGetUniformfv(program,tv2l),[3.0,3.0]) glUniform3fv(tv3l,[3.0,3.0,3.0]) assert_equal(glGetUniformfv(program,tv3l),[3.0,3.0,3.0]) glUniform4fv(tv4l,[3.0,3.0,3.0,3.0]) assert_equal(glGetUniformfv(program,tv4l),[3.0,3.0,3.0,3.0]) # iv glUniform1iv(tv1il,[2]) assert_equal(glGetUniformiv(program,tv1il),2) glUniform2iv(tv2il,[2,2]) assert_equal(glGetUniformiv(program,tv2il),[2,2]) glUniform3iv(tv3il,[2,2,2]) assert_equal(glGetUniformiv(program,tv3il),[2,2,2]) glUniform4iv(tv4il,[2,2,2,2]) assert_equal(glGetUniformiv(program,tv4il),[2,2,2,2]) glDeleteShader(vs) glDeleteProgram(program) end def test_shaders_3 return if not supported?(2.0) vertex_shader_source = "uniform mat2 testmat2; uniform mat3 testmat3; uniform mat4 testmat4; void main() { gl_Position = gl_Vertex * testmat4[0].x * testmat3[0].x * testmat2[0].x;}" program = glCreateProgram() vs = glCreateShader(GL_VERTEX_SHADER) glShaderSource(vs,vertex_shader_source) glCompileShader(vs) assert_equal(glGetShaderiv(vs,GL_COMPILE_STATUS),GL_TRUE) glAttachShader(program,vs) glLinkProgram(program) assert_equal(glGetProgramiv(program,GL_LINK_STATUS),GL_TRUE) glUseProgram(program) # assert((tm2l = glGetUniformLocation(program,"testmat2"))>=0) assert((tm3l = glGetUniformLocation(program,"testmat3"))>=0) assert((tm4l = glGetUniformLocation(program,"testmat4"))>=0) glUniformMatrix2fv(tm2l, GL_TRUE, [0,1, 1,0]) assert_equal(glGetUniformfv(program,tm2l),[0,1,1,0]) glUniformMatrix3fv(tm3l, GL_TRUE, [0,1,0, 1,0,1, 0,1,0]) assert_equal(glGetUniformfv(program,tm3l),[0,1,0, 1,0,1, 0,1,0]) glUniformMatrix4fv(tm4l, GL_TRUE, [0,1,0,1, 1,0,1,0, 0,1,0,1, 1,0,1,0]) assert_equal(glGetUniformfv(program,tm4l),[0,1,0,1, 1,0,1,0, 0,1,0,1, 1,0,1,0]) end def test_buffered_vertexattribpointer return if not supported?(2.0) vaa = [1,1,1,1, 2,2,2,2].pack("f*") buffers = glGenBuffers(1) glBindBuffer(GL_ARRAY_BUFFER,buffers[0]) glBufferData(GL_ARRAY_BUFFER,8*4,vaa,GL_DYNAMIC_DRAW) glVertexAttribPointer(1,4,GL_FLOAT,GL_FALSE,0,0) assert_equal(glGetVertexAttribPointerv(1),0) glEnableVertexAttribArray(1) glBegin(GL_POINTS) glArrayElement(1) glEnd() assert_equal(glGetVertexAttribfv(1,GL_CURRENT_VERTEX_ATTRIB),[2,2,2,2]) glDisableVertexAttribArray(1) glDeleteBuffers(buffers) end end ruby-opengl-0.60.1.orig/test/tc_ext_ext.rb0000644000000000000000000005064311377006423017163 0ustar rootroot# # Copyright (C) 2007 Jan Dvorak # # This program is distributed under the terms of the MIT license. # See the included MIT-LICENSE file for the terms of this license. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # require 'test/unit' class Test_EXT_EXT < Test::Unit::TestCase def setup common_setup() end def teardown if Gl.is_available?("GL_EXT_framebuffer_object") glBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, 0) glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, 0) end common_teardown() end def test_gl_ext_polygon_offset return if not supported?("GL_EXT_polygon_offset") glPolygonOffsetEXT(1.0,2.0) assert_equal(glGetIntegerv(GL_POLYGON_OFFSET_FACTOR_EXT),1.0) assert_equal(glGetIntegerv(GL_POLYGON_OFFSET_BIAS_EXT),2.0) end def test_gl_ext_framebuffer_object return if not supported?("GL_EXT_framebuffer_object") t = glGenTextures(3) glBindTexture(GL_TEXTURE_2D, t[0]) glTexImage2D(GL_TEXTURE_2D,0,GL_RGBA8,$window_size,$window_size,0,GL_RGBA,GL_UNSIGNED_BYTE,nil) glBindTexture(GL_TEXTURE_1D, t[1]) glTexImage1D(GL_TEXTURE_1D,0,GL_RGBA8,$window_size,0,GL_RGBA,GL_UNSIGNED_BYTE,nil) glBindTexture(GL_TEXTURE_3D, t[2]) glTexImage3D(GL_TEXTURE_3D,0,GL_RGBA8,$window_size,$window_size,1,0,GL_RGBA,GL_UNSIGNED_BYTE,nil) fb = glGenFramebuffersEXT(1) assert(fb.size==1) glBindFramebufferEXT(GL_FRAMEBUFFER_EXT,fb[0]) assert_equal(glIsFramebufferEXT(fb[0]),true) rb = glGenRenderbuffersEXT(1) assert(rb.size==1) glBindRenderbufferEXT(GL_RENDERBUFFER_EXT,rb[0]) assert_equal(glIsRenderbufferEXT(rb[0]),true) glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT, $window_size, $window_size) assert_equal(glGetRenderbufferParameterivEXT(GL_RENDERBUFFER_EXT,GL_RENDERBUFFER_WIDTH_EXT),$window_size) assert_equal(glGetRenderbufferParameterivEXT(GL_RENDERBUFFER_EXT,GL_RENDERBUFFER_HEIGHT_EXT),$window_size) assert_equal(glGetRenderbufferParameterivEXT(GL_RENDERBUFFER_EXT,GL_RENDERBUFFER_INTERNAL_FORMAT_EXT),GL_DEPTH_COMPONENT) glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, rb[0]); glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, t[0], 0) status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT) assert(status == GL_FRAMEBUFFER_COMPLETE_EXT || status == GL_FRAMEBUFFER_UNSUPPORTED_EXT) assert_equal(glGetFramebufferAttachmentParameterivEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT),GL_TEXTURE) glGenerateMipmapEXT(GL_TEXTURE_2D) glFramebufferTexture1DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_1D, t[1], 0) glFramebufferTexture3DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_3D, t[2], 0, 0) glDeleteRenderbuffersEXT(rb) glDeleteFramebuffersEXT(fb) glDeleteTextures(t) end def test_gl_ext_gpu_program_parameters return if not supported?("GL_EXT_gpu_program_parameters") glProgramEnvParameters4fvEXT(GL_VERTEX_PROGRAM_ARB,1, [1,2,3,4,5,6,7,8]) assert_equal(glGetProgramEnvParameterdvARB(GL_VERTEX_PROGRAM_ARB,1),[1,2,3,4]) assert_equal(glGetProgramEnvParameterdvARB(GL_VERTEX_PROGRAM_ARB,2),[5,6,7,8]) end def test_gl_ext_framebuffer_blit return if not supported?("GL_EXT_framebuffer_blit") fbo = glGenFramebuffersEXT(2) texture = glGenTextures(2) data = [1,1,1,1, 0,0,0,0, 1,1,1,1, 0,0,0,0] glBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, fbo[0]) glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, fbo[1]) glBindTexture(GL_TEXTURE_2D, texture[0]) glTexImage2D(GL_TEXTURE_2D,0,GL_RGBA8,2,2,0,GL_RGBA,GL_UNSIGNED_BYTE,data.pack("C*")) glGenerateMipmapEXT(GL_TEXTURE_2D); glBindTexture(GL_TEXTURE_2D, texture[1]) glTexImage2D(GL_TEXTURE_2D,0,GL_RGBA8,2,2,0,GL_RGBA,GL_UNSIGNED_BYTE,nil) glGenerateMipmapEXT(GL_TEXTURE_2D); glFramebufferTexture2DEXT(GL_READ_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, texture[0], 0) glFramebufferTexture2DEXT(GL_DRAW_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, texture[1], 0) status = glCheckFramebufferStatusEXT(GL_READ_FRAMEBUFFER_EXT) assert_equal(status,GL_FRAMEBUFFER_COMPLETE_EXT) status = glCheckFramebufferStatusEXT(GL_DRAW_FRAMEBUFFER_EXT) assert_equal(status,GL_FRAMEBUFFER_COMPLETE_EXT) glBlitFramebufferEXT(0, 0, 2, 2, 0, 0, 2, 2, GL_COLOR_BUFFER_BIT, GL_NEAREST) glBindTexture(GL_TEXTURE_2D, texture[1]) tex = glGetTexImage(GL_TEXTURE_2D,0,GL_RGBA,GL_UNSIGNED_BYTE).unpack("C*") assert_equal(tex,data) glDeleteTextures(texture) glDeleteFramebuffersEXT(fbo) end def test_gl_ext_framebuffer_multisample return if not supported?("GL_EXT_framebuffer_multisample") rb = glGenRenderbuffersEXT(1)[0] glBindRenderbufferEXT(GL_RENDERBUFFER_EXT,rb) glRenderbufferStorageMultisampleEXT(GL_RENDERBUFFER_EXT,4,GL_RGBA,2,2) samples = glGetRenderbufferParameterivEXT(GL_RENDERBUFFER_EXT,GL_RENDERBUFFER_SAMPLES_EXT) assert_equal(samples,4) glDeleteRenderbuffersEXT(rb) end def test_gl_ext_pointparameter return if not supported?("GL_EXT_point_parameters") glPointParameterfEXT(GL_POINT_SIZE_MIN,1.0) assert_equal(glGetDoublev(GL_POINT_SIZE_MIN),1.0) glPointParameterfvEXT(GL_POINT_DISTANCE_ATTENUATION,[1,0,1]) assert_equal(glGetDoublev(GL_POINT_DISTANCE_ATTENUATION),[1,0,1]) end def test_gl_ext_stencil_two_side return if not supported?("GL_EXT_stencil_two_side") glActiveStencilFaceEXT(GL_FRONT) assert_equal(glGetIntegerv(GL_ACTIVE_STENCIL_FACE_EXT),GL_FRONT) glActiveStencilFaceEXT(GL_BACK) assert_equal(glGetIntegerv(GL_ACTIVE_STENCIL_FACE_EXT),GL_BACK) end def test_gl_ext_stencil_clear_tag return if not supported?("GL_EXT_stencil_clear_tag") glStencilClearTagEXT(1,2) assert_equal(glGetIntegerv(GL_STENCIL_TAG_BITS_EXT),1) assert_equal(glGetIntegerv(GL_STENCIL_CLEAR_TAG_VALUE_EXT),2) end def test_gl_ext_secondary_color return if not supported?("GL_EXT_secondary_color") glSecondaryColor3bEXT(2**7-1,0,2**7-1) assert(approx_equal(glGetDoublev(GL_CURRENT_SECONDARY_COLOR),[1.0,0.0,1.0,1.0])) glSecondaryColor3bvEXT([0,2**7-1,0]) assert(approx_equal(glGetDoublev(GL_CURRENT_SECONDARY_COLOR),[0.0,1.0,0.0,1.0])) glSecondaryColor3dEXT(1.0,0.0,1.0) assert(approx_equal(glGetDoublev(GL_CURRENT_SECONDARY_COLOR),[1.0,0.0,1.0,1.0])) glSecondaryColor3dvEXT([0.0,1.0,0.0]) assert(approx_equal(glGetDoublev(GL_CURRENT_SECONDARY_COLOR),[0.0,1.0,0.0,1.0])) glSecondaryColor3fEXT(1.0,0.0,1.0) assert(approx_equal(glGetDoublev(GL_CURRENT_SECONDARY_COLOR),[1.0,0.0,1.0,1.0])) glSecondaryColor3fvEXT([0.0,1.0,0.0]) assert(approx_equal(glGetDoublev(GL_CURRENT_SECONDARY_COLOR),[0.0,1.0,0.0,1.0])) glSecondaryColor3iEXT(2**31-1,0,2**31-1) assert(approx_equal(glGetDoublev(GL_CURRENT_SECONDARY_COLOR),[1.0,0.0,1.0,1.0])) glSecondaryColor3ivEXT([0,2**31-1,0]) assert(approx_equal(glGetDoublev(GL_CURRENT_SECONDARY_COLOR),[0.0,1.0,0.0,1.0])) glSecondaryColor3sEXT(2**15-1,0,2**15-1) assert(approx_equal(glGetDoublev(GL_CURRENT_SECONDARY_COLOR),[1.0,0.0,1.0,1.0])) glSecondaryColor3svEXT([0,2**15-1,0]) assert(approx_equal(glGetDoublev(GL_CURRENT_SECONDARY_COLOR),[0.0,1.0,0.0,1.0])) glSecondaryColor3ubEXT(2**8-1,0,2**8-1) assert(approx_equal(glGetDoublev(GL_CURRENT_SECONDARY_COLOR),[1.0,0.0,1.0,1.0])) glSecondaryColor3ubvEXT([0,2**8-1,0]) assert(approx_equal(glGetDoublev(GL_CURRENT_SECONDARY_COLOR),[0.0,1.0,0.0,1.0])) glSecondaryColor3uiEXT(2**32-1,0,2**32-1) assert(approx_equal(glGetDoublev(GL_CURRENT_SECONDARY_COLOR),[1.0,0.0,1.0,1.0])) glSecondaryColor3uivEXT([0,2**32-1,0]) assert(approx_equal(glGetDoublev(GL_CURRENT_SECONDARY_COLOR),[0.0,1.0,0.0,1.0])) glSecondaryColor3usEXT(2**16-1,0,2**16-1) assert(approx_equal(glGetDoublev(GL_CURRENT_SECONDARY_COLOR),[1.0,0.0,1.0,1.0])) glSecondaryColor3usvEXT([0,2**16-1,0]) assert(approx_equal(glGetDoublev(GL_CURRENT_SECONDARY_COLOR),[0.0,1.0,0.0,1.0])) sc = [0,1,0, 1,0,1].pack("f*") glSecondaryColorPointerEXT(3,GL_FLOAT,0,sc) assert_equal(glGetIntegerv(GL_SECONDARY_COLOR_ARRAY_SIZE),3) assert_equal(glGetIntegerv(GL_SECONDARY_COLOR_ARRAY_TYPE),GL_FLOAT) assert_equal(glGetIntegerv(GL_SECONDARY_COLOR_ARRAY_STRIDE),0) assert_equal(glGetPointerv(GL_SECONDARY_COLOR_ARRAY_POINTER),sc) glEnableClientState(GL_SECONDARY_COLOR_ARRAY) glBegin(GL_TRIANGLES) glArrayElement(0) glEnd() assert_equal(glGetDoublev(GL_CURRENT_SECONDARY_COLOR),[0,1,0,1]) glBegin(GL_TRIANGLES) glArrayElement(1) glEnd() assert_equal(glGetDoublev(GL_CURRENT_SECONDARY_COLOR),[1,0,1,1]) glDisableClientState(GL_SECONDARY_COLOR_ARRAY) end def test_gl_ext_blend_color return if not supported?("GL_EXT_blend_color") glBlendColorEXT(1.0,0.0,1.0,0.0) assert_equal(glGetFloatv(GL_BLEND_COLOR_EXT),[1,0,1,0]) glBlendColorEXT(0.0,1.0,0.0,1.0) assert_equal(glGetFloatv(GL_BLEND_COLOR_EXT),[0,1,0,1]) end def test_gl_ext_blend_minmax return if not supported?("GL_EXT_blend_minmax") glBlendEquationEXT(GL_MIN_EXT) assert_equal(glGetIntegerv(GL_BLEND_EQUATION_EXT),GL_MIN_EXT) glBlendEquationEXT(GL_MAX_EXT) assert_equal(glGetIntegerv(GL_BLEND_EQUATION_EXT),GL_MAX_EXT) end def test_gl_ext_blend_func_separate return if not supported?("GL_EXT_blend_func_separate") glBlendFuncSeparateEXT(GL_ZERO,GL_ONE,GL_ZERO,GL_ONE) assert_equal(glGetIntegerv(GL_BLEND_SRC_RGB_EXT),GL_ZERO) assert_equal(glGetIntegerv(GL_BLEND_DST_RGB_EXT),GL_ONE) assert_equal(glGetIntegerv(GL_BLEND_SRC_ALPHA_EXT),GL_ZERO) assert_equal(glGetIntegerv(GL_BLEND_DST_ALPHA_EXT),GL_ONE) glBlendFuncSeparateEXT(GL_ONE,GL_ZERO,GL_ONE,GL_ZERO) assert_equal(glGetIntegerv(GL_BLEND_SRC_RGB_EXT),GL_ONE) assert_equal(glGetIntegerv(GL_BLEND_DST_RGB_EXT),GL_ZERO) assert_equal(glGetIntegerv(GL_BLEND_SRC_ALPHA_EXT),GL_ONE) assert_equal(glGetIntegerv(GL_BLEND_DST_ALPHA_EXT),GL_ZERO) end def test_gl_ext_blend_equation_separate return if not supported?("GL_EXT_blend_equation_separate") glBlendEquationSeparateEXT(GL_FUNC_ADD,GL_FUNC_SUBTRACT) assert_equal(glGetIntegerv(GL_BLEND_EQUATION_RGB_EXT),GL_FUNC_ADD) assert_equal(glGetIntegerv(GL_BLEND_EQUATION_ALPHA_EXT),GL_FUNC_SUBTRACT) glBlendEquationSeparateEXT(GL_FUNC_SUBTRACT,GL_FUNC_ADD) assert_equal(glGetIntegerv(GL_BLEND_EQUATION_RGB_EXT),GL_FUNC_SUBTRACT) assert_equal(glGetIntegerv(GL_BLEND_EQUATION_ALPHA_EXT),GL_FUNC_ADD) end def test_gl_ext_depth_bounds_test return if not supported?("GL_EXT_depth_bounds_test") glDepthBoundsEXT(0.2,0.8) assert(approx_equal(glGetDoublev(GL_DEPTH_BOUNDS_EXT),[0.2,0.8])) end def test_gl_ext_timer_query return if not supported?("GL_EXT_timer_query") queries = glGenQueries(2) glBeginQuery(GL_TIME_ELAPSED_EXT,queries[0]) glBegin(GL_QUADS) glVertex2i(0,0) glVertex2i(0,1) glVertex2i(1,1) glVertex2i(1,0) glEnd glEndQuery(GL_TIME_ELAPSED_EXT) while glGetQueryObjectiv(queries[0], GL_QUERY_RESULT_AVAILABLE)==GL_FALSE # end assert(glGetQueryObjecti64vEXT(queries[0], GL_QUERY_RESULT)>0) assert(glGetQueryObjectui64vEXT(queries[0], GL_QUERY_RESULT)>0) glDeleteQueries(queries) end def test_gl_ext_texture_object return if not supported?("GL_EXT_texture_object") textures = glGenTexturesEXT(2) glBindTextureEXT(GL_TEXTURE_1D,textures[0]) glBindTextureEXT(GL_TEXTURE_2D,textures[1]) assert_equal(glIsTextureEXT(textures[0]),true) assert_equal(glAreTexturesResidentEXT(textures).size,2) glPrioritizeTexturesEXT(textures,[0.5,1.0]) assert_equal(glGetTexParameterfv(GL_TEXTURE_1D,GL_TEXTURE_PRIORITY),0.5) assert_equal(glGetTexParameterfv(GL_TEXTURE_2D,GL_TEXTURE_PRIORITY),1.0) glDeleteTexturesEXT(textures) assert_equal(glIsTextureEXT(textures[0]),false) end def test_gl_ext_compiled_vertex_array return if not supported?("GL_EXT_compiled_vertex_array") glLockArraysEXT(1,2) assert_equal(glGetIntegerv(GL_ARRAY_ELEMENT_LOCK_FIRST_EXT),1) assert_equal(glGetIntegerv(GL_ARRAY_ELEMENT_LOCK_COUNT_EXT),2) glUnlockArraysEXT() end def test_gl_ext_fogcoord return if not supported?("GL_EXT_fog_coord") glFogCoordfEXT(2.0) assert_equal(glGetDoublev(GL_CURRENT_FOG_COORD),2.0) glFogCoordfvEXT([3.0]) assert_equal(glGetDoublev(GL_CURRENT_FOG_COORD),3.0) glFogCoorddEXT(2.0) assert_equal(glGetDoublev(GL_CURRENT_FOG_COORD),2.0) glFogCoorddvEXT([3.0]) assert_equal(glGetDoublev(GL_CURRENT_FOG_COORD),3.0) fc = [1, 0].pack("f*") glFogCoordPointerEXT(GL_FLOAT,0,fc) assert_equal(glGetIntegerv(GL_FOG_COORD_ARRAY_TYPE),GL_FLOAT) assert_equal(glGetIntegerv(GL_FOG_COORD_ARRAY_STRIDE),0) assert_equal(glGetPointerv(GL_FOG_COORD_ARRAY_POINTER),fc) glEnableClientState(GL_FOG_COORD_ARRAY) glBegin(GL_TRIANGLES) glArrayElement(0) glEnd() assert_equal(glGetDoublev(GL_CURRENT_FOG_COORD),1) glBegin(GL_TRIANGLES) glArrayElement(1) glEnd() assert_equal(glGetDoublev(GL_CURRENT_FOG_COORD),0) glDisableClientState(GL_FOG_COORD_ARRAY) end def test_gl_ext_multi_draw_arrays return if not supported?("GL_EXT_multi_draw_arrays") va = [0,0, 1,0, 1,1, 0,0, 1,0, 0,1].pack("f*") glVertexPointer(2,GL_FLOAT,0,va) glEnable(GL_VERTEX_ARRAY) buf = glFeedbackBuffer(256,GL_3D) glRenderMode(GL_FEEDBACK) glMultiDrawArraysEXT(GL_POLYGON, [0,3], [3,3]) i1 = [0,1,2].pack("C*") i2 = [3,4,5].pack("C*") glMultiDrawElementsEXT(GL_TRIANGLES,GL_UNSIGNED_BYTE,[i1,i2]) count = glRenderMode(GL_RENDER) assert_equal(count,(3*3+2)*4) glDisable(GL_VERTEX_ARRAY) end def test_gl_ext_drawrangeelements return if not supported?("GL_EXT_draw_range_elements") va = [0,0, 0,1, 1,1].pack("f*") glVertexPointer(2,GL_FLOAT,0,va) buf = glFeedbackBuffer(256,GL_3D) glRenderMode(GL_FEEDBACK) glEnable(GL_VERTEX_ARRAY) glDrawRangeElementsEXT(GL_POINTS,0,2,3,GL_UNSIGNED_BYTE,[0,1,2].pack("C*")) count = glRenderMode(GL_RENDER) assert_equal(count,12) glDisable(GL_VERTEX_ARRAY) end def test_gl_ext_geometry_shader4 return if not supported?("GL_EXT_geometry_shader4") program = glCreateProgramObjectARB() glProgramParameteriEXT(program,GL_GEOMETRY_INPUT_TYPE_EXT ,GL_LINES_ADJACENCY_EXT) assert_equal(glGetObjectParameterivARB(program,GL_GEOMETRY_INPUT_TYPE_EXT),GL_LINES_ADJACENCY_EXT) glDeleteObjectARB(program) end def test_gl_ext_gpu_shader4 return if not supported?(["GL_EXT_gpu_shader4","GL_ARB_vertex_program"]) programs = glGenProgramsARB(1) program = "!!ARBvp1.0\nTEMP vv;\nEND" glBindProgramARB(GL_VERTEX_PROGRAM_ARB, programs[0]) glProgramStringARB(GL_VERTEX_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, program) glVertexAttribI1iEXT(1,1) assert_equal(glGetVertexAttribIivEXT(1,GL_CURRENT_VERTEX_ATTRIB_ARB)[0],1) glVertexAttribI1uiEXT(1,2) assert_equal(glGetVertexAttribIivEXT(1,GL_CURRENT_VERTEX_ATTRIB_ARB)[0],2) glVertexAttribI1ivEXT(1,[3]) assert_equal(glGetVertexAttribIivEXT(1,GL_CURRENT_VERTEX_ATTRIB_ARB)[0],3) glVertexAttribI1uivEXT(1,[4]) assert_equal(glGetVertexAttribIivEXT(1,GL_CURRENT_VERTEX_ATTRIB_ARB)[0],4) glVertexAttribI2iEXT(1,1,2) assert_equal(glGetVertexAttribIivEXT(1,GL_CURRENT_VERTEX_ATTRIB_ARB)[0,2],[1,2]) glVertexAttribI2uiEXT(1,2,3) assert_equal(glGetVertexAttribIivEXT(1,GL_CURRENT_VERTEX_ATTRIB_ARB)[0,2],[2,3]) glVertexAttribI2ivEXT(1,[3,4]) assert_equal(glGetVertexAttribIivEXT(1,GL_CURRENT_VERTEX_ATTRIB_ARB)[0,2],[3,4]) glVertexAttribI2uivEXT(1,[4,5]) assert_equal(glGetVertexAttribIivEXT(1,GL_CURRENT_VERTEX_ATTRIB_ARB)[0,2],[4,5]) glVertexAttribI3iEXT(1,1,2,3) assert_equal(glGetVertexAttribIivEXT(1,GL_CURRENT_VERTEX_ATTRIB_ARB)[0,3],[1,2,3]) glVertexAttribI3uiEXT(1,2,3,4) assert_equal(glGetVertexAttribIivEXT(1,GL_CURRENT_VERTEX_ATTRIB_ARB)[0,3],[2,3,4]) glVertexAttribI3ivEXT(1,[3,4,5]) assert_equal(glGetVertexAttribIivEXT(1,GL_CURRENT_VERTEX_ATTRIB_ARB)[0,3],[3,4,5]) glVertexAttribI3uivEXT(1,[4,5,6]) assert_equal(glGetVertexAttribIivEXT(1,GL_CURRENT_VERTEX_ATTRIB_ARB)[0,3],[4,5,6]) glVertexAttribI4iEXT(1,1,2,3,4) assert_equal(glGetVertexAttribIivEXT(1,GL_CURRENT_VERTEX_ATTRIB_ARB),[1,2,3,4]) glVertexAttribI4uiEXT(1,2,3,4,5) assert_equal(glGetVertexAttribIivEXT(1,GL_CURRENT_VERTEX_ATTRIB_ARB),[2,3,4,5]) glVertexAttribI4ivEXT(1,[3,4,5,6]) assert_equal(glGetVertexAttribIivEXT(1,GL_CURRENT_VERTEX_ATTRIB_ARB),[3,4,5,6]) glVertexAttribI4uivEXT(1,[4,5,6,7]) assert_equal(glGetVertexAttribIivEXT(1,GL_CURRENT_VERTEX_ATTRIB_ARB),[4,5,6,7]) glVertexAttribI4bvEXT(1,[1,2,3,4]) assert_equal(glGetVertexAttribIivEXT(1,GL_CURRENT_VERTEX_ATTRIB_ARB),[1,2,3,4]) glVertexAttribI4svEXT(1,[2,3,4,5]) assert_equal(glGetVertexAttribIivEXT(1,GL_CURRENT_VERTEX_ATTRIB_ARB),[2,3,4,5]) glVertexAttribI4ubvEXT(1,[1,2,3,4]) assert_equal(glGetVertexAttribIivEXT(1,GL_CURRENT_VERTEX_ATTRIB_ARB),[1,2,3,4]) glVertexAttribI4usvEXT(1,[2,3,4,5]) assert_equal(glGetVertexAttribIivEXT(1,GL_CURRENT_VERTEX_ATTRIB_ARB),[2,3,4,5]) glVertexAttribIPointerEXT(1,2,GL_INT,0,[1,1].pack("i*")) assert_equal(glGetVertexAttribPointervARB(1),[1,1].pack("i*")) glDeleteProgramsARB(programs) end def test_gl_ext_gpu_shader4_2 return if not supported?(["GL_EXT_gpu_shader4","GL_ARB_shader_objects"]) vertex_shader_source = "attribute vec4 test; uniform float testvec1; uniform vec2 testvec2; uniform vec3 testvec3; uniform vec4 testvec4; uniform unsigned int testivec1; uniform uvec2 testivec2; uniform uvec3 testivec3; uniform uvec4 testivec4; void main() { gl_Position = testvec1 * test * testvec2.x * testvec3.x * testivec1 * testivec2.x * testivec3.x * testivec4.x + testvec4;}" program = glCreateProgramObjectARB() vs = glCreateShaderObjectARB(GL_VERTEX_SHADER) glShaderSourceARB(vs,vertex_shader_source) glCompileShaderARB(vs) glAttachObjectARB(program,vs) glLinkProgramARB(program) glUseProgramObjectARB(program) assert((tv1il = glGetUniformLocationARB(program,"testivec1"))>=0) assert((tv2il = glGetUniformLocationARB(program,"testivec2"))>=0) assert((tv3il = glGetUniformLocationARB(program,"testivec3"))>=0) assert((tv4il = glGetUniformLocationARB(program,"testivec4"))>=0) glUniform1uiEXT(tv1il,3) assert_equal(glGetUniformuivEXT(program,tv1il),3) glUniform1uivEXT(tv1il,[4]) assert_equal(glGetUniformuivEXT(program,tv1il),4) glUniform2uiEXT(tv2il,1,2) assert_equal(glGetUniformuivEXT(program,tv2il),[1,2]) glUniform2uivEXT(tv2il,[3,4]) assert_equal(glGetUniformuivEXT(program,tv2il),[3,4]) glUniform3uiEXT(tv3il,1,2,3) assert_equal(glGetUniformuivEXT(program,tv3il),[1,2,3]) glUniform3uivEXT(tv3il,[3,4,5]) assert_equal(glGetUniformuivEXT(program,tv3il),[3,4,5]) glUniform4uiEXT(tv4il,1,2,3,4) assert_equal(glGetUniformuivEXT(program,tv4il),[1,2,3,4]) glUniform4uivEXT(tv4il,[3,4,5,6]) assert_equal(glGetUniformuivEXT(program,tv4il),[3,4,5,6]) glBindFragDataLocationEXT(program,1,"test") assert_equal(glGetFragDataLocationEXT(program,"test"),-1) end def test_gl_ext_draw_instanced return if not supported?("GL_EXT_draw_instanced") glEnableClientState(GL_VERTEX_ARRAY) va = [0,0, 0,1, 1,1].pack("f*") glVertexPointer(2,GL_FLOAT,0,va) buf = glFeedbackBuffer(256,GL_3D) glRenderMode(GL_FEEDBACK) glDrawArraysInstancedEXT(GL_TRIANGLES,0,3,2) glDrawElementsInstancedEXT(GL_TRIANGLES,3,GL_UNSIGNED_BYTE,[0,1,2].pack("C*"),2) count = glRenderMode(GL_RENDER) assert_equal(count,2*2*11) glDisableClientState(GL_VERTEX_ARRAY) end def test_gl_ext_texture_buffer_object return if not supported?("GL_EXT_texture_buffer_object") buf = glGenBuffers(1)[0] glBindBuffer(GL_TEXTURE_BUFFER_EXT, buf) tex = glGenTextures(1)[0] glBindTexture(GL_TEXTURE_BUFFER_EXT, tex) glTexBufferEXT(GL_TEXTURE_BUFFER_EXT, GL_RGBA32F_ARB, buf) assert_equal(glGetIntegerv(GL_TEXTURE_BINDING_BUFFER_EXT),tex) assert_equal(glGetIntegerv(GL_TEXTURE_BUFFER_FORMAT_EXT),GL_RGBA32F_ARB) glDeleteBuffers(buf) glDeleteTextures(tex) end def test_gl_ext_texture_integer return if not supported?("GL_EXT_texture_integer") glClearColorIiEXT(1,2,3,4) glClearColorIuiEXT(1,2,3,4) glTexParameterIivEXT(GL_TEXTURE_2D,GL_TEXTURE_BORDER_COLOR,[1,2,3,4]) assert_equal(glGetTexParameterIivEXT(GL_TEXTURE_2D,GL_TEXTURE_BORDER_COLOR),[1,2,3,4]) glTexParameterIuivEXT(GL_TEXTURE_2D,GL_TEXTURE_BORDER_COLOR,[5,6,7,8]) assert_equal(glGetTexParameterIuivEXT(GL_TEXTURE_2D,GL_TEXTURE_BORDER_COLOR),[5,6,7,8]) end end ruby-opengl-0.60.1.orig/test/tc_func_14.rb0000644000000000000000000001621411377006423016736 0ustar rootroot# # Copyright (C) 2007 Jan Dvorak # # This program is distributed under the terms of the MIT license. # See the included MIT-LICENSE file for the terms of this license. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # require 'test/unit' class Test_14 < Test::Unit::TestCase def setup common_setup() end def teardown common_teardown() end def test_arrays_2 return if not supported?(1.4) sc = [0,1,0, 1,0,1].pack("f*") fc = [1, 0].pack("f*") glSecondaryColorPointer(3,GL_FLOAT,0,sc) assert_equal(glGetIntegerv(GL_SECONDARY_COLOR_ARRAY_SIZE),3) assert_equal(glGetIntegerv(GL_SECONDARY_COLOR_ARRAY_TYPE),GL_FLOAT) assert_equal(glGetIntegerv(GL_SECONDARY_COLOR_ARRAY_STRIDE),0) assert_equal(glGetPointerv(GL_SECONDARY_COLOR_ARRAY_POINTER),sc) glFogCoordPointer(GL_FLOAT,0,fc) assert_equal(glGetIntegerv(GL_FOG_COORD_ARRAY_TYPE),GL_FLOAT) assert_equal(glGetIntegerv(GL_FOG_COORD_ARRAY_STRIDE),0) assert_equal(glGetPointerv(GL_FOG_COORD_ARRAY_POINTER),fc) glEnableClientState(GL_SECONDARY_COLOR_ARRAY) glEnableClientState(GL_FOG_COORD_ARRAY) glBegin(GL_TRIANGLES) glArrayElement(0) glEnd() assert_equal(glGetDoublev(GL_CURRENT_SECONDARY_COLOR),[0,1,0,1]) assert_equal(glGetDoublev(GL_CURRENT_FOG_COORD),1) glBegin(GL_TRIANGLES) glArrayElement(1) glEnd() assert_equal(glGetDoublev(GL_CURRENT_SECONDARY_COLOR),[1,0,1,1]) assert_equal(glGetDoublev(GL_CURRENT_FOG_COORD),0) glDisableClientState(GL_SECONDARY_COLOR_ARRAY) glDisableClientState(GL_FOG_COORD_ARRAY) end def test_arrays_3 return if not supported?(1.4) va = [0,0, 1,0, 1,1, 0,0, 1,0, 0,1].pack("f*") glVertexPointer(2,GL_FLOAT,0,va) glEnable(GL_VERTEX_ARRAY) buf = glFeedbackBuffer(256,GL_3D) glRenderMode(GL_FEEDBACK) glMultiDrawArrays(GL_POLYGON, [0,3], [3,3]) i1 = [0,1,2].pack("C*") i2 = [3,4,5].pack("C*") glMultiDrawElements(GL_TRIANGLES,GL_UNSIGNED_BYTE,[i1,i2]) count = glRenderMode(GL_RENDER) assert_equal(count,(3*3+2)*4) glDisable(GL_VERTEX_ARRAY) end def test_glblendfuncseparate return if not supported?(1.4) glBlendFuncSeparate(GL_SRC_COLOR,GL_SRC_COLOR,GL_SRC_COLOR,GL_SRC_COLOR) assert_equal(glGetIntegerv(GL_BLEND_SRC_RGB),GL_SRC_COLOR) assert_equal(glGetIntegerv(GL_BLEND_SRC_ALPHA),GL_SRC_COLOR) assert_equal(glGetIntegerv(GL_BLEND_DST_RGB),GL_SRC_COLOR) assert_equal(glGetIntegerv(GL_BLEND_DST_ALPHA),GL_SRC_COLOR) end def test_glpointparameter return if not supported?(1.4) glPointParameterf(GL_POINT_SIZE_MIN,2.0) assert_equal(glGetDoublev(GL_POINT_SIZE_MIN),2.0) glPointParameterfv(GL_POINT_DISTANCE_ATTENUATION,[0,1,0]) assert_equal(glGetDoublev(GL_POINT_DISTANCE_ATTENUATION),[0,1,0]) glPointParameteri(GL_POINT_SIZE_MAX,4) assert_equal(glGetDoublev(GL_POINT_SIZE_MAX),4) glPointParameteriv(GL_POINT_DISTANCE_ATTENUATION,[1,0,1]) assert_equal(glGetDoublev(GL_POINT_DISTANCE_ATTENUATION),[1,0,1]) end def test_glfogcoord return if not supported?(1.4) glFogCoordf(2.0) assert_equal(glGetDoublev(GL_CURRENT_FOG_COORD),2.0) glFogCoordfv([3.0]) assert_equal(glGetDoublev(GL_CURRENT_FOG_COORD),3.0) glFogCoordd(2.0) assert_equal(glGetDoublev(GL_CURRENT_FOG_COORD),2.0) glFogCoorddv([3.0]) assert_equal(glGetDoublev(GL_CURRENT_FOG_COORD),3.0) end def test_glsecondarycolor return if not supported?(1.4) glSecondaryColor3b(2**7-1,0,2**7-1) assert(approx_equal(glGetDoublev(GL_CURRENT_SECONDARY_COLOR),[1.0,0.0,1.0,1.0])) glSecondaryColor3bv([0,2**7-1,0]) assert(approx_equal(glGetDoublev(GL_CURRENT_SECONDARY_COLOR),[0.0,1.0,0.0,1.0])) glSecondaryColor3d(1.0,0.0,1.0) assert(approx_equal(glGetDoublev(GL_CURRENT_SECONDARY_COLOR),[1.0,0.0,1.0,1.0])) glSecondaryColor3dv([0.0,1.0,0.0]) assert(approx_equal(glGetDoublev(GL_CURRENT_SECONDARY_COLOR),[0.0,1.0,0.0,1.0])) glSecondaryColor3f(1.0,0.0,1.0) assert(approx_equal(glGetDoublev(GL_CURRENT_SECONDARY_COLOR),[1.0,0.0,1.0,1.0])) glSecondaryColor3fv([0.0,1.0,0.0]) assert(approx_equal(glGetDoublev(GL_CURRENT_SECONDARY_COLOR),[0.0,1.0,0.0,1.0])) glSecondaryColor3i(2**31-1,0,2**31-1) assert(approx_equal(glGetDoublev(GL_CURRENT_SECONDARY_COLOR),[1.0,0.0,1.0,1.0])) glSecondaryColor3iv([0,2**31-1,0]) assert(approx_equal(glGetDoublev(GL_CURRENT_SECONDARY_COLOR),[0.0,1.0,0.0,1.0])) glSecondaryColor3s(2**15-1,0,2**15-1) assert(approx_equal(glGetDoublev(GL_CURRENT_SECONDARY_COLOR),[1.0,0.0,1.0,1.0])) glSecondaryColor3sv([0,2**15-1,0]) assert(approx_equal(glGetDoublev(GL_CURRENT_SECONDARY_COLOR),[0.0,1.0,0.0,1.0])) glSecondaryColor3ub(2**8-1,0,2**8-1) assert(approx_equal(glGetDoublev(GL_CURRENT_SECONDARY_COLOR),[1.0,0.0,1.0,1.0])) glSecondaryColor3ubv([0,2**8-1,0]) assert(approx_equal(glGetDoublev(GL_CURRENT_SECONDARY_COLOR),[0.0,1.0,0.0,1.0])) glSecondaryColor3ui(2**32-1,0,2**32-1) assert(approx_equal(glGetDoublev(GL_CURRENT_SECONDARY_COLOR),[1.0,0.0,1.0,1.0])) glSecondaryColor3uiv([0,2**32-1,0]) assert(approx_equal(glGetDoublev(GL_CURRENT_SECONDARY_COLOR),[0.0,1.0,0.0,1.0])) glSecondaryColor3us(2**16-1,0,2**16-1) assert(approx_equal(glGetDoublev(GL_CURRENT_SECONDARY_COLOR),[1.0,0.0,1.0,1.0])) glSecondaryColor3usv([0,2**16-1,0]) assert(approx_equal(glGetDoublev(GL_CURRENT_SECONDARY_COLOR),[0.0,1.0,0.0,1.0])) end def test_glwindowpos return if not supported?(1.4) # 2 glWindowPos2d(1.0,2.0) assert_equal(glGetDoublev(GL_CURRENT_RASTER_POSITION),[1,2,0,1]) glWindowPos2dv([2.0,1.0]) assert_equal(glGetDoublev(GL_CURRENT_RASTER_POSITION),[2,1,0,1]) glWindowPos2f(1.0,2.0) assert_equal(glGetDoublev(GL_CURRENT_RASTER_POSITION),[1,2,0,1]) glWindowPos2fv([2.0,1.0]) assert_equal(glGetDoublev(GL_CURRENT_RASTER_POSITION),[2,1,0,1]) glWindowPos2i(1,2) assert_equal(glGetDoublev(GL_CURRENT_RASTER_POSITION),[1,2,0,1]) glWindowPos2iv([2,1]) assert_equal(glGetDoublev(GL_CURRENT_RASTER_POSITION),[2,1,0,1]) glWindowPos2s(1,2) assert_equal(glGetDoublev(GL_CURRENT_RASTER_POSITION),[1,2,0,1]) glWindowPos2sv([2,1]) assert_equal(glGetDoublev(GL_CURRENT_RASTER_POSITION),[2,1,0,1]) # 3 glWindowPos3d(1.0,2.0,0.5) assert_equal(glGetDoublev(GL_CURRENT_RASTER_POSITION),[1,2,0.5,1]) glWindowPos3dv([3.0,2.0,1.0]) assert_equal(glGetDoublev(GL_CURRENT_RASTER_POSITION),[3,2,1,1]) glWindowPos3f(1.0,2.0,0.5) assert_equal(glGetDoublev(GL_CURRENT_RASTER_POSITION),[1,2,0.5,1]) glWindowPos3fv([3.0,2.0,1.0]) assert_equal(glGetDoublev(GL_CURRENT_RASTER_POSITION),[3,2,1,1]) glWindowPos3i(1,2,0) assert_equal(glGetDoublev(GL_CURRENT_RASTER_POSITION),[1,2,0,1]) glWindowPos3iv([3,2,1]) assert_equal(glGetDoublev(GL_CURRENT_RASTER_POSITION),[3,2,1,1]) glWindowPos3s(1,2,0) assert_equal(glGetDoublev(GL_CURRENT_RASTER_POSITION),[1,2,0,1]) glWindowPos3sv([3,2,1]) assert_equal(glGetDoublev(GL_CURRENT_RASTER_POSITION),[3,2,1,1]) end end ruby-opengl-0.60.1.orig/test/tc_ext_nv.rb0000644000000000000000000004032011377006423016775 0ustar rootroot # Copyright (C) 2007 Jan Dvorak # # This program is distributed under the terms of the MIT license. # See the included MIT-LICENSE file for the terms of this license. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # require 'test/unit' class Test_EXT_NV < Test::Unit::TestCase def setup common_setup() end def teardown common_teardown() end def test_gl_nv_vertex_program return if not supported?("GL_NV_vertex_program") assert_equal(glIsProgramNV(0),false) programs = glGenProgramsNV(2) assert_equal(programs.size,2) program = "!!VSP1.0\nEND" glBindProgramNV(GL_VERTEX_PROGRAM_NV, programs[1]) glLoadProgramNV(GL_VERTEX_STATE_PROGRAM_NV, programs[0], program) assert_equal(glGetProgramStringNV(programs[0], GL_PROGRAM_STRING_NV), program) assert_equal(glIsProgramNV(programs[0]),true) assert_equal(glGetProgramivNV(programs[0],GL_PROGRAM_LENGTH_NV),program.size) glVertexAttribPointerNV(1,2,GL_FLOAT,0,[1,1].pack("f*")) assert_equal(glGetVertexAttribPointervNV(1),[1,1].pack("f*")) glExecuteProgramNV(GL_VERTEX_STATE_PROGRAM_NV,programs[0],[1,1,1,1]) glProgramParameter4dNV(GL_VERTEX_PROGRAM_NV,1, 1,2,3,4) assert_equal(glGetProgramParameterdvNV(GL_VERTEX_PROGRAM_NV,1,GL_PROGRAM_PARAMETER_NV),[1,2,3,4]) glProgramParameter4fNV(GL_VERTEX_PROGRAM_NV,1, 5,6,7,8) assert_equal(glGetProgramParameterfvNV(GL_VERTEX_PROGRAM_NV,1,GL_PROGRAM_PARAMETER_NV),[5,6,7,8]) glProgramParameter4dvNV(GL_VERTEX_PROGRAM_NV,1, [1,2,3,4]) assert_equal(glGetProgramParameterdvNV(GL_VERTEX_PROGRAM_NV,1,GL_PROGRAM_PARAMETER_NV),[1,2,3,4]) glProgramParameter4fvNV(GL_VERTEX_PROGRAM_NV,1, [5,6,7,8]) assert_equal(glGetProgramParameterfvNV(GL_VERTEX_PROGRAM_NV,1,GL_PROGRAM_PARAMETER_NV),[5,6,7,8]) glProgramParameters4fvNV(GL_VERTEX_PROGRAM_NV,1, [1,2,3,4,5,6,7,8]) assert_equal(glGetProgramParameterfvNV(GL_VERTEX_PROGRAM_NV,1,GL_PROGRAM_PARAMETER_NV),[1,2,3,4]) assert_equal(glGetProgramParameterfvNV(GL_VERTEX_PROGRAM_NV,2,GL_PROGRAM_PARAMETER_NV),[5,6,7,8]) glProgramParameters4dvNV(GL_VERTEX_PROGRAM_NV,1, [8,7,6,5,4,3,2,1]) assert_equal(glGetProgramParameterdvNV(GL_VERTEX_PROGRAM_NV,1,GL_PROGRAM_PARAMETER_NV),[8,7,6,5]) assert_equal(glGetProgramParameterdvNV(GL_VERTEX_PROGRAM_NV,2,GL_PROGRAM_PARAMETER_NV),[4,3,2,1]) glVertexAttrib1dNV(1,1) assert_equal(glGetVertexAttribdvNV(1,GL_CURRENT_ATTRIB_NV)[0],1) glVertexAttrib1fNV(1,2) assert_equal(glGetVertexAttribfvNV(1,GL_CURRENT_ATTRIB_NV)[0],2) glVertexAttrib1sNV(1,3) assert_equal(glGetVertexAttribivNV(1,GL_CURRENT_ATTRIB_NV)[0],3) glVertexAttrib1dvNV(1,[1]) assert_equal(glGetVertexAttribdvNV(1,GL_CURRENT_ATTRIB_NV)[0],1) glVertexAttrib1fvNV(1,[2]) assert_equal(glGetVertexAttribfvNV(1,GL_CURRENT_ATTRIB_NV)[0],2) glVertexAttrib1svNV(1,[3]) assert_equal(glGetVertexAttribivNV(1,GL_CURRENT_ATTRIB_NV)[0],3) glVertexAttrib2dNV(1,1,2) assert_equal(glGetVertexAttribdvNV(1,GL_CURRENT_ATTRIB_NV)[0,2],[1,2]) glVertexAttrib2fNV(1,2,3) assert_equal(glGetVertexAttribfvNV(1,GL_CURRENT_ATTRIB_NV)[0,2],[2,3]) glVertexAttrib2sNV(1,3,4) assert_equal(glGetVertexAttribivNV(1,GL_CURRENT_ATTRIB_NV)[0,2],[3,4]) glVertexAttrib2dvNV(1,[1,2]) assert_equal(glGetVertexAttribdvNV(1,GL_CURRENT_ATTRIB_NV)[0,2],[1,2]) glVertexAttrib2fvNV(1,[2,3]) assert_equal(glGetVertexAttribfvNV(1,GL_CURRENT_ATTRIB_NV)[0,2],[2,3]) glVertexAttrib2svNV(1,[3,4]) assert_equal(glGetVertexAttribivNV(1,GL_CURRENT_ATTRIB_NV)[0,2],[3,4]) glVertexAttrib3dNV(1,1,2,3) assert_equal(glGetVertexAttribdvNV(1,GL_CURRENT_ATTRIB_NV)[0,3],[1,2,3]) glVertexAttrib3fNV(1,2,3,4) assert_equal(glGetVertexAttribfvNV(1,GL_CURRENT_ATTRIB_NV)[0,3],[2,3,4]) glVertexAttrib3sNV(1,3,4,5) assert_equal(glGetVertexAttribivNV(1,GL_CURRENT_ATTRIB_NV)[0,3],[3,4,5]) glVertexAttrib3dvNV(1,[1,2,3]) assert_equal(glGetVertexAttribdvNV(1,GL_CURRENT_ATTRIB_NV)[0,3],[1,2,3]) glVertexAttrib3fvNV(1,[2,3,4]) assert_equal(glGetVertexAttribfvNV(1,GL_CURRENT_ATTRIB_NV)[0,3],[2,3,4]) glVertexAttrib3svNV(1,[3,4,5]) assert_equal(glGetVertexAttribivNV(1,GL_CURRENT_ATTRIB_NV)[0,3],[3,4,5]) glVertexAttrib4dNV(1,1,2,3,4) assert_equal(glGetVertexAttribdvNV(1,GL_CURRENT_ATTRIB_NV)[0,4],[1,2,3,4]) glVertexAttrib4fNV(1,2,3,4,5) assert_equal(glGetVertexAttribfvNV(1,GL_CURRENT_ATTRIB_NV)[0,4],[2,3,4,5]) glVertexAttrib4sNV(1,3,4,5,6) assert_equal(glGetVertexAttribivNV(1,GL_CURRENT_ATTRIB_NV)[0,4],[3,4,5,6]) glVertexAttrib4dvNV(1,[1,2,3,4]) assert_equal(glGetVertexAttribdvNV(1,GL_CURRENT_ATTRIB_NV)[0,4],[1,2,3,4]) glVertexAttrib4fvNV(1,[2,3,4,5]) assert_equal(glGetVertexAttribfvNV(1,GL_CURRENT_ATTRIB_NV)[0,4],[2,3,4,5]) glVertexAttrib4svNV(1,[3,4,5,6]) assert_equal(glGetVertexAttribivNV(1,GL_CURRENT_ATTRIB_NV)[0,4],[3,4,5,6]) glVertexAttrib4ubNV(1,2**8-1,0,2**8-1,0) assert_equal(glGetVertexAttribdvNV(1,GL_CURRENT_ATTRIB_NV)[0,4],[1,0,1,0]) glVertexAttrib4ubvNV(1,[0,2**8-1,0,2**8-1]) assert_equal(glGetVertexAttribdvNV(1,GL_CURRENT_ATTRIB_NV)[0,4],[0,1,0,1]) glVertexAttribs1dvNV(1,[1,2]) assert_equal(glGetVertexAttribdvNV(1,GL_CURRENT_ATTRIB_NV)[0],1) assert_equal(glGetVertexAttribdvNV(2,GL_CURRENT_ATTRIB_NV)[0],2) glVertexAttribs1fvNV(1,[3,4]) assert_equal(glGetVertexAttribdvNV(1,GL_CURRENT_ATTRIB_NV)[0],3) assert_equal(glGetVertexAttribdvNV(2,GL_CURRENT_ATTRIB_NV)[0],4) glVertexAttribs1svNV(1,[5,6]) assert_equal(glGetVertexAttribdvNV(1,GL_CURRENT_ATTRIB_NV)[0],5) assert_equal(glGetVertexAttribdvNV(2,GL_CURRENT_ATTRIB_NV)[0],6) glVertexAttribs2dvNV(1,[1,2,3,4]) assert_equal(glGetVertexAttribdvNV(1,GL_CURRENT_ATTRIB_NV)[0,2],[1,2]) assert_equal(glGetVertexAttribdvNV(2,GL_CURRENT_ATTRIB_NV)[0,2],[3,4]) glVertexAttribs2fvNV(1,[3,4,5,6]) assert_equal(glGetVertexAttribdvNV(1,GL_CURRENT_ATTRIB_NV)[0,2],[3,4]) assert_equal(glGetVertexAttribdvNV(2,GL_CURRENT_ATTRIB_NV)[0,2],[5,6]) glVertexAttribs2svNV(1,[5,6,7,8]) assert_equal(glGetVertexAttribdvNV(1,GL_CURRENT_ATTRIB_NV)[0,2],[5,6]) assert_equal(glGetVertexAttribdvNV(2,GL_CURRENT_ATTRIB_NV)[0,2],[7,8]) glVertexAttribs3dvNV(1,[1,2,3,4,5,6]) assert_equal(glGetVertexAttribdvNV(1,GL_CURRENT_ATTRIB_NV)[0,3],[1,2,3]) assert_equal(glGetVertexAttribdvNV(2,GL_CURRENT_ATTRIB_NV)[0,3],[4,5,6]) glVertexAttribs3fvNV(1,[3,4,5,6,7,8]) assert_equal(glGetVertexAttribdvNV(1,GL_CURRENT_ATTRIB_NV)[0,3],[3,4,5]) assert_equal(glGetVertexAttribdvNV(2,GL_CURRENT_ATTRIB_NV)[0,3],[6,7,8]) glVertexAttribs3svNV(1,[5,6,7,8,9,10]) assert_equal(glGetVertexAttribdvNV(1,GL_CURRENT_ATTRIB_NV)[0,3],[5,6,7]) assert_equal(glGetVertexAttribdvNV(2,GL_CURRENT_ATTRIB_NV)[0,3],[8,9,10]) glVertexAttribs4dvNV(1,[1,2,3,4,5,6,7,8]) assert_equal(glGetVertexAttribdvNV(1,GL_CURRENT_ATTRIB_NV)[0,4],[1,2,3,4]) assert_equal(glGetVertexAttribdvNV(2,GL_CURRENT_ATTRIB_NV)[0,4],[5,6,7,8]) glVertexAttribs4fvNV(1,[3,4,5,6,7,8,9,10]) assert_equal(glGetVertexAttribdvNV(1,GL_CURRENT_ATTRIB_NV)[0,4],[3,4,5,6]) assert_equal(glGetVertexAttribdvNV(2,GL_CURRENT_ATTRIB_NV)[0,4],[7,8,9,10]) glVertexAttribs4svNV(1,[5,6,7,8,9,10,11,12]) assert_equal(glGetVertexAttribdvNV(1,GL_CURRENT_ATTRIB_NV)[0,4],[5,6,7,8]) assert_equal(glGetVertexAttribdvNV(2,GL_CURRENT_ATTRIB_NV)[0,4],[9,10,11,12]) glVertexAttribs4ubvNV(1,[2**8-1,0,2**8-1,0,2**8-1,0,2**8-1,0]) assert_equal(glGetVertexAttribdvNV(1,GL_CURRENT_ATTRIB_NV)[0,4],[1,0,1,0]) assert_equal(glGetVertexAttribdvNV(2,GL_CURRENT_ATTRIB_NV)[0,4],[1,0,1,0]) glTrackMatrixNV(GL_VERTEX_PROGRAM_NV, 4, GL_MATRIX0_NV, GL_IDENTITY_NV); assert_equal(glGetTrackMatrixivNV(GL_VERTEX_PROGRAM_NV, 4, GL_TRACK_MATRIX_NV),GL_MATRIX0_NV) glRequestResidentProgramsNV(programs[0]) res = glAreProgramsResidentNV(programs[0]) assert_equal(res.size,1) glDeleteProgramsNV(programs) end def test_gl_nv_fragment_program return if not supported?("GL_NV_fragment_program") programs = glGenProgramsNV(1) program = "!!FP1.0\nDECLARE test = {0,0,0,0};\nEND" glBindProgramNV(GL_FRAGMENT_PROGRAM_NV, programs[0]) glLoadProgramNV(GL_FRAGMENT_PROGRAM_NV, programs[0], program) glProgramNamedParameter4fNV(programs[0],"test",1,2,3,4) assert_equal(glGetProgramNamedParameterfvNV(programs[0],"test"),[1,2,3,4]) glProgramNamedParameter4dNV(programs[0],"test",5,6,7,8) assert_equal(glGetProgramNamedParameterdvNV(programs[0],"test"),[5,6,7,8]) glProgramNamedParameter4fvNV(programs[0],"test",[1,2,3,4]) assert_equal(glGetProgramNamedParameterfvNV(programs[0],"test"),[1,2,3,4]) glProgramNamedParameter4dvNV(programs[0],"test",[5,6,7,8]) assert_equal(glGetProgramNamedParameterdvNV(programs[0],"test"),[5,6,7,8]) glDeleteProgramsNV(programs) end def test_gl_nv_framebuffer_multisample_coverage return if not supported?("GL_NV_framebuffer_multisample_coverage") rb = glGenRenderbuffersEXT(1)[0] glBindRenderbufferEXT(GL_RENDERBUFFER_EXT,rb) glRenderbufferStorageMultisampleCoverageNV(GL_RENDERBUFFER_EXT,4,4, GL_RGBA,2,2) samples = glGetRenderbufferParameterivEXT(GL_RENDERBUFFER_EXT,GL_RENDERBUFFER_COVERAGE_SAMPLES_NV) assert_equal(samples,4) samples = glGetRenderbufferParameterivEXT(GL_RENDERBUFFER_EXT,GL_RENDERBUFFER_COLOR_SAMPLES_NV) assert_equal(samples,4) glDeleteRenderbuffersEXT(rb) end def test_gl_nv_fence return if not supported?("GL_NV_fence") fences = glGenFencesNV(2) assert_equal(fences.size,2) glSetFenceNV(fences[0],GL_ALL_COMPLETED_NV) assert_equal(glGetFenceivNV(fences[0],GL_FENCE_CONDITION_NV),GL_ALL_COMPLETED_NV) assert_equal(glIsFenceNV(fences[0]),true) glFinishFenceNV(fences[0]) assert_equal(glTestFenceNV(fences[0]),true) glDeleteFencesNV(fences) end def test_gl_nv_depth_buffer_float return if not supported?("GL_NV_depth_buffer_float") glDepthRangedNV(0.1,0.2) assert(approx_equal(glGetFloatv(GL_DEPTH_RANGE),[0.1,0.2])) glDepthBoundsdNV(0.1,0.2) assert(approx_equal(glGetFloatv(GL_DEPTH_BOUNDS_EXT),[0.1,0.2])) glClearDepthdNV(0.3) assert(approx_equal([glGetDoublev(GL_DEPTH_CLEAR_VALUE)],[0.3])) end def test_gl_nv_occlusion_query return if not supported?("GL_NV_occlusion_query") queries = glGenOcclusionQueriesNV(2) assert_equal(queries.size,2) glBeginOcclusionQueryNV(queries[0]) assert_equal(glIsOcclusionQueryNV(queries[0]),true) glEndOcclusionQueryNV() r = glGetOcclusionQueryivNV(queries[0],GL_PIXEL_COUNT_AVAILABLE_NV) assert(r==GL_TRUE || r==GL_FALSE) assert(glGetOcclusionQueryuivNV(queries[0],GL_PIXEL_COUNT_NV)>=0) glDeleteOcclusionQueriesNV(queries) assert_equal(glIsOcclusionQueryNV(queries[1]),false) end def test_gl_nv_gpu_program4 return if not supported?(["GL_NV_gpu_program4","GL_ARB_vertex_program"]) programs = glGenProgramsARB(1) program = "!!ARBvp1.0\nTEMP vv;\nEND" glBindProgramARB(GL_VERTEX_PROGRAM_ARB, programs[0]) glProgramStringARB(GL_VERTEX_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, program) glProgramLocalParameterI4iNV(GL_VERTEX_PROGRAM_ARB,1, 1,2,3,4) assert_equal(glGetProgramLocalParameterIivNV(GL_VERTEX_PROGRAM_ARB,1),[1,2,3,4]) glProgramLocalParameterI4uiNV(GL_VERTEX_PROGRAM_ARB,1, 5,6,7,8) assert_equal(glGetProgramLocalParameterIuivNV(GL_VERTEX_PROGRAM_ARB,1),[5,6,7,8]) glProgramLocalParameterI4ivNV(GL_VERTEX_PROGRAM_ARB,1, [1,2,3,4]) assert_equal(glGetProgramLocalParameterIivNV(GL_VERTEX_PROGRAM_ARB,1),[1,2,3,4]) glProgramLocalParameterI4uivNV(GL_VERTEX_PROGRAM_ARB,1, [5,6,7,8]) assert_equal(glGetProgramLocalParameterIuivNV(GL_VERTEX_PROGRAM_ARB,1),[5,6,7,8]) glProgramLocalParametersI4ivNV(GL_VERTEX_PROGRAM_ARB,1, [1,2,3,4]) assert_equal(glGetProgramLocalParameterIivNV(GL_VERTEX_PROGRAM_ARB,1),[1,2,3,4]) glProgramLocalParametersI4uivNV(GL_VERTEX_PROGRAM_ARB,1, [5,6,7,8]) assert_equal(glGetProgramLocalParameterIuivNV(GL_VERTEX_PROGRAM_ARB,1),[5,6,7,8]) glProgramEnvParameterI4iNV(GL_VERTEX_PROGRAM_ARB,1, 1,2,3,4) assert_equal(glGetProgramEnvParameterIivNV(GL_VERTEX_PROGRAM_ARB,1),[1,2,3,4]) glProgramEnvParameterI4uiNV(GL_VERTEX_PROGRAM_ARB,1, 5,6,7,8) assert_equal(glGetProgramEnvParameterIuivNV(GL_VERTEX_PROGRAM_ARB,1),[5,6,7,8]) glProgramEnvParameterI4ivNV(GL_VERTEX_PROGRAM_ARB,1, [1,2,3,4]) assert_equal(glGetProgramEnvParameterIivNV(GL_VERTEX_PROGRAM_ARB,1),[1,2,3,4]) glProgramEnvParameterI4uivNV(GL_VERTEX_PROGRAM_ARB,1, [5,6,7,8]) assert_equal(glGetProgramEnvParameterIuivNV(GL_VERTEX_PROGRAM_ARB,1),[5,6,7,8]) glProgramEnvParametersI4ivNV(GL_VERTEX_PROGRAM_ARB,1, [1,2,3,4]) assert_equal(glGetProgramEnvParameterIivNV(GL_VERTEX_PROGRAM_ARB,1),[1,2,3,4]) glProgramEnvParametersI4uivNV(GL_VERTEX_PROGRAM_ARB,1, [5,6,7,8]) assert_equal(glGetProgramEnvParameterIuivNV(GL_VERTEX_PROGRAM_ARB,1),[5,6,7,8]) glDeleteProgramsARB(programs) end def test_gl_nv_gpu_program4 return if not supported?(["GL_NV_gpu_program4","GL_EXT_framebuffer_object"]) geometry_program = <<-EOP !!NVgp4.0 PRIMITIVE_IN TRIANGLES; PRIMITIVE_OUT TRIANGLE_STRIP; VERTICES_OUT 1; END EOP program_id = glGenProgramsARB(1)[0] glBindProgramARB(GL_GEOMETRY_PROGRAM_NV, program_id) glProgramStringARB(GL_GEOMETRY_PROGRAM_NV, GL_PROGRAM_FORMAT_ASCII_ARB, geometry_program); assert_equal(glGetProgramivARB(GL_GEOMETRY_PROGRAM_NV,GL_GEOMETRY_VERTICES_OUT_EXT),1) glProgramVertexLimitNV(GL_GEOMETRY_PROGRAM_NV, 2) assert_equal(glGetProgramivARB(GL_GEOMETRY_PROGRAM_NV,GL_GEOMETRY_VERTICES_OUT_EXT),2) # fbo = glGenFramebuffersEXT(1)[0] glBindFramebufferEXT(GL_FRAMEBUFFER_EXT,fbo) texture2d,texture3d,texture_cube = glGenTextures(3) glBindTexture(GL_TEXTURE_2D, texture2d) glBindTexture(GL_TEXTURE_3D, texture3d) glBindTexture(GL_TEXTURE_CUBE_MAP, texture_cube) glFramebufferTextureEXT(GL_FRAMEBUFFER_EXT,GL_COLOR_ATTACHMENT0_EXT,texture2d,0) assert_equal(glGetFramebufferAttachmentParameterivEXT(GL_FRAMEBUFFER_EXT,GL_COLOR_ATTACHMENT0_EXT, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT),texture2d) assert_equal(glGetFramebufferAttachmentParameterivEXT(GL_FRAMEBUFFER_EXT,GL_COLOR_ATTACHMENT0_EXT,GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT),0) glFramebufferTextureLayerEXT(GL_FRAMEBUFFER_EXT,GL_COLOR_ATTACHMENT0_EXT,texture3d,0,1) assert_equal(glGetFramebufferAttachmentParameterivEXT(GL_FRAMEBUFFER_EXT,GL_COLOR_ATTACHMENT0_EXT,GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT),texture3d) assert_equal(glGetFramebufferAttachmentParameterivEXT(GL_FRAMEBUFFER_EXT,GL_COLOR_ATTACHMENT0_EXT,GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT),0) assert_equal(glGetFramebufferAttachmentParameterivEXT(GL_FRAMEBUFFER_EXT,GL_COLOR_ATTACHMENT0_EXT,GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT),1) glFramebufferTextureFaceEXT(GL_FRAMEBUFFER_EXT,GL_COLOR_ATTACHMENT0_EXT,texture_cube,0,GL_TEXTURE_CUBE_MAP_POSITIVE_X) assert_equal(glGetFramebufferAttachmentParameterivEXT(GL_FRAMEBUFFER_EXT,GL_COLOR_ATTACHMENT0_EXT,GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT),texture_cube) assert_equal(glGetFramebufferAttachmentParameterivEXT(GL_FRAMEBUFFER_EXT,GL_COLOR_ATTACHMENT0_EXT,GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT),0) assert_equal(glGetFramebufferAttachmentParameterivEXT(GL_FRAMEBUFFER_EXT,GL_COLOR_ATTACHMENT0_EXT,GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT),GL_TEXTURE_CUBE_MAP_POSITIVE_X) glDeleteTextures([texture2d,texture3d]) glDeleteFramebuffersEXT(fbo) glDeleteProgramsARB(program_id) end def test_gl_nv_primitive_restart return if not supported?("GL_NV_primitive_restart") glBegin(GL_TRIANGLES) glPrimitiveRestartNV() glEnd glPrimitiveRestartIndexNV(2) assert_equal(glGetIntegerv(GL_PRIMITIVE_RESTART_INDEX_NV),2) end def test_gl_nv_point_sprite return if not supported?("GL_NV_point_sprite") glPointParameteriNV(GL_POINT_SPRITE_R_MODE_NV, GL_ZERO) assert_equal(glGetIntegerv(GL_POINT_SPRITE_R_MODE_NV),GL_ZERO) glPointParameteriNV(GL_POINT_SPRITE_R_MODE_NV, GL_S) assert_equal(glGetIntegerv(GL_POINT_SPRITE_R_MODE_NV),GL_S) glPointParameterivNV(GL_POINT_SPRITE_R_MODE_NV, [GL_ZERO]) assert_equal(glGetIntegerv(GL_POINT_SPRITE_R_MODE_NV),GL_ZERO) glPointParameterivNV(GL_POINT_SPRITE_R_MODE_NV, [GL_S]) assert_equal(glGetIntegerv(GL_POINT_SPRITE_R_MODE_NV),GL_S) end end ruby-opengl-0.60.1.orig/test/tc_func_15.rb0000644000000000000000000001627111377006423016742 0ustar rootroot# # Copyright (C) 2007 Jan Dvorak # # This program is distributed under the terms of the MIT license. # See the included MIT-LICENSE file for the terms of this license. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # require 'test/unit' class Test_15 < Test::Unit::TestCase def setup common_setup() end def teardown common_teardown() end def test_query return if not supported?(1.5) queries = glGenQueries(2) assert_equal(queries.size,2) glBeginQuery(GL_SAMPLES_PASSED,queries[1]) assert_equal(glIsQuery(queries[1]),true) glBegin(GL_TRIANGLES) glVertex2i(0,0) glVertex2i(1,0) glVertex2i(1,1) glEnd() assert_equal(glGetQueryiv(GL_SAMPLES_PASSED,GL_CURRENT_QUERY),queries[1]) glEndQuery(GL_SAMPLES_PASSED) r = glGetQueryObjectiv(queries[1],GL_QUERY_RESULT_AVAILABLE) assert((r==GL_TRUE || r==GL_FALSE)) if (r==GL_TRUE) assert(glGetQueryObjectiv(queries[1],GL_QUERY_RESULT)[0] > 0) assert(glGetQueryObjectuiv(queries[1],GL_QUERY_RESULT)[0] > 0) end glDeleteQueries(queries) assert_equal(glIsQuery(queries[1]),false) end def test_buffers return if not supported?(1.5) buffers = glGenBuffers(2) glBindBuffer(GL_ARRAY_BUFFER,buffers[0]) assert_equal(glIsBuffer(buffers[0]),true) data = [0,1,2,3].pack("C*") data2 = [4,5,6,7].pack("C*") glBufferData(GL_ARRAY_BUFFER,4,data,GL_STREAM_READ) assert_equal(glGetBufferSubData(GL_ARRAY_BUFFER,0,4),data) assert_equal(glGetBufferParameteriv(GL_ARRAY_BUFFER,GL_BUFFER_USAGE),GL_STREAM_READ) glBufferSubData(GL_ARRAY_BUFFER,0,4,data2) assert_equal(glGetBufferSubData(GL_ARRAY_BUFFER,0,4),data2) assert_equal(glMapBuffer(GL_ARRAY_BUFFER,GL_READ_ONLY),data2) r = glUnmapBuffer(GL_ARRAY_BUFFER) assert(r == true || r == false) glDeleteBuffers(buffers) assert_equal(glIsBuffer(buffers[0]),false) # FIXME: GetBufferPointerv not yet implemented end def test_buffer_binding_element_array return if not supported?(1.5) glEnableClientState(GL_VERTEX_ARRAY) va = [0,0, 0,1, 1,1].pack("f*") glVertexPointer(2,GL_FLOAT,0,va) # data = [0,1,2].pack("C*") buffers = glGenBuffers(1) glBindBuffer(GL_ELEMENT_ARRAY_BUFFER,buffers[0]) glBufferData(GL_ELEMENT_ARRAY_BUFFER,3,data,GL_DYNAMIC_DRAW) # feedback = glFeedbackBuffer(256,GL_3D) glRenderMode(GL_FEEDBACK) glDrawElements(GL_TRIANGLES,3,GL_UNSIGNED_BYTE,0) glDrawRangeElements(GL_TRIANGLES,0,3,3,GL_UNSIGNED_BYTE,0) count = glRenderMode(GL_RENDER) assert_equal(count,22) glDisableClientState(GL_VERTEX_ARRAY) glDeleteBuffers(buffers) end def test_buffer_binding_array_1 return if not supported?(1.5) glEnableClientState(GL_VERTEX_ARRAY) va = [0,0, 0,1, 1,1].pack("f*") # buffers = glGenBuffers(1) glBindBuffer(GL_ARRAY_BUFFER,buffers[0]) glBufferData(GL_ARRAY_BUFFER,6*4,va,GL_DYNAMIC_DRAW) glVertexPointer(2,GL_FLOAT,0,0) assert_equal(glGetPointerv(GL_VERTEX_ARRAY_POINTER),0) # feedback = glFeedbackBuffer(256,GL_3D) glRenderMode(GL_FEEDBACK) glDrawElements(GL_TRIANGLES,3,GL_UNSIGNED_BYTE,[0,1,2].pack("f*")) count = glRenderMode(GL_RENDER) assert_equal(count,11) glDeleteBuffers(buffers) glDisableClientState(GL_VERTEX_ARRAY) end def test_buffer_binding_array_2 return if not supported?(1.5) efa = [0].pack("C*") na = [0,1,0].pack("f*") ca = [1,0,1,0].pack("f*") ta = [1,0,1,0].pack("f*") buffers = glGenBuffers(4) # load data into buffers buffer_efa,buffer_na,buffer_ca,buffer_ta = buffers glBindBuffer(GL_ARRAY_BUFFER,buffer_efa) glBufferData(GL_ARRAY_BUFFER,1,efa,GL_DYNAMIC_DRAW) glBindBuffer(GL_ARRAY_BUFFER,buffer_na) glBufferData(GL_ARRAY_BUFFER,3*4,na,GL_DYNAMIC_DRAW) glBindBuffer(GL_ARRAY_BUFFER,buffer_ca) glBufferData(GL_ARRAY_BUFFER,4*4,ca,GL_DYNAMIC_DRAW) glBindBuffer(GL_ARRAY_BUFFER,buffer_ta) glBufferData(GL_ARRAY_BUFFER,4*4,ta,GL_DYNAMIC_DRAW) # load buffers into arrays glBindBuffer(GL_ARRAY_BUFFER,buffer_na) glEdgeFlagPointer(0,0) assert_equal(glGetPointerv(GL_EDGE_FLAG_ARRAY_POINTER),0) glBindBuffer(GL_ARRAY_BUFFER,buffer_na) glNormalPointer(GL_FLOAT,0,0) assert_equal(glGetPointerv(GL_NORMAL_ARRAY_POINTER),0) glBindBuffer(GL_ARRAY_BUFFER,buffer_ca) glColorPointer(4,GL_FLOAT,0,0) assert_equal(glGetPointerv(GL_COLOR_ARRAY_POINTER),0) glBindBuffer(GL_ARRAY_BUFFER,buffer_ta) glTexCoordPointer(4,GL_FLOAT,0,0) assert_equal(glGetPointerv(GL_TEXTURE_COORD_ARRAY_POINTER),0) # not really testing index glIndexPointer(GL_INT,2,0) assert_equal(glGetPointerv(GL_INDEX_ARRAY_POINTER),0) # draw arrays glEnable(GL_NORMAL_ARRAY) glEnable(GL_COLOR_ARRAY) glEnable(GL_TEXTURE_COORD_ARRAY) glEnable(GL_EDGE_FLAG_ARRAY) glBegin(GL_TRIANGLES) glArrayElement(0) glEnd() assert_equal(glGetDoublev(GL_CURRENT_NORMAL),[0,1,0]) assert_equal(glGetDoublev(GL_CURRENT_COLOR),[1,0,1,0]) assert_equal(glGetDoublev(GL_CURRENT_TEXTURE_COORDS),[1,0,1,0]) assert_equal(glGetBooleanv(GL_EDGE_FLAG),GL_FALSE) glDisable(GL_EDGE_FLAG_ARRAY) glDisable(GL_TEXTURE_COORD_ARRAY) glDisable(GL_COLOR_ARRAY) glDisable(GL_NORMAL_ARRAY) glDeleteBuffers(buffers) end def test_buffer_binding_array_3 return if not supported?(1.5) sc = [0,1,0].pack("f*") fc = [1].pack("f*") buffers = glGenBuffers(2) # load data into buffers buffer_sc,buffer_fc = buffers glBindBuffer(GL_ARRAY_BUFFER,buffer_sc) glBufferData(GL_ARRAY_BUFFER,3*4,sc,GL_DYNAMIC_DRAW) glBindBuffer(GL_ARRAY_BUFFER,buffer_fc) glBufferData(GL_ARRAY_BUFFER,1*4,fc,GL_DYNAMIC_DRAW) # load buffers into arrays glBindBuffer(GL_ARRAY_BUFFER,buffer_sc) glSecondaryColorPointer(3,GL_FLOAT,0,0) assert_equal(glGetPointerv(GL_SECONDARY_COLOR_ARRAY_POINTER),0) glBindBuffer(GL_ARRAY_BUFFER,buffer_fc) glFogCoordPointer(GL_FLOAT,0,0) assert_equal(glGetPointerv(GL_FOG_COORD_ARRAY_POINTER),0) # draw arrays glEnableClientState(GL_SECONDARY_COLOR_ARRAY) glEnableClientState(GL_FOG_COORD_ARRAY) glBegin(GL_TRIANGLES) glArrayElement(0) glEnd() assert_equal(glGetDoublev(GL_CURRENT_SECONDARY_COLOR),[0,1,0,1]) assert_equal(glGetDoublev(GL_CURRENT_FOG_COORD),1) glDisableClientState(GL_SECONDARY_COLOR_ARRAY) glDisableClientState(GL_FOG_COORD_ARRAY) glDeleteBuffers(buffers) end def test_buffer_binding_array_4 return if not supported?(1.5) va = [0,0, 1,0, 1,1, 0,0, 1,0, 0,1].pack("f*") glVertexPointer(2,GL_FLOAT,0,va) glEnable(GL_VERTEX_ARRAY) buf = glFeedbackBuffer(256,GL_3D) glRenderMode(GL_FEEDBACK) data = [0,1,2,3,4,5] buffers = glGenBuffers(3) glBindBuffer(GL_ELEMENT_ARRAY_BUFFER,buffers[0]) glBufferData(GL_ELEMENT_ARRAY_BUFFER,6,data.pack("C*"),GL_DYNAMIC_DRAW) glMultiDrawElements(GL_TRIANGLES,GL_UNSIGNED_BYTE,[3,3],[0,3]) count = glRenderMode(GL_RENDER) assert_equal(count,(3*3+2)*2) glDisable(GL_VERTEX_ARRAY) glDeleteBuffers(buffers) end end ruby-opengl-0.60.1.orig/test/tc_func_10_11.rb0000644000000000000000000011433211377006423017233 0ustar rootroot# # Copyright (C) 2007 Jan Dvorak # # This program is distributed under the terms of the MIT license. # See the included MIT-LICENSE file for the terms of this license. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # require 'test/unit' class Test_10_11 < Test::Unit::TestCase def setup common_setup() end def teardown common_teardown() end def test_glhint glHint(GL_FOG_HINT,GL_NICEST) assert_equal(glGetIntegerv(GL_FOG_HINT), GL_NICEST) glHint(GL_FOG_HINT,GL_FASTEST) assert_equal(glGetIntegerv(GL_FOG_HINT), GL_FASTEST) end def test_glindex glIndexd(2.0) assert_in_delta(glGetDoublev(GL_CURRENT_INDEX),2.0,0.001) glIndexdv([3.0]) assert_in_delta(glGetDoublev(GL_CURRENT_INDEX),3.0,0.001) glIndexf(4.0) assert_in_delta(glGetFloatv(GL_CURRENT_INDEX),4.0,0.001) glIndexfv([5.0]) assert_in_delta(glGetFloatv(GL_CURRENT_INDEX),5.0,0.001) glIndexi(6) assert_in_delta(glGetIntegerv(GL_CURRENT_INDEX),6,0.001) glIndexiv([7]) assert_in_delta(glGetIntegerv(GL_CURRENT_INDEX),7,0.001) glIndexs(8) assert_in_delta(glGetIntegerv(GL_CURRENT_INDEX),8,0.001) glIndexsv([9]) assert_in_delta(glGetIntegerv(GL_CURRENT_INDEX),9,0.001) glIndexub(10) assert_in_delta(glGetIntegerv(GL_CURRENT_INDEX),10,0.001) glIndexubv([11]) assert_in_delta(glGetIntegerv(GL_CURRENT_INDEX),11,0.001) # index pointer glIndexPointer(GL_INT,2,"") assert_equal(glGetIntegerv(GL_INDEX_ARRAY_STRIDE),2) assert_equal(glGetIntegerv(GL_INDEX_ARRAY_TYPE),GL_INT) end def test_glclear glClearColor(1,0,1,0) assert_equal(glGetDoublev(GL_COLOR_CLEAR_VALUE),[1,0,1,0]) glClearIndex(2) assert_equal(glGetDoublev(GL_INDEX_CLEAR_VALUE),2) glClearAccum(0.5,0.5,0.5,0.5) assert_equal(glGetDoublev(GL_ACCUM_CLEAR_VALUE),[0.5,0.5,0.5,0.5]) glClearStencil(1) assert_equal(glGetIntegerv(GL_STENCIL_CLEAR_VALUE),1) glClearDepth(0.5) assert_equal(glGetDoublev(GL_DEPTH_CLEAR_VALUE),0.5) end def test_glclientattrib glPixelStorei(GL_PACK_ALIGNMENT,2) glPushClientAttrib(GL_CLIENT_PIXEL_STORE_BIT) glPixelStorei(GL_PACK_ALIGNMENT,4) assert_equal(glGetIntegerv(GL_PACK_ALIGNMENT),4) glPopClientAttrib() assert_equal(glGetIntegerv(GL_PACK_ALIGNMENT),2) end def test_matrix m_a = [[2.0,0.0,0.0,0.0], [0.0,2.0,0.0,0.0], [0.0,0.0,2.0,0.0], [0.0,0.0,0.0,2.0]] m_b = [[3.0,0.0,0.0,0.0], [0.0,3.0,0.0,0.0], [0.0,0.0,3.0,0.0], [0.0,0.0,0.0,3.0]] m_ident = [[1.0,0.0,0.0,0.0], [0.0,1.0,0.0,0.0], [0.0,0.0,1.0,0.0], [0.0,0.0,0.0,1.0]] # 1 glMatrixMode(GL_MODELVIEW) glLoadMatrixf(m_a) assert_equal(glGetDoublev(GL_MODELVIEW_MATRIX), m_a) glLoadMatrixd(m_b) assert_equal(glGetDoublev(GL_MODELVIEW_MATRIX), m_b) glLoadIdentity() assert_equal(glGetDoublev(GL_MODELVIEW_MATRIX), m_ident) glMultMatrixf(m_a) assert_equal(glGetDoublev(GL_MODELVIEW_MATRIX), m_a) glLoadIdentity() glMultMatrixd(m_b) assert_equal(glGetDoublev(GL_MODELVIEW_MATRIX), m_b) # 2 glMatrixMode(GL_MODELVIEW) glLoadMatrixf(m_a) glMatrixMode(GL_PROJECTION) glLoadMatrixf(m_b) assert_equal(glGetDoublev(GL_MODELVIEW_MATRIX), m_a) assert_equal(glGetDoublev(GL_PROJECTION_MATRIX), m_b) glMatrixMode(GL_MODELVIEW) glLoadMatrixf(m_a) glPushMatrix() glLoadMatrixf(m_b) assert_equal(glGetDoublev(GL_MODELVIEW_MATRIX), m_b) glPopMatrix() assert_equal(glGetDoublev(GL_MODELVIEW_MATRIX), m_a) # 3 m = Matrix.rows([[1,2,3,4],[5,6,7,8],[9,10,11,12],[13,14,15,16]]) glMatrixMode(GL_MODELVIEW) glLoadMatrixf(m) assert_equal(glGetDoublev(GL_MODELVIEW_MATRIX), m.to_a) glLoadIdentity() glLoadMatrixd(m) assert_equal(glGetDoublev(GL_MODELVIEW_MATRIX), m.to_a) glLoadIdentity() glMultMatrixf(m) assert_equal(glGetDoublev(GL_MODELVIEW_MATRIX), m.to_a) glLoadIdentity() glMultMatrixd(m) assert_equal(glGetDoublev(GL_MODELVIEW_MATRIX), m.to_a) assert_raise ArgumentError do glLoadMatrixf([1,2,3,4]) end assert_raise ArgumentError do glLoadMatrixd([1,2,3,4]) end assert_raise ArgumentError do glMultMatrixf([1,2,3,4]) end assert_raise ArgumentError do glMultMatrixd([1,2,3,4]) end end def test_gledge glEdgeFlag(GL_FALSE) assert_equal(glGetBooleanv(GL_EDGE_FLAG),false) glEdgeFlag(GL_TRUE) assert_equal(glGetBooleanv(GL_EDGE_FLAG),true) glEdgeFlagv([GL_FALSE]) assert_equal(glGetBooleanv(GL_EDGE_FLAG),false) end def test_clientstate glEnableClientState(GL_COLOR_ARRAY) assert_equal(glIsEnabled(GL_COLOR_ARRAY),true) glDisableClientState(GL_COLOR_ARRAY) assert_equal(glIsEnabled(GL_COLOR_ARRAY),false) end def test_glshademodel glShadeModel(GL_FLAT) assert_equal(glGetIntegerv(GL_SHADE_MODEL),GL_FLAT) glShadeModel(GL_SMOOTH) assert_equal(glGetIntegerv(GL_SHADE_MODEL),GL_SMOOTH) end def test_glclipplane glClipPlane(GL_CLIP_PLANE0,[1,2,3,4]) assert_equal(glGetClipPlane(GL_CLIP_PLANE0),[1,2,3,4]) end def test_polygonoffset glPolygonOffset(2.0,3.0) assert_equal(glGetDoublev(GL_POLYGON_OFFSET_FACTOR),2.0) assert_equal(glGetDoublev(GL_POLYGON_OFFSET_UNITS),3.0) end def test_glviewport glViewport(1,2,3,4) assert_equal(glGetIntegerv(GL_VIEWPORT), [1,2,3,4]) end def test_mask glStencilMask(2) assert_equal(glGetIntegerv(GL_STENCIL_WRITEMASK), 2) glStencilMask(1) assert_equal(glGetIntegerv(GL_STENCIL_BACK_WRITEMASK), 1) glColorMask(GL_TRUE,GL_FALSE,GL_TRUE,GL_FALSE) assert_equal(glGetBooleanv(GL_COLOR_WRITEMASK),[true,false,true,false]) glDepthMask(GL_TRUE) assert_equal(glGetBooleanv(GL_DEPTH_WRITEMASK),true) glDepthMask(GL_FALSE) assert_equal(glGetBooleanv(GL_DEPTH_WRITEMASK),false) glIndexMask(2) assert_equal(glGetIntegerv(GL_INDEX_WRITEMASK), 2) glIndexMask(1) assert_equal(glGetIntegerv(GL_INDEX_WRITEMASK), 1) end def test_glflush begin glBegin(GL_POINTS) glFlush() glEnd rescue Gl::Error => err assert(err.id == GL_INVALID_OPERATION) end end def test_glfinish begin glBegin(GL_POINTS) glFinish() glEnd rescue Gl::Error => err assert(err.id == GL_INVALID_OPERATION) end end def test_glgetstring assert(glGetString(GL_VERSION).size > 0) end def test_glscissor glScissor(1,2,3,4) assert_equal(glGetIntegerv(GL_SCISSOR_BOX),[1,2,3,4]) end def test_glstencilfunc glStencilFunc(GL_LEQUAL,2,3) assert_equal(glGetIntegerv(GL_STENCIL_FUNC),GL_LEQUAL) assert_equal(glGetIntegerv(GL_STENCIL_REF),2) assert_equal(glGetIntegerv(GL_STENCIL_VALUE_MASK),3) end def test_glstencilop glStencilOp(GL_ZERO,GL_REPLACE,GL_INCR) assert_equal(glGetIntegerv(GL_STENCIL_FAIL),GL_ZERO) assert_equal(glGetIntegerv(GL_STENCIL_PASS_DEPTH_FAIL),GL_REPLACE) assert_equal(glGetIntegerv(GL_STENCIL_PASS_DEPTH_PASS),GL_INCR) end def test_gllogicop glLogicOp(GL_NAND) assert_equal(glGetIntegerv(GL_LOGIC_OP_MODE),GL_NAND) end def test_glfrustum glMatrixMode(GL_PROJECTION) glLoadIdentity() glFrustum(1,2,3,4,5,6) assert_equal(glGetDoublev(GL_PROJECTION_MATRIX),[[10.0, 0.0, 0.0, 0.0], [0.0, 10.0, 0.0, 0.0], [3.0, 7.0, -11.0, -1.0], [0.0, 0.0, -60.0, 0.0]]) end def test_gldepthrange glDepthRange(0.5,0.5) assert_equal(glGetDoublev(GL_DEPTH_RANGE),[0.5,0.5]) end def test_func glAlphaFunc(GL_GREATER,0.5) assert_equal(glGetIntegerv(GL_ALPHA_TEST_FUNC),GL_GREATER) assert_equal(glGetDoublev(GL_ALPHA_TEST_REF),0.5) glBlendFunc(GL_CONSTANT_ALPHA, GL_ONE_MINUS_DST_COLOR) assert_equal(glGetIntegerv(GL_BLEND_SRC),GL_CONSTANT_ALPHA) assert_equal(glGetIntegerv(GL_BLEND_DST),GL_ONE_MINUS_DST_COLOR) glDepthFunc(GL_LEQUAL) assert_equal(glGetIntegerv(GL_DEPTH_FUNC),GL_LEQUAL) end def test_glpixelzoom glPixelZoom(0.5,0.5) assert_equal(glGetDoublev(GL_ZOOM_X),0.5) assert_equal(glGetDoublev(GL_ZOOM_Y),0.5) end def test_glpixelstore glPixelStoref(GL_PACK_IMAGE_HEIGHT,5) assert_equal(glGetIntegerv(GL_PACK_IMAGE_HEIGHT),5) glPixelStorei(GL_PACK_IMAGE_HEIGHT,6) assert_equal(glGetIntegerv(GL_PACK_IMAGE_HEIGHT),6) end def test_glpixeltransfer glPixelTransferf(GL_RED_SCALE,2) assert_equal(glGetIntegerv(GL_RED_SCALE),2) glPixelTransferi(GL_RED_SCALE,3) assert_equal(glGetIntegerv(GL_RED_SCALE),3) end def test_pixelmap glPixelMapfv(GL_PIXEL_MAP_I_TO_I,[1,2,3,4]) assert_equal(glGetPixelMapfv(GL_PIXEL_MAP_I_TO_I), [1,2,3,4]) glPixelMapuiv(GL_PIXEL_MAP_I_TO_I,[5,6,7,8]) assert_equal(glGetPixelMapuiv(GL_PIXEL_MAP_I_TO_I),[5,6,7,8]) glPixelMapusv(GL_PIXEL_MAP_I_TO_I,[9,10,11,12]) assert_equal(glGetPixelMapusv(GL_PIXEL_MAP_I_TO_I),[9,10,11,12]) end def test_buffers glDrawBuffer(GL_FRONT) assert_equal(glGetIntegerv(GL_DRAW_BUFFER),GL_FRONT) glDrawBuffer(GL_BACK) assert_equal(glGetIntegerv(GL_DRAW_BUFFER),GL_BACK) glReadBuffer(GL_FRONT) assert_equal(glGetIntegerv(GL_READ_BUFFER),GL_FRONT) glReadBuffer(GL_BACK) assert_equal(glGetIntegerv(GL_READ_BUFFER),GL_BACK) end def test__selection_buffer buf = glSelectBuffer(32) glRenderMode(GL_SELECT) glInitNames() glPushName(6) glPushName(3) glLoadName(5) glPopName() glBegin(GL_QUADS) glVertex2i(-1,-1) glVertex2i( 1,-1) glVertex2i( 1, 1) glVertex2i(-1, 1) glEnd() count = glRenderMode(GL_RENDER) data = buf.unpack("i*") assert(count==1) # number of records assert(data[0]==1) # number of hits in this record # assert(data[1]>0) # zbuffer near # assert(data[2]>0) # zbuffer far assert(data[3]==6) # name of hit end def test__feedback_buffer buf = glFeedbackBuffer(32,GL_2D) glRenderMode(GL_FEEDBACK) glBegin(GL_TRIANGLES) glVertex2i(-1,-1) glVertex2i( 1,-1) glVertex2i( 1, 1) glEnd() glPassThrough(2.0) count = glRenderMode(GL_RENDER) data = buf.unpack("f*") assert_equal(count,10) # (1 + 1 + 3x2) + (1 + 1) assert_equal(data[0],GL_POLYGON_TOKEN) assert_equal(data[1],3) # 3 vertices # skip rasterized vertex data assert_equal(data[8],GL_PASS_THROUGH_TOKEN) assert_equal(data[9],2.0) end def test_glrasterpos glOrtho(0,$window_size,0,$window_size,0,-1) # 2 glRasterPos2d(1.0,2.0) assert_equal(glGetDoublev(GL_CURRENT_RASTER_POSITION),[1.0,2.0,0.0,1.0]) glRasterPos2dv([3.0,4.0]) assert_equal(glGetDoublev(GL_CURRENT_RASTER_POSITION),[3.0,4.0,0.0,1.0]) glRasterPos2f(1.0,2.0) assert_equal(glGetDoublev(GL_CURRENT_RASTER_POSITION),[1.0,2.0,0.0,1.0]) glRasterPos2fv([3.0,4.0]) assert_equal(glGetDoublev(GL_CURRENT_RASTER_POSITION),[3.0,4.0,0.0,1.0]) glRasterPos2i(1,2) assert_equal(glGetDoublev(GL_CURRENT_RASTER_POSITION),[1.0,2.0,0.0,1.0]) glRasterPos2iv([3,4]) assert_equal(glGetDoublev(GL_CURRENT_RASTER_POSITION),[3.0,4.0,0.0,1.0]) glRasterPos2s(1,2) assert_equal(glGetDoublev(GL_CURRENT_RASTER_POSITION),[1.0,2.0,0.0,1.0]) glRasterPos2sv([3,4]) assert_equal(glGetDoublev(GL_CURRENT_RASTER_POSITION),[3.0,4.0,0.0,1.0]) # 3 glRasterPos3d(1.0,2.0,1.0) assert_equal(glGetDoublev(GL_CURRENT_RASTER_POSITION),[1.0,2.0,1.0,1.0]) glRasterPos3dv([3.0,4.0,0.0]) assert_equal(glGetDoublev(GL_CURRENT_RASTER_POSITION),[3.0,4.0,0.0,1.0]) glRasterPos3f(1.0,2.0,1.0) assert_equal(glGetDoublev(GL_CURRENT_RASTER_POSITION),[1.0,2.0,1.0,1.0]) glRasterPos3fv([3.0,4.0,0.0]) assert_equal(glGetDoublev(GL_CURRENT_RASTER_POSITION),[3.0,4.0,0.0,1.0]) glRasterPos3i(1,2,1) assert_equal(glGetDoublev(GL_CURRENT_RASTER_POSITION),[1.0,2.0,1.0,1.0]) glRasterPos3iv([3,4,0]) assert_equal(glGetDoublev(GL_CURRENT_RASTER_POSITION),[3.0,4.0,0.0,1.0]) glRasterPos3s(1,2,1) assert_equal(glGetDoublev(GL_CURRENT_RASTER_POSITION),[1.0,2.0,1.0,1.0]) glRasterPos3sv([3,4,0]) assert_equal(glGetDoublev(GL_CURRENT_RASTER_POSITION),[3.0,4.0,0.0,1.0]) # 4 glRasterPos4d(1.0,2.0,1.0,1.0) assert_equal(glGetDoublev(GL_CURRENT_RASTER_POSITION),[1.0,2.0,1.0,1.0]) glRasterPos4dv([3.0,4.0,0.0,1.0]) assert_equal(glGetDoublev(GL_CURRENT_RASTER_POSITION),[3.0,4.0,0.0,1.0]) glRasterPos4f(1.0,2.0,1.0,1.0) assert_equal(glGetDoublev(GL_CURRENT_RASTER_POSITION),[1.0,2.0,1.0,1.0]) glRasterPos4fv([3.0,4.0,0.0,1.0]) assert_equal(glGetDoublev(GL_CURRENT_RASTER_POSITION),[3.0,4.0,0.0,1.0]) glRasterPos4i(1,2,1,1) assert_equal(glGetDoublev(GL_CURRENT_RASTER_POSITION),[1.0,2.0,1.0,1.0]) glRasterPos4iv([3,4,0,1]) assert_equal(glGetDoublev(GL_CURRENT_RASTER_POSITION),[3.0,4.0,0.0,1.0]) glRasterPos4s(1,2,1,1) assert_equal(glGetDoublev(GL_CURRENT_RASTER_POSITION),[1.0,2.0,1.0,1.0]) glRasterPos4sv([3,4,0,1]) assert_equal(glGetDoublev(GL_CURRENT_RASTER_POSITION),[3.0,4.0,0.0,1.0]) end def test_glbitmap glOrtho(0,$window_size,0,$window_size,0,-1) bitmap = [ 0x55 ] * 8 # 64 bits (8x8 bitmap), stipple pattern glPixelStorei(GL_PACK_ALIGNMENT,1) glPixelStorei(GL_UNPACK_ALIGNMENT,1) glBitmap(8,8,0,0,0,0,bitmap.pack("c*")) data = glReadPixels(0,0,8,8,GL_RED,GL_UNSIGNED_BYTE) assert_equal(data.unpack("C*"),[0,255] * 32) end def test_glfog glFogfv(GL_FOG_COLOR,[0.0,1.0,0.0,1.0]) assert_equal(glGetDoublev(GL_FOG_COLOR),[0.0,1.0,0.0,1.0]) glFogf(GL_FOG_DENSITY,0.5) assert_equal(glGetDoublev(GL_FOG_DENSITY),0.5) glFogi(GL_FOG_MODE,GL_LINEAR) assert_equal(glGetIntegerv(GL_FOG_MODE),GL_LINEAR) glFogi(GL_FOG_MODE,GL_EXP) assert_equal(glGetIntegerv(GL_FOG_MODE),GL_EXP) glFogiv(GL_FOG_MODE,[GL_EXP2]) assert_equal(glGetIntegerv(GL_FOG_MODE),GL_EXP2) end def test_glcolor # 3 glColor3b(2**7-1,0,2**7-1) assert(approx_equal(glGetDoublev(GL_CURRENT_COLOR),[1.0,0.0,1.0,1.0])) glColor3bv([0,2**7-1,0]) assert(approx_equal(glGetDoublev(GL_CURRENT_COLOR),[0.0,1.0,0.0,1.0])) glColor3d(1.0,0.0,1.0) assert(approx_equal(glGetDoublev(GL_CURRENT_COLOR),[1.0,0.0,1.0,1.0])) glColor3dv([0.0,1.0,0.0]) assert(approx_equal(glGetDoublev(GL_CURRENT_COLOR),[0.0,1.0,0.0,1.0])) glColor3f(1.0,0.0,1.0) assert(approx_equal(glGetDoublev(GL_CURRENT_COLOR),[1.0,0.0,1.0,1.0])) glColor3fv([0.0,1.0,0.0]) assert(approx_equal(glGetDoublev(GL_CURRENT_COLOR),[0.0,1.0,0.0,1.0])) glColor3i(2**31-1,0,2**31-1) assert(approx_equal(glGetDoublev(GL_CURRENT_COLOR),[1.0,0.0,1.0,1.0])) glColor3iv([0,2**31-1,0]) assert(approx_equal(glGetDoublev(GL_CURRENT_COLOR),[0.0,1.0,0.0,1.0])) glColor3s(2**15-1,0,2**15-1) assert(approx_equal(glGetDoublev(GL_CURRENT_COLOR),[1.0,0.0,1.0,1.0])) glColor3sv([0,2**15-1,0]) assert(approx_equal(glGetDoublev(GL_CURRENT_COLOR),[0.0,1.0,0.0,1.0])) glColor3ub(2**8-1,0,2**8-1) assert(approx_equal(glGetDoublev(GL_CURRENT_COLOR),[1.0,0.0,1.0,1.0])) glColor3ubv([0,2**8-1,0]) assert(approx_equal(glGetDoublev(GL_CURRENT_COLOR),[0.0,1.0,0.0,1.0])) glColor3ui(2**32-1,0,2**32-1) assert(approx_equal(glGetDoublev(GL_CURRENT_COLOR),[1.0,0.0,1.0,1.0])) glColor3uiv([0,2**32-1,0]) assert(approx_equal(glGetDoublev(GL_CURRENT_COLOR),[0.0,1.0,0.0,1.0])) glColor3us(2**16-1,0,2**16-1) assert(approx_equal(glGetDoublev(GL_CURRENT_COLOR),[1.0,0.0,1.0,1.0])) glColor3usv([0,2**16-1,0]) # 4 glColor4b(2**7-1,0,2**7-1,0) assert(approx_equal(glGetDoublev(GL_CURRENT_COLOR),[1.0,0.0,1.0,0.0])) glColor4bv([0,2**7-1,0,2**7-1]) assert(approx_equal(glGetDoublev(GL_CURRENT_COLOR),[0.0,1.0,0.0,1.0])) glColor4d(1.0,0.0,1.0,0.0) assert(approx_equal(glGetDoublev(GL_CURRENT_COLOR),[1.0,0.0,1.0,0.0])) glColor4dv([0.0,1.0,0.0,1.0]) assert(approx_equal(glGetDoublev(GL_CURRENT_COLOR),[0.0,1.0,0.0,1.0])) glColor4f(1.0,0.0,1.0,0.0) assert(approx_equal(glGetDoublev(GL_CURRENT_COLOR),[1.0,0.0,1.0,0.0])) glColor4fv([0.0,1.0,0.0,1.0]) assert(approx_equal(glGetDoublev(GL_CURRENT_COLOR),[0.0,1.0,0.0,1.0])) glColor4i(2**31-1,0,2**31-1,0) assert(approx_equal(glGetDoublev(GL_CURRENT_COLOR),[1.0,0.0,1.0,0.0])) glColor4iv([0,2**31-1,0,2**31-1]) assert(approx_equal(glGetDoublev(GL_CURRENT_COLOR),[0.0,1.0,0.0,1.0])) glColor4s(2**15-1,0,2**15-1,0) assert(approx_equal(glGetDoublev(GL_CURRENT_COLOR),[1.0,0.0,1.0,0.0])) glColor4sv([0,2**15-1,0,2**15-1]) assert(approx_equal(glGetDoublev(GL_CURRENT_COLOR),[0.0,1.0,0.0,1.0])) glColor4ub(2**8-1,0,2**8-1,0) assert(approx_equal(glGetDoublev(GL_CURRENT_COLOR),[1.0,0.0,1.0,0.0])) glColor4ubv([0,2**8-1,0,2**8-1]) assert(approx_equal(glGetDoublev(GL_CURRENT_COLOR),[0.0,1.0,0.0,1.0])) glColor4ui(2**32-1,0,2**32-1,0) assert(approx_equal(glGetDoublev(GL_CURRENT_COLOR),[1.0,0.0,1.0,0.0])) glColor4uiv([0,2**32-1,0,2**32-1]) assert(approx_equal(glGetDoublev(GL_CURRENT_COLOR),[0.0,1.0,0.0,1.0])) glColor4us(2**16-1,0,2**16-1,0) assert(approx_equal(glGetDoublev(GL_CURRENT_COLOR),[1.0,0.0,1.0,0.0])) glColor4usv([0,2**16-1,0,2**16-1]) assert(approx_equal(glGetDoublev(GL_CURRENT_COLOR),[0.0,1.0,0.0,1.0])) end def test_glortho res = [ [2.0/$window_size, 0, 0, 0], [0, 2.0/$window_size, 0, 0], [0, 0, 2, 0], [-1,-1,-1,1] ] glMatrixMode(GL_PROJECTION) glLoadIdentity() glOrtho(0,$window_size,0,$window_size,0,-1) assert_equal(glGetDoublev(GL_PROJECTION_MATRIX),res) end def test_glnormal glNormal3d(1.0,2.0,3.0) assert_equal(glGetDoublev(GL_CURRENT_NORMAL),[1.0,2.0,3.0]) glNormal3dv([4.0,5.0,6.0]) assert_equal(glGetDoublev(GL_CURRENT_NORMAL),[4.0,5.0,6.0]) glNormal3f(1.0,2.0,3.0) assert_equal(glGetDoublev(GL_CURRENT_NORMAL),[1.0,2.0,3.0]) glNormal3fv([4.0,5.0,6.0]) assert_equal(glGetDoublev(GL_CURRENT_NORMAL),[4.0,5.0,6.0]) glNormal3i(1,2,3) assert_equal(glGetIntegerv(GL_CURRENT_NORMAL),[1,2,3]) glNormal3iv([4,5,6]) assert_equal(glGetIntegerv(GL_CURRENT_NORMAL),[4,5,6]) glNormal3b(2**7-1,0,2**7-1) assert(approx_equal(glGetDoublev(GL_CURRENT_NORMAL),[1.0,0.0,1.0])) glNormal3bv(0,2**7-1,0) assert(approx_equal(glGetDoublev(GL_CURRENT_NORMAL),[0.0,1.0,0.0])) glNormal3s(2**15-1,0,2**15-1) assert(approx_equal(glGetDoublev(GL_CURRENT_NORMAL),[1.0,0.0,1.0])) glNormal3sv(0,2**15-1,0) assert(approx_equal(glGetDoublev(GL_CURRENT_NORMAL),[0.0,1.0,0.0])) end def test_gllight glLightf(GL_LIGHT0,GL_SPOT_CUTOFF,80.0) assert_equal(glGetLightfv(GL_LIGHT0,GL_SPOT_CUTOFF),80.0) glLighti(GL_LIGHT0,GL_SPOT_CUTOFF,75) assert_equal(glGetLightiv(GL_LIGHT0,GL_SPOT_CUTOFF),75) glLightfv(GL_LIGHT0,GL_AMBIENT,[0.5,0.5,0.5,1.0]) assert_equal(glGetLightfv(GL_LIGHT0,GL_AMBIENT), [0.5,0.5,0.5,1.0]) glLightiv(GL_LIGHT0,GL_CONSTANT_ATTENUATION,[32]) assert_equal(glGetLightiv(GL_LIGHT0,GL_CONSTANT_ATTENUATION),32) end def test_glmaterial glMaterialfv(GL_FRONT,GL_AMBIENT,[0.0,1.0,0.0,1.0]) assert_equal(glGetMaterialfv(GL_FRONT,GL_AMBIENT),[0.0,1.0,0.0,1.0]) glMaterialiv(GL_FRONT,GL_SHININESS,[50]) assert_equal(glGetMaterialiv(GL_FRONT,GL_SHININESS),50) glMaterialf(GL_FRONT,GL_SHININESS,49.0) assert_equal(glGetMaterialfv(GL_FRONT,GL_SHININESS),49.0) glMateriali(GL_FRONT,GL_SHININESS,48) assert_equal(glGetMaterialiv(GL_FRONT,GL_SHININESS),48) end def test_glcolormaterial glColorMaterial(GL_FRONT,GL_EMISSION) assert_equal(glGetIntegerv(GL_COLOR_MATERIAL_FACE),GL_FRONT) assert_equal(glGetIntegerv(GL_COLOR_MATERIAL_PARAMETER),GL_EMISSION) glColorMaterial(GL_BACK,GL_SPECULAR) assert_equal(glGetIntegerv(GL_COLOR_MATERIAL_FACE),GL_BACK) assert_equal(glGetIntegerv(GL_COLOR_MATERIAL_PARAMETER),GL_SPECULAR) end def test_gllightmodel glLightModeli(GL_LIGHT_MODEL_TWO_SIDE,GL_TRUE) assert_equal(glGetBooleanv(GL_LIGHT_MODEL_TWO_SIDE),GL_TRUE) glLightModelf(GL_LIGHT_MODEL_TWO_SIDE,GL_FALSE) assert_equal(glGetBooleanv(GL_LIGHT_MODEL_TWO_SIDE),GL_FALSE) glLightModelfv(GL_LIGHT_MODEL_AMBIENT,[0.5,0.5,0.5,1.0]) assert_equal(glGetDoublev(GL_LIGHT_MODEL_AMBIENT),[0.5,0.5,0.5,1.0]) glLightModeliv(GL_LIGHT_MODEL_AMBIENT,[1,0,1,0]) assert_equal(glGetIntegerv(GL_LIGHT_MODEL_AMBIENT),[1,0,1,0]) end def test_gltexcoord # 1 glTexCoord1d(1.5) assert_equal(glGetDoublev(GL_CURRENT_TEXTURE_COORDS),[1.5,0,0,1]) glTexCoord1dv([0.5]) assert_equal(glGetDoublev(GL_CURRENT_TEXTURE_COORDS),[0.5,0,0,1]) glTexCoord1f(1.5) assert_equal(glGetDoublev(GL_CURRENT_TEXTURE_COORDS),[1.5,0,0,1]) glTexCoord1fv([0.5]) assert_equal(glGetDoublev(GL_CURRENT_TEXTURE_COORDS),[0.5,0,0,1]) glTexCoord1i(1) assert_equal(glGetDoublev(GL_CURRENT_TEXTURE_COORDS),[1,0,0,1]) glTexCoord1iv([0]) assert_equal(glGetDoublev(GL_CURRENT_TEXTURE_COORDS),[0,0,0,1]) glTexCoord1s(1) assert_equal(glGetDoublev(GL_CURRENT_TEXTURE_COORDS),[1,0,0,1]) glTexCoord1sv([0]) assert_equal(glGetDoublev(GL_CURRENT_TEXTURE_COORDS),[0,0,0,1]) # 2 glTexCoord2d(1.5,1.5) assert_equal(glGetDoublev(GL_CURRENT_TEXTURE_COORDS),[1.5,1.5,0,1]) glTexCoord2dv([0.5,0.5]) assert_equal(glGetDoublev(GL_CURRENT_TEXTURE_COORDS),[0.5,0.5,0,1]) glTexCoord2f(1.5,1.5) assert_equal(glGetDoublev(GL_CURRENT_TEXTURE_COORDS),[1.5,1.5,0,1]) glTexCoord2fv([0.5,0.5]) assert_equal(glGetDoublev(GL_CURRENT_TEXTURE_COORDS),[0.5,0.5,0,1]) glTexCoord2i(1,1) assert_equal(glGetDoublev(GL_CURRENT_TEXTURE_COORDS),[1,1,0,1]) glTexCoord2iv([0,0]) assert_equal(glGetDoublev(GL_CURRENT_TEXTURE_COORDS),[0,0,0,1]) glTexCoord2s(1,1) assert_equal(glGetDoublev(GL_CURRENT_TEXTURE_COORDS),[1,1,0,1]) glTexCoord2sv([0,0]) assert_equal(glGetDoublev(GL_CURRENT_TEXTURE_COORDS),[0,0,0,1]) # 3 glTexCoord3d(1.5,1.5,1.5) assert_equal(glGetDoublev(GL_CURRENT_TEXTURE_COORDS),[1.5,1.5,1.5,1]) glTexCoord3dv([0.5,0.5,0.5]) assert_equal(glGetDoublev(GL_CURRENT_TEXTURE_COORDS),[0.5,0.5,0.5,1]) glTexCoord3f(1.5,1.5,1.5) assert_equal(glGetDoublev(GL_CURRENT_TEXTURE_COORDS),[1.5,1.5,1.5,1]) glTexCoord3fv([0.5,0.5,0.5]) assert_equal(glGetDoublev(GL_CURRENT_TEXTURE_COORDS),[0.5,0.5,0.5,1]) glTexCoord3i(1,1,1) assert_equal(glGetDoublev(GL_CURRENT_TEXTURE_COORDS),[1,1,1,1]) glTexCoord3iv([0,0,0]) assert_equal(glGetDoublev(GL_CURRENT_TEXTURE_COORDS),[0,0,0,1]) glTexCoord3s(1,1,1) assert_equal(glGetDoublev(GL_CURRENT_TEXTURE_COORDS),[1,1,1,1]) glTexCoord3sv([0,0,0]) assert_equal(glGetDoublev(GL_CURRENT_TEXTURE_COORDS),[0,0,0,1]) # 4 glTexCoord4d(1.5,1.5,1.5,1.5) assert_equal(glGetDoublev(GL_CURRENT_TEXTURE_COORDS),[1.5,1.5,1.5,1.5]) glTexCoord4dv([0.5,0.5,0.5,0.5]) assert_equal(glGetDoublev(GL_CURRENT_TEXTURE_COORDS),[0.5,0.5,0.5,0.5]) glTexCoord4f(1.5,1.5,1.5,1.5) assert_equal(glGetDoublev(GL_CURRENT_TEXTURE_COORDS),[1.5,1.5,1.5,1.5]) glTexCoord4fv([0.5,0.5,0.5,0.5]) assert_equal(glGetDoublev(GL_CURRENT_TEXTURE_COORDS),[0.5,0.5,0.5,0.5]) glTexCoord4i(1,1,1,1) assert_equal(glGetDoublev(GL_CURRENT_TEXTURE_COORDS),[1,1,1,1]) glTexCoord4iv([0,0,0,0]) assert_equal(glGetDoublev(GL_CURRENT_TEXTURE_COORDS),[0,0,0,0]) glTexCoord4s(1,1,1,1) assert_equal(glGetDoublev(GL_CURRENT_TEXTURE_COORDS),[1,1,1,1]) glTexCoord4sv([0,0,0,0]) assert_equal(glGetDoublev(GL_CURRENT_TEXTURE_COORDS),[0,0,0,0]) end def test_glenable_disable glEnable(GL_FOG) assert_equal(glIsEnabled(GL_FOG),true) glDisable(GL_FOG) assert_equal(glIsEnabled(GL_FOG),false) end def test_gltexparameter glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S,GL_CLAMP) assert_equal(glGetTexParameteriv(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S),GL_CLAMP) glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S,GL_MIRRORED_REPEAT) assert_equal(glGetTexParameterfv(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S),GL_MIRRORED_REPEAT) glTexParameteriv(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S,[GL_CLAMP]) assert_equal(glGetTexParameteriv(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S),GL_CLAMP) glTexParameterfv(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S,[GL_MIRRORED_REPEAT]) assert_equal(glGetTexParameterfv(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S),GL_MIRRORED_REPEAT) assert_equal(glGetTexLevelParameterfv(GL_TEXTURE_2D,0,GL_TEXTURE_WIDTH),0.0) assert_equal(glGetTexLevelParameteriv(GL_TEXTURE_2D,0,GL_TEXTURE_WIDTH),0) end def test_glcullface glCullFace(GL_FRONT) assert_equal(glGetIntegerv(GL_CULL_FACE_MODE),GL_FRONT) glCullFace(GL_BACK) assert_equal(glGetIntegerv(GL_CULL_FACE_MODE),GL_BACK) end def test_glfrontface glFrontFace(GL_CW) assert_equal(glGetIntegerv(GL_FRONT_FACE),GL_CW) glFrontFace(GL_CCW) assert_equal(glGetIntegerv(GL_FRONT_FACE),GL_CCW) end def test_glpointsize glPointSize(2.0) assert_equal(glGetDoublev(GL_POINT_SIZE),2.0) glPointSize(3.0) assert_equal(glGetDoublev(GL_POINT_SIZE),3.0) end def test_glpolygonmode glPolygonMode(GL_FRONT_AND_BACK,GL_LINE) assert_equal(glGetIntegerv(GL_POLYGON_MODE),[GL_LINE,GL_LINE]) glPolygonMode(GL_FRONT_AND_BACK,GL_FILL) assert_equal(glGetIntegerv(GL_POLYGON_MODE),[GL_FILL,GL_FILL]) end def test_gllinewidth glLineWidth(2.0) assert_equal(glGetDoublev(GL_LINE_WIDTH),2.0) glLineWidth(3.0) assert_equal(glGetDoublev(GL_LINE_WIDTH),3.0) end def test_gllinestipple glLineStipple(3,0x1234) assert_equal(glGetIntegerv(GL_LINE_STIPPLE_REPEAT),3) assert_equal(glGetIntegerv(GL_LINE_STIPPLE_PATTERN),0x1234) end def test_glpolygonstipple stipple = [0x12] * 128 glPolygonStipple(stipple.pack("c*")) assert_equal(glGetPolygonStipple(),stipple.pack("c*")) end def parse_feedback_data(data,count) c = count / 11 ret = [] (0...c).each do |x| i = x *11 type = data[0+i] v1 = [data[2+i], data[3+i], data[4+i]] v2 = [data[5+i], data[6+i], data[7+i]] v3 = [data[8+i], data[9+i], data[10+i]] vertex = [v1,v2,v3].sort ret << [type,vertex] end ret end def test_glvertex glMatrixMode(GL_PROJECTION) glOrtho(0,$window_size,0,$window_size,0,-1) buf = glFeedbackBuffer(256,GL_3D) glRenderMode(GL_FEEDBACK) glBegin(GL_TRIANGLES) glVertex2d( 1, 0) glVertex2dv([0,0]) glVertex2f( 1,1) glVertex2fv([ 1, 0]) glVertex2i( 0,0) glVertex2iv([1,1]) glVertex2s( 1, 0) glVertex2sv([0,0]) glVertex3d( 1,1,0) glVertex3dv([ 1, 0,0]) glVertex3f( 0,0,0) glVertex3fv([1,1,0]) glVertex3i( 1, 0,0) glVertex3iv([0,0,0]) glVertex3s( 1,1,0) glVertex3sv([ 1, 0,0]) glVertex4d( 0,0,0,1) glVertex4dv([1,1,0,1]) glVertex4f( 1, 0,0,1) glVertex4fv([0,0,0,1]) glVertex4i( 1,1,0,1) glVertex4iv([ 1, 0,0,1]) glVertex4s( 0,0,0,1) glVertex4sv([1,1,0,1]) glEnd() count = glRenderMode(GL_RENDER) data = buf.unpack("f*") ref = [[GL_POLYGON_TOKEN,[[0,0,0],[1,0,0],[1,1,0]]]] * 8 assert_equal(parse_feedback_data(data,count),ref) end def test_glrect glMatrixMode(GL_PROJECTION) glOrtho(0,$window_size,0,$window_size,0,-1) buf = glFeedbackBuffer(256,GL_3D) glRenderMode(GL_FEEDBACK) glRectd(0,0,1,1) glRectdv([0,0],[1,1]) glRectf(0,0,1,1) glRectfv([0,0],[1,1]) glRecti(0,0,1,1) glRectiv([0,0],[1,1]) glRects(0,0,1,1) glRectsv([0,0],[1,1]) count = glRenderMode(GL_RENDER) data = buf.unpack("f*") assert_equal(count, (3*3+2)*2*8) end def test_glclear glClearColor(1.0,1.0,1.0,1.0) glClear(GL_COLOR_BUFFER_BIT) data = glReadPixels(0,0,1,1,GL_RGB,GL_FLOAT) assert_equal(data.unpack("f*"),[1.0,1.0,1.0]) glClearColor(0.0,0.0,0.0,0.0) glClear(GL_COLOR_BUFFER_BIT) data = glReadPixels(0,0,1,1,GL_RGB,GL_FLOAT) assert_equal(data.unpack("f*"),[0.0,0.0,0.0]) end def test_gltexenv glTexEnvf(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE,GL_ADD) assert_equal(glGetTexEnvfv(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE),GL_ADD) glTexEnvi(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE,GL_MODULATE) assert_equal(glGetTexEnviv(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE),GL_MODULATE) glTexEnvfv(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE,[GL_ADD]) assert_equal(glGetTexEnvfv(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE),GL_ADD) glTexEnviv(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE,[GL_MODULATE]) assert_equal(glGetTexEnviv(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE),GL_MODULATE) end def test_gltexgen glTexGend(GL_S,GL_TEXTURE_GEN_MODE,GL_REFLECTION_MAP) assert_equal(glGetTexGendv(GL_S,GL_TEXTURE_GEN_MODE),GL_REFLECTION_MAP) glTexGenf(GL_S,GL_TEXTURE_GEN_MODE,GL_EYE_LINEAR) assert_equal(glGetTexGenfv(GL_S,GL_TEXTURE_GEN_MODE),GL_EYE_LINEAR) glTexGeni(GL_S,GL_TEXTURE_GEN_MODE,GL_SPHERE_MAP) assert_equal(glGetTexGeniv(GL_S,GL_TEXTURE_GEN_MODE),GL_SPHERE_MAP) glTexGendv(GL_S,GL_TEXTURE_GEN_MODE,[GL_REFLECTION_MAP]) assert_equal(glGetTexGendv(GL_S,GL_TEXTURE_GEN_MODE),GL_REFLECTION_MAP) glTexGenfv(GL_S,GL_TEXTURE_GEN_MODE,[GL_EYE_LINEAR]) assert_equal(glGetTexGenfv(GL_S,GL_TEXTURE_GEN_MODE),GL_EYE_LINEAR) glTexGeniv(GL_S,GL_TEXTURE_GEN_MODE,[GL_SPHERE_MAP]) assert_equal(glGetTexGeniv(GL_S,GL_TEXTURE_GEN_MODE),GL_SPHERE_MAP) end def test_textures textures = glGenTextures(2) assert_equal(textures.size, 2) assert_equal(glIsTexture(textures[0]),false) glBindTexture(GL_TEXTURE_2D,textures[0]) assert_equal(glIsTexture(textures[0]),true) image = ([0,0,0,1,1,1] * 8).pack("f*") # 16 RGB pixels glTexImage2D(GL_TEXTURE_2D,0,GL_RGB8, 4, 4, 0, GL_RGB, GL_FLOAT, image) assert_equal(glGetTexImage(GL_TEXTURE_2D,0,GL_RGB,GL_FLOAT), image) glBindTexture(GL_TEXTURE_1D,textures[1]) glTexImage1D(GL_TEXTURE_1D,0,GL_RGB8, 16, 0, GL_RGB, GL_FLOAT, image) assert_equal(glGetTexImage(GL_TEXTURE_1D,0,GL_RGB,GL_FLOAT), image) glDeleteTextures(textures) assert_equal(glIsTexture(textures[0]),false) end def test_pixels glClearColor(0,0,0,0) glClear(GL_COLOR_BUFFER_BIT) data = glReadPixels(0,0,4,4,GL_RGB,GL_FLOAT) assert_equal(data.unpack("f*"), [0] * 3 * 16) image = ([1.0] * 3 * 16).pack("f*") glDrawPixels(4,4,GL_RGB,GL_FLOAT,image) data = glReadPixels(0,0,4,4,GL_RGB,GL_FLOAT) assert_equal(data,image) # glClearColor(0,0,0,0) glClear(GL_COLOR_BUFFER_BIT) image = (([0.0] * 3 * 8) + ([1.0] * 3 * 8)).pack("f*") glDrawPixels(4,4,GL_RGB,GL_FLOAT,image) data = glReadPixels(0,0,4,4,GL_RGB,GL_FLOAT) assert_equal(data,image) glCopyPixels(0,2,4,2,GL_COLOR) data = glReadPixels(0,0,4,4,GL_RGB,GL_FLOAT) assert_equal(data,([1.0] * 3 * 16).pack("f*")) end def test_gltranslate m = [[1,0,0,0],[0,1,0,0],[0,0,1,0],[1,2,3,1]] glMatrixMode(GL_MODELVIEW) glLoadIdentity() glTranslated(1.0,2.0,3.0) assert_equal(glGetDoublev(GL_MODELVIEW_MATRIX),m) glLoadIdentity() glTranslatef(1.0,2.0,3.0) assert_equal(glGetDoublev(GL_MODELVIEW_MATRIX),m) end def test_glscale m = [[1,0,0,0],[0,2,0,0],[0,0,3,0],[0,0,0,1]] glMatrixMode(GL_MODELVIEW) glLoadIdentity() glScaled(1.0,2.0,3.0) assert_equal(glGetDoublev(GL_MODELVIEW_MATRIX),m) glLoadIdentity() glScalef(1.0,2.0,3.0) assert_equal(glGetDoublev(GL_MODELVIEW_MATRIX),m) end def test_glrotate m1 = [[0,0,-1,0],[0,1,0,0],[1,0,0,0],[0,0,0,1]] m2 = [[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]] glMatrixMode(GL_MODELVIEW) glLoadIdentity() glRotated(90,0,1,0) assert(approx_equal(glGetDoublev(GL_MODELVIEW_MATRIX).flatten,m1.flatten)) glRotated(-90,0,1,0) assert(approx_equal(glGetDoublev(GL_MODELVIEW_MATRIX).flatten,m2.flatten)) end def test_textures_2 textures = glGenTextures(2) glBindTexture(GL_TEXTURE_1D,textures[0]) glBindTexture(GL_TEXTURE_2D,textures[1]) assert_equal(glAreTexturesResident(textures).size,2) glPrioritizeTextures(textures,[0.5,1.0]) assert_equal(glGetTexParameterfv(GL_TEXTURE_1D,GL_TEXTURE_PRIORITY),0.5) assert_equal(glGetTexParameterfv(GL_TEXTURE_2D,GL_TEXTURE_PRIORITY),1.0) tex = ([0,0,0,1,1,1] * 2).pack("f*") tex2 = ([1] * 3 * 4).pack("f*") # 1d glDrawPixels(4,1,GL_RGB,GL_FLOAT,tex) glCopyTexImage1D(GL_TEXTURE_1D,0,GL_RGB8,0,0,4,0) assert_equal(glGetTexImage(GL_TEXTURE_1D,0,GL_RGB,GL_FLOAT),tex) glDrawPixels(4,1,GL_RGB,GL_FLOAT,tex2) glCopyTexSubImage1D(GL_TEXTURE_1D,0,0,0,0,4) assert_equal(glGetTexImage(GL_TEXTURE_1D,0,GL_RGB,GL_FLOAT),tex2) glTexSubImage1D(GL_TEXTURE_1D,0,0,4,GL_RGB,GL_FLOAT,tex) assert_equal(glGetTexImage(GL_TEXTURE_1D,0,GL_RGB,GL_FLOAT),tex) # 2d glDrawPixels(2,2,GL_RGB,GL_FLOAT,tex) glCopyTexImage2D(GL_TEXTURE_2D,0,GL_RGB8,0,0,2,2,0) assert_equal(glGetTexImage(GL_TEXTURE_2D,0,GL_RGB,GL_FLOAT),tex) glDrawPixels(2,2,GL_RGB,GL_FLOAT,tex2) glCopyTexSubImage2D(GL_TEXTURE_2D,0,0,0,0,0,2,2) assert_equal(glGetTexImage(GL_TEXTURE_2D,0,GL_RGB,GL_FLOAT),tex2) glTexSubImage2D(GL_TEXTURE_2D,0,0,0,2,2,GL_RGB,GL_FLOAT,tex) assert_equal(glGetTexImage(GL_TEXTURE_2D,0,GL_RGB,GL_FLOAT),tex) glDeleteTextures(textures) end def test_glmap control_points = [ 0.25, 0.5, 0.0, 1.0, 1.0, 0.0 ] control_points_2 = [ 1.25, 1.5, 1.0, 0.0, 0.0, 1.0 ] glMap1f(GL_MAP1_VERTEX_3,0,100,3,2,control_points) assert_equal(glGetMapfv(GL_MAP1_VERTEX_3,GL_COEFF),control_points) glMap1d(GL_MAP1_VERTEX_3,0,100,3,2,control_points_2) assert_equal(glGetMapdv(GL_MAP1_VERTEX_3,GL_COEFF),control_points_2) assert_equal(glGetMapiv(GL_MAP1_VERTEX_3,GL_ORDER),2) glMap2f(GL_MAP2_VERTEX_3,0,100,3,1,0,100,3,2,control_points) assert_equal(glGetMapfv(GL_MAP2_VERTEX_3,GL_COEFF),control_points) glMap2d(GL_MAP2_VERTEX_3,0,100,3,1,0,100,3,2,control_points_2) assert_equal(glGetMapdv(GL_MAP2_VERTEX_3,GL_COEFF),control_points_2) end def test_glmapgrid glMapGrid1d(2,1,100) assert_equal(glGetIntegerv(GL_MAP1_GRID_SEGMENTS),2) assert_equal(glGetIntegerv(GL_MAP1_GRID_DOMAIN),[1,100]) glMapGrid1f(3,2,99) assert_equal(glGetIntegerv(GL_MAP1_GRID_SEGMENTS),3) assert_equal(glGetIntegerv(GL_MAP1_GRID_DOMAIN),[2,99]) # glMapGrid2d(2,1,100,3,2,99) assert_equal(glGetIntegerv(GL_MAP2_GRID_SEGMENTS),[2,3]) assert_equal(glGetIntegerv(GL_MAP2_GRID_DOMAIN),[1,100,2,99]) glMapGrid2f(3,2,99,4,3,98) assert_equal(glGetIntegerv(GL_MAP2_GRID_SEGMENTS),[3,4]) assert_equal(glGetIntegerv(GL_MAP2_GRID_DOMAIN),[2,99,3,98]) end def test_gleval control_points = [0,0,0,1,1,1] glMap1f(GL_MAP1_VERTEX_3,0,1,3,2,control_points) glMap2f(GL_MAP2_VERTEX_3,0,1,3,1,0,1,3,2,control_points) glEnable(GL_MAP1_VERTEX_3) glEnable(GL_MAP2_VERTEX_3) buf = glFeedbackBuffer(256,GL_3D) glRenderMode(GL_FEEDBACK) glBegin(GL_TRIANGLES) glEvalCoord1d(1.0) glEvalCoord1dv([1.0]) glEvalCoord1f(1.0) glEvalCoord1fv([1.0]) glEvalCoord1fv([1.0]) glEvalCoord1fv([1.0]) glEvalCoord2d(1.0,1.0) glEvalCoord2dv([1.0,1.0]) glEvalCoord2f(1.0,1.0) glEvalCoord2fv([1.0,1.0]) glEvalCoord2fv([1.0,1.0]) glEvalCoord2fv([1.0,1.0]) glEvalPoint1(0.0) glEvalPoint1(0.0) glEvalPoint1(0.0) glEvalPoint2(0.0,1.0) glEvalPoint2(0.0,1.0) glEvalPoint2(0.0,1.0) glEnd count = glRenderMode(GL_RENDER) assert_equal(count,(3*3+2)*6) glDisable(GL_MAP2_VERTEX_3) glDisable(GL_MAP1_VERTEX_3) end def test_glevalmesh control_points = [0,0,0,1,1,1] glMap1f(GL_MAP1_VERTEX_3,0,1,3,2,control_points) glMap2f(GL_MAP2_VERTEX_3,0,1,3,1,0,1,3,2,control_points) glEnable(GL_MAP1_VERTEX_3) glEnable(GL_MAP2_VERTEX_3) buf = glFeedbackBuffer(256,GL_3D) glRenderMode(GL_FEEDBACK) glEvalMesh1(GL_POINT,0,1) glEvalMesh2(GL_POINT,0,1,0,1) count = glRenderMode(GL_RENDER) assert_equal(count,((3+1)*(2+2*2))) glDisable(GL_MAP2_VERTEX_3) glDisable(GL_MAP1_VERTEX_3) end def test_glaccum return if glGetIntegerv(GL_ACCUM_RED_BITS) <= 0 # no accumulation buffer ? i1 = ([0.0] * 3 + [1.0] * 3 ).pack("f*") i2 = ([1.0] * 3 + [0.0] * 3 ).pack("f*") # init glClearColor(0,0,0,0) glClear(GL_ACCUM_BUFFER_BIT | GL_COLOR_BUFFER_BIT) # left glDrawPixels(2,1,GL_RGB,GL_FLOAT,i1) glAccum(GL_ACCUM,1.0) # right glClear(GL_COLOR_BUFFER_BIT) glDrawPixels(2,1,GL_RGB,GL_FLOAT,i2) glAccum(GL_ACCUM,1.0) # combine glAccum(GL_RETURN,1.0) data = glReadPixels(0,0,2,1,GL_RGB,GL_FLOAT) assert_equal(data.unpack("f*"),[1.0] * 2 * 3) end def test_displaylists base = glGenLists(2) assert(base>0) glListBase(1) assert_equal(glGetIntegerv(GL_LIST_BASE),1) glListBase(0) assert_equal(glGetIntegerv(GL_LIST_BASE),0) glNewList(base+0, GL_COMPILE) glBegin(GL_TRIANGLES) glVertex2f(0,0) glVertex2f(1,0) glVertex2f(1,1) glEnd() glEndList() glNewList(base+1, GL_COMPILE) glBegin(GL_TRIANGLES) glVertex2f(0,0) glVertex2f(1,0) glVertex2f(1,1) glEnd() glEndList() assert_equal(glIsList(base+0),true) assert_equal(glIsList(base+1),true) assert_equal(glIsList(base+2),false) # buf = glFeedbackBuffer(256,GL_3D) glRenderMode(GL_FEEDBACK) glCallList(base+0) glCallLists(GL_INT,[base+0,base+1]) count = glRenderMode(GL_RENDER) assert_equal(count,(3*3+2) * 3) # 3 triangles # glDeleteLists(base,2) assert_equal(glIsList(base+0),false) assert_equal(glIsList(base+1),false) end def test_arrays glEnableClientState(GL_VERTEX_ARRAY) va = [0,0, 0,1, 1,1].pack("f*") glVertexPointer(2,GL_FLOAT,0,va) assert_equal(glGetPointerv(GL_VERTEX_ARRAY_POINTER),va) assert_equal(glGetIntegerv(GL_VERTEX_ARRAY_SIZE),2) assert_equal(glGetIntegerv(GL_VERTEX_ARRAY_TYPE),GL_FLOAT) assert_equal(glGetIntegerv(GL_VERTEX_ARRAY_STRIDE),0) # buf = glFeedbackBuffer(256,GL_3D) glRenderMode(GL_FEEDBACK) glDrawArrays(GL_TRIANGLES,0,3) glBegin(GL_TRIANGLES) glArrayElement(0) glArrayElement(1) glArrayElement(2) glEnd() glDrawElements(GL_TRIANGLES,3,GL_UNSIGNED_BYTE,[0,1,2].pack("C*")) glInterleavedArrays(GL_V2F,0, va) glDrawElements(GL_TRIANGLES,3,GL_UNSIGNED_BYTE,[0,1,2].pack("C*")) # count = glRenderMode(GL_RENDER) assert_equal(count,44) glDisableClientState(GL_VERTEX_ARRAY) end def test_arrays_2 na = [0,1,0].pack("f*") ta = [1,0,1,0].pack("f*") ea = [0].pack("C*") ca = [1,0,1,0].pack("f*") glNormalPointer(GL_FLOAT,0,na) assert_equal(glGetIntegerv(GL_NORMAL_ARRAY_TYPE),GL_FLOAT) assert_equal(glGetIntegerv(GL_NORMAL_ARRAY_STRIDE),0) assert_equal(glGetPointerv(GL_NORMAL_ARRAY_POINTER),na) glTexCoordPointer(4,GL_FLOAT,0,ta) assert_equal(glGetIntegerv(GL_TEXTURE_COORD_ARRAY_SIZE),4) assert_equal(glGetIntegerv(GL_TEXTURE_COORD_ARRAY_TYPE),GL_FLOAT) assert_equal(glGetIntegerv(GL_TEXTURE_COORD_ARRAY_STRIDE),0) assert_equal(glGetPointerv(GL_TEXTURE_COORD_ARRAY_POINTER),ta) glEdgeFlagPointer(0,ea) assert_equal(glGetIntegerv(GL_EDGE_FLAG_ARRAY_STRIDE),0) assert_equal(glGetPointerv(GL_EDGE_FLAG_ARRAY_POINTER),ea) glColorPointer(4,GL_FLOAT,0,ca) assert_equal(glGetIntegerv(GL_COLOR_ARRAY_SIZE),4) assert_equal(glGetIntegerv(GL_COLOR_ARRAY_TYPE),GL_FLOAT) assert_equal(glGetIntegerv(GL_COLOR_ARRAY_STRIDE),0) assert_equal(glGetPointerv(GL_COLOR_ARRAY_POINTER),ca) # glEnable(GL_COLOR_ARRAY) glEnable(GL_NORMAL_ARRAY) glEnable(GL_TEXTURE_COORD_ARRAY) glEnable(GL_EDGE_FLAG_ARRAY) glBegin(GL_TRIANGLES) glArrayElement(0) glEnd() assert_equal(glGetDoublev(GL_CURRENT_COLOR),[1,0,1,0]) assert_equal(glGetDoublev(GL_CURRENT_NORMAL),[0,1,0]) assert_equal(glGetDoublev(GL_CURRENT_TEXTURE_COORDS),[1,0,1,0]) assert_equal(glGetBooleanv(GL_EDGE_FLAG),false) glDisable(GL_EDGE_FLAG_ARRAY) glDisable(GL_TEXTURE_COORD_ARRAY) glDisable(GL_NORMAL_ARRAY) glDisable(GL_COLOR_ARRAY) end end ruby-opengl-0.60.1.orig/test/tc_require_gl.rb0000644000000000000000000000224611377006423017635 0ustar rootroot#-- # Copyright (C) 2006 Peter McLain # # This program is distributed under the terms of the MIT license. # See the included MIT-LICENSE file for the terms of this license. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #++ if __FILE__ == $0 # If we are being called from the command line, e.g., ruby foo.rb, then # fixup the load path so we can find the OpenGL extension libs $: << File.join(File.dirname(__FILE__), '..', 'lib') end require 'test/unit' require 'gl' # Test that a require but not include of GL forces the use of the full # namespace qualifiers: # require Gl # ... # Gl::VERSION exists class GLRequireTest < Test::Unit::TestCase def test_require_of_gl assert Gl::GL_VERSION end end ruby-opengl-0.60.1.orig/test/tc_func_13.rb0000644000000000000000000002142111377006423016731 0ustar rootroot# # Copyright (C) 2007 Jan Dvorak # # This program is distributed under the terms of the MIT license. # See the included MIT-LICENSE file for the terms of this license. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # require 'test/unit' class Test_13 < Test::Unit::TestCase def setup common_setup() end def teardown common_teardown() end def test_glsamplecoverage return if not supported?(1.3) glSampleCoverage(0.0,GL_TRUE) assert_equal(glGetDoublev(GL_SAMPLE_COVERAGE_VALUE),0.0) assert_equal(glGetBooleanv(GL_SAMPLE_COVERAGE_INVERT),GL_TRUE) glSampleCoverage(1.0,GL_FALSE) assert_equal(glGetDoublev(GL_SAMPLE_COVERAGE_VALUE),1.0) assert_equal(glGetBooleanv(GL_SAMPLE_COVERAGE_INVERT),GL_FALSE) end def test_multitexture return if not supported?(1.3) glActiveTexture(GL_TEXTURE1) glClientActiveTexture(GL_TEXTURE2) assert_equal(glGetIntegerv(GL_ACTIVE_TEXTURE),GL_TEXTURE1) assert_equal(glGetIntegerv(GL_CLIENT_ACTIVE_TEXTURE),GL_TEXTURE2) end def test_transposematrix return if not supported?(1.3) m_a = [[1.0,2.0,3.0,4.0], [0.0,2.0,0.0,0.0], [0.0,0.0,2.0,0.0], [0.0,0.0,0.0,2.0]] m_b = [[1.0,2.0,3.0,4.0], [0.0,3.0,0.0,0.0], [0.0,0.0,3.0,0.0], [0.0,0.0,0.0,3.0]] glMatrixMode(GL_MODELVIEW) glLoadTransposeMatrixf(m_a) assert_equal(glGetDoublev(GL_TRANSPOSE_MODELVIEW_MATRIX), m_a) glLoadTransposeMatrixd(m_b) assert_equal(glGetDoublev(GL_TRANSPOSE_MODELVIEW_MATRIX), m_b) glLoadIdentity() glMultTransposeMatrixf(m_a) assert_equal(glGetDoublev(GL_TRANSPOSE_MODELVIEW_MATRIX), m_a) glLoadIdentity() glMultTransposeMatrixd(m_b) assert_equal(glGetDoublev(GL_TRANSPOSE_MODELVIEW_MATRIX), m_b) # 2 m = Matrix.rows([[1,2,3,4],[5,6,7,8],[9,10,11,12],[13,14,15,16]]) glMatrixMode(GL_MODELVIEW) glLoadTransposeMatrixf(m) assert_equal(glGetDoublev(GL_MODELVIEW_MATRIX), m.to_a.transpose) glLoadIdentity() glLoadTransposeMatrixd(m) assert_equal(glGetDoublev(GL_MODELVIEW_MATRIX), m.to_a.transpose) glLoadIdentity() glMultTransposeMatrixf(m) assert_equal(glGetDoublev(GL_MODELVIEW_MATRIX), m.to_a.transpose) glLoadIdentity() glMultTransposeMatrixd(m) assert_equal(glGetDoublev(GL_MODELVIEW_MATRIX), m.to_a.transpose) assert_raise ArgumentError do glLoadTransposeMatrixf([1,2,3,4]) end assert_raise ArgumentError do glLoadTransposeMatrixd([1,2,3,4]) end assert_raise ArgumentError do glMultTransposeMatrixf([1,2,3,4]) end assert_raise ArgumentError do glMultTransposeMatrixd([1,2,3,4]) end end def test_texturecompression return if not supported?(1.3) return if not supported?("GL_EXT_texture_compression_s3tc") # S3TC/DXT5 compressed 2x2 pixels stipple patterns [w,b,b,w] and [b,w,w,b] image_1 = [0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0x00,0x00,0x01,0x54,0x5C,0x5C].pack("C*") image_2 = [0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0x00,0x00,0x54,0x01,0x0D,0x0D].pack("C*") textures = glGenTextures(3) glBindTexture(GL_TEXTURE_1D,textures[0]) glBindTexture(GL_TEXTURE_2D,textures[1]) glBindTexture(GL_TEXTURE_3D,textures[2]) # Note: 1D and 3D compressed textures are not supported by S3TC/DXTn, and usually not supported at all # 1D begin glCompressedTexImage1D(GL_TEXTURE_1D,0,GL_COMPRESSED_RGBA_S3TC_DXT5_EXT,4,0,16,image_1) assert_equal(glGetCompressedTexImage(GL_TEXTURE_1D,0), image_1) rescue Gl::Error => err assert(err.id == GL_INVALID_ENUM || err.id == GL_INVALID_OPERATION) end begin glCompressedTexSubImage1D(GL_TEXTURE_1D,0,0,4,GL_COMPRESSED_RGBA_S3TC_DXT5_EXT,16,image_2) assert_equal(glGetCompressedTexImage(GL_TEXTURE_1D,0), image_2) rescue Gl::Error => err assert(err.id == GL_INVALID_ENUM || err.id == GL_INVALID_OPERATION) end # 2D glCompressedTexImage2D(GL_TEXTURE_2D,0,GL_COMPRESSED_RGBA_S3TC_DXT5_EXT,2,2,0,16,image_1) assert_equal(glGetCompressedTexImage(GL_TEXTURE_2D,0), image_1) glCompressedTexSubImage2D(GL_TEXTURE_2D,0,0,0,2,2,GL_COMPRESSED_RGBA_S3TC_DXT5_EXT,16,image_2) assert_equal(glGetCompressedTexImage(GL_TEXTURE_2D,0), image_2) # 3D begin glCompressedTexImage3D(GL_TEXTURE_3D,0,GL_COMPRESSED_RGBA_S3TC_DXT5_EXT,2,2,1,0,16,image_1) assert_equal(glGetCompressedTexImage(GL_TEXTURE_3D,0), image_1) rescue Gl::Error => err assert(err.id == GL_INVALID_ENUM || err.id == GL_INVALID_OPERATION) end begin glCompressedTexSubImage3D(GL_TEXTURE_3D,0, 0,0,0, 2,2,1, GL_COMPRESSED_RGBA_S3TC_DXT5_EXT, 16, image_2) assert_equal(glGetCompressedTexImage(GL_TEXTURE_3D,0), image_2) rescue Gl::Error => err assert(err.id == GL_INVALID_ENUM || err.id == GL_INVALID_OPERATION) end glDeleteTextures(textures) n = glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS) if (n>0) assert_equal(glGetIntegerv(GL_COMPRESSED_TEXTURE_FORMATS).size,n) end end def test_glmultitexcoord return if not supported?(1.3) glActiveTexture(GL_TEXTURE1) # 1 glMultiTexCoord1d(GL_TEXTURE1, 1.0) assert_equal(glGetDoublev(GL_CURRENT_TEXTURE_COORDS), [1,0,0,1]) glMultiTexCoord1dv(GL_TEXTURE1, [0.0]) assert_equal(glGetDoublev(GL_CURRENT_TEXTURE_COORDS), [0,0,0,1]) glMultiTexCoord1f(GL_TEXTURE1, 1.0) assert_equal(glGetDoublev(GL_CURRENT_TEXTURE_COORDS), [1,0,0,1]) glMultiTexCoord1fv(GL_TEXTURE1, [0.0]) assert_equal(glGetDoublev(GL_CURRENT_TEXTURE_COORDS), [0,0,0,1]) glMultiTexCoord1i(GL_TEXTURE1, 1) assert_equal(glGetDoublev(GL_CURRENT_TEXTURE_COORDS), [1,0,0,1]) glMultiTexCoord1iv(GL_TEXTURE1, [0]) assert_equal(glGetDoublev(GL_CURRENT_TEXTURE_COORDS), [0,0,0,1]) glMultiTexCoord1s(GL_TEXTURE1, 1) assert_equal(glGetDoublev(GL_CURRENT_TEXTURE_COORDS), [1,0,0,1]) glMultiTexCoord1sv(GL_TEXTURE1, [0]) assert_equal(glGetDoublev(GL_CURRENT_TEXTURE_COORDS), [0,0,0,1]) # 2 glMultiTexCoord2d(GL_TEXTURE1, 1.0,1.0) assert_equal(glGetDoublev(GL_CURRENT_TEXTURE_COORDS), [1,1,0,1]) glMultiTexCoord2dv(GL_TEXTURE1, [0.0,0.0]) assert_equal(glGetDoublev(GL_CURRENT_TEXTURE_COORDS), [0,0,0,1]) glMultiTexCoord2f(GL_TEXTURE1, 1.0,1.0) assert_equal(glGetDoublev(GL_CURRENT_TEXTURE_COORDS), [1,1,0,1]) glMultiTexCoord2fv(GL_TEXTURE1, [0.0,0.0]) assert_equal(glGetDoublev(GL_CURRENT_TEXTURE_COORDS), [0,0,0,1]) glMultiTexCoord2i(GL_TEXTURE1, 1,1) assert_equal(glGetDoublev(GL_CURRENT_TEXTURE_COORDS), [1,1,0,1]) glMultiTexCoord2iv(GL_TEXTURE1, [0,0]) assert_equal(glGetDoublev(GL_CURRENT_TEXTURE_COORDS), [0,0,0,1]) glMultiTexCoord2s(GL_TEXTURE1, 1,1) assert_equal(glGetDoublev(GL_CURRENT_TEXTURE_COORDS), [1,1,0,1]) glMultiTexCoord2sv(GL_TEXTURE1, [0,0]) assert_equal(glGetDoublev(GL_CURRENT_TEXTURE_COORDS), [0,0,0,1]) # 3 glMultiTexCoord3d(GL_TEXTURE1, 1.0,1.0,1.0) assert_equal(glGetDoublev(GL_CURRENT_TEXTURE_COORDS), [1,1,1,1]) glMultiTexCoord3dv(GL_TEXTURE1, [0.0,0.0,0.0]) assert_equal(glGetDoublev(GL_CURRENT_TEXTURE_COORDS), [0,0,0,1]) glMultiTexCoord3f(GL_TEXTURE1, 1.0,1.0,1.0) assert_equal(glGetDoublev(GL_CURRENT_TEXTURE_COORDS), [1,1,1,1]) glMultiTexCoord3fv(GL_TEXTURE1, [0.0,0.0,0.0]) assert_equal(glGetDoublev(GL_CURRENT_TEXTURE_COORDS), [0,0,0,1]) glMultiTexCoord3i(GL_TEXTURE1, 1,1,1) assert_equal(glGetDoublev(GL_CURRENT_TEXTURE_COORDS), [1,1,1,1]) glMultiTexCoord3iv(GL_TEXTURE1, [0,0,0]) assert_equal(glGetDoublev(GL_CURRENT_TEXTURE_COORDS), [0,0,0,1]) glMultiTexCoord3s(GL_TEXTURE1, 1,1,1) assert_equal(glGetDoublev(GL_CURRENT_TEXTURE_COORDS), [1,1,1,1]) glMultiTexCoord3sv(GL_TEXTURE1, [0,0,0]) assert_equal(glGetDoublev(GL_CURRENT_TEXTURE_COORDS), [0,0,0,1]) # 4 glMultiTexCoord4d(GL_TEXTURE1, 1.0,1.0,1.0,1.0) assert_equal(glGetDoublev(GL_CURRENT_TEXTURE_COORDS), [1,1,1,1]) glMultiTexCoord4dv(GL_TEXTURE1, [0.0,0.0,0.0,0.0]) assert_equal(glGetDoublev(GL_CURRENT_TEXTURE_COORDS), [0,0,0,0]) glMultiTexCoord4f(GL_TEXTURE1, 1.0,1.0,1.0,1.0) assert_equal(glGetDoublev(GL_CURRENT_TEXTURE_COORDS), [1,1,1,1]) glMultiTexCoord4fv(GL_TEXTURE1, [0.0,0.0,0.0,0.0]) assert_equal(glGetDoublev(GL_CURRENT_TEXTURE_COORDS), [0,0,0,0]) glMultiTexCoord4i(GL_TEXTURE1, 1,1,1,1) assert_equal(glGetDoublev(GL_CURRENT_TEXTURE_COORDS), [1,1,1,1]) glMultiTexCoord4iv(GL_TEXTURE1, [0,0,0,0]) assert_equal(glGetDoublev(GL_CURRENT_TEXTURE_COORDS), [0,0,0,0]) glMultiTexCoord4s(GL_TEXTURE1, 1,1,1,1) assert_equal(glGetDoublev(GL_CURRENT_TEXTURE_COORDS), [1,1,1,1]) glMultiTexCoord4sv(GL_TEXTURE1, [0,0,0,0]) assert_equal(glGetDoublev(GL_CURRENT_TEXTURE_COORDS), [0,0,0,0]) glActiveTexture(GL_TEXTURE0) end end ruby-opengl-0.60.1.orig/test/tc_glu.rb0000644000000000000000000002074011377006423016265 0ustar rootroot# # Copyright (C) 2007 Jan Dvorak # # This program is distributed under the terms of the MIT license. # See the included MIT-LICENSE file for the terms of this license. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # require 'test/unit' require 'glu' include Glu class Test_GLU < Test::Unit::TestCase def setup common_setup() end def teardown common_teardown() end def test_gluortho res = [ [2.0/$window_size, 0, 0, 0], [0, 2.0/$window_size, 0, 0], [0, 0, -1, 0], [-1,-1,0,1] ] glMatrixMode(GL_PROJECTION) glLoadIdentity() gluOrtho2D(0,$window_size,0,$window_size) assert_equal(glGetDoublev(GL_PROJECTION_MATRIX),res) end def test_glugetstring ver = gluGetString(GLU_VERSION) assert(ver.to_f > 1.1) end def test_gluerrorstring error = gluErrorString(GL_INVALID_VALUE) assert(error.class == String) assert(error.length > 2) end def test_glubuild2dmipmaps textures = glGenTextures(1) glBindTexture(GL_TEXTURE_2D,textures[0]) image = ([0,0,0,1,1,1] * 8).pack("f*") # 16 RGB pixels gluBuild2DMipmaps(GL_TEXTURE_2D,GL_RGB8,4,4,GL_RGB,GL_FLOAT,image) im = glGetTexImage(GL_TEXTURE_2D,0,GL_RGB,GL_FLOAT) assert_equal(im,image) assert_equal(im.unpack("f*").size,4*4*3) im = glGetTexImage(GL_TEXTURE_2D,1,GL_RGB,GL_FLOAT) assert_equal(im.unpack("f*").size,2*2*3) im = glGetTexImage(GL_TEXTURE_2D,2,GL_RGB,GL_FLOAT) assert_equal(im.unpack("f*").size,1*1*3) glDeleteTextures(textures) end def test_glubuild1dmipmaps textures = glGenTextures(1) glBindTexture(GL_TEXTURE_1D,textures[0]) image = ([0,0,0,1,1,1] * 2).pack("f*") # 4 RGB pixels gluBuild1DMipmaps(GL_TEXTURE_1D,GL_RGB8,4,GL_RGB,GL_FLOAT,image) im = glGetTexImage(GL_TEXTURE_1D,0,GL_RGB,GL_FLOAT) assert_equal(im,image) assert_equal(im.unpack("f*").size,4*3) im = glGetTexImage(GL_TEXTURE_1D,1,GL_RGB,GL_FLOAT) assert_equal(im.unpack("f*").size,2*3) im = glGetTexImage(GL_TEXTURE_1D,2,GL_RGB,GL_FLOAT) assert_equal(im.unpack("f*").size,1*3) glDeleteTextures(textures) end def test_glulookat m = [[0,0,1,0], [0,1,0,0], [-1,0,0,0], [0,0,-1, 1]] gluLookAt(1,0,0, 0,0,0, 0,1,0) assert_equal(glGetDoublev(GL_PROJECTION_MATRIX),m) end def test_gluproject pos = gluProject(1,1,1) assert_equal(pos,[$window_size,$window_size,1]) mp = glGetDoublev(GL_PROJECTION_MATRIX) mm = Matrix.rows(glGetDoublev(GL_MODELVIEW_MATRIX)) view = glGetDoublev(GL_VIEWPORT) pos = gluProject(1,1,1,mp,mm,view) assert_equal(pos,[$window_size,$window_size,1]) assert_raise ArgumentError do pos = gluProject(1,1,1,mp,[1,2,3,4],view) end end def test_gluunproject pos = gluUnProject($window_size,$window_size,1) assert_equal(pos,[1,1,1]) mp = glGetDoublev(GL_PROJECTION_MATRIX) mm = Matrix.rows(glGetDoublev(GL_MODELVIEW_MATRIX)) view = glGetDoublev(GL_VIEWPORT) pos = gluUnProject($window_size,$window_size,1,mp,mm,view) assert_equal(pos,[1,1,1]) assert_raise ArgumentError do pos = gluUnProject($window_size,$window_size,1,mp,[1,2,3,4],view) end end def test_glupickmatrix t = $window_size / 5.0 m = [[t, 0.0, 0.0, 0.0], [0.0, t, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0], [t,t, 0.0, 1.0]] glMatrixMode(GL_PROJECTION) glLoadIdentity() gluPickMatrix(0,0) assert(approx_equal(glGetDoublev(GL_PROJECTION_MATRIX).flatten,m.flatten)) glLoadIdentity() gluPickMatrix(0,0,5,5) assert(approx_equal(glGetDoublev(GL_PROJECTION_MATRIX).flatten,m.flatten)) glLoadIdentity() gluPickMatrix(0,0,5,5,glGetDoublev(GL_VIEWPORT)) assert(approx_equal(glGetDoublev(GL_PROJECTION_MATRIX).flatten,m.flatten)) end def test_gluperspective m = [[1,0,0,0], [0,1,0,0], [0,0,-3,-1], [0,0,-4,0]] gluPerspective(90,1,1,2) assert_equal(glGetDoublev(GL_PROJECTION_MATRIX),m) end def test_gluscaleimage image = ([0,0,0,1,1,1] * 8).pack("f*") # 16 RGB pixels scaled = gluScaleImage(GL_RGB,4,4,GL_FLOAT,image, 2,2,GL_FLOAT) assert_equal(scaled.unpack("f*").length,2*2*3) end def test_gluquadrics ecount = 0 error_func = lambda do |error| ecount+=1 end q = gluNewQuadric() gluQuadricDrawStyle(q,GL_LINE) gluQuadricNormals(q,GL_SMOOTH) gluQuadricOrientation(q,GLU_OUTSIDE) gluQuadricTexture(q,GL_FALSE) gluQuadricCallback(q,GLU_ERROR,error_func) buf = glFeedbackBuffer(1024,GL_3D) glRenderMode(GL_FEEDBACK) gluSphere(q,1.0,4,3) count = glRenderMode(GL_RENDER) assert(count % 11 == 0) glRenderMode(GL_FEEDBACK) gluCylinder(q,1.0,1.0,1.0,4,3) count = glRenderMode(GL_RENDER) assert(count % 11 == 0) glRenderMode(GL_FEEDBACK) gluDisk(q,1.0,2.0,4,3) count = glRenderMode(GL_RENDER) assert(count % 11 == 0) glRenderMode(GL_FEEDBACK) gluPartialDisk(q,1.0,2.0,4,3,0,360) count = glRenderMode(GL_RENDER) assert(count % 11 == 0) gluSphere(q,0.0,0,0) assert_equal(ecount,1) gluDeleteQuadric(q) end def test_glunurbs ecount = 0 glViewport(0, 0, $window_size, $window_size) glMatrixMode(GL_PROJECTION) glOrtho(0, $window_size, 0, $window_size, -1, 1) n_error = lambda do |error| ecount += 1 end m = [[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]] m2 = Matrix.rows(m) n = gluNewNurbsRenderer() gluNurbsCallback(n,GLU_ERROR,n_error) gluNurbsProperty(n,GLU_SAMPLING_TOLERANCE,40) assert_equal(gluGetNurbsProperty(n,GLU_SAMPLING_TOLERANCE),40) gluLoadSamplingMatrices(n,m,m2,glGetIntegerv(GL_VIEWPORT)) assert_raise ArgumentError do gluLoadSamplingMatrices(n,m,[1,2,3,4],glGetIntegerv(GL_VIEWPORT)) end knots = [0,0,0,0,1,1,1,1] ctlpoints_curve = [[50,50,0],[400,50,0],[400,400,0],[50,400,0]] # generate surface control points ctlpoints = Array.new(4).collect { Array.new(4).collect { Array.new(3, nil) } } # 4*4*3 array 0.upto(3) do |u| 0.upto(3) do |v| ctlpoints[u][v][0]=2.0*(u-1.5) ctlpoints[u][v][1]=2.0*(v-1.5) if ((u==1 || u==2) && (v==1 || v==2)) ctlpoints[u][v][2]=6.0 else ctlpoints[u][v][2]=0.0 end end end buf = glFeedbackBuffer(1024*1024*8,GL_3D) # large enough buffer for tesselated surface glRenderMode(GL_FEEDBACK) gluBeginCurve(n) gluNurbsCurve(n,knots,ctlpoints_curve,4,GL_MAP1_VERTEX_3) gluEndCurve(n) gluBeginSurface(n) gluNurbsSurface(n,knots,knots,ctlpoints,4,4,GL_MAP2_VERTEX_3) gluEndSurface(n) gluBeginTrim(n) gluPwlCurve(n,[[0,0],[1,0],[1,1],[0,1],[0,0]],GLU_MAP1_TRIM_2) gluEndTrim(n) count = glRenderMode(GL_RENDER) assert(count>1) gluDeleteNurbsRenderer(n) assert(ecount>=1) end def test_glutess glViewport(0, 0, $window_size, $window_size) glMatrixMode(GL_PROJECTION) glOrtho(0, $window_size, 0, $window_size, -1, 1) vcount,bcount,ecount = 0,0,0 cb_begin = lambda do |type| bcount += 1 end cb_end = lambda do ecount += 1 end cb_vertex = lambda do |data| vcount += 1 end cb_error = lambda do |error| p gluErrorString(error) end t = gluNewTess() gluTessCallback(t,GLU_TESS_BEGIN,cb_begin) gluTessCallback(t,GLU_TESS_END,cb_end) gluTessCallback(t,GLU_TESS_ERROR,cb_error) gluTessCallback(t,GLU_TESS_VERTEX,cb_vertex) gluTessProperty(t,GLU_TESS_BOUNDARY_ONLY,GL_TRUE) assert_equal(gluGetTessProperty(t,GLU_TESS_BOUNDARY_ONLY),GL_TRUE) gluTessProperty(t,GLU_TESS_BOUNDARY_ONLY,GL_FALSE) assert_equal(gluGetTessProperty(t,GLU_TESS_BOUNDARY_ONLY),GL_FALSE) gluTessNormal(t, 0.0, 0.0, 0.0) rect = [[50.0, 50.0, 0.0], [200.0, 50.0, 0.0], [200.0, 200.0, 0.0], [50.0, 200.0, 0.0]] tri = [[75.0, 75.0, 0.0], [125.0, 175.0, 0.0], [175.0, 75.0, 0.0]] gluTessBeginPolygon(t, nil) gluTessBeginContour(t) gluTessVertex(t, rect[0], rect[0]) gluTessVertex(t, rect[1], rect[1]) gluTessVertex(t, rect[2], rect[2]) gluTessVertex(t, rect[3], rect[3]) gluTessEndContour(t) gluTessBeginContour(t) gluTessVertex(t, tri[0], tri[0]) gluTessVertex(t, tri[1], tri[1]) gluTessVertex(t, tri[2], tri[2]) gluTessEndContour(t) gluTessEndPolygon(t) gluTessCallback(t,GLU_TESS_BEGIN,nil) gluTessCallback(t,GLU_TESS_END,nil) gluTessCallback(t,GLU_TESS_ERROR,nil) gluTessCallback(t,GLU_TESS_VERTEX,nil) gluDeleteTess(t) assert_equal(bcount,1) assert_equal(ecount,1) assert_equal(vcount,3*3) end end ruby-opengl-0.60.1.orig/test/tc_include_gl.rb0000644000000000000000000000226411377006423017604 0ustar rootroot#-- # Copyright (C) 2006 Peter McLain # # This program is distributed under the terms of the MIT license. # See the included MIT-LICENSE file for the terms of this license. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #++ if __FILE__ == $0 # If we are being called from the command line, e.g., ruby foo.rb, then # fixup the load path so we can find the OpenGL extension libs $: << File.join(File.dirname(__FILE__), '..', 'lib') end require 'test/unit' require 'gl' include Gl # Test that an include of Gl forces makes the OpenGL namespace available in # the current module. # include Gl # ... # Gl::VERSION exists class GlIncludeTest < Test::Unit::TestCase def test_require_of_gl assert Gl::GL_VERSION end end ruby-opengl-0.60.1.orig/test/tc_func_12.rb0000644000000000000000000001525211377006423016735 0ustar rootroot# # Copyright (C) 2007 Jan Dvorak # # This program is distributed under the terms of the MIT license. # See the included MIT-LICENSE file for the terms of this license. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # require 'test/unit' class Test_12 < Test::Unit::TestCase def setup common_setup() end def teardown common_teardown() end def test_glblend return if not supported?(1.2) glBlendColor(0.0,1.0,0.0,1.0) assert_equal(glGetDoublev(GL_BLEND_COLOR),[0,1,0,1]) glBlendEquation(GL_MIN) assert_equal(glGetIntegerv(GL_BLEND_EQUATION),GL_MIN) glBlendEquation(GL_MAX) assert_equal(glGetIntegerv(GL_BLEND_EQUATION),GL_MAX) end def test_gldrawrangeelements return if not supported?(1.2) va = [0,0, 0,1, 1,1].pack("f*") glVertexPointer(2,GL_FLOAT,0,va) buf = glFeedbackBuffer(256,GL_3D) glRenderMode(GL_FEEDBACK) glEnable(GL_VERTEX_ARRAY) glDrawRangeElements(GL_POINTS,0,2,3,GL_UNSIGNED_BYTE,[0,1,2].pack("C*")) count = glRenderMode(GL_RENDER) assert_equal(count,12) glDisable(GL_VERTEX_ARRAY) end def test_colortable return if not supported?(1.2) ct = ([0]*3+[1]*3+[0]*3+[1]*3).pack("f*") ct2 = ([1]*3+[0]*3+[1]*3+[0]*3).pack("f*") glColorTable(GL_COLOR_TABLE,GL_RGB8,4,GL_RGB,GL_FLOAT,ct) assert_equal(glGetColorTable(GL_COLOR_TABLE,GL_RGB,GL_FLOAT),ct) glColorSubTable(GL_COLOR_TABLE,0,4,GL_RGB,GL_FLOAT,ct2) assert_equal(glGetColorTable(GL_COLOR_TABLE,GL_RGB,GL_FLOAT),ct2) glDrawPixels(4,1,GL_RGB,GL_FLOAT,ct) glCopyColorTable(GL_COLOR_TABLE,GL_RGB8,0,0,4) assert_equal(glGetColorTable(GL_COLOR_TABLE,GL_RGB,GL_FLOAT),ct) glDrawPixels(4,1,GL_RGB,GL_FLOAT,ct2) glCopyColorSubTable(GL_COLOR_TABLE,0,0,0,4) assert_equal(glGetColorTable(GL_COLOR_TABLE,GL_RGB,GL_FLOAT),ct2) glColorTableParameterfv(GL_COLOR_TABLE,GL_COLOR_TABLE_BIAS,[0,1,0,1]) assert_equal(glGetColorTableParameterfv(GL_COLOR_TABLE,GL_COLOR_TABLE_BIAS),[0,1,0,1]) glColorTableParameteriv(GL_COLOR_TABLE,GL_COLOR_TABLE_BIAS,[1,0,1,0]) assert_equal(glGetColorTableParameteriv(GL_COLOR_TABLE,GL_COLOR_TABLE_BIAS),[1,0,1,0]) end def test_convolutionfilter return if not supported?(1.2) cf = ([0]*3+[1]*3+[0]*3+[1]*3).pack("f*") cf2 = ([1]*3+[0]*3+[1]*3+[0]*3).pack("f*") glConvolutionFilter1D(GL_CONVOLUTION_1D, GL_RGB8, 4, GL_RGB, GL_FLOAT,cf) assert_equal(glGetConvolutionFilter(GL_CONVOLUTION_1D, GL_RGB, GL_FLOAT),cf) glConvolutionFilter2D(GL_CONVOLUTION_2D, GL_RGB8, 2,2, GL_RGB, GL_FLOAT,cf2) assert_equal(glGetConvolutionFilter(GL_CONVOLUTION_2D, GL_RGB, GL_FLOAT),cf2) glDrawPixels(4,1,GL_RGB,GL_FLOAT,cf2) glCopyConvolutionFilter1D(GL_CONVOLUTION_1D,GL_RGB8,0,0,4) assert_equal(glGetConvolutionFilter(GL_CONVOLUTION_1D, GL_RGB, GL_FLOAT),cf2) glDrawPixels(2,2,GL_RGB,GL_FLOAT,cf) glCopyConvolutionFilter2D(GL_CONVOLUTION_2D,GL_RGB8,0,0,2,2) assert_equal(glGetConvolutionFilter(GL_CONVOLUTION_2D, GL_RGB, GL_FLOAT),cf) glConvolutionParameterf(GL_CONVOLUTION_1D,GL_CONVOLUTION_BORDER_MODE,GL_CONSTANT_BORDER) assert_equal(glGetConvolutionParameterfv(GL_CONVOLUTION_1D,GL_CONVOLUTION_BORDER_MODE),GL_CONSTANT_BORDER) glConvolutionParameterf(GL_CONVOLUTION_1D,GL_CONVOLUTION_BORDER_MODE,GL_REPLICATE_BORDER) assert_equal(glGetConvolutionParameterfv(GL_CONVOLUTION_1D,GL_CONVOLUTION_BORDER_MODE),GL_REPLICATE_BORDER) glConvolutionParameterfv(GL_CONVOLUTION_1D,GL_CONVOLUTION_BORDER_MODE,[GL_CONSTANT_BORDER]) assert_equal(glGetConvolutionParameterfv(GL_CONVOLUTION_1D,GL_CONVOLUTION_BORDER_MODE),GL_CONSTANT_BORDER) glConvolutionParameteri(GL_CONVOLUTION_1D,GL_CONVOLUTION_BORDER_MODE,GL_REPLICATE_BORDER) assert_equal(glGetConvolutionParameteriv(GL_CONVOLUTION_1D,GL_CONVOLUTION_BORDER_MODE),GL_REPLICATE_BORDER) glConvolutionParameteriv(GL_CONVOLUTION_1D,GL_CONVOLUTION_BORDER_MODE,[GL_CONSTANT_BORDER]) assert_equal(glGetConvolutionParameteriv(GL_CONVOLUTION_1D,GL_CONVOLUTION_BORDER_MODE),GL_CONSTANT_BORDER) end def test_separablefilter return if not supported?(1.2) sf_a = ([0]*3+[1]*3).pack("f*") sf_b = ([1]*3+[0]*3).pack("f*") glSeparableFilter2D(GL_SEPARABLE_2D,GL_RGB8, 2,2,GL_RGB,GL_FLOAT,sf_a,sf_b) assert_equal(glGetSeparableFilter(GL_SEPARABLE_2D,GL_RGB,GL_FLOAT), [sf_a,sf_b]) end def test_histogram return if not supported?(1.2) glEnable(GL_HISTOGRAM) glHistogram(GL_HISTOGRAM,1,GL_RGB,GL_FALSE) assert_equal(glGetHistogramParameterfv(GL_HISTOGRAM,GL_HISTOGRAM_WIDTH),1) assert_equal(glGetHistogramParameteriv(GL_HISTOGRAM,GL_HISTOGRAM_FORMAT),GL_RGB) assert_equal(glGetHistogramParameteriv(GL_HISTOGRAM,GL_HISTOGRAM_SINK),GL_FALSE) glDrawPixels(2,1,GL_RGB,GL_FLOAT,[1,1,1,1,1,1].pack("f*")) h = glGetHistogram(GL_HISTOGRAM,GL_FALSE,GL_RGB,GL_FLOAT) assert_equal(h.unpack("f*"),[2,2,2]) glResetHistogram(GL_HISTOGRAM) h = glGetHistogram(GL_HISTOGRAM,GL_FALSE,GL_RGB,GL_FLOAT) assert_equal(h.unpack("f*"),[0,0,0]) glDisable(GL_HISTOGRAM) end def test_minmax return if not supported?(1.2) glEnable(GL_MINMAX) glMinmax(GL_MINMAX,GL_RGB,GL_FALSE) assert_equal(glGetMinmaxParameteriv(GL_MINMAX,GL_MINMAX_FORMAT),GL_RGB) assert_equal(glGetMinmaxParameterfv(GL_MINMAX,GL_MINMAX_FORMAT),GL_RGB) assert_equal(glGetMinmaxParameteriv(GL_MINMAX,GL_MINMAX_SINK),GL_FALSE) glDrawPixels(2,1,GL_RGB,GL_FLOAT,[0,0,0,1,1,1].pack("f*")) mm = glGetMinmax(GL_MINMAX,GL_FALSE,GL_RGB,GL_FLOAT) assert_equal(mm.unpack("f*"),[0,0,0,1,1,1]) glResetMinmax(GL_MINMAX) mm = glGetMinmax(GL_MINMAX,GL_FALSE,GL_RGB,GL_UNSIGNED_BYTE) assert(approx_equal(mm.unpack("f*"),[0,0,0,0,0,0])) glDisable(GL_MINMAX) end def test_texture_3D return if not supported?(1.2) image = ([0,0,0,1,1,1] * 2 * 2).pack("f*") image2 = ([1,1,1,0,0,0] * 2 * 2).pack("f*") textures = glGenTextures(1) glBindTexture(GL_TEXTURE_3D,textures[0]) glTexImage3D(GL_TEXTURE_3D,0,GL_RGB8,2,2,2,0,GL_RGB,GL_FLOAT,image) assert_equal(glGetTexImage(GL_TEXTURE_3D,0,GL_RGB,GL_FLOAT),image) glTexSubImage3D(GL_TEXTURE_3D,0, 0,0,0, 2,2,2,GL_RGB,GL_FLOAT,image2) assert_equal(glGetTexImage(GL_TEXTURE_3D,0,GL_RGB,GL_FLOAT),image2) glDrawPixels(2,2,GL_RGB,GL_FLOAT,image) glCopyTexSubImage3D(GL_TEXTURE_3D,0,0,0,0,0,0,2,2) ti = glGetTexImage(GL_TEXTURE_3D,0,GL_RGB,GL_FLOAT).unpack("f*") assert_equal(ti,([0]*3 + [1]*3) * 2 + ([1]*3 + [0]*3) * 2) glDeleteTextures(textures) end end ruby-opengl-0.60.1.orig/test/tc_misc.rb0000644000000000000000000000311211377006423016423 0ustar rootroot# # Copyright (C) 2007 Jan Dvorak # # This program is distributed under the terms of the MIT license. # See the included MIT-LICENSE file for the terms of this license. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # if __FILE__ == $0 # If we are being called from the command line, e.g., ruby foo.rb, then # fixup the load path so we can find the OpenGL extension libs $: << File.join(File.dirname(__FILE__), '..', 'lib') end require 'test/unit' require 'gl' require 'glut' include Gl include Glut class Test_misc < Test::Unit::TestCase def setup return if $glut_initialized glut_init() $glut_initialized = true end def test_isavailable assert_equal(is_available?(1.1),true) assert_equal(is_available?("GL_ARB_multitexture"),true) assert_equal(is_available?("GL_NON_EXISTENT"),false) end def test_errorchecking Gl.disable_error_checking assert_equal(Gl.is_error_checking_enabled?,false) Gl.enable_error_checking assert_equal(Gl.is_error_checking_enabled?,true) begin glEnable(0) rescue Gl::Error => err assert_equal(err.id,GL_INVALID_ENUM) else assert(false) # error not detected end end end ruby-opengl-0.60.1.orig/test/tc_common.rb0000644000000000000000000000450211377006423016764 0ustar rootroot# # Copyright (C) 2007 Jan Dvorak # # This program is distributed under the terms of the MIT license. # See the included MIT-LICENSE file for the terms of this license. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # if __FILE__ == $0 # If we are being called from the command line, e.g., ruby foo.rb, then # fixup the load path so we can find the OpenGL extension libs $: << File.join(File.dirname(__FILE__), '..', 'lib') end require 'test/unit' require 'gl' require 'glut' require 'matrix' include Gl include Glut Gl.enable_error_checking $window_size = 512 def glut_init() display_func = lambda do raise end glutInit glutInitDisplayMode(GLUT_DEPTH | GLUT_DOUBLE | GLUT_RGBA | GLUT_STENCIL | GLUT_ACCUM | GLUT_ALPHA) glutInitWindowPosition(1, 1) glutInitWindowSize($window_size, $window_size) glutCreateWindow("test") # hack the need to call glutMainLoop on some implementations glutDisplayFunc(display_func) begin glutMainLoop() rescue # continue end end def approx_equal(a,b,epsilon=0.01) (0...a.size).each do |i| if ((a[i] - b[i]).abs > epsilon) return false end end true end def common_setup if $glut_initialized == nil glut_init() $glut_initialized = true end glPushAttrib(GL_ALL_ATTRIB_BITS) glPushClientAttrib(GL_CLIENT_ALL_ATTRIB_BITS) glMatrixMode(GL_MODELVIEW) glLoadIdentity() glMatrixMode(GL_PROJECTION) glLoadIdentity() glClearColor(0,0,0,0) glClear(GL_COLOR_BUFFER_BIT) end def common_teardown glPopAttrib() glPopClientAttrib() glRenderMode(GL_RENDER) # in case there is an GL error that escaped error checking routines ... error = glGetError() p gluErrorString(error) if (error!=0) assert_equal(error,0) end def supported?(funcs) Array(funcs).each do |name| # convert to array if it isn't already if !Gl.is_available?(name) puts "" print "#{name} not supported, test skipped" return false end end return true end ruby-opengl-0.60.1.orig/test/tc_func_21.rb0000644000000000000000000004370111377006423016735 0ustar rootroot# # Copyright (C) 2007 Jan Dvorak # # This program is distributed under the terms of the MIT license. # See the included MIT-LICENSE file for the terms of this license. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # require 'test/unit' class Test_21 < Test::Unit::TestCase def setup common_setup() end def teardown common_teardown() end def test_gluniformmatrix21 return if not supported?(2.1) vertex_shader_source = "#version 120\n uniform mat2x3 testmat23; uniform mat3x2 testmat32; uniform mat2x4 testmat24; uniform mat4x2 testmat42; uniform mat3x4 testmat34; uniform mat4x3 testmat43; void main() { gl_Position = gl_Vertex * testmat23[0].x * testmat32[0].x * testmat24[0].x * testmat42[0].x * testmat34[0].x * testmat43[0].x;}" program = glCreateProgram() vs = glCreateShader(GL_VERTEX_SHADER) glShaderSource(vs,vertex_shader_source) glCompileShader(vs) assert_equal(glGetShaderiv(vs,GL_COMPILE_STATUS),GL_TRUE) glAttachShader(program,vs) glLinkProgram(program) assert_equal(glGetProgramiv(program,GL_LINK_STATUS),GL_TRUE) glUseProgram(program) assert((tm23l = glGetUniformLocation(program,"testmat23"))>=0) assert((tm32l = glGetUniformLocation(program,"testmat32"))>=0) assert((tm24l = glGetUniformLocation(program,"testmat24"))>=0) assert((tm42l = glGetUniformLocation(program,"testmat42"))>=0) assert((tm34l = glGetUniformLocation(program,"testmat34"))>=0) assert((tm43l = glGetUniformLocation(program,"testmat43"))>=0) glUniformMatrix2x3fv(tm23l, GL_FALSE, [0,1, 1,0, 0,1]) assert_equal(glGetUniformfv(program,tm23l),[0,1, 1,0, 0,1]) glUniformMatrix3x2fv(tm32l, GL_FALSE, [1,0, 0,1, 1,0]) assert_equal(glGetUniformfv(program,tm32l),[1,0, 0,1, 1,0]) glUniformMatrix2x4fv(tm24l, GL_FALSE, [0,1, 1,0, 0,1, 1,0]) assert_equal(glGetUniformfv(program,tm24l),[0,1, 1,0, 0,1, 1,0]) glUniformMatrix4x2fv(tm42l, GL_FALSE, [1,0, 0,1, 1,0, 0,1]) assert_equal(glGetUniformfv(program,tm42l),[1,0, 0,1, 1,0, 0,1]) glUniformMatrix3x4fv(tm34l, GL_FALSE, [0,1,1, 1,0,1, 0,1,1, 1,0,1]) assert_equal(glGetUniformfv(program,tm34l),[0,1,1, 1,0,1, 0,1,1, 1,0,1]) glUniformMatrix4x3fv(tm43l, GL_FALSE, [1,0,0, 0,1,0, 1,0,0, 0,1,0]) assert_equal(glGetUniformfv(program,tm43l),[1,0,0, 0,1,0, 1,0,0, 0,1,0]) # 2 m = Matrix.rows([[0,1],[1,0],[0,1]]) glUniformMatrix2x3fv(tm23l, GL_FALSE, m) assert_equal(glGetUniformfv(program,tm23l),[0,1, 1,0, 0,1]) m = Matrix.rows([[0,1,1],[0,0,1]]) glUniformMatrix3x2fv(tm32l, GL_FALSE, m) assert_equal(glGetUniformfv(program,tm32l),[0,1,1, 0,0,1]) m = Matrix.rows([[0,1],[1,0],[0,1],[1,0]]) glUniformMatrix2x4fv(tm24l, GL_FALSE, m) assert_equal(glGetUniformfv(program,tm24l),[0,1, 1,0, 0,1, 1,0]) m = Matrix.rows([[0,1,1,1],[0,0,1,1]]) glUniformMatrix4x2fv(tm42l, GL_FALSE, m) assert_equal(glGetUniformfv(program,tm42l),[0,1,1,1, 0,0,1,1]) m = Matrix.rows([[0,1,0],[1,0,1],[0,1,0],[1,0,1]]) glUniformMatrix3x4fv(tm34l, GL_FALSE, m) assert_equal(glGetUniformfv(program,tm34l),[0,1,0, 1,0,1, 0,1,0, 1,0,1]) m = Matrix.rows([[0,1,1,1],[0,0,1,1],[1,1,0,0]]) glUniformMatrix4x3fv(tm43l, GL_FALSE, m) assert_equal(glGetUniformfv(program,tm43l),[0,1,1,1, 0,0,1,1, 1,1,0,0]) # 3 assert_raise ArgumentError do glUniformMatrix2x3fv(tm23l, GL_FALSE, [1,2,3,4]) end assert_raise ArgumentError do glUniformMatrix3x2fv(tm32l, GL_FALSE, [1,2,3,4]) end assert_raise ArgumentError do glUniformMatrix2x4fv(tm24l, GL_FALSE, [1,2,3,4]) end assert_raise ArgumentError do glUniformMatrix4x2fv(tm42l, GL_FALSE, [1,2,3,4]) end assert_raise ArgumentError do glUniformMatrix3x4fv(tm34l, GL_FALSE, [1,2,3,4]) end assert_raise ArgumentError do glUniformMatrix4x3fv(tm43l, GL_FALSE, [1,2,3,4]) end end def test_pixelunpack_bitmap return if not supported?(2.1) glOrtho(0,$window_size,0,$window_size,0,-1) bitmap = [ 0x55 ] * 8 # 64 bits (8x8 bitmap), stipple pattern glPixelStorei(GL_PACK_ALIGNMENT,1) glPixelStorei(GL_UNPACK_ALIGNMENT,1) buffers = glGenBuffers(1) glBindBuffer(GL_PIXEL_UNPACK_BUFFER,buffers[0]) glBufferData(GL_PIXEL_UNPACK_BUFFER,8,bitmap.pack("C*"),GL_DYNAMIC_DRAW) glBitmap(8,8,0,0,0,0,0) data = glReadPixels(0,0,8,8,GL_RED,GL_UNSIGNED_BYTE) assert_equal(data.unpack("C*"),[0,255] * 32) glDeleteBuffers(buffers) end def test_pixelunpack_color_convolution return if not supported?(2.1) ct = ([0]*3+[1]*3+[0]*3+[1]*3).pack("f*") ct2 = ([1]*3+[0]*3+[1]*3+[0]*3).pack("f*") buffers = glGenBuffers(2) glBindBuffer(GL_PIXEL_UNPACK_BUFFER,buffers[0]) glBufferData(GL_PIXEL_UNPACK_BUFFER,4*3*4,ct,GL_DYNAMIC_DRAW) glBindBuffer(GL_PIXEL_UNPACK_BUFFER,buffers[1]) glBufferData(GL_PIXEL_UNPACK_BUFFER,4*3*4,ct2,GL_DYNAMIC_DRAW) glBindBuffer(GL_PIXEL_UNPACK_BUFFER,buffers[0]) glColorTable(GL_COLOR_TABLE,GL_RGB8,4,GL_RGB,GL_FLOAT,0) assert_equal(glGetColorTable(GL_COLOR_TABLE,GL_RGB,GL_FLOAT),ct) glConvolutionFilter1D(GL_CONVOLUTION_1D, GL_RGB8, 4, GL_RGB, GL_FLOAT,0) assert_equal(glGetConvolutionFilter(GL_CONVOLUTION_1D, GL_RGB, GL_FLOAT),ct) glBindBuffer(GL_PIXEL_UNPACK_BUFFER,buffers[1]) glColorSubTable(GL_COLOR_TABLE,0,4,GL_RGB,GL_FLOAT,0) assert_equal(glGetColorTable(GL_COLOR_TABLE,GL_RGB,GL_FLOAT),ct2) glConvolutionFilter2D(GL_CONVOLUTION_2D, GL_RGB8, 2,2, GL_RGB, GL_FLOAT,0) assert_equal(glGetConvolutionFilter(GL_CONVOLUTION_2D, GL_RGB, GL_FLOAT),ct2) glDeleteBuffers(buffers) end def test_pixelunpack_separable return if not supported?(2.1) sf_a = ([0]*3+[1]*3).pack("f*") sf_b = ([1]*3+[0]*3).pack("f*") buffers = glGenBuffers(1) glBindBuffer(GL_PIXEL_UNPACK_BUFFER,buffers[0]) glBufferData(GL_PIXEL_UNPACK_BUFFER,2*3*4 *2,sf_a + sf_b,GL_DYNAMIC_DRAW) glSeparableFilter2D(GL_SEPARABLE_2D,GL_RGB8, 2,2,GL_RGB,GL_FLOAT,0,2*3*4) assert_equal(glGetSeparableFilter(GL_SEPARABLE_2D,GL_RGB,GL_FLOAT), [sf_a,sf_b]) glDeleteBuffers(buffers) end def test_pixelunpack_drawpixels return if not supported?(2.1) glClearColor(0,0,0,0) glClear(GL_COLOR_BUFFER_BIT) image = ([1.0] * 3 * 16).pack("f*") buffers = glGenBuffers(1) glBindBuffer(GL_PIXEL_UNPACK_BUFFER,buffers[0]) glBufferData(GL_PIXEL_UNPACK_BUFFER,3*16*4,image,GL_DYNAMIC_DRAW) glDrawPixels(4,4,GL_RGB,GL_FLOAT,0) data = glReadPixels(0,0,4,4,GL_RGB,GL_FLOAT) assert_equal(data,image) glDeleteBuffers(buffers) end def test_pixelunpack_polygonstipple return if not supported?(2.1) stipple = ([0x12] * 128).pack("c*") buffers = glGenBuffers(1) glBindBuffer(GL_PIXEL_UNPACK_BUFFER,buffers[0]) glBufferData(GL_PIXEL_UNPACK_BUFFER,128,stipple,GL_DYNAMIC_DRAW) glPolygonStipple(0) assert_equal(glGetPolygonStipple(),stipple) glDeleteBuffers(buffers) end def test_pixelunpack_texturecompression return if not supported?(2.1) return if not supported?("GL_EXT_texture_compression_s3tc") # S3TC/DXT5 compressed 2x2 pixels stipple patterns [w,b,b,w] and [b,w,w,b] image_1 = [0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0x00,0x00,0x01,0x54,0x5C,0x5C].pack("C*") image_2 = [0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0x00,0x00,0x54,0x01,0x0D,0x0D].pack("C*") textures = glGenTextures(3) glBindTexture(GL_TEXTURE_1D,textures[0]) glBindTexture(GL_TEXTURE_2D,textures[1]) glBindTexture(GL_TEXTURE_3D,textures[2]) buffers = glGenBuffers(2) glBindBuffer(GL_PIXEL_UNPACK_BUFFER,buffers[0]) glBufferData(GL_PIXEL_UNPACK_BUFFER,16,image_1,GL_DYNAMIC_DRAW) glBindBuffer(GL_PIXEL_UNPACK_BUFFER,buffers[1]) glBufferData(GL_PIXEL_UNPACK_BUFFER,16,image_2,GL_DYNAMIC_DRAW) # Note: 1D and 3D compressed textures are not supported by S3TC/DXTn, and usually not supported at all # 1D glBindBuffer(GL_PIXEL_UNPACK_BUFFER,buffers[0]) begin glCompressedTexImage1D(GL_TEXTURE_1D,0,GL_COMPRESSED_RGBA_S3TC_DXT5_EXT,4,0,16,0) assert_equal(glGetCompressedTexImage(GL_TEXTURE_1D,0), image_1) rescue Gl::Error => err assert(err.id == GL_INVALID_ENUM || err.id == GL_INVALID_OPERATION) end glBindBuffer(GL_PIXEL_UNPACK_BUFFER,buffers[1]) begin glCompressedTexSubImage1D(GL_TEXTURE_1D,0,0,4,GL_COMPRESSED_RGBA_S3TC_DXT5_EXT,16,0) assert_equal(glGetCompressedTexImage(GL_TEXTURE_1D,0), image_2) rescue Gl::Error => err assert(err.id == GL_INVALID_ENUM || err.id == GL_INVALID_OPERATION) end # 2D glBindBuffer(GL_PIXEL_UNPACK_BUFFER,buffers[0]) glCompressedTexImage2D(GL_TEXTURE_2D,0,GL_COMPRESSED_RGBA_S3TC_DXT5_EXT,2,2,0,16,0) assert_equal(glGetCompressedTexImage(GL_TEXTURE_2D,0), image_1) glBindBuffer(GL_PIXEL_UNPACK_BUFFER,buffers[1]) glCompressedTexSubImage2D(GL_TEXTURE_2D,0,0,0,2,2,GL_COMPRESSED_RGBA_S3TC_DXT5_EXT,16,0) assert_equal(glGetCompressedTexImage(GL_TEXTURE_2D,0), image_2) # 3D glBindBuffer(GL_PIXEL_UNPACK_BUFFER,buffers[0]) begin glCompressedTexImage3D(GL_TEXTURE_3D,0,GL_COMPRESSED_RGBA_S3TC_DXT5_EXT,2,2,1,0,16,0) assert_equal(glGetCompressedTexImage(GL_TEXTURE_3D,0), image_1) rescue Gl::Error => err assert(err.id == GL_INVALID_ENUM || err.id == GL_INVALID_OPERATION) end glBindBuffer(GL_PIXEL_UNPACK_BUFFER,buffers[1]) begin glCompressedTexSubImage3D(GL_TEXTURE_3D,0, 0,0,0, 2,2,1, GL_COMPRESSED_RGBA_S3TC_DXT5_EXT, 16, 0) assert_equal(glGetCompressedTexImage(GL_TEXTURE_3D,0), image_2) rescue Gl::Error => err assert(err.id == GL_INVALID_ENUM || err.id == GL_INVALID_OPERATION) end glDeleteBuffers(buffers) glDeleteTextures(textures) end def test_pixelunpack_texture return if not supported?(2.1) textures = glGenTextures(3) image_1 = ([0,0,0,1,1,1] * 8).pack("f*") # 16 RGB pixels image_2 = ([1,1,1,0,0,0] * 8).pack("f*") # 16 RGB pixels buffers = glGenBuffers(2) glBindBuffer(GL_PIXEL_UNPACK_BUFFER,buffers[0]) glBufferData(GL_PIXEL_UNPACK_BUFFER,6*8*4,image_1,GL_DYNAMIC_DRAW) glBindBuffer(GL_PIXEL_UNPACK_BUFFER,buffers[1]) glBufferData(GL_PIXEL_UNPACK_BUFFER,6*8*4,image_2,GL_DYNAMIC_DRAW) # 3D glBindTexture(GL_TEXTURE_3D,textures[0]) glBindBuffer(GL_PIXEL_UNPACK_BUFFER,buffers[0]) glTexImage3D(GL_TEXTURE_3D,0,GL_RGB8,2,2,4,0,GL_RGB,GL_FLOAT,0) assert_equal(glGetTexImage(GL_TEXTURE_3D,0,GL_RGB,GL_FLOAT),image_1) glBindBuffer(GL_PIXEL_UNPACK_BUFFER,buffers[1]) glTexSubImage3D(GL_TEXTURE_3D,0, 0,0,0, 2,2,4,GL_RGB,GL_FLOAT,0) assert_equal(glGetTexImage(GL_TEXTURE_3D,0,GL_RGB,GL_FLOAT),image_2) # 2D glBindTexture(GL_TEXTURE_2D,textures[1]) glBindBuffer(GL_PIXEL_UNPACK_BUFFER,buffers[0]) glTexImage2D(GL_TEXTURE_2D,0,GL_RGB8, 4, 4, 0, GL_RGB, GL_FLOAT, 0) assert_equal(glGetTexImage(GL_TEXTURE_2D,0,GL_RGB,GL_FLOAT), image_1) glBindBuffer(GL_PIXEL_UNPACK_BUFFER,buffers[1]) glTexSubImage2D(GL_TEXTURE_2D,0, 0,0, 4,4,GL_RGB,GL_FLOAT,0) assert_equal(glGetTexImage(GL_TEXTURE_2D,0,GL_RGB,GL_FLOAT),image_2) # 1D glBindTexture(GL_TEXTURE_1D,textures[2]) glBindBuffer(GL_PIXEL_UNPACK_BUFFER,buffers[0]) glTexImage1D(GL_TEXTURE_1D,0,GL_RGB8, 16, 0, GL_RGB, GL_FLOAT, 0) assert_equal(glGetTexImage(GL_TEXTURE_1D,0,GL_RGB,GL_FLOAT), image_1) glBindBuffer(GL_PIXEL_UNPACK_BUFFER,buffers[1]) glTexSubImage1D(GL_TEXTURE_1D,0, 0, 16,GL_RGB,GL_FLOAT,0) assert_equal(glGetTexImage(GL_TEXTURE_1D,0,GL_RGB,GL_FLOAT),image_2) glDeleteBuffers(buffers) glDeleteTextures(textures) end def test_pixelunpack_pixelmap return if not supported?(2.1) data_1 = [1,2,3,4].pack("f*") data_2 = [5,6,7,8].pack("I*") data_3 = [9,10,11,12].pack("S*") buffers = glGenBuffers(3) glBindBuffer(GL_PIXEL_UNPACK_BUFFER,buffers[0]) glBufferData(GL_PIXEL_UNPACK_BUFFER,4*4+4*4+4*2,data_1+data_2+data_3,GL_DYNAMIC_DRAW) glPixelMapfv(GL_PIXEL_MAP_I_TO_I,4,0) assert_equal(glGetPixelMapfv(GL_PIXEL_MAP_I_TO_I), [1,2,3,4]) glPixelMapuiv(GL_PIXEL_MAP_I_TO_I,4,4*4) assert_equal(glGetPixelMapuiv(GL_PIXEL_MAP_I_TO_I),[5,6,7,8]) glPixelMapusv(GL_PIXEL_MAP_I_TO_I,4,4*4+4*4) assert_equal(glGetPixelMapusv(GL_PIXEL_MAP_I_TO_I),[9,10,11,12]) glDeleteBuffers(buffers) end def test_pixelpack_readpixels return if not supported?(2.1) glClearColor(0,0,0,0) glClear(GL_COLOR_BUFFER_BIT) image = ([1.0] * 3 * 16).pack("f*") glDrawPixels(4,4,GL_RGB,GL_FLOAT,image) buffers = glGenBuffers(1) glBindBuffer(GL_PIXEL_PACK_BUFFER,buffers[0]) glBufferData(GL_PIXEL_PACK_BUFFER_ARB,4*4*4*3, nil, GL_STREAM_READ) glReadPixels(0,0,4,4,GL_RGB,GL_FLOAT,0) data = glMapBuffer(GL_PIXEL_PACK_BUFFER_ARB, GL_READ_ONLY) assert_equal(data,image) glUnmapBuffer(GL_PIXEL_PACK_BUFFER_ARB) glDeleteBuffers(buffers) end def test_pixelpack_pixelmap return if not supported?(2.1) buffers = glGenBuffers(1) glBindBuffer(GL_PIXEL_PACK_BUFFER,buffers[0]) glBufferData(GL_PIXEL_PACK_BUFFER_ARB,4*4, nil, GL_STREAM_READ) # fv glPixelMapfv(GL_PIXEL_MAP_I_TO_I,[1,2,3,4]) glGetPixelMapfv(GL_PIXEL_MAP_I_TO_I,0) data = glMapBuffer(GL_PIXEL_PACK_BUFFER_ARB, GL_READ_ONLY) assert_equal([1,2,3,4].pack("f*"),data) glUnmapBuffer(GL_PIXEL_PACK_BUFFER_ARB) # uiv glPixelMapuiv(GL_PIXEL_MAP_I_TO_I,[5,6,7,8]) glGetPixelMapuiv(GL_PIXEL_MAP_I_TO_I,0) data = glMapBuffer(GL_PIXEL_PACK_BUFFER_ARB, GL_READ_ONLY) assert_equal([5,6,7,8].pack("I*"),data) glUnmapBuffer(GL_PIXEL_PACK_BUFFER_ARB) # usv glBufferData(GL_PIXEL_PACK_BUFFER_ARB,4*2, nil, GL_STREAM_READ) glPixelMapusv(GL_PIXEL_MAP_I_TO_I,[9,10,11,12]) glGetPixelMapusv(GL_PIXEL_MAP_I_TO_I,0) data = glMapBuffer(GL_PIXEL_PACK_BUFFER_ARB, GL_READ_ONLY) assert_equal([9,10,11,12].pack("S*"),data) glUnmapBuffer(GL_PIXEL_PACK_BUFFER_ARB) glDeleteBuffers(buffers) end def test_pixelpack_polygonstipple return if not supported?(2.1) stipple = [0x12] * 128 buffers = glGenBuffers(1) glBindBuffer(GL_PIXEL_PACK_BUFFER,buffers[0]) glBufferData(GL_PIXEL_PACK_BUFFER_ARB,128, nil, GL_STREAM_READ) glPolygonStipple(stipple.pack("c*")) glGetPolygonStipple(0) data = glMapBuffer(GL_PIXEL_PACK_BUFFER_ARB, GL_READ_ONLY) assert_equal(stipple.pack("c*"),data) glUnmapBuffer(GL_PIXEL_PACK_BUFFER_ARB) glDeleteBuffers(buffers) end def test_pixelpack_separablefilter return if not supported?(2.1) sf_a = ([0]*3+[1]*3).pack("f*") sf_b = ([1]*3+[0]*3).pack("f*") buffers = glGenBuffers(1) glBindBuffer(GL_PIXEL_PACK_BUFFER,buffers[0]) glBufferData(GL_PIXEL_PACK_BUFFER_ARB,6*4 + 6*4, nil, GL_STREAM_READ) glSeparableFilter2D(GL_SEPARABLE_2D,GL_RGB8, 2,2,GL_RGB,GL_FLOAT,sf_a,sf_b) glGetSeparableFilter(GL_SEPARABLE_2D,GL_RGB,GL_FLOAT,0,6*4,0) data = glMapBuffer(GL_PIXEL_PACK_BUFFER_ARB, GL_READ_ONLY) assert_equal(data,sf_a + sf_b) glUnmapBuffer(GL_PIXEL_PACK_BUFFER_ARB) glDeleteBuffers(buffers) end def test_pixelpack_convolutionfilter return if not supported?(2.1) cf = ([0]*3+[1]*3+[0]*3+[1]*3).pack("f*") buffers = glGenBuffers(1) glBindBuffer(GL_PIXEL_PACK_BUFFER,buffers[0]) glBufferData(GL_PIXEL_PACK_BUFFER_ARB,3*4*4, nil, GL_STREAM_READ) glConvolutionFilter1D(GL_CONVOLUTION_1D, GL_RGB8, 4, GL_RGB, GL_FLOAT,cf) glGetConvolutionFilter(GL_CONVOLUTION_1D, GL_RGB, GL_FLOAT,0) data = glMapBuffer(GL_PIXEL_PACK_BUFFER_ARB, GL_READ_ONLY) assert_equal(data,cf) glUnmapBuffer(GL_PIXEL_PACK_BUFFER_ARB) glDeleteBuffers(buffers) end def test_pixelpack_histogram return if not supported?(2.1) glEnable(GL_HISTOGRAM) glHistogram(GL_HISTOGRAM,1,GL_RGB8,GL_FALSE) buffers = glGenBuffers(1) glBindBuffer(GL_PIXEL_PACK_BUFFER,buffers[0]) glBufferData(GL_PIXEL_PACK_BUFFER_ARB,3*4, nil, GL_STREAM_READ) glDrawPixels(2,1,GL_RGB,GL_FLOAT,[1,1,1,1,1,1].pack("f*")) glGetHistogram(GL_HISTOGRAM,GL_FALSE,GL_RGB,GL_FLOAT,0) data = glMapBuffer(GL_PIXEL_PACK_BUFFER_ARB, GL_READ_ONLY) assert_equal(data.unpack("f*"),[2,2,2]) glUnmapBuffer(GL_PIXEL_PACK_BUFFER_ARB) glDeleteBuffers(buffers) glDisable(GL_HISTOGRAM) end def test_pixelpack_minmax return if not supported?(2.1) glEnable(GL_MINMAX) glMinmax(GL_MINMAX,GL_RGB8,GL_FALSE) buffers = glGenBuffers(1) glBindBuffer(GL_PIXEL_PACK_BUFFER,buffers[0]) glBufferData(GL_PIXEL_PACK_BUFFER_ARB,6*4, nil, GL_STREAM_READ) glDrawPixels(2,1,GL_RGB,GL_FLOAT,[0,0,0,1,1,1].pack("f*")) glGetMinmax(GL_MINMAX,GL_FALSE,GL_RGB,GL_FLOAT,0) data = glMapBuffer(GL_PIXEL_PACK_BUFFER_ARB, GL_READ_ONLY) assert_equal(data.unpack("f*"),[0,0,0,1,1,1]) glUnmapBuffer(GL_PIXEL_PACK_BUFFER_ARB) glDeleteBuffers(buffers) glDisable(GL_MINMAX) end def test_pixelpack_teximage return if not supported?(2.1) textures = glGenTextures(1) glBindTexture(GL_TEXTURE_2D,textures[0]) image = ([0,0,0,1,1,1] * 8).pack("f*") # 16 RGB pixels buffers = glGenBuffers(1) glBindBuffer(GL_PIXEL_PACK_BUFFER,buffers[0]) glBufferData(GL_PIXEL_PACK_BUFFER_ARB,16*3*4, nil, GL_STREAM_READ) glTexImage2D(GL_TEXTURE_2D,0,GL_RGB8, 4, 4, 0, GL_RGB, GL_FLOAT, image) glGetTexImage(GL_TEXTURE_2D,0,GL_RGB,GL_FLOAT,0) data = glMapBuffer(GL_PIXEL_PACK_BUFFER_ARB, GL_READ_ONLY) assert_equal(data,image) glUnmapBuffer(GL_PIXEL_PACK_BUFFER_ARB) glDeleteBuffers(buffers) glDeleteTextures(textures) end def test_pixelpack_compressedteximage return if not supported?(2.1) return if not supported?("GL_EXT_texture_compression_s3tc") # S3TC/DXT5 compressed 2x2 pixels stipple pattern [w,b,b,w] image = [0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0x00,0x00,0x01,0x54,0x5C,0x5C].pack("C*") textures = glGenTextures(1) glBindTexture(GL_TEXTURE_2D,textures[0]) buffers = glGenBuffers(1) glBindBuffer(GL_PIXEL_PACK_BUFFER,buffers[0]) glBufferData(GL_PIXEL_PACK_BUFFER_ARB,image.size, nil, GL_STREAM_READ) glCompressedTexImage2D(GL_TEXTURE_2D,0,GL_COMPRESSED_RGBA_S3TC_DXT5_EXT,2,2,0,16,image) glGetCompressedTexImage(GL_TEXTURE_2D,0,0) data = glMapBuffer(GL_PIXEL_PACK_BUFFER_ARB, GL_READ_ONLY) assert_equal(data,image) glUnmapBuffer(GL_PIXEL_PACK_BUFFER_ARB) glDeleteBuffers(buffers) glDeleteTextures(textures) end end ruby-opengl-0.60.1.orig/test/tc_ext_gremedy.rb0000644000000000000000000000206411377006423020011 0ustar rootroot# # Copyright (C) 2007 Jan Dvorak # # This program is distributed under the terms of the MIT license. # See the included MIT-LICENSE file for the terms of this license. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # require 'test/unit' class Test_EXT_GREMEDY < Test::Unit::TestCase def setup common_setup() end def teardown common_teardown() end def test_gl_gremedy_string_marker return if not supported?("GL_GREMEDY_string_marker") glStringMarkerGREMEDY("test") end def test_gl_gremedy_frame_terminator return if not supported?("GL_GREMEDY_frame_terminator") glFrameTerminatorGREMEDY() end end ruby-opengl-0.60.1.orig/doc/0000755000000000000000000000000011377006423014246 5ustar rootrootruby-opengl-0.60.1.orig/doc/build_install.txt0000644000000000000000000001071111377006423017634 0ustar rootrootBuilding ruby-opengl ==================== Pre-requisites -------------- General -------------- * C compiler (not needed for binary install on Windows) * ruby 1.8.5+ or ruby 1.9.0+ * rake * mkrf 0.2.0+ (0.2.3+ for ruby 1.9) * rubygems 0.9.1+ * OpenGL headers for OpenGL version 1.1 or later (not needed for binary install on Windows) * GLUT 3.7+ or API-compatible implementation (freeglut,OpenGLUT) Linux -------------- On Ubuntu or Debian systems, aside from Ruby you'll need ruby and some extra ruby related packages: * `ruby rdoc ri ruby1.8-dev` For OpenGL related headers you'll need the following packages: * `libgl1-mesa-dri libglu1-mesa freeglut3` * `libgl1-mesa-dev libglu1-mesa-dev freeglut3-dev` On older Gentoo, Debian and Ubuntu, rubygems 0.9.0 will be installed by default in the packages. This version of rubygems is INCOMPATIBLE with ruby-opengl. You'll need to install rubygems 0.9.1+ from source. On some distributions you may need 'xorg-dev' developer package. Mac OS X -------------- On OS X, you will need to install your own version of Ruby as the version that ships with OS X has known problems with properly building ruby-opengl bindings. You'll also need XCode for gcc and tools. Macports or fink should handle this cleanly. * To compile under Mac OS X you MUST install your own version of Ruby as the version included with Tiger (1.8.2) has a broken rbconfig and will fail to build the project properly. Try either [MacPorts][], [Fink][], or [building your own from source][]. [Macports]: http://www.macports.org/ [Fink]: http://finkproject.org/ [building your own from source]: http://www.ruby-lang.org/en/downloads/ Windows -------------- For manual build on Windows you need to have platform SDK and compiler that *must* match the one which was used for compiling ruby binary (for One-click ruby installer it is MSVC 6.0). You may also need 'glut.h' in SDK include directory, as the One-click ruby installer is missing it. You can copy the file from glut package at [glut homepage][]. Alternatively, you can install the precompiled binary gem (see bellow). Important note: If you are using the One-click installer version 1.8.6-25 or earlier, you must delete or rename files 'opengl.so' and 'glut.so' in C:/ruby/lib/ruby/site_ruby/1.8/i386-msvcrt [glut homepage]: http://www.xmission.com/~nate/glut.html Build and installation -------------- Installing from rubygems ------------------- ruby-opengl should support being installed via gems now. Just try 'gem install -y ruby-opengl' and it should pull down the gem and try to build the bindings for you automatically. For windows there is also pre-built binary windows gem available (i386-mswin32) which is compatible with the ruby one-click installer and does not need compiler or other mentioned tools installed. Manual Build instructions for all platforms (see above for platform-specific notes) ------------------ 1. Make sure you have working ruby with rubygems installed and (if needed) appropriate developer packages (ruby-dev,ruby1.8-dev,...). 2. Make sure you have working C compiler 3. Install rake either from package or by running 'gem install rake' 4. Install mkrf (0.2.0+) either from package or by running 'gem install mkrf' 5. Make sure you have working OpenGL installation, this includes libGL,libGLU, glut and (if needed) appropriate -dev or -devel packages. 6. Run 'rake' at the top level of the project 7. (OPTIONAL) Run 'rake test' to run unit tests to verify it works properly Installing manually built extensions ------------------ 1. Run 'rake clean' to clean out the project 2. Run 'rake gem' to create source gem from project 3. Run 'gem install pkg/ruby-opengl-(version).gem' to compile and install the gem 4. Done. Building binary gem (useful only for binary distribution of the project) ------------------ 1. Run 'gem install gembuilder' to install the gembuilder package 2. Run 'rake clean' to clean out the project 3. Run 'rake gem' to build source gem 4. Run 'gembuilder pkg/ruby-opengl-(version).gem' to compile the binary gem Testing ----------------- To run unit tests: $ rake test Note that the tests have the adverse effect of testing the underlying OpenGL implementation, so depending on your GL provider,drivers or OS, the tests may fail, crash, or not run at all, without affecting your ability to use the bindings. Running programs and examples ----------------- To run a sample file, make sure the ruby-opengl gem is installed then: $ cd examples $ ruby -rubygems plane.rb ruby-opengl-0.60.1.orig/doc/thanks.txt0000644000000000000000000000124511377006423016301 0ustar rootrootThank you --------- Aside from big thank-you's to the core devs, special thanks also goes to: * Bill Kelly -- provided some pilot code changing how users can call method and constant names. * Ilmari Heikkinen -- provided code for changing how users can call method and constant names. * James Adam -- Mac OS X fixes * Tony Hursh -- Mac OS X glut build tweak * Sean Long -- More Mac OS X fixes * John Gabriele -- Numerous fixes, documentation, and project support * Ronald Pijnacker -- Windows support and bugfixes * **Yoshi** -- providing ruby-opengl-0.32g from which to work off of.














ruby-opengl-0.60.1.orig/doc/tutorial.txt0000644000000000000000000003620111377006423016654 0ustar rootrootUsage Tutorial ============== This page should serve as tutorial and also as reference to Ruby bindings for OpenGL language. It is assumed that you have basic understanding of both OpenGL and Ruby. If you are new to OpenGL, you can start by visiting [OpenGL homepage](http://www.opengl.org) , reading the [OpenGL Programming Guide](http://opengl.org/documentation/books/#the_opengl_programming_guide_the_official_guide_to_learning_opengl_version) (also known as Red Book) or going to [NeHe's tutorials page](http://nehe.gamedev.net/). If you are new to Ruby, [the ruby-lang website](http://www.ruby-lang.org/en/documentation/) contains lots of documentation and manuals for Ruby. Table of Contents ============== Basics: * [Naming Conventions](#naming_conventions)
* [Function parameters](#function_parameters)
* [Return values](#return_values)
* [Matrices](#matrices)
* [Textures and other raw data](#textures)
* [Error Checking](#error_checking)
* [Examples](#examples)
Advanced stuff: * [OpenGL version and Extensions](#extensions)
* [Selection and Feedback queries](#selection_feedback)
* [Vertex Arrays](#vertex_arrays)
* [Buffer Objects](#buffer_objects)
* [GLUT, SDL, GLFW..](#glut_sdl)
* [GLUT callbacks](#glut_callbacks)
* [Internals](#internals)
API reference: * TODO Naming conventions ------------------ The bindings contains three modules: * 'Gl' - OpenGL functions itself * 'Glu' - OpenGL Utility Library API - higher-level drawing routines, NURBS etc. * 'Glut' - OpenGL Utility Toolkit - low level functions such as creating OpenGL context, opening window or handling user input You can import all three modules by calling {{ruby}} require 'opengl' You can also load the modules separately by using: {{ruby}} require 'gl' require 'glu' require 'glut' The functions and constants are named the same as their C counterparts: {{ruby}} require 'opengl' ... Gl.glFooBar( Gl::GL_FOO_BAR ) Glu.gluFooBar( Glu::GLU_FOO_BAR ) Glut.glutFooBar( Glut::GLUT_FOO_BAR ) This is the 'full' syntax, usefull when you are expecting name clashes with other modules, or just want to be formal ;) More often, you will want to use the 'C-style' syntax, which you can accomplish by using 'include' to export the module functions and constants to global namespace: {{ruby}} require 'opengl' include Gl,Glu,Glut ... glFooBar( GL_FOO_BAR ) gluFooBar( GLU_FOO_BAR ) glutFooBar( GLUT_FOO_BAR ) Finally, you can use the 'old' syntax: {{ruby}} require 'opengl' ... # Note the missing prefixes in functions and constants # and also capitalization of module names GL.FooBar( GL::FOO_BAR ) GLU.FooBar( GLU::FOO_BAR ) GLUT.FooBar( GLUT::FOO_BAR ) This syntax was used by previous ruby-opengl versions; some people also consider it as being more in the spirit of OO programming. It has one downside though - due to Ruby's naming scheme, you cannot use constants which begins with number, e.g. GL_2D would under this syntax be (GL::)2D which is illegal. All three variants of syntax will continue to be supported in future, so it's up to you which one you choose to use. The rest of this tutorial will use the C syntax. Calling syntax -------------- Function parameters -------------- For most types the ruby syntax follows the C API. If needed, ruby will do automatic parameter conversion to required type if possible. Example: {{ruby}} glVertex3f( 1.0, 1.0, 1.0 ) # matches C syntax glVertex3f( 1, 1, 1 ) # equivalent to the above glVertex3f( "string", 1, 1 ) # raises TypeError exception Arrays are passed/received as Ruby arrays: {{ruby}} vertex = [ 1, 1, 1 ] glVertex3fv( vertex ) For functions with multiple parameter-number variations (glVertex,glColor,...) we define 'overloaded' functions, as in: {{ruby}} glVertexf( 1, 1 ) # will call glVertex2f() glVertexf( 1, 1, 1 ) # will call glVertex3f() glVertexf( 1, 1, 1, 1 ) # will call glVertex4f() glVertexi( 1, 1 ) # will call glVertex2i() ... # and so on Return values ------------- In C, OpenGL functions rarely return values directly, instead you pass in pointer to preallocated buffer and they will fill it with values; sometimes you have to even query how big buffer you'll need to allocate. Ruby does this all for you, returning either single value or array: {{ruby}} glColor4f( 1.0, 1.0, 1.0, 1.0 ) ... color = glGetDoublev(GL_CURRENT_COLOR) p color # will be [1.0,1.0,1.0,1.0] Matrices ------------- Matrices are passed and received as ruby array, or as ruby Matrix objects: {{ruby}} matrix_a = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15] matrix_b = [ [ 0, 1, 2, 3 ], [ 4, 5, 6, 7 ], [ 8, 9,10,11 ], [ 12,13,14,15 ] ] matrix_c = Matrix.rows( [ [ 0, 1, 2, 3 ], [ 4, 5, 6, 7 ], [ 8, 9,10,11 ], [ 12,13,14,15 ] ] ) ... glLoadMatrixf(matrix_a) glLoadMatrixf(matrix_b) glLoadMatrixf(matrix_c) # same result You may also create your own matrix class and pass it this way, provided that it is convertible to array (has 'to_a' method). Note that as OpenGL uses column-major notation for matrices, you may need to call transpose() when working with row-major matrices or arrays in ruby. Textures and other raw data ------------- Data for textures, arrays, buffers etc. can be specified either as ruby arrays or directly as raw packed strings - strings that contains their direct memory representation (just like C arrays). If you need to convert between ruby arrays and these strings, use ruby Array#pack() and String#unpack() functions. Example: {{ruby}} # create texture, 2x2 pixels, # 3 components (R,G,B) for each pixel as floats texture = [ 1.0, 0.0, 0.0, # 1st pixel, red 0.0, 1.0, 0.0, # 2nd pixel, green 0.0, 0.0, 1.0, # 3rd pixel, blue 1.0, 1.0, 1.0 # 4th pixel, white ] # convert it to string # f = native float representation # * = convert all values in the array the same way data = texture.pack("f*") ... glTexImage2D( GL_TEXTURE_2D, # target 0, # mipmap level, GL_RGB8, # internal format 2, 2, # width, height 0, # border = no GL_RGB, # components per each pixel GL_FLOAT, # component type - floats data # the packed data ) Reverse works just the same: {{ruby}} ... data = glGetTexImage( # returns the packed data as string GL_TEXTURE_2D, # target 0, # mipmap level GL_RGB, # components per pixel GL_FLOAT # component type ) # now convert it to ruby array texture = data.unpack("f*") ... For storage, packed strings are more memory efficient than ruby arrays, but cannot be easily changed or manipulated. Error Checking -------------- Starting with version 0.60.0, ruby-opengl performs automatic checking of OpenGL and GLU errors. Functions: {{ruby}} Gl.enable_error_checking Gl.disable_error_checking Gl.is_error_checking_enabled? # true/false When the checking is enabled (default), glGetError() is executed after each OpenGL call, and should error occur, Gl::Error exception is raised: {{ruby}} Gl.enable_error_checking ... begin ... glEnable(GL_TRUE) # will raise exception ... rescue Gl::Error => err # err.id contains the OpenGL error ID if (err.id == GL_INVALID_ENUM) puts "Oh noes! You used invalid enum!" ... end ... end Some GLU functions may also throw Glu::Error - the handling is the same as above. It is usually good idea to leave error checking on for all your code, as OpenGL errors have habit to pop-up in unexpected places. For now there is no measurable performance hit for error checking, although this may depend on your graphic drivers implementation. The Examples ----------- Various examples are in 'examples' directory of the bindings. To run them, manually pass them to `ruby` like: ruby some_sample.rb On windows, you may want to use 'rubyw' instead, which displays the standard output window as some examples use the console for usage info etc. If you get 'opengl not found' error, and you installed ruby-opengl from gems, your shell or ruby installation is probably not configured to use the gems; in that case type: ruby -rubygems some_sample.rb The `README` file in the `examples` directory contains some notes on the examples. OpenGL Version and Extensions ----------- To query for available OpenGL version or OpenGL extension, use Gl.is_available? function: {{ruby}} # true if OpenGL version is 2.0 or later is available Gl.is_available?(2.0) ... # returns true if GL_ARB_shadow is available on this system Gl.is_available?("GL_ARB_shadow") For list of what extensions are supported in ruby-opengl see this [page](extensions.html) The extensions' function names once again follows the C API. Some extensions were over time promoted to ARB or even to OpenGL core, retaining their function names just with suffix changed or removed. However sometimes the functions semantics was changed in the process, so to avoid confusion, ruby-opengl bindings will strictly adhere to the C naming, e.g. : {{ruby}} # will call the function from GL_ARB_transpose_matrix extension glLoadTransposeMatrixfARB(matrix) ... # will call the function from OpenGL 1.3 glLoadTransposeMatrixf(matrix) Note: ruby-opengl is compiled against OpenGL 1.1, and all functions and enums from later versions of OpenGL and from extensions are loaded dynamically at runtime. That means that all of OpenGL 2.1 and supported extensions are available even if the ruby-opengl bindings are compiled on platform which lacks proper libraries or headers (like for example Windows without installed graphic drivers). This should ease binary-only distribution and application packaging. Selection/Feedback queries ----------- Querying selection and feedback is different from C. Example: {{ruby}} # this will create selection buffer 512*sizeof(GLuint) long buf = glselectbuffer(512) # enter feedback mode glRenderMode(GL_SELECT) ... # draw something here # return to render mode count = glRenderMode(GL_RENDER) # at this point the buf string is freezed and contains # the selection data, which you can recover with unpack # function data = buf.unpack("I*") # I for unsigned integer # also, next call to glRenderMode(GL_SELECT) will overwrite # the 'buf' buffer with new data The feedback query follows the same pattern, only the data are stored as floats. Vertex Arrays ----------- In current state, vertex arrays are not very efficient in ruby-opengl, as it is not possible to change the array content once it is specified, and there is overhead for converting between ruby and C representation of numbers. Using display lists for static and immediate mode for dynamic objects is recommended instead. You can specify the data the same way as [texture data](#textures). Example: {{ruby}} normals = [0,1,0, 1,0,0, 1,1,1] glNormalPointer(GL_FLOAT,0,normals) ... glEnable(GL_NORMAL_ARRAY) glDrawArrays(...) ... This applies to all *pointer functions. glGetPointerv will return reference to the frozen string previously specified. Buffer Objects ----------- Once again, in current state buffer objects (VBOs in particular) are not very efficient in ruby-opengl. Unlike textures and vertex arrays, the data for buffers *must* be prepacked by using .pack() function, as buffers does not retain information about the storage type. Mapping of the buffer afterwards is read-only. Like in C, buffer binding affects some functions in way that if particular buffer is bound, the related functions (for example glTexImage) take integer offset in place of data string argument. This is also true for getter functions (e.g. glGetTexImage) - instead of returning the data string, they take offset as they're last argument (so in ruby they take one extra argument), and will write the data in the bound buffer as expected. VBO example: {{ruby}} # specify 3 vertices, 2*float each data = [0,0, 0,1, 1,1].pack("f*") ... # generate buffer name buffers = glGenBuffers(1) # bind to the name to ARRAY buffer for vertex array glBindBuffer(GL_ARRAY_BUFFER,buffers[0]) # here the data is specified, size is n*sizeof(float) # note that you don't get to specify type, as buffers # operate on byte level glBufferData(GL_ARRAY_BUFFER,6*4,data,GL_DYNAMIC_DRAW) ... # here instead of specyfing the data, you pass '0' (or # positive integer) as offset to the bound buffer glVertexPointer(2,GL_FLOAT,0,0) ... glEnableClientState(GL_VERTEX_ARRAY) ... GLUT, SDL, GLFW.. --------- When it comes to low-level task like GL window creation, input and event handling, the first choice is GLUT, as it is readilly available alongside OpenGL. However both GLUT itself and its implementations have their drawbacks, and for that and other reasons there are number of replacement libraries. You can use any of them with ruby-opengl (as long as there are ruby bindings for them). Here is example for [SDL](http://www.kmc.gr.jp/~ohai/index.en.html): {{ruby}} require 'opengl' require 'sdl' # init SDL.init(SDL::INIT_VIDEO) SDL.setGLAttr(SDL::GL_DOUBLEBUFFER,1) SDL.setVideoMode(512,512,32,SDL::OPENGL) ... Gl.glVertex3f(1.0,0.0,0.0) ... SDL.GLSwapBuffers() ... and another example for [GLFW](http://ruby-glfw.rubyforge.org/): {{ruby}} require 'opengl' require 'glfw' # init Glfw.glfwOpenWindow( 500,500, 0,0,0,0, 32,0, Glfw::GLFW_WINDOW ) ... Gl.glVertex3f(1.0,0.0,0.0) ... Glfw.glfwSwapBuffers() ... GLUT callbacks -------------- The GLUT callback functions are specified as Proc objects, which you can either create with lambda as: {{ruby}} reshape = lambda do |w, h| ... end ... glutReshapeFunc( reshape ) or by conversion from normal functions: {{ruby}} def reshape(w,h) ... end ... glutReshapeFunc( method("reshape").to_proc ) Note: An older notation you'll see instead of `lambda` is `proc`. The PickAxe v2 notes that `proc` is "mildly deprecated" in favor of `lambda`. You'll also sometimes see `Proc.new` used in place of either. Pages 359-360 of PickAxe v2 describe the differences between using `lambda` and `Proc.new`, but for our purposes either will be fine. Internals --------- The directory structure follows current Ruby standards, with a few extra directories added. * `doc/` -- Contains documentation for the project (from which this website is generated). * `examples/` -- Example programs. * `ext/` -- Contains subdirectories, one for each of the three extension modules (gl, glu, glut). Herein are the files needed to compile the extension modules. * `lib/` -- Files that the user is meant to `require` in their own code. * `test/` -- Contains automatic testsuite for the bindings * `utils` -- Some utility scripts used to help generate code, documentation and website. * `website` -- After running `rake gen_website` this directory will contain the ruby-opengl website. ruby-opengl-0.60.1.orig/doc/requirements_and_design.txt0000644000000000000000000000706611377006423021716 0ustar rootrootDesign ====== This document records the requirements, high-level design, and the specifications for the ruby-opengl project. The content of this document was gleaned from the postings on the ruby-opengl-dev list and internal notes from John G., Peter M., Vo Minh Thu, and Robert K. Requirements ------------ * ruby-opengl is a Ruby extension library which wraps the OpenGL, GLU, and GLUT libraries. * ruby-opengl shall provide three base modules: *BaseGL*, *BaseGLU*, and *BaseGLUT* (the "Base Modules"). Note: "BaseGL" etc. are not the names that appear in the code -- they are just handles so we can write about them in documents like this one. * The Base Modules shall be separately loadable. * BaseGL shall not depend on any of the other Ruby modules. * BaseGLU shall depend on, at most, BaseGL. * BaseGLUT shall depend on, at most, BaseGLU and BaseGL. * Base Module syntax shall closely follow the standard C-syntax. The syntax for a Ruby program that uses the base modules, shall closely follow the standard C-like syntax that OpenGL programmers are used to, and that most OpenGL examples are published in: {{ruby}} require 'gl' Gl.glBegin( Gl::GL_POLYGON ) Gl.glVertex2d( 0, 0 ) Gl.glVertex2d( 0, 1 ) Gl.glVertex2d( 1, 1 ) Gl.glVertex2d( 1, 0 ) Gl.glEnd Or: {{ruby}} require 'gl' include Gl glBegin( GL_POLYGON ) glVertex2d( 0, 0 ) glVertex2d( 0, 1 ) glVertex2d( 1, 1 ) glVertex2d( 1, 0 ) glEnd The rationale for adopting the C-like syntax is: * Makes it familiar to OpenGL programmers. * Removes the burden of learning OpenGL plus some Ruby-isms, just to get started. * Makes it easier to port OpenGL programs to/from ruby-opengl. * The current OpenGL documentation more naturally fits ruby-opengl. * Putting "gl", "glu" and "glut" in front of all the names (i.e., following the C-like syntax) leaves common variable names open for the programmers (e.g., "vertex", "color" etc. are popular topics in 3D programming, so not robbing the ruby namespace of such valuable real-estate seems nice). * It shall be possible to check out the project from svn, compile and test on the following platforms: Mac OS X, GNU/Linux. MS Windows operating systems may also be supported in the future. * The project will make a number of pre-compiled extensions available as gems. * The project will supply source code and build scripts (via svn checkout) conducive to straightforward porting to other platforms. * There shall be a test suite that exercises each call in each of the Base modules. * All project documentation will be in Markdown format in files that end in `.txt`. * The project will make some efforts to track versions of OpenGL. ### Things in the future Once the base modules are implemented, there are several ideas on things to do next. This list is not really requirements, but a list of nice ideas to try: * Provide wrappers for glBegin/glEnd, eg: polygon()...translates to glBegin(GL_POLYGON)....glEnd * Untyped versions of the multi-typed gl functions: e.g., a single glVertex that examines its arguments and calls the appropriate glVertex{234}{fisdv} call in BaseGL. Implementation -------------- Our plan is to continue on with Yoshi's original code, modified to use standard OpenGL-style constant and function names. ### Build environment ### The build environment will use: * use rake and mkrf. * minimize the number of additional tools required ruby-opengl-0.60.1.orig/doc/extensions.txt.in0000644000000000000000000003132211377006423017614 0ustar rootroot# extension name, [Supported/Unsupported/NonGL], first supported in ruby-opengl version x.y.z GL_ARB_multitexture,Unsupported,N/A GLX_ARB_get_proc_address,NonGL,N/A GL_ARB_transpose_matrix,Supported,0.50 WGL_ARB_buffer_region,NonGL,N/A GL_ARB_multisample,Supported,0.50 GLX_ARB_multisample,NonGL,N/A WGL_ARB_multisample,NonGL,N/A GL_ARB_texture_env_add,Supported,0.50 GL_ARB_texture_cube_map,Supported,0.50 WGL_ARB_extensions_string,NonGL,N/A WGL_ARB_pixel_format,NonGL,N/A WGL_ARB_make_current_read,NonGL,N/A WGL_ARB_pbuffer,NonGL,N/A GL_ARB_texture_compression,Unsupported,N/A GL_ARB_texture_border_clamp,Supported,0.50 GL_ARB_point_parameters,Supported,0.60 GL_ARB_vertex_blend,Unsupported,N/A GL_ARB_matrix_palette,Unsupported,N/A GL_ARB_texture_env_combine,Supported,0.50 GL_ARB_texture_env_crossbar,Supported,0.50 GL_ARB_texture_env_dot3,Supported,0.50 WGL_ARB_render_texture,NonGL,N/A GL_ARB_texture_mirrored_repeat,Supported,0.50 GL_ARB_depth_texture,Supported,0.50 GL_ARB_shadow,Supported,0.50 GL_ARB_shadow_ambient,Supported,0.50 GL_ARB_window_pos,Supported,0.60 GL_ARB_vertex_program,Supported,0.60 GL_ARB_fragment_program,Supported,0.60 GL_ARB_vertex_buffer_object,Unsupported,N/A GL_ARB_occlusion_query,Supported,0.60 GL_ARB_shader_objects,Supported,0.60 GL_ARB_vertex_shader,Supported,0.60 GL_ARB_fragment_shader,Supported,0.60 GL_ARB_shading_language_100,Supported,0.50 GL_ARB_texture_non_power_of_two,Supported,0.50 GL_ARB_point_sprite,Supported,0.50 GL_ARB_fragment_program_shadow,Supported,0.50 GL_ARB_draw_buffers,Supported,0.50 GL_ARB_texture_rectangle,Supported,0.50 GL_ARB_color_buffer_float,Supported,0.50 WGL_ARB_pixel_format_float,NonGL,N/A GLX_ARB_fbconfig_float,NonGL,N/A GL_ARB_half_float_pixel,Supported,0.50 GL_ARB_texture_float,Supported,0.50 GL_ARB_pixel_buffer_object,Supported,0.50 GL_EXT_abgr,Supported,0.50 GL_EXT_blend_color,Supported,0.60 GL_EXT_polygon_offset,Supported,0.60 GL_EXT_texture,Supported,0.50 GL_EXT_texture3D,Supported,0.50 GL_SGIS_texture_filter4,Unsupported,N/A GL_EXT_subtexture,Unsupported,N/A GL_EXT_copy_texture,Unsupported,N/A GL_EXT_histogram,Unsupported,N/A GL_EXT_convolution,Unsupported,N/A GL_SGI_color_matrix,Supported,0.50 GL_SGI_color_table,Unsupported,N/A GL_SGIS_pixel_texture,Unsupported,N/A GL_SGIX_pixel_texture,Unsupported,N/A GL_SGIS_texture4D,Unsupported,N/A GL_SGI_texture_color_table,Supported,0.50 GL_EXT_cmyka,Supported,0.50 GL_EXT_texture_object,Supported,0.60 GL_SGIS_detail_texture,Unsupported,N/A GL_SGIS_sharpen_texture,Unsupported,N/A GL_EXT_packed_pixels,Supported,0.50 GL_SGIS_texture_lod,Supported,0.50 GL_SGIS_multisample,Unsupported,N/A GLX_SGIS_multisample,NonGL,N/A GL_EXT_rescale_normal,Supported,0.50 GLX_EXT_visual_info,NonGL,N/A GL_EXT_vertex_array,Unsupported,N/A GL_EXT_misc_attribute,Supported,0.50 GL_SGIS_generate_mipmap,Supported,0.50 GL_SGIX_clipmap,Supported,0.50 GL_SGIX_shadow,Supported,0.50 GL_SGIS_texture_edge_clamp,Supported,0.50 GL_SGIS_texture_border_clamp,Supported,0.50 GL_EXT_blend_minmax,Supported,0.60 GL_EXT_blend_subtract,Supported,0.50 GL_EXT_blend_logic_op,Supported,0.50 GLX_SGI_swap_control,NonGL,N/A GLX_SGI_video_sync,NonGL,N/A GLX_SGI_make_current_read,NonGL,N/A GLX_SGIX_video_source,NonGL,N/A GLX_EXT_visual_rating,NonGL,N/A GL_SGIX_interlace,Supported,0.50 GLX_EXT_import_context,NonGL,N/A GLX_SGIX_fbconfig,NonGL,N/A GLX_SGIX_pbuffer,NonGL,N/A GL_SGIS_texture_select,Supported,0.50 GL_SGIX_sprite,Unsupported,N/A GL_SGIX_texture_multi_buffer,Supported,0.50 GL_EXT_point_parameters,Supported,0.60 GL_SGIX_instruments,Unsupported,N/A GL_SGIX_texture_scale_bias,Supported,0.50 GL_SGIX_framezoom,Unsupported,N/A GL_SGIX_tag_sample_buffer,Unsupported,N/A GL_SGIX_reference_plane,Unsupported,N/A GL_SGIX_flush_raster,Unsupported,N/A GLX_SGI_cushion,NonGL,N/A GL_SGIX_depth_texture,Supported,0.50 GL_SGIS_fog_function,Unsupported,N/A GL_SGIX_fog_offset,Supported,0.50 GL_HP_image_transform,Unsupported,N/A GL_HP_convolution_border_modes,Supported,0.50 GL_SGIX_texture_add_env,Supported,0.50 GL_EXT_color_subtable,Unsupported,N/A GLU_EXT_object_space_tess,NonGL,N/A GL_PGI_vertex_hints,Supported,0.50 GL_PGI_misc_hints,Unsupported,N/A GL_EXT_paletted_texture,Unsupported,N/A GL_EXT_clip_volume_hint,Supported,0.50 GL_SGIX_list_priority,Unsupported,N/A GL_SGIX_ir_instrument1,Supported,0.50 GLX_SGIX_video_resize,NonGL,N/A GL_SGIX_texture_lod_bias,Supported,0.50 GLU_SGI_filter4_parameters,NonGL,N/A GLX_SGIX_dm_buffer,NonGL,N/A GL_SGIX_shadow_ambient,Supported,0.50 GLX_SGIX_swap_group,NonGL,N/A GLX_SGIX_swap_barrier,NonGL,N/A GL_EXT_index_texture,Supported,0.50 GL_EXT_index_material,Unsupported,N/A GL_EXT_index_func,Unsupported,N/A GL_EXT_index_array_formats,Supported,0.50 GL_EXT_compiled_vertex_array,Supported,0.60 GL_EXT_cull_vertex,Unsupported,N/A GLU_EXT_nurbs_tessellator,NonGL,N/A GL_SGIX_ycrcb,Supported,0.50 GL_EXT_fragment_lighting,Unsupported,N/A GL_IBM_rasterpos_clip,Supported,0.50 GL_HP_texture_lighting,Supported,0.50 GL_EXT_draw_range_elements,Supported,0.60 GL_WIN_phong_shading,Supported,0.50 GL_WIN_specular_fog,Supported,0.50 GL_SGIS_color_range,NonGL,N/A GLX_SGIS_color_range,NonGL,N/A GL_EXT_light_texture,Unsupported,N/A GL_SGIX_blend_alpha_minmax,Supported,0.50 GL_EXT_scene_marker,NonGL,N/A GLX_EXT_scene_marker,NonGL,N/A GL_SGIX_pixel_texture_bits,Supported,0.50 GL_EXT_bgra,Supported,0.50 GL_SGIX_async,Unsupported,N/A GL_SGIX_async_pixel,Supported,0.50 GL_SGIX_async_histogram,Supported,0.50 GL_INTEL_texture_scissor,Other,N/A GL_INTEL_parallel_arrays,Unsupported,N/A GL_HP_occlusion_test,Other,N/A GL_EXT_pixel_transform,Unsupported,N/A GL_EXT_pixel_transform_color_table,Supported,0.50 GL_EXT_shared_texture_palette,Supported,0.50 GLX_SGIS_blended_overlay,NonGL,N/A GL_EXT_separate_specular_color,Supported,0.50 GL_EXT_secondary_color,Supported,0.60 GL_EXT_texture_env,Other,N/A GL_EXT_texture_perturb_normal,Unsupported,N/A GL_EXT_multi_draw_arrays,Supported,0.60 GL_SUN_multi_draw_arrays,Supported,0.60 GL_EXT_fog_coord,Supported,0.60 GL_REND_screen_coordinates,Supported,0.50 GL_EXT_coordinate_frame,Unsupported,N/A GL_EXT_texture_env_combine,Supported,0.50 GL_APPLE_specular_vector,Supported,0.50 GL_APPLE_transform_hint,Supported,0.50 GL_SUNX_constant_data,Unsupported,N/A GL_SUN_global_alpha,Unsupported,N/A GL_SUN_triangle_list,Unsupported,N/A GL_SUN_vertex,Unsupported,N/A WGL_EXT_display_color_table,NonGL,N/A WGL_EXT_extensions_string,NonGL,N/A WGL_EXT_make_current_read,NonGL,N/A WGL_EXT_pixel_format,NonGL,N/A WGL_EXT_pbuffer,NonGL,N/A WGL_EXT_swap_control,NonGL,N/A GL_EXT_blend_func_separate,Supported,0.60 GL_INGR_color_clamp,Supported,0.50 GL_INGR_interlace_read,Supported,0.50 GL_EXT_stencil_wrap,Supported,0.50 WGL_EXT_depth_float,NonGL,N/A GL_EXT_422_pixels,Supported,0.50 GL_NV_texgen_reflection,Supported,0.50 GL_SGIX_texture_range,Supported,0.50 GL_SUN_convolution_border_modes,Supported,0.50 GLX_SUN_get_transparent_index,NonGL,N/A GL_EXT_texture_env_add,Supported,0.50 GL_EXT_texture_lod_bias,Supported,0.50 GL_EXT_texture_filter_anisotropic,Supported,0.50 GL_EXT_vertex_weighting,Unsupported,N/A GL_NV_light_max_exponent,Supported,0.50 GL_NV_vertex_array_range,Unsupported,N/A GL_NV_register_combiners,Unsupported,N/A GL_NV_fog_distance,Supported,0.50 GL_NV_texgen_emboss,Supported,0.50 GL_NV_blend_square,Supported,0.50 GL_NV_texture_env_combine4,Supported,0.50 GL_MESA_resize_buffers,NonGL,N/A GL_MESA_window_pos,NonGL,N/A GL_EXT_texture_compression_s3tc,Supported,0.50 GL_IBM_cull_vertex,Supported,0.50 GL_IBM_multimode_draw_arrays,Unsupported,N/A GL_IBM_vertex_array_lists,Unsupported,N/A GL_3DFX_texture_compression_FXT1,Supported,0.50 GL_3DFX_multisample,NonGL,N/A GL_3DFX_tbuffer,Supported,0.60 GL_EXT_multisample,NonGL,N/A WGL_EXT_multisample,NonGL,N/A GL_SGIX_vertex_preclip,Supported,0.50 GL_SGIX_vertex_preclip_hint,Supported,0.50 GL_SGIX_resample,Supported,0.50 GL_SGIS_texture_color_mask,Unsupported,N/A GLX_MESA_copy_sub_buffer,NonGL,N/A GLX_MESA_pixmap_colormap,NonGL,N/A GLX_MESA_release_buffers,NonGL,N/A GLX_MESA_set_3dfx_mode,NonGL,N/A GL_EXT_texture_env_dot3,Supported,0.50 GL_ATI_texture_mirror_once,Supported,0.50 GL_NV_fence,Supported,0.60 GL_IBM_static_data,Unsupported,N/A GL_IBM_texture_mirrored_repeat,Supported,0.50 GL_NV_evaluators,Other,N/A GL_NV_packed_depth_stencil,Supported,0.50 GL_NV_register_combiners2,Unsupported,N/A GL_NV_texture_compression_vtc,Supported,0.50 GL_NV_texture_rectangle,Supported,0.50 GL_NV_texture_shader,Supported,0.50 GL_NV_texture_shader2,Supported,0.50 GL_NV_vertex_array_range2,Supported,0.50 GL_NV_vertex_program,Supported,0.60 GLX_SGIX_visual_select_group,NonGL,N/A GL_SGIX_texture_coordinate_clamp,Supported,0.50 GLX_OML_swap_method,NonGL,N/A GLX_OML_sync_control,NonGL,N/A GL_OML_interlace,Supported,0.50 GL_OML_subsample,Supported,0.50 GL_OML_resample,Supported,0.50 WGL_OML_sync_control,NonGL,N/A GL_NV_copy_depth_to_color,Supported,0.50 GL_ATI_envmap_bumpmap,Unsupported,N/A GL_ATI_fragment_shader,Unsupported,N/A GL_ATI_pn_triangles,Unsupported,N/A GL_ATI_vertex_array_object,Unsupported,N/A GL_EXT_vertex_shader,Unsupported,N/A GL_ATI_vertex_streams,Unsupported,N/A WGL_I3D_digital_video_control,NonGL,N/A WGL_I3D_gamma,NonGL,N/A WGL_I3D_genlock,NonGL,N/A WGL_I3D_image_buffer,NonGL,N/A WGL_I3D_swap_frame_lock,NonGL,N/A WGL_I3D_swap_frame_usage,NonGL,N/A GL_ATI_element_array,Unsupported,N/A GL_SUN_mesh_array,Unsupported,N/A GL_SUN_slice_accum,Supported,0.50 GL_NV_multisample_filter_hint,Supported,0.50 GL_NV_depth_clamp,Supported,0.50 GL_NV_occlusion_query,Supported,0.60 GL_NV_point_sprite,Supported,0.60 WGL_NV_render_depth_texture,NonGL,N/A WGL_NV_render_texture_rectangle,NonGL,N/A GL_NV_texture_shader3,Supported,0.50 GL_NV_vertex_program1_1,Supported,0.50 GL_EXT_shadow_funcs,Supported,0.50 GL_EXT_stencil_two_side,Supported,0.60 GL_ATI_text_fragment_shader,Supported,0.50 GL_APPLE_client_storage,Supported,0.50 GL_APPLE_element_array,Unsupported,N/A GL_APPLE_fence,Unsupported,N/A GL_APPLE_vertex_array_object,Unsupported,N/A GL_APPLE_vertex_array_range,Unsupported,N/A GL_APPLE_ycbcr_422,Supported,0.50 GL_S3_s3tc,Other,N/A GL_ATI_draw_buffers,Supported,0.60 WGL_ATI_pixel_format_float,NonGL,N/A GL_ATI_texture_env_combine3,Supported,0.50 GL_ATI_texture_float,Supported,0.50 GL_NV_float_buffer,Supported,0.50 WGL_NV_float_buffer,NonGL,N/A GL_NV_fragment_program,Supported,0.60 GL_NV_half_float,Unsupported,N/A GL_NV_pixel_data_range,Unsupported,N/A GL_NV_primitive_restart,Supported,0.60 GL_NV_texture_expand_normal,Supported,0.50 GL_NV_vertex_program2,Supported,0.50 GL_ATI_map_object_buffer,Unsupported,N/A GL_ATI_separate_stencil,Unsupported,N/A GL_ATI_vertex_attrib_array_object,Unsupported,N/A GL_OES_byte_coordinates,Supported,0.50 GL_OES_fixed_point,Unsupported,N/A GL_OES_single_precision,Unsupported,N/A GL_OES_compressed_paletted_texture,Supported,0.50 GL_OES_read_format,Supported,0.50 GL_OES_query_matrix,Unsupported,N/A GL_EXT_depth_bounds_test,Supported,0.60 GL_EXT_texture_mirror_clamp,Supported,0.50 GL_EXT_blend_equation_separate,Supported,0.60 GL_MESA_pack_invert,Supported,0.50 GL_MESA_ycbcr_texture,Supported,0.50 GL_EXT_pixel_buffer_object,Supported,0.50 GL_NV_fragment_program_option,Supported,0.50 GL_NV_fragment_program2,Supported,0.50 GL_NV_vertex_program2_option,Supported,0.50 GL_NV_vertex_program3,Supported,0.50 GLX_SGIX_hyperpipe,NonGL,N/A GLX_MESA_agp_offset,NonGL,N/A GL_EXT_texture_compression_dxt1,Supported,0.50 GL_EXT_framebuffer_object,Supported,0.50 GL_GREMEDY_string_marker,Supported,0.60 GL_EXT_packed_depth_stencil,Supported,0.50 WGL_3DL_stereo_control,NonGL,N/A GL_EXT_stencil_clear_tag,Supported,0.60 GL_EXT_texture_sRGB,Supported,0.50 GL_EXT_framebuffer_blit,Supported,0.60 GL_EXT_framebuffer_multisample,Supported,0.60 GL_MESAX_texture_stack,Supported,0.50 GL_EXT_timer_query,Supported,0.60 GL_EXT_gpu_program_parameters,Supported,0.60 GL_APPLE_flush_buffer_range,Unsupported,N/A GL_NV_gpu_program4,Supported,0.60 GL_NV_geometry_program4,Supported,0.60 GL_EXT_geometry_shader4,Supported,0.60 GL_NV_vertex_program4,Supported,0.60 GL_EXT_gpu_shader4,Supported,0.60 GL_EXT_draw_instanced,Supported,0.60 GL_EXT_packed_float,Supported,0.50 WGL_EXT_pixel_format_packed_float,NonGL,N/A GLX_EXT_fbconfig_packed_float,NonGL,N/A GL_EXT_texture_array,Supported,0.60 GL_EXT_texture_buffer_object,Supported,0.60 GL_EXT_texture_compression_latc,Supported,0.50 GL_EXT_texture_compression_rgtc,Supported,0.50 GL_EXT_texture_shared_exponent,Supported,0.50 GL_NV_depth_buffer_float,Supported,0.60 GL_NV_fragment_program4,Supported,0.50 GL_NV_framebuffer_multisample_coverage,Supported,0.60 GL_EXT_framebuffer_sRGB,Supported,0.50 GLX_EXT_framebuffer_sRGB,NonGL,N/A WGL_EXT_framebuffer_sRGB,NonGL,N/A GL_NV_geometry_shader4,Supported,0.50 GL_NV_parameter_buffer_object,Unsupported,N/A GL_EXT_draw_buffers2,Unsupported,N/A GL_NV_transform_feedback,Unsupported,N/A GL_EXT_bindable_uniform,Unsupported,N/A GL_EXT_texture_integer,Supported,0.60 GLX_EXT_texture_from_pixmap,NonGL,N/A GL_GREMEDY_frame_terminator,Supported,0.60 ruby-opengl-0.60.1.orig/doc/supplies/0000755000000000000000000000000011377006423016112 5ustar rootrootruby-opengl-0.60.1.orig/doc/supplies/page_template.html0000644000000000000000000000443711377006423021617 0ustar rootroot ruby-opengl -- {{title}} ruby-opengl-0.60.1.orig/doc/extensions.txt0000644000000000000000000015535611377006423017225 0ustar rootroot
Extension svn 0.60 0.50
GL_3DFX_tbufferYESYESNO
GL_3DFX_texture_compression_FXT1YESYESYES
GL_APPLE_client_storageYESYESYES
GL_APPLE_element_arrayNONONO
GL_APPLE_fenceNONONO
GL_APPLE_flush_buffer_rangeNONONO
GL_APPLE_specular_vectorYESYESYES
GL_APPLE_transform_hintYESYESYES
GL_APPLE_vertex_array_objectNONONO
GL_APPLE_vertex_array_rangeNONONO
GL_APPLE_ycbcr_422YESYESYES
GL_ARB_color_buffer_floatYESYESYES
GL_ARB_depth_textureYESYESYES
GL_ARB_draw_buffersYESYESYES
GL_ARB_fragment_programYESYESNO
GL_ARB_fragment_program_shadowYESYESYES
GL_ARB_fragment_shaderYESYESNO
GL_ARB_half_float_pixelYESYESYES
GL_ARB_matrix_paletteNONONO
GL_ARB_multisampleYESYESYES
GL_ARB_multitextureNONONO
GL_ARB_occlusion_queryYESYESNO
GL_ARB_pixel_buffer_objectYESYESYES
GL_ARB_point_parametersYESYESNO
GL_ARB_point_spriteYESYESYES
GL_ARB_shader_objectsYESYESNO
GL_ARB_shading_language_100YESYESYES
GL_ARB_shadowYESYESYES
GL_ARB_shadow_ambientYESYESYES
GL_ARB_texture_border_clampYESYESYES
GL_ARB_texture_compressionNONONO
GL_ARB_texture_cube_mapYESYESYES
GL_ARB_texture_env_addYESYESYES
GL_ARB_texture_env_combineYESYESYES
GL_ARB_texture_env_crossbarYESYESYES
GL_ARB_texture_env_dot3YESYESYES
GL_ARB_texture_floatYESYESYES
GL_ARB_texture_mirrored_repeatYESYESYES
GL_ARB_texture_non_power_of_twoYESYESYES
GL_ARB_texture_rectangleYESYESYES
GL_ARB_transpose_matrixYESYESYES
GL_ARB_vertex_blendNONONO
GL_ARB_vertex_buffer_objectNONONO
GL_ARB_vertex_programYESYESNO
GL_ARB_vertex_shaderYESYESNO
GL_ARB_window_posYESYESNO
GL_ATI_draw_buffersYESYESNO
GL_ATI_element_arrayNONONO
GL_ATI_envmap_bumpmapNONONO
GL_ATI_fragment_shaderNONONO
GL_ATI_map_object_bufferNONONO
GL_ATI_pn_trianglesNONONO
GL_ATI_separate_stencilNONONO
GL_ATI_text_fragment_shaderYESYESYES
GL_ATI_texture_env_combine3YESYESYES
GL_ATI_texture_floatYESYESYES
GL_ATI_texture_mirror_onceYESYESYES
GL_ATI_vertex_array_objectNONONO
GL_ATI_vertex_attrib_array_objectNONONO
GL_ATI_vertex_streamsNONONO
GL_EXT_422_pixelsYESYESYES
GL_EXT_abgrYESYESYES
GL_EXT_bgraYESYESYES
GL_EXT_bindable_uniformNONONO
GL_EXT_blend_colorYESYESNO
GL_EXT_blend_equation_separateYESYESNO
GL_EXT_blend_func_separateYESYESNO
GL_EXT_blend_logic_opYESYESYES
GL_EXT_blend_minmaxYESYESNO
GL_EXT_blend_subtractYESYESYES
GL_EXT_clip_volume_hintYESYESYES
GL_EXT_cmykaYESYESYES
GL_EXT_color_subtableNONONO
GL_EXT_compiled_vertex_arrayYESYESNO
GL_EXT_convolutionNONONO
GL_EXT_coordinate_frameNONONO
GL_EXT_copy_textureNONONO
GL_EXT_cull_vertexNONONO
GL_EXT_depth_bounds_testYESYESNO
GL_EXT_draw_buffers2NONONO
GL_EXT_draw_instancedYESYESNO
GL_EXT_draw_range_elementsYESYESNO
GL_EXT_fog_coordYESYESNO
GL_EXT_fragment_lightingNONONO
GL_EXT_framebuffer_blitYESYESNO
GL_EXT_framebuffer_multisampleYESYESNO
GL_EXT_framebuffer_objectYESYESYES
GL_EXT_framebuffer_sRGBYESYESYES
GL_EXT_geometry_shader4YESYESNO
GL_EXT_gpu_program_parametersYESYESNO
GL_EXT_gpu_shader4YESYESNO
GL_EXT_histogramNONONO
GL_EXT_index_array_formatsYESYESYES
GL_EXT_index_funcNONONO
GL_EXT_index_materialNONONO
GL_EXT_index_textureYESYESYES
GL_EXT_light_textureNONONO
GL_EXT_misc_attributeYESYESYES
GL_EXT_multi_draw_arraysYESYESNO
GL_EXT_packed_depth_stencilYESYESYES
GL_EXT_packed_floatYESYESYES
GL_EXT_packed_pixelsYESYESYES
GL_EXT_paletted_textureNONONO
GL_EXT_pixel_buffer_objectYESYESYES
GL_EXT_pixel_transformNONONO
GL_EXT_pixel_transform_color_tableYESYESYES
GL_EXT_point_parametersYESYESNO
GL_EXT_polygon_offsetYESYESNO
GL_EXT_rescale_normalYESYESYES
GL_EXT_secondary_colorYESYESNO
GL_EXT_separate_specular_colorYESYESYES
GL_EXT_shadow_funcsYESYESYES
GL_EXT_shared_texture_paletteYESYESYES
GL_EXT_stencil_clear_tagYESYESNO
GL_EXT_stencil_two_sideYESYESNO
GL_EXT_stencil_wrapYESYESYES
GL_EXT_subtextureNONONO
GL_EXT_textureYESYESYES
GL_EXT_texture3DYESYESYES
GL_EXT_texture_arrayYESYESNO
GL_EXT_texture_buffer_objectYESYESNO
GL_EXT_texture_compression_dxt1YESYESYES
GL_EXT_texture_compression_latcYESYESYES
GL_EXT_texture_compression_rgtcYESYESYES
GL_EXT_texture_compression_s3tcYESYESYES
GL_EXT_texture_envNONONO
GL_EXT_texture_env_addYESYESYES
GL_EXT_texture_env_combineYESYESYES
GL_EXT_texture_env_dot3YESYESYES
GL_EXT_texture_filter_anisotropicYESYESYES
GL_EXT_texture_integerYESYESNO
GL_EXT_texture_lod_biasYESYESYES
GL_EXT_texture_mirror_clampYESYESYES
GL_EXT_texture_objectYESYESNO
GL_EXT_texture_perturb_normalNONONO
GL_EXT_texture_sRGBYESYESYES
GL_EXT_texture_shared_exponentYESYESYES
GL_EXT_timer_queryYESYESNO
GL_EXT_vertex_arrayNONONO
GL_EXT_vertex_shaderNONONO
GL_EXT_vertex_weightingNONONO
GL_GREMEDY_frame_terminatorYESYESNO
GL_GREMEDY_string_markerYESYESNO
GL_HP_convolution_border_modesYESYESYES
GL_HP_image_transformNONONO
GL_HP_occlusion_testNONONO
GL_HP_texture_lightingYESYESYES
GL_IBM_cull_vertexYESYESYES
GL_IBM_multimode_draw_arraysNONONO
GL_IBM_rasterpos_clipYESYESYES
GL_IBM_static_dataNONONO
GL_IBM_texture_mirrored_repeatYESYESYES
GL_IBM_vertex_array_listsNONONO
GL_INGR_color_clampYESYESYES
GL_INGR_interlace_readYESYESYES
GL_INTEL_parallel_arraysNONONO
GL_INTEL_texture_scissorNONONO
GL_MESAX_texture_stackYESYESYES
GL_MESA_pack_invertYESYESYES
GL_MESA_ycbcr_textureYESYESYES
GL_NV_blend_squareYESYESYES
GL_NV_copy_depth_to_colorYESYESYES
GL_NV_depth_buffer_floatYESYESNO
GL_NV_depth_clampYESYESYES
GL_NV_evaluatorsNONONO
GL_NV_fenceYESYESNO
GL_NV_float_bufferYESYESYES
GL_NV_fog_distanceYESYESYES
GL_NV_fragment_programYESYESNO
GL_NV_fragment_program2YESYESYES
GL_NV_fragment_program4YESYESYES
GL_NV_fragment_program_optionYESYESYES
GL_NV_framebuffer_multisample_coverageYESYESNO
GL_NV_geometry_program4YESYESNO
GL_NV_geometry_shader4YESYESYES
GL_NV_gpu_program4YESYESNO
GL_NV_half_floatNONONO
GL_NV_light_max_exponentYESYESYES
GL_NV_multisample_filter_hintYESYESYES
GL_NV_occlusion_queryYESYESNO
GL_NV_packed_depth_stencilYESYESYES
GL_NV_parameter_buffer_objectNONONO
GL_NV_pixel_data_rangeNONONO
GL_NV_point_spriteYESYESNO
GL_NV_primitive_restartYESYESNO
GL_NV_register_combinersNONONO
GL_NV_register_combiners2NONONO
GL_NV_texgen_embossYESYESYES
GL_NV_texgen_reflectionYESYESYES
GL_NV_texture_compression_vtcYESYESYES
GL_NV_texture_env_combine4YESYESYES
GL_NV_texture_expand_normalYESYESYES
GL_NV_texture_rectangleYESYESYES
GL_NV_texture_shaderYESYESYES
GL_NV_texture_shader2YESYESYES
GL_NV_texture_shader3YESYESYES
GL_NV_transform_feedbackNONONO
GL_NV_vertex_array_rangeNONONO
GL_NV_vertex_array_range2YESYESYES
GL_NV_vertex_programYESYESNO
GL_NV_vertex_program1_1YESYESYES
GL_NV_vertex_program2YESYESYES
GL_NV_vertex_program2_optionYESYESYES
GL_NV_vertex_program3YESYESYES
GL_NV_vertex_program4YESYESNO
GL_OES_byte_coordinatesYESYESYES
GL_OES_compressed_paletted_textureYESYESYES
GL_OES_fixed_pointNONONO
GL_OES_query_matrixNONONO
GL_OES_read_formatYESYESYES
GL_OES_single_precisionNONONO
GL_OML_interlaceYESYESYES
GL_OML_resampleYESYESYES
GL_OML_subsampleYESYESYES
GL_PGI_misc_hintsNONONO
GL_PGI_vertex_hintsYESYESYES
GL_REND_screen_coordinatesYESYESYES
GL_S3_s3tcNONONO
GL_SGIS_detail_textureNONONO
GL_SGIS_fog_functionNONONO
GL_SGIS_generate_mipmapYESYESYES
GL_SGIS_multisampleNONONO
GL_SGIS_pixel_textureNONONO
GL_SGIS_sharpen_textureNONONO
GL_SGIS_texture4DNONONO
GL_SGIS_texture_border_clampYESYESYES
GL_SGIS_texture_color_maskNONONO
GL_SGIS_texture_edge_clampYESYESYES
GL_SGIS_texture_filter4NONONO
GL_SGIS_texture_lodYESYESYES
GL_SGIS_texture_selectYESYESYES
GL_SGIX_asyncNONONO
GL_SGIX_async_histogramYESYESYES
GL_SGIX_async_pixelYESYESYES
GL_SGIX_blend_alpha_minmaxYESYESYES
GL_SGIX_clipmapYESYESYES
GL_SGIX_depth_textureYESYESYES
GL_SGIX_flush_rasterNONONO
GL_SGIX_fog_offsetYESYESYES
GL_SGIX_framezoomNONONO
GL_SGIX_instrumentsNONONO
GL_SGIX_interlaceYESYESYES
GL_SGIX_ir_instrument1YESYESYES
GL_SGIX_list_priorityNONONO
GL_SGIX_pixel_textureNONONO
GL_SGIX_pixel_texture_bitsYESYESYES
GL_SGIX_reference_planeNONONO
GL_SGIX_resampleYESYESYES
GL_SGIX_shadowYESYESYES
GL_SGIX_shadow_ambientYESYESYES
GL_SGIX_spriteNONONO
GL_SGIX_tag_sample_bufferNONONO
GL_SGIX_texture_add_envYESYESYES
GL_SGIX_texture_coordinate_clampYESYESYES
GL_SGIX_texture_lod_biasYESYESYES
GL_SGIX_texture_multi_bufferYESYESYES
GL_SGIX_texture_rangeYESYESYES
GL_SGIX_texture_scale_biasYESYESYES
GL_SGIX_vertex_preclipYESYESYES
GL_SGIX_vertex_preclip_hintYESYESYES
GL_SGIX_ycrcbYESYESYES
GL_SGI_color_matrixYESYESYES
GL_SGI_color_tableNONONO
GL_SGI_texture_color_tableYESYESYES
GL_SUNX_constant_dataNONONO
GL_SUN_convolution_border_modesYESYESYES
GL_SUN_global_alphaNONONO
GL_SUN_mesh_arrayNONONO
GL_SUN_multi_draw_arraysYESYESNO
GL_SUN_slice_accumYESYESYES
GL_SUN_triangle_listNONONO
GL_SUN_vertexNONONO
GL_WIN_phong_shadingYESYESYES
GL_WIN_specular_fogYESYESYES
ruby-opengl-0.60.1.orig/doc/scientific_use.txt0000644000000000000000000000173011377006423020004 0ustar rootrootScientific Use -------------- Though not directly related to ruby-opengl, this page contains a few tidbits of general info that might possibly be of interest to a number of users. There are currently two bindings to the [GNU Scientific Library][1] (GSL): * Yoshiki's Ruby/GSL () -- Comes with an API reference. Also, I've been told that the API has been worked a bit to be more comfortable for Ruby programmers. * Arno's ruby-gsl () -- more of a straight wrapper around the C API. [1]: http://www.gnu.org/software/gsl/ Browse Rubyforge for more. Links ----- * -- SciRuby wiki. * -- Numerical n-dimensional Array class. * -- Tioga. Create plots using Ruby and TeX.





ruby-opengl-0.60.1.orig/doc/roadmap.txt0000644000000000000000000000210411377006423016427 0ustar rootrootRoadmap ======= * Write comprehensive API documentation * Create more example code * Add RMagick(ImageMagick) integration for easy image handling (textures,screenshots) * Support all pixelstore modes (currently forced to default values by any function getting/setting data affected by it) Possible Features ======== * Add **all** OpenGL extensions (some are obsolete or not really used or useful at all) * Add direct mapping on ruby types for vertex arrays, buffers and image data to allow high performance data operations from within ruby - this should be modeled after Perl's OpenGL::Array - Update: preliminary tests shows that performance-wise there is no need for it, as the Ruby interpreter overhead is currently larger than immediate-mode calls overhead, so any potential speed gains are in domain of 1-5%. It still may be good idea from usability perspective, although that would require more comprehensive design, not just simple wrapper. * Support for r/w VBO buffer mapping - gl(Un)MapBuffer (is it needed?)










ruby-opengl-0.60.1.orig/doc/history.txt0000644000000000000000000000435311377006423016515 0ustar rootrootProject history =============== The [original ruby-opengl](http://www2.giganet.net/~yoshi/) was written by Yoshi. James A. desperately wanted to get the OpenGL Ruby bindings working on his Mac, but they wouldn't even compile on OSX. After a little bit of tweaking, he made his patched bindings available to the ruby community in a very informal manner. John G. then wanted to clean it up and add some docs to it, and so started tweaking and put up a new site and made his changes available. Then Peter M. came along and decided to try updating ruby-opengl using SWIG, as it seemed easier than doing everything by hand. Peter wrote the new code, John started the actual RubyForge project, put up a new site, and Peter committed the code. Thu M. V. joined the project with a lot of energy, and the mailing list was showing a good bit of activity. After some experience, we began to question whether SWIG was necessary/helpful for a project of this nature. The leaning was that people want to abandon SWIG and go back to maintaining the binding files by hand. Thu even provided a script to help with the manual coding that would be required without using SWIG. The reasoning at the time was: Pro-SWIG: * Could use the .i files for another project, perhaps (OTOH, we couldn't use previous .i files on this project...) * It's supposed to require less manual coding. Con-SWIG: * yet another tool to learn * OpenGL isn't really all that big * OpenGL doesn't change a lot * A lot of boilerplate and overhead in the generated files because SWIG is a general tool. In September 2006, we stopped using SWIG. Thu and Peter began fine tuning Thu's original `utils/mkwrap.rb` script. Development stalled in October 2006. Development picked up again towards the end of 2006. After a long hiatus and getting a new release of mkrf out the door, version 0.33 (following the numbering of original Yoshi's bindings which stalled at 0.32) was released. During first half of 2007, we added large portion of code, as well as number of unit tests, creating near-complete support for OpenGL 2.1. Support for MS Windows was also added during this time. Version 0.40 was released in July 2007. Version 0.50 was released in October 2007. Version 0.60 was released in December 2007. ruby-opengl-0.60.1.orig/lib/0000755000000000000000000000000011377006423014247 5ustar rootrootruby-opengl-0.60.1.orig/lib/opengl.rb0000644000000000000000000000424011377006423016060 0ustar rootroot# # Copyright (C) 2006 Peter McLain # Copyright (C) 2007 Jan Dvorak # # This program is distributed under the terms of the MIT license. # See the included MIT-LICENSE file for the terms of this license. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # This module provides access to the GL,GLU and GLUT methods and constants # in the way that they were available in previous versions of ruby-opengl. # # Thanks to Ilmari Heikkinen for a previous "reversed" version of this code, # and to Bill Kelly for a version before that one. require 'gl' require 'glu' require 'glut' include Gl,Glu,Glut # (Gl.)glVertex -> GL.Vertex # (Gl::)GL_TRUE -> GL::TRUE module GL extend self include Gl Gl.constants.each do |cn| n = cn.to_s.sub(/^GL_/,'') # due to ruby naming scheme, we can't export constants with leading decimal, # e.g. (Gl::)GL_2D would under old syntax become (GL::)2D which is illegal next if n =~ /^[0-9]/ const_set( n, Gl.const_get( cn ) ) end Gl.methods( false ).each do |mn| n = mn.to_s.sub(/^gl/,'') alias_method( n, mn ) public( n ) end end # (Glu.)gluSphere -> GLU.Sphere # (Glu::)GLU_INSIDE -> GLU::INSIDE module GLU extend self include Glu Glu.constants.each do |cn| n = cn.to_s.sub(/^GLU_/,'') const_set( n, Glu.const_get( cn ) ) end Glu.methods( false ).each do |mn| n = mn.to_s.sub(/^glu/,'') alias_method( n, mn ) public( n ) end end # (Glut.)glutInit -> GLUT.Init # (Glut::)GLUT_RGBA -> GLUT::RGBA module GLUT extend self include Glut Glut.constants.each do |cn| n = cn.to_s.sub(/^GLUT_/,'') const_set( n, Glut.const_get( cn ) ) end Glut.methods( false ).each do |mn| n = mn.to_s.sub(/^glut/,'') alias_method( n, mn ) public( n ) end end ruby-opengl-0.60.1.orig/metadata.yml0000644000000000000000000001136311377006423016010 0ustar rootroot--- !ruby/object:Gem::Specification name: ruby-opengl version: !ruby/object:Gem::Version version: 0.60.1 platform: ruby authors: - Alain Hoang - Jan Dvorak - Minh Thu Vo - James Adam autorequire: gl bindir: bin cert_chain: [] date: 2009-02-16 00:00:00 +01:00 default_executable: dependencies: - !ruby/object:Gem::Dependency name: mkrf type: :runtime version_requirement: version_requirements: !ruby/object:Gem::Requirement requirements: - - ">=" - !ruby/object:Gem::Version version: 0.2.0 version: - !ruby/object:Gem::Dependency name: rake type: :runtime version_requirement: version_requirements: !ruby/object:Gem::Requirement requirements: - - ">=" - !ruby/object:Gem::Version version: "0" version: description: email: ruby-opengl-devel@rubyforge.org executables: [] extensions: - Rakefile extra_rdoc_files: [] files: - lib/opengl.rb - ext/glut - ext/glut/glut.c - ext/glut/mkrf_conf.rb - ext/gl - ext/gl/gl-1.5.c - ext/gl/gl-ext-ext.c - ext/gl/gl-ext-ati.c - ext/gl/gl-ext-nv.c - ext/gl/gl-2.1.c - ext/gl/gl-1.4.c - ext/gl/gl-ext-gremedy.c - ext/gl/gl-1.3.c - ext/gl/gl-enums.c - ext/gl/gl-error.c - ext/gl/gl.c - ext/gl/gl-ext-3dfx.c - ext/gl/gl-ext-arb.c - ext/gl/gl-2.0.c - ext/gl/mkrf_conf.rb - ext/gl/gl-1.2.c - ext/gl/gl-1.0-1.1.c - ext/common - ext/common/funcdef.h - ext/common/common.h - ext/common/conv.h - ext/common/gl-types.h - ext/common/gl-enums.h - ext/common/glu-enums.h - ext/common/gl-error.h - ext/glu - ext/glu/glu.c - ext/glu/glu-enums.c - ext/glu/mkrf_conf.rb - doc/extensions.txt - doc/supplies - doc/supplies/page_template.html - doc/scientific_use.txt - doc/tutorial.txt - doc/build_install.txt - doc/extensions.txt.in - doc/thanks.txt - doc/history.txt - doc/roadmap.txt - doc/requirements_and_design.txt - examples/NeHe - examples/NeHe/nehe_lesson04.rb - examples/NeHe/nehe_lesson36.rb - examples/NeHe/nehe_lesson03.rb - examples/NeHe/nehe_lesson02.rb - examples/NeHe/nehe_lesson05.rb - examples/README - examples/OrangeBook - examples/OrangeBook/brick.frag - examples/OrangeBook/particle.vert - examples/OrangeBook/3Dlabs-License.txt - examples/OrangeBook/brick.rb - examples/OrangeBook/particle.rb - examples/OrangeBook/particle.frag - examples/OrangeBook/brick.vert - examples/RedBook - examples/RedBook/checker.rb - examples/RedBook/texbind.rb - examples/RedBook/texgen.rb - examples/RedBook/teapots.rb - examples/RedBook/bezmesh.rb - examples/RedBook/clip.rb - examples/RedBook/aargb.rb - examples/RedBook/double.rb - examples/RedBook/alpha.rb - examples/RedBook/jitter.rb - examples/RedBook/dof.rb - examples/RedBook/colormat.rb - examples/RedBook/smooth.rb - examples/RedBook/pickdepth.rb - examples/RedBook/varray.rb - examples/RedBook/accanti.rb - examples/RedBook/cube.rb - examples/RedBook/wrap.rb - examples/RedBook/lines.rb - examples/RedBook/bezcurve.rb - examples/RedBook/robot.rb - examples/RedBook/hello.rb - examples/RedBook/aapoly.rb - examples/RedBook/movelight.rb - examples/RedBook/model.rb - examples/RedBook/accpersp.rb - examples/RedBook/depthcue.rb - examples/RedBook/drawf.rb - examples/RedBook/list.rb - examples/RedBook/surface.rb - examples/RedBook/material.rb - examples/RedBook/planet.rb - examples/RedBook/quadric.rb - examples/RedBook/image.rb - examples/RedBook/stroke.rb - examples/RedBook/texturesurf.rb - examples/RedBook/feedback.rb - examples/RedBook/teaambient.rb - examples/RedBook/select.rb - examples/RedBook/font.rb - examples/RedBook/stencil.rb - examples/RedBook/tess.rb - examples/RedBook/fog.rb - examples/RedBook/mipmap.rb - examples/RedBook/alpha3D.rb - examples/misc - examples/misc/sdltest.rb - examples/misc/readpixel.rb - examples/misc/plane.rb - examples/misc/fbo_test.rb - examples/misc/anisotropic.rb - examples/misc/glfwtest.rb - examples/misc/OGLBench.rb - examples/misc/font-glut.rb - examples/misc/trislam.rb - test/tc_include_gl.rb - test/tc_ext_ati.rb - test/tc_func_10_11.rb - test/tc_func_14.rb - test/tc_ext_arb.rb - test/tc_func_13.rb - test/tc_func_20.rb - test/tc_glu.rb - test/tc_require_gl.rb - test/tc_ext_gremedy.rb - test/README - test/tc_func_15.rb - test/tc_ext_ext.rb - test/tc_ext_nv.rb - test/tc_misc.rb - test/tc_func_12.rb - test/tc_func_21.rb - test/tc_common.rb has_rdoc: false homepage: http://ruby-opengl.rubyforge.org post_install_message: rdoc_options: [] require_paths: - lib required_ruby_version: !ruby/object:Gem::Requirement requirements: - - ">=" - !ruby/object:Gem::Version version: "0" version: required_rubygems_version: !ruby/object:Gem::Requirement requirements: - - ">=" - !ruby/object:Gem::Version version: "0" version: requirements: [] rubyforge_project: ruby-opengl rubygems_version: 1.2.0 signing_key: specification_version: 2 summary: OpenGL Interface for Ruby test_files: []