Sign in to follow this  

GetDC in DX7 only locks whole texture?

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 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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this