From: Alban C. <aco...@mi...> - 2003-02-27 17:06:51
|
Hi, When I ask gl4java the count of available auxiliary buffers,=20 It returns 0. gl.glGetIntegerv(gl.GL_AUX_BUFFERS, numbuff); Does anyone know if auxiliary buffers are activated by default, if they can be activated, or if I get 0 buffers because my OpenGL implementation (nvidia, win32) would not support auxiliary buffers ? I'm implementing color picking. It's done, it works, but my screen flashes (a tenth of second, showing my drawn colors) because it looks like it is drawing on a buffer used by OpenGL for display, though I'm drawing my objects into the left buffer (because I don't have any auxiliary buffers). Here is the code (a bit simplified for ease of reading): //switch to an offscreen buffer. Left buffer should be=20 //available in any implementation since it is mandatory=20 gl.glDrawBuffer(gl.GL_LEFT); gl.glReadBuffer(gl.GL_LEFT); //make sure the buffer can be written gl.glColorMask(true,true,true,true); =20 //clean the buffer gl.glClear(gl.GL_COLOR_BUFFER_BIT); //draw our objects in plain red color drawObjects(); //look for color under the mouse =20 gl.glReadPixels(nextX,canvasSize().height-yMouseCoordinate,1,1,gl.GL_RED ,gl.GL_UNSIGNED_BYTE,pickedColor); =20 processPickedColorAndTellMeWhatObjectHasBeenPicked(pickedColor); =20 //switch back to regular display buffer=20 gl.glReadBuffer(gl.GL_BACK); gl.glDrawBuffer(gl.GL_BACK); Anyone has an idea of what could go wrong with those buffers ? Thanks, Alban Cousini=E9 MIND2MACHINE http://www.mind2machine.com =20 |