LWJGL Forum

Programming => OpenGL => Topic started by: wmjoers on July 08, 2005, 09:23:47

Title: Setting up double/tripple-buffer
Post by: wmjoers on July 08, 2005, 09:23:47
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.
Title: Setting up double/tripple-buffer
Post by: Matzon on July 08, 2005, 10:54:44
isn't this left up to the drivers, or can one programatically change that ?
Title: glutInitDisplayMode
Post by: wmjoers on July 08, 2005, 11:04:48
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.
Title: Setting up double/tripple-buffer
Post by: Orangy Tang on July 08, 2005, 12:59:26
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.
Title: Re: glutInitDisplayMode
Post by: aldacron on July 09, 2005, 15:11:27
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.
Title: Setting up double/tripple-buffer
Post by: elias on July 10, 2005, 19:35:03
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
Title: Setting up double/tripple-buffer
Post by: princec on July 10, 2005, 20:06:08
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 :)
Title: Setting up double/tripple-buffer
Post by: wmjoers on July 11, 2005, 06:31:47
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.
Title: Re: Setting up double/tripple-buffer
Post by: rupy on August 23, 2015, 13:46:14
With VR global update screens isn't single buffering what you want?

I draw directly to the front buffer:

Code: [Select]
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?