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: Rendering in two different windows

  1. #1
    Junior Member Newbie
    Join Date
    May 2001
    Location
    Cali, Colombia
    Posts
    1

    Rendering in two different windows

    Based on Nehe tutorials, I am rendering OpenGL in a a child of one window in my Win32 API app. Now I need to render on a child of -another- window in my app. Currently, in WM_CREATE for each child window I do something like:

    case WM_CREATE:
    ....
    openGLOk=CreateGLWindow(hwnd);
    ....
    break;

    ....

    case WM_PAINT:
    wglMakeCurrent(hDC,hRC);
    GLDrawScene();
    SwapBuffers(hDC);
    wglMakeCurrent(NULL,NULL);
    ....
    break;

    I do the same for both windows. Of course, different hRC and the hDC of each corresponding windows. hRC, hDC for each different child has a different name and is in a different file which contains the different window procedure.

    Only one of the OpenGL window is shown rendering. If I comment out the call to CreateGLWindow of the one showing, it will then show the other one.

    Note that each child window is calling different versions of CreateGLWindow and the other initializing functions. I did this while experimenting. Will create a single function for both child windows when I get this working, which passed the RC and DC as arguments.

    CreateGLWindow is based on nehe.gamedev.net tutorials, and is working well (at least for one window). Just the normal GL under win32 API creation stuff... pixel format, getting a RC based on the DC, etc.

    Later, thanks for any help!!

  2. #2
    Guest

    Re: Rendering in two different windows


  3. #3
    Junior Member Newbie
    Join Date
    May 2001
    Location
    Cali, Colombia
    Posts
    1

    Re: Rendering in two different windows

    Hey, I know you! Got me all excited when I saw a reply...

Posting Permissions

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