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 › glReadPixels() crashes ?
Page Index Toggle Pages: 1
glReadPixels() crashes ?? (Read 904 times)
glReadPixels() crashes ??
Dec 18th, 2006, 7:19pm
 
hi all ...

i'm trying to work a bit with proce55ing but calling javax.media.opengl functions and it works great for displaying in OpenGL but when i tried to read pixels from the OpenGL framebuffer ... i got this :

javax.media.openGL.GLException : Required extensions not available to call this function.

could anybody light me if i can "include" this extensions to be able to call this function ? i've an alternative way of doing this trough loadPixels()..pixels[i] but i need to work it out with glReadPixels ...

any information about this "extensions" required ?

i include in case its usefull some portions of code where i try to read a pixel from the screen ...

GLContext GLCONT;
 GLCONT = pgl.canvas.getContext();
 GLCONT.makeCurrent();
 gl.glFlush();
 gl.glReadBuffer(gl.GL_FRONT);
 gl.glFinish();
 gl.glReadBuffer(gl.GL_FRONT);
 gl.glPixelStorei(gl.GL_INT,1);
 
 long data=0;
 gl.glReadPixels(0,0,0,0,gl.GL_RGB,gl.GL_INT,data);
 println(data);

////////

and that's how i inicialize OpenGL in setup

.../...

 pgl = (PGraphicsOpenGL) g;
 gl = pgl.beginGL();
 gl.glShadeModel(gl.GL_SMOOTH);
 pgl.beginDraw();
 gl.glClearColor(0.0,0.0,255.0,0.0);

.../...

thanks for any info Wink

e*
Page Index Toggle Pages: 1