Part of the Khronos Group

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 4 of 4

Thread: PFD_DRAW_TO_BITMAP size limit?

  1. #1
    Junior Member Newbie
    Join Date
    Sep 2013

    PFD_DRAW_TO_BITMAP size limit?

    Hi All,

    I'm an OpenGL newbie and I have a little issue...

    I'm adding a 3D view option to a graphing program. The program draws the graphs into a bitmap DC created used CreateCompatibleBitmap, then BitBlts it onto the client area. This allows very slick panning and scaling and also makes it easy to cut and paste the graphs into documents.

    I've done the 3D view in a similar way by using PFD_DRAW_TO_BITMAP and it works very well...UNTIL the bitmap reaches about 700 x 300 pixels, when the model simply disappears!

    The bitmap size is determined by the size of the client area, so resizing the application window causes a redraw into a newly sized bitmap. The bug is quite repeatable, such that you can drag the window bigger and the model disappears at exactly the same point, then reappears when the window is shrunk back to that point.

    None of the OpenGL or windows functions seem to be failing, and it's temping to think it's a windows issue, but the graph view works a treat on huge displays.

    Any ideas?

  2. #2
    Advanced Member Frequent Contributor
    Join Date
    Jun 2013
    Quote Originally Posted by PeterHawkin View Post
    I've done the 3D view in a similar way by using PFD_DRAW_TO_BITMAP
    Note that PFD_DRAW_TO_BITMAP forces the use of the built-in, OpenGL 1.1-only software renderer.

    If you want better performance or to use later features, you can render to an FBO then extract the image data with glReadPixels().

    Other than that, be sure to check any implementation limits against the PFD_DRAW_TO_BITMAP context, not against a context created for a window, as the two will be using different drivers.

  3. #3
    Junior Member Newbie
    Join Date
    Sep 2013
    Thanks G - I'll look into the FBO thing. If someone can point me in the direction of a simple tutorial for using an FBO (I don't need texturing).

    In the meantime, I've limited the size of the bitmap and it seems to be working OK,


  4. #4
    Member Regular Contributor
    Join Date
    Apr 2009
    You can start here:

Posting Permissions

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