Jump to content
  • Advertisement
Sign in to follow this  

GetDC in DX7 only locks whole texture?

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

Edit Latest Added: Ok, I took out the lock and unlock, letting GetDC and ReleaseDC do the locking. It now works exactly as fast as the DX8 version. I now have two identical functions performed in DX7 and DX8 executables. They both perform the exact same frame rate, even though I have an extra BitBlt in the DX7 version (which will be replaced by the video frame render). Evidently the extra padding does not take much time to copy out through the AGP port upon texture unlock (when I releaseDC). My laptop has no HAL (have to use RGB) but my desktop has HAL. On both machines DX7 works just as fast as DX8 for this operation. I'm wondering if DX7 kept a record of what areas I actually blitted to or whether DX7 is just slightly faster than DX8, even on my 2D-hostile desktop machine. I'm happy now with being able to use TLVertex Quads in DX7 to accomplish 2D on machines that have worse than no 2D acceleration. I had promised a post of my experimental results, which I will do when I try this on all the machines I can get my hands on. When that happens I'll make a fresh post. Original post below: In DX8 I was able to limit the copying by locking a smaller rect than the whole texture. In DX7 I tried the same thing, but then my GetDC failed (returned null). I read in SDK that GetDC implicitly locks the texture and ReleaseDC implicitly unlocks the texture. I also read here http://www.gamedev.net/community/forums/topic.asp?topic_id=265903 that "4) Things such as a locked surface could also cause that error." (referring to null return from GetDC). OK, I'll byte. If I just do a GetDC without locking it first I have no choice but to end up locking the whole texture, right? I mean, if that's the case, the time saved by rendering video straight to the DC gets used up by DX7 having to copy all the padding margins upon unlock. I might as well use my own copymemory routine I developed for DX8 within DX7 too. I like DX7 for "out of the box" compatibility with more machines but I think I'll not be saving any time using GetDC. Right? [Edited by - inspired on September 29, 2006 11:56:45 AM]

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!