I've never used auxilary buffers so I can't comment on that. But
wouldn't it be easier to just render on the back buffer as usual, but
not perform a buffer swap?
Pepijn
Alban Cousinie wrote:
> Hi,
>
> When I ask gl4java the count of available auxiliary buffers,
> 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
> //available in any implementation since it is mandatory
> gl.glDrawBuffer(gl.GL_LEFT);
> gl.glReadBuffer(gl.GL_LEFT);
> //make sure the buffer can be written
> gl.glColorMask(true,true,true,true);
>
> //clean the buffer
> gl.glClear(gl.GL_COLOR_BUFFER_BIT);
>
> //draw our objects in plain red color
> drawObjects();
>
> //look for color under the mouse
> gl.glReadPixels(nextX,canvasSize().height-yMouseCoordinate,1,1,gl.GL_RED
> ,gl.GL_UNSIGNED_BYTE,pickedColor);
>
> processPickedColorAndTellMeWhatObjectHasBeenPicked(pickedColor);
>
> //switch back to regular display buffer
> 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é
>
> MIND2MACHINE
> http://www.mind2machine.com
>
>
>
>
>
>
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> gl4java-usergroup mailing list
> gl4...@li...
> https://lists.sourceforge.net/lists/listinfo/gl4java-usergroup
>
|