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
    2

    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
    2

    Re: Rendering in two different windows

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

Similar Threads

  1. Windows and Offscreen Rendering
    By irishtexan in forum OpenGL: Windows
    Replies: 1
    Last Post: 12-11-2011, 02:39 PM
  2. Multiple Rendering Windows
    By SeanAustin in forum OpenGL: Advanced Coding
    Replies: 3
    Last Post: 08-20-2009, 11:43 AM
  3. rendering in multiple windows ...HELP
    By vietlf in forum OpenGL: Advanced Coding
    Replies: 0
    Last Post: 11-23-2003, 12:57 PM
  4. Multiple Rendering Windows (MFC)
    By GoatNat in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 04-14-2001, 05:44 AM
  5. Multithreaded rendering in Windows
    By skippyj777 in forum OpenGL: Advanced Coding
    Replies: 2
    Last Post: 08-27-2000, 01:08 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean