Setting up double/tripple-buffer

Started by wmjoers, July 08, 2005, 09:23:47

Previous topic - Next topic

wmjoers

Hi, me again,

I've been reading the OpenGL redbook and is still struggeling with the differences between LWJGL and GLUT.

Now I really could need some help about how to configure my app to use double or tripple buffers. I could'nt find anything in the docs but I guess its just to obvious.

Matzon

isn't this left up to the drivers, or can one programatically change that ?

wmjoers

At least with the GLUT-method glutInitDisplayMode(...) you can specify if you want a single or double buffer. (GLUT_SINGLE, GLUT_DOUBLE)

So I guess you can set it....but I'm just not sure how to do it with LWJGL.

Orangy Tang

Double buffer is the default with LWJGL. I don't know of any way to get single-buffered, and I'm not even sure it's possible (or desirable) for any half-decent graphics card.

Triple buffer control usually ends up being a driver/control panel option which again I'm not sure if that can be changed programmatically.

aldacron

Quote from: "wmjoers"At least with the GLUT-method glutInitDisplayMode(...) you can specify if you want a single or double buffer. (GLUT_SINGLE, GLUT_DOUBLE)

So I guess you can set it....but I'm just not sure how to do it with LWJGL.

You don't need to. GLUT_SINGLE means there's no backbuffer - everything is rendered directly to the screen. This surely isn't what you want to be doing in a game if you want smooth animation. GLUT_DOUBLE means there is a backbuffer where the rendering takes place. If LWJGL were to allow you to set single/double buffering on the window, a likely place for it would be in the PixelFormat object. But since single buffering isn't useful for games, and the 'G' in LWJGL stands for 'Game', I doubt you'll see that option anytime soon.

elias

If there's demand for it, and a patch is presented that defaults to double buffering, I don't see why we couldn't add it. Should be as easy as adding a flag to PixelFormat and check for it on the native side.

- elias

princec

There are no situations why anyone would actually want to use a single-buffered display... it's a bit like supporting 256-colour mode: pointless.

Cas :)

wmjoers

Actualy...the reason for my original question is that the only thing that differs from OpenGL "redbook" is the setup of the display.  And because the documentation still is a little vague it's hard to guess sometimes.

rupy

With VR global update screens isn't single buffering what you want?

I draw directly to the front buffer:

glDrawBuffer(GL_FRONT_LEFT);
// draw left eye
...
glDrawBuffer(GL_FRONT_RIGTH);
// draw right eye


But I don't know how to disable back buffer stuff to improve performance?

"It's like Homeworld in first person."