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 2 of 2

Thread: win32, child windows, opengl

  1. #1
    Junior Member Newbie
    Join Date
    Jul 2001
    Location
    Ottawa
    Posts
    2

    win32, child windows, opengl

    I have 4 child windows in an aplication, what I want is to do is use opengl with each window, I usually use one single window with a rendering context and a device context that make opengl draw to tha window, I use a double buffer so first I draw the scene and then I send it to the window with
    SwapBuffers(handleDeviceContext);
    I learned this from nehe.
    Now is it posible to do this with some kind of handle to a device context of a child window or child windows can't have device contexts?. Or are you allowed to only have one device context in your window? I was thinking that maybe I could create diferent hDC like hDC1, hDC2... hDC4 and then draw what I want to display in child window one in the back buffer and use
    SwapBuffers(hDC1), then draw the what has to be displayed in the second child window and use SwapBuffers(hDC2) for the next one... and so on.
    Is this possible?..
    Or its better if I just create one whindow and create 4 views with opengl instead of using separate child windows..?

  2. #2
    Senior Member OpenGL Pro
    Join Date
    Jun 2000
    Location
    Shreveport, LA, USA
    Posts
    1,757

    Re: win32, child windows, opengl

    You can do it either way. If you decide to use multiple rendering contexts, you just have to be certain to make the rendering context you want to draw in current before drawing. Then when you swap buffers you must swap the proper device context. There are also other details to be aware of when using multiple rendering contexts, e.g. sharing display lists.

Posting Permissions

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