Archived

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

Ro

Advice on GetDC()/ReleaseDC()

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