Archived

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

if (!wglMakeCurrent(NULL,NULL))

This topic is 5776 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

yes, you would want to be sure you released the rendering context. let''s say you are in the middle of a "glBegin/glEnd" block, OpenGL may still be sending rendering commands. at this moment in time you probably won''t be able to release the rendering context.

To the vast majority of mankind, nothing is more agreeable than to escape the need for mental exertion... To most people, nothing is more troublesome than the effort of thinking.

Share this post


Link to post
Share on other sites
from the MSDN....

The wglMakeCurrent function makes a specified OpenGL rendering context the calling thread''s current rendering context. All subsequent OpenGL calls made by the thread are drawn on the device identified by hdc. You can also use wglMakeCurrent to change the calling thread''s current rendering context so it''s no longer current.

BOOL wglMakeCurrent(
HDC hdc, // device context of device that OpenGL calls are
// to be drawn on
HGLRC hglrc // OpenGL rendering context to be made the calling
// thread''s current rendering context
);

Parameters
hdc
Handle to a device context. Subsequent OpenGL calls made by the calling thread are drawn on the device identified by hdc.
hglrc
Handle to an OpenGL rendering context that the function sets as the calling thread''s rendering context.
If hglrc is NULL, the function makes the calling thread''s current rendering context no longer current, and releases the device context that is used by the rendering context. In this case, hdc is ignored.

Return Values
When the wglMakeCurrent function succeeds, the return value is TRUE; otherwise the return value is FALSE. To get extended error information, callGetLastError.

To the vast majority of mankind, nothing is more agreeable than to escape the need for mental exertion... To most people, nothing is more troublesome than the effort of thinking.

Share this post


Link to post
Share on other sites
I dunno how far off I am, but are you aware that

if (!wglMakeCurrent(NULL,NULL))

actually calls the function wglMakeCurrent(), and then checks its return value to see if it has succeeded or failed?

Sorry if I''m way off, I just got the feeling that''s what was stumping you.

Share this post


Link to post
Share on other sites