Archived

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

URGENT HELP PLEASE !!!

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

i'm using opengl .. just showing an outlined font with a tga texture on the text.. at the end somehow the Device context fails to release.. and when i run the prog for the second time the pc just reboots.... can anyone give me a hand ??? thx alot (by hte way i tall KillText () before KillGLWindow () )
Metal Typhoon
[edited by - Metal Typhoon on August 28, 2002 1:07:53 AM]

Share this post


Link to post
Share on other sites
quote:
Original post by jwalker
post some code ? .
i guess its your coding which is the problem. not the opengl or the OS.

Its my duty, to please that booty ! - John Shaft


ok here it goes..

  
bool R_Ogl::Disable ()
{
if (!wglMakeCurrent (NULL,NULL))
{
MessageBox (NULL,"Error Setting Current","Disable",MB_OK|MB_ICONEXCLAMATION);
return false;
}
if (!wglDeleteContext (Rhrc))
{
MessageBox (NULL,"Error Deleting Context","Disable",MB_OK|MB_ICONEXCLAMATION);
return false;
}

if (!ReleaseDC(Rhwnd,Rhdc))
{
MessageBox (NULL,"Error Releasing Device Context","Disable",MB_OK|MB_ICONEXCLAMATION);
return false;
}

return true;
}


Metal Typhoon

Share this post


Link to post
Share on other sites
I when deselecting the hRC, try using

wglMakeCurrent(0, 0);

This is what I use, and I''ve never had any problems. I think the problem may be that if you use wglMakeCurrent(NULL, NULL), you''re not actually freeing the device context, so when you try to delete it, it''s still in use, and the system has problems...

Bear in mind that this is off the top of my head, and it could be wrong, but it''s only a little thing to change, right?


Movie Quote of the Week:

"The greatest trick the Devil ever pulled was convincing the
world he didn''t exist."

- Roger "Verbal" Kint, The Usual Suspects.

Try http://uk.geocities.com/mentalmantle - DarkVertex Coming Soon!

Share this post


Link to post
Share on other sites
quote:
Original post by iNsAn1tY
I when deselecting the hRC, try using

wglMakeCurrent(0, 0);

This is what I use, and I''ve never had any problems. I think the problem may be that if you use wglMakeCurrent(NULL, NULL), you''re not actually freeing the device context, so when you try to delete it, it''s still in use, and the system has problems...

Bear in mind that this is off the top of my head, and it could be wrong, but it''s only a little thing to change, right?


Movie Quote of the Week:

"The greatest trick the Devil ever pulled was convincing the
world he didn''t exist."

- Roger "Verbal" Kint, The Usual Suspects.

Try http://uk.geocities.com/mentalmantle - DarkVertex Coming Soon!



That worked :D thx alot

Metal Typhoon

Share this post


Link to post
Share on other sites