Results 1 to 2 of 2

Thread: wglMakeCurrent - strange error

  1. #1
    Junior Member Newbie
    Join Date
    Jun 2009
    Posts
    4

    wglMakeCurrent - strange error

    I have a strange error with wglMakeCurrent.

    In my application there are multiple threads which are rendering to one single context. The draw Operations are secured by a Semaphore, so the threads should not interfere with each other.

    Each thread basically looks like this

    Code :
    GetSemaphore()
    wglMakeCurrent(context,0);
     
    Draw(); // this is where all drawing is done
     
    wglMakeCurrent(NULL,NULL);
    ReleaseSemaphore()

    Now, whenever i call wglMakeCurrent(NULL,NULL); i get an OpenGL error GL_INVALID_OPERATION.

    The strange thing is that everything is rendered exactly as it should be and wglMakeCurrents always returns TRUE ... so i would expect that there was no error. OpenGL seems to think different.

    Does anyone have an idea what the problem could be?

  2. #2
    Senior Member Regular Contributor
    Join Date
    Aug 2005
    Posts
    145

    Re: wglMakeCurrent - strange error

    For one thing you need to make sure you release your context in the current thread (which I believe will flush the command buffer - see the MSDN on Windows); otherwise you'll likely get an invalid handle error on e.g. SwapBuffers (check GetLastError on Windows).



Similar Threads

  1. strange vao error
    By vincent71 in forum OpenGL: Basic Coding
    Replies: 13
    Last Post: 04-27-2018, 02:26 AM
  2. FBO and wglMakeCurrent... strange slowdown every 10frames
    By ChiefWiggum in forum OpenGL: Advanced Coding
    Replies: 17
    Last Post: 10-22-2005, 07:27 AM
  3. wglMakeCurrent fails with GL_INVALID_OPERATION error
    By stevel in forum OpenGL: Windows
    Replies: 0
    Last Post: 10-14-2004, 02:00 PM
  4. Pbuffers, wglMakeCurrent, Run Time Error
    By drahei_c in forum OpenGL: Advanced Coding
    Replies: 5
    Last Post: 06-28-2003, 08:04 AM
  5. Strange error
    By Psyche_BW in forum OpenGL: Linux
    Replies: 4
    Last Post: 09-13-2001, 07:08 AM

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