Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


Problems with wglCreateContext()

This topic is 5749 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Here's the code:
hRC = wglCreateContext(hDC);
if(hRC == NULL)
     MessageBox(NULL, "Can not create the Rendering Context. This application will now close.", "GLCrusader", MB_OK);
//   ShutDown();

     return false;
Every time the hRC comes back NULL, and all functions taking hRC as an argument fail, but GetLastError() ( held within the function ShowLastError() ) comes back with the error code 0x00000000 ( The function completed successfuly ). Has anyone else had this problem? Does anyone know what might cause wglCreateContext() to fail? //////////// // Update // //////////// My problem was that I forgot to call SetPixelFormat() before hand. This still does not excuse the error code however. [edited by - QBRADQ on December 27, 2002 1:56:41 AM]

Share this post

Link to post
Share on other sites
The reason ShowLastError() showed success was because you called it after calling MessageBox(). It showed the result of that call, rather than the wglCreateContext() call.

Share this post

Link to post
Share on other sites
Is your PixelFormat ok ?

int PixelFormat ChoosePixelFormat(Canvas->Handle,&pfd);
isnt PixelFormat NULL ?
or what does that return ?

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!