Jump to content
  • Advertisement


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


Advice on GetDC()/ReleaseDC()

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

My game runs in an MFC SDI window. I have little objects running around on an overview of my world. I''m using GetDC()/ReleaseDC() on the backbuffer to display text about the object next to each little object. According to the DX API, it states that using GetDC() takes the Win16Mutex lock which disables the GDI for the time it''s in the lock. Now, I was wondering which would be a better thing to do: 1) Call GetDC() on the backbuffer and draw all of the text that are next to the objects in one fell swoop. 2) Or for each object call GetDC()/ReleaseDC() to draw the text associated with the object. When there are a lot of the objects, Windows seems to get really sluggish - I assume due to the Win16Mutex lock. Correct me if I''m wrong. I want to minimize this sluggishness. Option 1 would do it all at once while Option 2 might be better since maybe other Windows messages could be processed after a GetDC()/ReleaseDC() block has been processed. I''m not sure which is better. Which algortithm do you guys use in this case? Also, is there a way to make GetDC() not take the Win16Mutex lock?

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!