Results 1 to 4 of 4

Thread: wglMakeCurrent

  1. #1
    Junior Member Newbie
    Join Date
    Feb 2001
    Location
    Apopka, FL USA
    Posts
    2

    wglMakeCurrent

    okay, a win32 question.

    you set the rendering context with
    wglMakeCurrent ( hDC, hRC );

    but why is it that you clear it with
    wglMakeCurrent ( NULL, NULL );

    shouldn't you assign a null rendering context
    to the DC for the window?

    wglMakeCurrent ( hDC, NULL );

    every tute/doc i've seen (for win32) does
    this. any idea why?

  2. #2
    Senior Member Regular Contributor
    Join Date
    May 2001
    Location
    London UK
    Posts
    195

    Re: wglMakeCurrent

    I think it is logical to the make the calling thread's current rendering context no longer current with wglMakeCurrent( NULL, NULL). If hRC is NULL is hDC ignored so you could use it the way you prefer.

  3. #3
    Junior Member Newbie
    Join Date
    Feb 2001
    Location
    Apopka, FL USA
    Posts
    2

    Re: wglMakeCurrent

    yeah, but can't a calling thread have more
    than one window? does win32 actually go
    through each and every window of the calling
    thread and set its rendering context to null?
    just curious, because well
    wglMakeCurrent (NULL, NULL) doesn't seriously
    look right. it looks like it's just setting
    the RC for the NULL window to NULL.
    i always use what i said above, but it got
    me wondering when my friend pointed it out to
    me.

  4. #4
    Senior Member Regular Contributor
    Join Date
    May 2001
    Location
    London UK
    Posts
    195

    Re: wglMakeCurrent

    If you want the OpenGL machine to write to a window win with the hardware settings hw_settings:
    wglMakeCurrent(win, hw_settings);

    If you want to reset the hardware settings would it perhaps be better to have a special function like:
    wglResetCurrent();
    In the MS OpenGL implementation do you call wglMakeCurrent with a NULL second argument. To me is (NULL, NULL) closer to (void) than (win, NULL) so I prefer the first.

    It seems like you are thinking of the rendering context as settings for the window but it is more like settings for the hardware.

Similar Threads

  1. wglMakeCurrent
    By sammie381 in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 11-03-2008, 12:01 AM
  2. wglMakeCurrent() ???
    By andreasMank in forum OpenGL: Windows
    Replies: 1
    Last Post: 04-16-2004, 04:08 PM
  3. wglMakeCurrent in W2K/XP
    By in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 07-07-2002, 12:31 PM
  4. wglMakeCurrent
    By DUMEZ in forum OpenGL: Advanced Coding
    Replies: 3
    Last Post: 06-27-2000, 01:29 AM
  5. GPF in wglMakeCurrent()
    By JJ in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 06-13-2000, 02:17 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