Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 3 of 3

Thread: How to retain previous image in the frame buffer

  1. #1
    Junior Member Newbie
    Join Date
    Sep 2011
    Posts
    2

    How to retain previous image in the frame buffer

    Hi
    I would like to load a model and then render it, I would then like to move the model and render it again but still keep an image of the initial rendering on the screen.(Displaying two of the model)

    Is it possible to add further information to the framebuffer without deleting the previous contents.

    Any pointers in the right direction would be greatly appreciated.

    all the best

    fred

  2. #2
    Senior Member OpenGL Pro BionicBytes's Avatar
    Join Date
    Mar 2009
    Location
    UK, London
    Posts
    1,165

    Re: How to retain previous image in the frame buffer

    Sounds like you would be best rendering to an offscreen buffer and then that is automatically available as a texture afterwards. Look up Frame Buffer Objects (which is an extension for GL 2.x, but part of core GL 3.x).
    Another way would be to copy the main window to a texture after you have initially drawn the model.
    This method has the advantage that it's available no matter which GL version you are using and is dead simple to implment:
    Code :
       glBindTexture (GL_TEXTURE_2D, texture.id);
       glCopyTexSubImage2D(GL_TEXTURE_2D,0,0,0, 0,0,texture.image.sizex, texture.image.sizey);

  3. #3
    Junior Member Newbie
    Join Date
    Sep 2011
    Posts
    2

    Re: How to retain previous image in the frame buffer

    Thanks for that i'll take a look

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •