🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Direct Draw lockup

Started by
2 comments, last by Glavian 24 years, 5 months ago
I''m running Win95(I believe its the original version) with DX7 on my computer, when I try to get the DC with the call GETDC(), for a Direct Draw Surface4 my computer completely locks up inside the function, I have the latest drivers for my ATI Rage Pro card. Anybody know what is causing this?
Advertisement
Which surface are you trying to get a HDC for? GetDC locks the surface, and sometimes this lock will cause a debugger to not work until it''s unlocked (It shouldn''t lock up if you just run it without breaking into it). If you''re having problems when running it normally, I''d beware of anything between the GetDC and ReleaseDC, not just the calls themselves, as if you have a bug between them (causing it to crash/freeze), when you debug it the locking action of GetDC might get in the way(before the real bug is reached). See if you can just do a GetDC and ReleaseDC right after, then breakpoint after the ReleaseDC. If you get that far, the bug is most likely something between your Get/ReleaseDC pair.


-ns-
-ns-
Why are you getting an HDC for a DirectDraw surface? Thats not something you would normally want to do. Are you trying to do that because you want to write fonts onto the surface or create window controls? If thats the case, then getting the HDC would be fine. however, before you do anything else to the surface, remember to release the HDC with lpDDSurface->ReleaseDC(hdc) or your program will basically just mess up and have unpredictable results.
The ReleaseDC thing worked, I had a bug between the GetDC and the ReleaseDC, so the program was running but I wasn''t seeing anything on the screen because of the DC wasn''t released. The reason I am getting the DC is I''m trying to hack an opengl port with a DirectDraw Surface. Thanks for the help.

This topic is closed to new replies.

Advertisement