Results 1 to 5 of 5

Thread: how to Swap buffers from single to double?

  1. #1
    Member Contributor
    Join Date
    May 2001
    Location
    United Kingdom - London
    Posts
    71

    how to Swap buffers from single to double?

    hi all I would like to know how to swap buffers from double buffering to single just for a moment while running my program at the same time!
    The reason for that is because I am comparing 2 images pixel by pixel and I would like to switch to single buffer to see each pixel being drawn which gives quite a nice effect whereas double bufferring won't give this nice effect. When using Double it just waits until all pixels are dawn into memory then after it simply displays them in one go which is not what I want!
    Is ther anything like say.
    if ( flag ) //true then sinlge buffer
    else //carry on wtih double buffer

    any suggestions?
    Thank you very much indeed!!!

  2. #2
    Senior Member OpenGL Guru
    Join Date
    Mar 2001
    Posts
    3,574

    Re: how to Swap buffers from single to double?

    I don't remember the exact command, but I'm pretty sure there is a function that sets which buffer you render to. Normally, you render to the back buffer, but you could set it to render to the front buffer instead.

    As for actually shutting off the back buffer, that is likely not possible. The option to use or not use a back buffer is part of the pixel format (in Windows, at least), and the pixel format is used to generate a rendering context.

  3. #3
    Member Contributor
    Join Date
    May 2001
    Location
    United Kingdom - London
    Posts
    71

    Re: how to Swap buffers from single to double?

    Thanks Korval!! I am sure there should be something but I just can't find it!
    It works when I set it to glutInitDisplayMode (GLUT_SINGLE | GLUT_RGB); but obviously I can't keep changing the line from SINGLE to DOUBLE while running the program! THX!!

  4. #4
    Senior Member Regular Contributor
    Join Date
    Mar 2001
    Posts
    319

    Re: how to Swap buffers from single to double?

    glDrawBuffer(GL_FRONT) should do what you want

  5. #5
    Member Contributor
    Join Date
    May 2001
    Location
    United Kingdom - London
    Posts
    71

    Re: how to Swap buffers from single to double?

    Thanks!! Guys for help!!
    ET3D was right!! It works!!
    glDrawBuffer() was what I was looking for!!
    I really appreciate that!!

Similar Threads

  1. Swap Buffers and Gameloop, vsync
    By jaketehsnake in forum OpenGL: Advanced Coding
    Replies: 5
    Last Post: 08-20-2015, 01:30 AM
  2. Optimising OpenGL in Blender 2.50 - swap buffers
    By mal_CanDo in forum OpenGL: Advanced Coding
    Replies: 7
    Last Post: 01-14-2009, 07:03 AM
  3. What happens to the front buffer after I swap the buffers?
    By Coconut_Crab in forum OpenGL: Advanced Coding
    Replies: 18
    Last Post: 09-08-2004, 08:30 PM
  4. OpenGL Swap Buffers Blocking.
    By MrShoe in forum OpenGL: Advanced Coding
    Replies: 15
    Last Post: 04-12-2004, 09:16 PM
  5. vertical sync and swap buffers
    By green in forum OpenGL: Linux
    Replies: 1
    Last Post: 12-19-2001, 12:35 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean