Index: setup.py =================================================================== RCS file: /store/cvs/axis/setup.py,v retrieving revision 1.24 diff -u -u -r1.24 setup.py --- setup.py 27 Oct 2005 15:06:53 -0000 1.24 +++ setup.py 22 Nov 2005 20:01:02 -0000 @@ -51,12 +51,25 @@ bdi4_marker = os.path.join(emcroot, "src/include", "config.h") is_bdi4 = os.path.exists(bdi4_marker) +opengl = Extension("minigl", + ["extensions/minigl.c"], + libraries = ["GL", "GLU"], + library_dirs = ["/usr/X11R6/lib"]) + if simple_install: try: - import emc, gcode, _glfixes, _togl + import emc, gcode, _togl except ImportError, detail: print "%s. SIMPLE_INSTALL won't work" % (detail.args[0]) raise SystemExit, 1 + try: + import minigl + except ImportError, detail1: + try: + import _glfixes + except ImportError, detail2: + print "%s. %s. SIMPLE_INSTALL won't work" \ + % (detail1.args[0], detail2.args[0]) d1 = os.path.join(emcroot, "plat", "*", "bin") d2 = os.path.join(emcroot, "emc", "plat", "*", "bin") for bin in ['bin', 'emc/bin'] + glob(d1) + glob(d2): @@ -204,13 +217,11 @@ ) togl = Extension("_togl", ["extensions/_toglmodule.c"], **get_togl_flags()) -glfixes = Extension("_glfixes", ["extensions/_glfixes.c"], libraries = ["GL"], - library_dirs = ["/usr/X11R6/lib"]) if simple_install: ext_modules = [] else: - ext_modules = [emc, glfixes, togl, gcode] + ext_modules = [emc, togl, gcode, opengl] setup(name=name, version=version, description="AXIS front-end for emc", Index: lib/hershey.py =================================================================== RCS file: /store/cvs/axis/lib/hershey.py,v retrieving revision 1.3 diff -u -u -r1.3 hershey.py --- lib/hershey.py 22 Nov 2005 15:58:12 -0000 1.3 +++ lib/hershey.py 22 Nov 2005 20:01:03 -0000 @@ -15,7 +15,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -from OpenGL.GL import * +from minigl import * # [[(180.0, 100.0), (220.0, 80.0), (280.0, 20.0), (280.0, 440.0)]], \ @@ -78,8 +78,6 @@ for point in stroke: glVertex3f(point[0], 500-point[1], 0) glEnd() - glPolygonMode(GL_FRONT, GL_FILL) - glPolygonMode(GL_BACK, GL_FILL) glEndList() def plot_digit(self, n): @@ -90,14 +88,14 @@ def plot_string(self, s, frac=0): glPushMatrix() - mat = glGetDouble(GL_MODELVIEW_MATRIX) - if mat[2][2] <= 0: + mat = glGetDoublev(GL_MODELVIEW_MATRIX) + if mat[10] <= 0: glTranslatef(0, .5, 0) glRotatef(180, 0, 1, 0) glTranslatef(0, -.5, 0) frac = 1 - frac - mat = glGetDouble(GL_MODELVIEW_MATRIX) - if mat[1][1] <= 0: + mat = glGetDoublev(GL_MODELVIEW_MATRIX) + if mat[5] <= 0: glTranslatef(0, .5, 0) glRotatef(180, 0, 0, 1) glTranslatef(0, -.5, 0) Index: rs274/OpenGLTk.py =================================================================== RCS file: /store/cvs/axis/rs274/OpenGLTk.py,v retrieving revision 1.2 diff -u -u -r1.2 OpenGLTk.py --- rs274/OpenGLTk.py 29 Nov 2004 18:47:54 -0000 1.2 +++ rs274/OpenGLTk.py 22 Nov 2005 20:01:03 -0000 @@ -9,8 +9,7 @@ # University of York, UK # -from OpenGL.GL import * -from OpenGL.GLU import * +from minigl import * from Tkinter import _default_root from Tkinter import * import math Index: rs274/glcanon.py =================================================================== RCS file: /store/cvs/axis/rs274/glcanon.py,v retrieving revision 1.13 diff -u -u -r1.13 glcanon.py --- rs274/glcanon.py 20 Nov 2005 21:46:29 -0000 1.13 +++ rs274/glcanon.py 22 Nov 2005 20:01:03 -0000 @@ -16,7 +16,10 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA from rs274 import Translated, ArcsToSegmentsMixin -from OpenGL.GL import * +from minigl import * +def glColor3fv(args): glColor3f(*args) +def glVertex3fv(args): glVertex3f(*args) + from math import sin, cos, pi class GLCanon(Translated, ArcsToSegmentsMixin): @@ -104,8 +107,7 @@ def highlight(self, lineno): glLineWidth(3) - c = 0, 255, 255 - glColor3fv(c) + glColor3f(0, 255, 255) glBegin(GL_LINES) for line in self.traverse: if line[0] != lineno: continue Index: scripts/axis.py =================================================================== RCS file: /store/cvs/axis/scripts/axis.py,v retrieving revision 1.76 diff -u -u -r1.76 axis.py --- scripts/axis.py 21 Nov 2005 04:38:14 -0000 1.76 +++ scripts/axis.py 22 Nov 2005 20:01:03 -0000 @@ -48,10 +48,8 @@ Tkinter.Tk = Tk from Tkinter import * -from OpenGL.GL import * -from OpenGL.GLU import * +from minigl import * from rs274.OpenGLTk import * -from _glfixes import glInterleavedArrays from rs274.glcanon import GLCanon from hershey import Hershey import rs274.options @@ -1717,13 +1715,13 @@ maxlen = 0 ypos -= coordinate_linespace+5 i=0 - glColor(1,1,1) + glColor3f(1,1,1) for string in positions: maxlen = max(maxlen, len(string)) if s.homed[i]: glRasterPos(6, ypos) glBitmap(13, 16, 0, 3, 17, 0, homeicon) - glRasterPos(23, ypos) + glRasterPos2i(23, ypos) for char in string: glCallList(fontbase + ord(char)) ypos -= coordinate_linespace @@ -1764,6 +1762,7 @@ elif os.environ.has_key("AXIS_OPEN_FILE"): open_file_guts(os.environ["AXIS_OPEN_FILE"]) +print [k for k in sys.modules.keys() if 'gl' in k.lower()] o.mainloop() # vim:sw=4:sts=4:et: --- /dev/null 2003-01-30 04:24:37.000000000 -0600 +++ extensions/minigl.c 2005-11-22 13:52:16.000000000 -0600 @@ -0,0 +1,542 @@ +#include +#include +#include + +static PyObject *glerror; + +#define GLCALL0V(name) \ +static PyObject *py##name(PyObject *s, PyObject *o) { \ + if(!PyArg_ParseTuple(o, "")) return NULL; \ + name(); \ + CHECK_ERROR; \ + Py_INCREF(Py_None); return Py_None; \ +} +#define GLCALL1V(name, fmt, t1) \ +static PyObject *py##name(PyObject *s, PyObject *o) { \ + t1 p1; \ + if(!PyArg_ParseTuple(o, fmt, &p1)) return NULL; \ + name(p1); \ + CHECK_ERROR; \ + Py_INCREF(Py_None); return Py_None; \ +} +#define GLCALL2V(name, fmt, t1, t2) \ +static PyObject *py##name(PyObject *s, PyObject *o) { \ + t1 p1; t2 p2; \ + if(!PyArg_ParseTuple(o, fmt, &p1, &p2)) return NULL; \ + name(p1, p2); \ + CHECK_ERROR; \ + Py_INCREF(Py_None); return Py_None; \ +} +#define GLCALL3V(name, fmt, t1, t2, t3) \ +static PyObject *py##name(PyObject *s, PyObject *o) { \ + t1 p1; t2 p2; t3 p3; \ + if(!PyArg_ParseTuple(o, fmt, &p1, &p2, &p3)) return NULL; \ + name(p1, p2, p3); \ + CHECK_ERROR; \ + Py_INCREF(Py_None); return Py_None; \ +} + +#define GLCALL4V(name, fmt, t1, t2, t3, t4) \ +static PyObject *py##name(PyObject *s, PyObject *o) { \ + t1 p1; t2 p2; t3 p3; t4 p4; \ + if(!PyArg_ParseTuple(o, fmt, &p1, &p2, &p3, &p4)) return NULL; \ + name(p1, p2, p3, p4); \ + CHECK_ERROR; \ + Py_INCREF(Py_None); return Py_None; \ +} + +#define GLCALL6V(name, fmt, t1, t2, t3, t4, t5, t6) \ +static PyObject *py##name(PyObject *s, PyObject *o) { \ + t1 p1; t2 p2; t3 p3; t4 p4; t5 p5; t6 p6; \ + if(!PyArg_ParseTuple(o, fmt, &p1, &p2, &p3, &p4, &p5, &p6)) return NULL; \ + name(p1, p2, p3, p4, p5, p6); \ + CHECK_ERROR; \ + Py_INCREF(Py_None); return Py_None; \ +} + +#define CHECK_ERROR (void)0 + +GLCALL1V(glBegin, "i", int) +GLCALL3V(glColor3f, "fff", float, float, float) +GLCALL4V(glColor4f, "ffff", float, float, float, float) +GLCALL3V(glVertex3f, "fff", float, float, float); +GLCALL2V(glLineStipple, "ii", int, int) +GLCALL1V(glLineWidth, "f", float) + +GLCALL1V(glCallList, "i", int) +GLCALL1V(glClear, "i", int) +GLCALL4V(glClearColor, "ffff", float, float, float, float) +GLCALL1V(glDepthFunc, "i", int) +GLCALL1V(glDepthMask, "i", int) +GLCALL1V(glDisable, "i", int) +GLCALL1V(glEnable, "i", int) +GLCALL0V(glEndList) +GLCALL0V(glInitNames) +GLCALL3V(glLightf, "iif", int, int, float) +GLCALL0V(glLoadIdentity) +GLCALL1V(glLoadName, "i", int) +GLCALL2V(glNewList, "ii", int, int) +GLCALL0V(glPopMatrix) +GLCALL0V(glPushMatrix) +GLCALL1V(glPushName, "i", int) +GLCALL2V(glRasterPos2i, "ii", int, int) +GLCALL4V(glRotatef, "ffff", float, float, float, float) +GLCALL3V(glScalef, "fff", float, float, float) +GLCALL1V(glDrawBuffer, "i", int) +GLCALL3V(glDrawArrays, "iii", int, int, int) +GLCALL1V(glMatrixMode, "i", int) +GLCALL6V(glOrtho, "ffffff", float, float, float, float, float, float); +GLCALL3V(glTranslatef, "fff", float, float, float); +GLCALL4V(glViewport, "iiii", int, int, int, int); +GLCALL4V(gluPerspective, "dddd", double, double, double, double); + +static void make_glerror(int code) { + PyObject *e = \ + PyObject_CallFunction(glerror, "is", code, gluErrorString(code)); + PyErr_SetObject(glerror, e); +} + +#undef CHECK_ERROR +#define CHECK_ERROR do { \ + GLenum e = glGetError(); \ + if(e) { make_glerror(e); return NULL; } \ +} while(0) + +GLCALL0V(glEnd) +GLCALL2V(glDeleteLists, "ii", int, int) +GLCALL2V(glBlendFunc, "ii", int, int) +GLCALL0V(glFlush) +GLCALL2V(glPixelStorei, "ii", int, int) + +static PyObject *pyglBitmap(PyObject *s, PyObject *o) { + int width, height, nbitmap; + double xorg, yorg, xmove, ymove; + char *bitmap; + if(!PyArg_ParseTuple(o, "iiffffffs#", &width, &height, + &xorg, &yorg, &xmove, &ymove, &nbitmap, &bitmap)) { + return NULL; + } + glBitmap(width, height, xorg, yorg, xmove, ymove, bitmap); + CHECK_ERROR; + Py_INCREF(Py_None); + return Py_None; +} + +static PyObject *pyglGenLists(PyObject *s, PyObject *o) { + int range; + if(!PyArg_ParseTuple(o, "i", &range)) return NULL; + return PyInt_FromLong(glGenLists(range)); +} + +static PyObject *pyglGetDoublev(PyObject *s, PyObject *o) { + int what; + if(!PyArg_ParseTuple(o, "i", &what)) return NULL; + switch(what) { + case GL_MODELVIEW_MATRIX: + case GL_PROJECTION_MATRIX: { + double d[16]; + PyObject *r = PyList_New(16); + int i; + glGetDoublev(what, d); + for(i=0; i<16; i++) { + PyList_SetItem(r, i, PyFloat_FromDouble(d[i])); + } + return r; + } + default: + PyErr_Format(PyExc_ValueError, "glGetDoublev does not support getting %d", what); + return NULL; + } +} + +static PyObject *pyglGetIntegerv(PyObject *s, PyObject *o) { + int what; + if(!PyArg_ParseTuple(o, "i", &what)) return NULL; + switch(what) { + case GL_VIEWPORT: { + int d[4]; + PyObject *r = PyList_New(4); + int i; + glGetIntegerv(what, d); + for(i=0; i<4; i++) { + PyList_SetItem(r, i, PyInt_FromLong(d[i])); + } + return r; + } + default: + PyErr_Format(PyExc_ValueError, "glGetIntegerv does not support getting %d", what); + return NULL; + } +} + +static PyObject *pyglInterleavedArrays(PyObject *s, PyObject *o) { + static void *buf = NULL; + PyObject *str; + int format, stride, size; + + if(!PyArg_ParseTuple(o, "iiO", &format, &stride, &str)) { + return NULL; + } + + if(!PyString_Check(str)) { + PyErr_Format( PyExc_TypeError, "Expected string" ); + return NULL; + } + + // size = min(8192, PyString_GET_SIZE(str)); + size = PyString_GET_SIZE(str); + if(buf == NULL) buf = malloc(size); + else buf = realloc(buf, size); + memcpy(buf, PyString_AS_STRING(str), size); + glInterleavedArrays(format, stride, buf); + + CHECK_ERROR; + Py_INCREF(Py_None); + return Py_None; +} + +static PyObject *pyglLightfv(PyObject *s, PyObject *o) { + int light, pname; + float param[4]; + if(!PyArg_ParseTuple(o, "ii(ffff)", &light, &pname, param, param+1, param+2, param+3)) + return NULL; + glLightfv(light, pname, param); + + CHECK_ERROR; + Py_INCREF(Py_None); + return Py_None; +} + +static PyObject *pyglMultMatrixd(PyObject *s, PyObject *o) { + double matrix[16]; + if(!PyArg_ParseTuple(o, "(dddddddddddddddd)", + matrix, matrix+1, matrix+2, matrix+3, + matrix+4, matrix+5, matrix+6, matrix+7, + matrix+8, matrix+9, matrix+10, matrix+11, + matrix+12, matrix+13, matrix+14, matrix+15)) return NULL; + + glMultMatrixd(matrix); + + CHECK_ERROR; + Py_INCREF(Py_None); + return Py_None; +} + +static PyObject *pygluNewQuadric(PyObject *s, PyObject *o) { + Py_INCREF(Py_None); + return Py_None; +} + +static PyObject *pygluDeleteQuadric(PyObject *s, PyObject *o) { + Py_INCREF(Py_None); + return Py_None; +} + +static PyObject *pygluCylinder(PyObject *s, PyObject *o) { + GLUquadric *q = gluNewQuadric(); + double base, top, height; + int slices, stacks; + PyObject *ignore; + + if(!PyArg_ParseTuple(o, "Odddii", &ignore, &base, &top, + &height, &slices, &stacks)) + return NULL; + + gluCylinder(q, base, top, height, slices, stacks); + gluDeleteQuadric(q); + + CHECK_ERROR; + + Py_INCREF(Py_None); + return Py_None; +} + +static PyObject *pygluDisk(PyObject *s, PyObject *o) { + GLUquadric *q = gluNewQuadric(); + double inner, outer; + int slices, loops; + PyObject *ignore; + + if(!PyArg_ParseTuple(o, "Oddii", &ignore, &inner, &outer, + &slices, &loops)) + return NULL; + + gluDisk(q, inner, outer, slices, loops); + gluDeleteQuadric(q); + + CHECK_ERROR; + + Py_INCREF(Py_None); + return Py_None; +} + +static PyObject *pygluLookAt(PyObject *s, PyObject *o) { + double eyex, eyey, eyez, centerx, centery, centerz, upx, upy, upz; + if(!PyArg_ParseTuple(o, "ddddddddd", &eyex, &eyey, &eyez, + ¢erx, ¢ery, ¢erz, &upx, &upy, &upz)) + return NULL; + gluLookAt(eyex, eyey, eyez, centerx, centery, centerz, upx, upy, upz); + + CHECK_ERROR; + + Py_INCREF(Py_None); + return Py_None; +} + +static PyObject *pygluPickMatrix(PyObject *s, PyObject *o) { + double x, y, delx, dely; + int viewport[4]; + if(!PyArg_ParseTuple(o, "dddd(iiii)", &x, &y, &delx, &dely, + viewport, viewport+1, viewport+2, viewport+3)) + return NULL; + gluPickMatrix(x, y, delx, dely, viewport); + + CHECK_ERROR; + + Py_INCREF(Py_None); + return Py_None; +} + +static PyObject *pygluProject(PyObject *s, PyObject *o) { + double x, y, z, wx, wy, wz, model[16], proj[16]; + int viewport[4]; + + if(!PyArg_ParseTuple(o, "ddd", &x, &y, &z)) + return NULL; + + glGetIntegerv(GL_VIEWPORT, viewport); + glGetDoublev(GL_MODELVIEW_MATRIX, model); + glGetDoublev(GL_PROJECTION_MATRIX, proj); + + gluProject(x, y, z, model, proj, viewport, &wx, &wy, &wz); + + CHECK_ERROR; + + return Py_BuildValue("ddd", wx, wy, wz); +} + +static PyObject *pygluUnProject(PyObject *s, PyObject *o) { + double x, y, z, wx, wy, wz, model[16], proj[16]; + int viewport[4]; + + if(!PyArg_ParseTuple(o, "ddd", &x, &y, &z)) + return NULL; + + glGetIntegerv(GL_VIEWPORT, viewport); + glGetDoublev(GL_MODELVIEW_MATRIX, model); + glGetDoublev(GL_PROJECTION_MATRIX, proj); + + gluUnProject(x, y, z, model, proj, viewport, &wx, &wy, &wz); + + CHECK_ERROR; + + return Py_BuildValue("ddd", wx, wy, wz); +} + + +#if 0 +static PyObject *pygluProject(PyObject *s, PyObject *o) { + double x, y, z, model[16], proj[16], wx, wy, wz; + int viewport[4]; + + if(!PyArg_ParseTuple(o, "ddd(dddddddddddddddd)(dddddddddddddddd)(iiii)", + &x, &y, &z, + model, model+1, model+2, model+3, + model+4, model+5, model+6, model+7, + model+8, model+9, model+10, model+11, + model+12, model+13, model+14, model+15, + proj, proj+1, proj+2, proj+3, + proj+4, proj+5, proj+6, proj+7, + proj+8, proj+9, proj+10, proj+11, + proj+12, proj+13, proj+14, proj+15, + viewport, viewport+1, viewport+2, viewport+3)) + return NULL; + gluProject(x, y, z, model, proj, viewport, &wx, &wy, &wz); + + CHECK_ERROR; + + return Py_BuildValue("ddd", wx, wy, wz); +} + + +static PyObject *pygluUnProject(PyObject *s, PyObject *o) { + double x, y, z, model[16], proj[16], ox, oy, oz; + int viewport[4]; + + if(!PyArg_ParseTuple(o, "ddd(dddddddddddddddd)(dddddddddddddddd)(iiii)", + &x, &y, &z, + model, model+1, model+2, model+3, + model+4, model+5, model+6, model+7, + model+8, model+9, model+10, model+11, + model+12, model+13, model+14, model+15, + proj, proj+1, proj+2, proj+3, + proj+4, proj+5, proj+6, proj+7, + proj+8, proj+9, proj+10, proj+11, + proj+12, proj+13, proj+14, proj+15, + viewport, viewport+1, viewport+2, viewport+3)) + return NULL; + gluUnProject(x, y, z, model, proj, viewport, &ox, &oy, &oz); + + CHECK_ERROR; + + return Py_BuildValue("ddd", ox, oy, oz); +} +#endif +static int *select_buffer = NULL; +static PyObject *pyglSelectBuffer( PyObject *s, PyObject *o) { + int sz; + if(!PyArg_ParseTuple(o, "i", &sz)) + return NULL; + if(select_buffer) select_buffer = realloc( select_buffer, sizeof(int) * sz); + else select_buffer = malloc(sizeof(int) * sz); + + glSelectBuffer(sz, select_buffer); + + CHECK_ERROR; + + Py_INCREF(Py_None); + return Py_None; + +} + +static PyObject *pyglRenderMode( PyObject *s, PyObject *o) { + int mode, lastmode, count; + if(!PyArg_ParseTuple(o, "i", &mode)) + return NULL; + + glGetIntegerv(GL_RENDER_MODE, &lastmode); + count = glRenderMode(mode); + + CHECK_ERROR; + + if(lastmode == GL_SELECT) { + PyObject *r = PyList_New(0); + int i = 0; + while(i < count) { + PyObject *record = PyTuple_New(3); + int namelen = select_buffer[i++]; + PyObject *name = PyList_New(namelen); + int j; + PyTuple_SetItem(record, 0, + PyFloat_FromDouble(select_buffer[i++] / 214748364.)); + PyTuple_SetItem(record, 1, + PyFloat_FromDouble(select_buffer[i++] / 214748364.)); + for(j=0; namelen; namelen--, j++, i++) + PyList_SetItem(name, j, PyInt_FromLong(select_buffer[i])); + PyTuple_SetItem(record, 2, name); + PyList_Append(r, record); + } + return r; + } + + Py_INCREF(Py_None); + return Py_None; +} + +/* +glSelectBuffer +*/ + +static PyMethodDef methods[] = { +#define METH(name, doc) { #name, (PyCFunction) py##name, METH_VARARGS, doc } +METH(glBegin, ""), +METH(glColor3f, ""), +METH(glColor4f, ""), +METH(glDeleteLists, ""), +METH(glBlendFunc, ""), +METH(glCallList, ""), +METH(glClear, ""), +METH(glClearColor, ""), +METH(glDepthFunc, ""), +METH(glDepthMask, ""), +METH(glDisable, ""), +METH(glEnable, ""), +METH(glEnd, ""), +METH(glEndList, ""), +METH(glFlush, ""), +METH(glInitNames, ""), +METH(glLightf, ""), +METH(glLineStipple, ""), +METH(glLineWidth, ""), +METH(glLoadIdentity, ""), +METH(glLoadName, ""), +METH(glMatrixMode, ""), +METH(glNewList, ""), +METH(glPopMatrix, ""), +METH(glPushMatrix, ""), +METH(glPushName, ""), +METH(glRenderMode, ""), +METH(glRasterPos2i, ""), +METH(glRotatef, ""), +METH(glScalef, ""), +METH(glFlush, ""), +METH(glDrawBuffer, ""), +METH(glDrawArrays, ""), +METH(glMatrixMode, ""), +METH(glOrtho, ""), +METH(glTranslatef, ""), +METH(glVertex3f, ""), +METH(glViewport, ""), +METH(gluPerspective, ""), + +METH(glGenLists, ""), +METH(glGetDoublev, ""), +METH(glGetIntegerv, ""), +METH(glInterleavedArrays, ""), +METH(glLightfv, ""), +METH(glMultMatrixd, ""), +METH(glPixelStorei, ""), + +METH(glSelectBuffer, ""), +// METH(glVertex3fv, ""), +METH(gluCylinder, ""), +METH(gluDeleteQuadric, ""), +METH(gluDisk, ""), +METH(gluLookAt, ""), +METH(gluNewQuadric, ""), +METH(gluPickMatrix, ""), +METH(gluProject, ""), +METH(gluUnProject, ""), +#undef METH +{NULL, NULL, 0, 0}, +}; + +#define CONST(x) PyObject_SetAttrString(m, #x, PyInt_FromLong(x)) +void initminigl(void) { + PyObject *m = \ + Py_InitModule3("minigl", methods, "Mini version of pyopengl for axis"); + glerror = PyErr_NewException("minigl.error", PyExc_RuntimeError, NULL); + PyObject_SetAttrString(m, "error", glerror); + CONST(GL_ALWAYS); + CONST(GL_BACK); + CONST(GL_BLEND); + CONST(GL_COLOR_BUFFER_BIT); + CONST(GL_COMPILE); + CONST(GL_CULL_FACE); + CONST(GL_DEPTH_BUFFER_BIT); + CONST(GL_DEPTH_TEST); + CONST(GL_FALSE); + CONST(GL_FRONT); + CONST(GL_LESS); + CONST(GL_LIGHTING); + CONST(GL_LIGHTING); + CONST(GL_LINES); + CONST(GL_LINE_STIPPLE); + CONST(GL_LINE_STRIP); + CONST(GL_MODELVIEW); + CONST(GL_MODELVIEW_MATRIX); + CONST(GL_ONE_MINUS_SRC_ALPHA); + CONST(GL_PROJECTION); + CONST(GL_PROJECTION_MATRIX); + CONST(GL_QUADS); + CONST(GL_RENDER); + CONST(GL_SELECT); + CONST(GL_SRC_ALPHA); + CONST(GL_STACK_OVERFLOW); + CONST(GL_TRUE); + CONST(GL_UNPACK_ALIGNMENT); + CONST(GL_V3F); + CONST(GL_VIEWPORT); + CONST(GL_LIGHT0); + CONST(GL_POSITION); +}