Results 1 to 6 of 6

Thread: Double Buffering

  1. #1
    Junior Member Newbie
    Join Date
    Jan 2003
    Location
    Montreal,Qc,Canada
    Posts
    9

    Double Buffering

    Hello,
    I'm doing a 2d game in OpenGL (I know it sounds weird but I have to...).

    I'm wondering how I can use more video buffers to accelerate the rendering of my data to the screen.

    I want to store my background in one buffer(#2) my sprites in another buffer(#3) and draw the scene on buffer #1 copying the back from the buffer #2 to the buffer #1 and then the sprites over the back from the buffer #3 to the buffer #1

    When I'm using glDrawPixel to draw my image on the screen it reads from the CPU memory each time it draws to the scene. I'm wondering if glDrawList() could also be used???

    Thanks to everyone for the infos.

    Mr Pink

  2. #2
    Halcyon
    Guest

    Re: Double Buffering

    I don't know exactly how to do triple buffering in OpenGL, but i can get at the second question. You can store vertices and pixels in display lists and they are stored on the GPU memory. So just load up your image data into a display list and call it when you are rendering.

    - Halcyon

  3. #3
    Senior Member Frequent Contributor
    Join Date
    Aug 2000
    Location
    Cardiff University
    Posts
    653

    Re: Double Buffering

    Store your background as a texture and just map it to a quad and draw your scene as normal. If your background changes do an offscreen render to texture...

  4. #4
    Senior Member Frequent Contributor
    Join Date
    Nov 2002
    Location
    Latvia
    Posts
    626

    Re: Double Buffering

    Double buffering means you have to "plates" you can draw to. You clear current backbuffer(plate) then draw elements one by one, then call swapbuffers. So it comes in front in one piece and the second one becomes backbuffer, that's only to prevent flickering for every element, for advanced purposes you can use only pbuffers.

  5. #5
    Junior Member Newbie
    Join Date
    Jan 2003
    Location
    Montreal,Qc,Canada
    Posts
    9

    Re: Double Buffering

    Thanks to everyone who answered !

    I may not have been really clear in my question.....

    In fact, I know about Page Flipping (using the Back buffer to draw then flipping at the VBL interupt so the Back becomes front and vice-versa).

    What I want to do is use another buffer in addition to those 2 that would permit me to draw my back on.

    This way when I would draw the background in the back buffer (which I'll eventually flip with glxSwapBuffer) I would just have to copy the back from video memory to video memory.

    Otherwise it's too slow...

    I'm really interested in the drawlist thing but I've tried many things and I really can't figure out what to put in between the BeginList and the EndList???


    the glDrawPixel works between these but it doesn't seem to increase the number of frames per second.


    Thanks to everyone,

    Mr Pink

  6. #6
    Member Newbie
    Join Date
    Jun 2002
    Posts
    33

    Re: Double Buffering

    Hi,

    I amjust a newbie but I think what is being suggested is that the glcopypixel command is very slow. The quick way to draw your image is to load you background as a texture. As well as the forground stuff. Then draw the background first as a texture then all the 2D elements over the top. As a texture this should easily have enough speed for most applications (I think). The display list is then you quad (with the bind texture in can't remeber if you can do this). This should be really quick,

    fringe

Similar Threads

  1. Double buffering
    By link19 in forum OpenGL: Basic Coding
    Replies: 18
    Last Post: 10-28-2003, 09:48 AM
  2. double buffering
    By cobbal in forum OpenGL: macOS
    Replies: 1
    Last Post: 03-17-2003, 05:27 PM
  3. Double buffering
    By Corillian in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 02-19-2001, 07:31 PM
  4. double buffering
    By niranjan in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 01-09-2001, 07:08 PM
  5. Help with Double Buffering
    By Zackiepoo in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 03-19-2000, 10:18 AM

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