We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpOpenGL and 3D Libraries › using other openGL methods
Page Index Toggle Pages: 1
using other openGL methods (Read 1243 times)
using other openGL methods
Jun 2nd, 2005, 10:50pm
 
Can we use other openGL methods?  For example, I want to clear the z-buffer, and I tried writing this code but it doesn't work (I'm still shakey with opengl, so this might just be bad code):

PGraphicsGL PGL;

void initGLEx()
{
 PGL = (PGraphicsGL)g;
 clearBuffer = new float[height*width];
 for (int i=0; i<clearBuffer.length; i++)
 {
   clearBuffer[i] = 1;
 }

}

void glClearDepthBuffer()
{
 PGL.gl.glRasterPos2f(0.0,0.0);
 PGL.gl.glDrawPixels(width,height,PGL.gl.GL_DEPTH_COMPONENT,
                   PGL.gl.GL_FLOAT,clearBuffer);
}
Re: using other openGL methods
Reply #1 - Jun 2nd, 2005, 11:43pm
 
you can use some gl, but as noted in the faq, if things don't work, you're out of luck and we're not likely to "fix" it:
http://processing.org/faq/bugs.html#opengl

looking at your code that's just a weird way to clear the zbuffer.. you might try glClear() instead.
Page Index Toggle Pages: 1