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: get back buffer DC

  1. #1
    Junior Member Newbie
    Join Date
    Feb 2000
    Posts
    4

    get back buffer DC

    Hi,

    I'm trying to use GDI function(ex BitBlt) at back buffer. However, I could not find any information about getting HDC for back buffer. When I call wglGetCurrentDC, it seems like I got DC for front buffer.

    How can I get HDC for back buffer?

    Any help will be appreciated.

    Jeff

  2. #2
    Senior Member OpenGL Pro
    Join Date
    Feb 2000
    Location
    France
    Posts
    1,118

    Re: get back buffer DC

    You can not use GDI functions with OpenGL.
    That's a limitation and you can not do anything about it...

    If you want to access the Front or Back buffer, you have to use glReadPixels/glDrawPixels after having selected your buffer.

    What do you want to do exactly ?

    Eric

  3. #3
    Junior Member Newbie
    Join Date
    Feb 2000
    Posts
    4

    Re: get back buffer DC

    I'm doing some unusual thing.(Everyone thinks he's doing unusual thing :-)

    I made an openGl wrapper which converts Quake3 into stereoscopic Quake3.

    With the wrapper, I intercept some OpenGl calls and render twice at different viewpoints. Now I got an Side-by-Side image where a Left-eye-viewed image is in the left half of the screen and right-eye-viewed one in the right half.

    I'm using VRJOY, a 3D glasses which needs a interleaved stereoscopic image. That is, Left image should be in add lines and Right image in even lines.(or vice-versa).

    I have to make an interleaved image from side-by-side one.

    I tried glCopyPixel but it was very slow. Also, I tried stencil buffer but it seed like most of opengl accelerator does not support stencil buffer. Software stecncil operation was very slow.

    So, I tried to use "BitBlt" or "stretchblit" to make an interleaved image. To do this, I need to access the back buffer.

    I also tried to use DirectDraw surface because DirectDraw's Blit is very fast and most of VGA card supports hardware blitting. However, when DDraw take over the full screen, I could not accss the OpenGL's front(back buffer too) buffer. I think the front buffer DC is lost when DDraw prevails.

    That's what I'm doing. I thought it would be easy to make an interleaved image once I have a Side-By-Side image. Now I'm feeling shortage of OpenGL function. Well.. anyway basically OpenGL is just for 3D. I think 2D support should be done by O/S.

    Is there anyone who can help me with this?
    I can offer some money. :-)

    Jeff

Posting Permissions

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