can't seem to access opengl constants
in
Contributed Library Questions
•
1 years ago
does anyone know why i would get a "Cannot find anything named 'GL_ALL_ATTRIB_BITS'" error? im getting it on 2.0a3 and 1.5.1, here is the code i'm trying to run - its a modified version of the glslshader demo in GLGraphics examples:
- void draw() {
- background(250);
- GLGraphics renderer = (GLGraphics)g;
- renderer.beginGL();
- // Push the GL attribute bits so that we don't wreck any settings
- glPushAttrib(GL_ALL_ATTRIB_BITS);
- // Enable polygon offsets, and offset filled polygons forward by 2.5
- glEnable(GL_POLYGON_OFFSET_FILL);
- glPolygonOffset(-2.5f, -2.5f);
- // Set the render mode to be line rendering with a thick line width
- glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
- glLineWidth(3.0f);
- // Set the colour to be white
- glColor3f(1.0f, 1.0f, 1.0f);
- // Set the polygon mode to be filled triangles
- glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
- glEnable(GL_LIGHTING);
- // Set the colour to the background
- glColor3f(0.0f, 0.0f, 0.0f);
- // Pop the state changes off the attribute stack
- // to set things back how they were
- glPopAttrib();
- renderer.endGL();
- // The light is drawn after applying the translation and
- // rotation trasnformations, so it always shines on the
- // same side of the torus.
- pointLight(0, 160, 255, -1, 0, 0);
- lights();
- // Centering the model in the screen.
- translate(width/2, height/2, 0);
- angle += 0.01;
- rotateY(angle);
- // Any geometry drawn between the shader's stop() and end() will be
- // processed by the shader.
- shader.start(); // Enabling shader.
- renderer.model(torus);
- shader.stop(); // Disabling shader.
- }
it's the highlighted code im having trouble with. any help would be greatly appreciated.
1