Hello Guest

Setting up double/tripple-buffer

  • 8 Replies
  • 12764 Views
Setting up double/tripple-buffer
« 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.

*

Offline Matzon

  • *****
  • 2242
Setting up double/tripple-buffer
« Reply #1 on: July 08, 2005, 10:54:44 »
isn't this left up to the drivers, or can one programatically change that ?

glutInitDisplayMode
« Reply #2 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.

Setting up double/tripple-buffer
« Reply #3 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.

Re: glutInitDisplayMode
« Reply #4 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.

*

Offline elias

  • *****
  • 899
    • http://oddlabs.com
Setting up double/tripple-buffer
« Reply #5 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

*

Offline princec

  • *****
  • 1933
    • Puppygames
Setting up double/tripple-buffer
« Reply #6 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 :)

Setting up double/tripple-buffer
« Reply #7 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.

*

Offline rupy

  • *
  • 28
Re: Setting up double/tripple-buffer
« Reply #8 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?
« Last Edit: August 23, 2015, 13:58:21 by rupy »

"It's like Homeworld in first person."