Delen via


A break from our regular programming

Have you ever tried to use UpdateTexture in D3D to push a texture from system memory to video memory?

Maybe I am a bit dense, but my first interpretation of this page:

https://msdn.microsoft.com/library/default.asp?url=/library/en-us/directx9_c/IDirect3DDevice9__UpdateTexture.asp

Gave me the impression that the *destination* texture should be dirty for this to work. But the *source* is the one that you have to dirty.

Reading the "Texture Dirty Regions" topic in the SDK gave me the insight. For some reason when I first looked at the API I figured that you would mark the areas of destination that you want to be updated (kind of like how you do InvalidateWindow on a HWND in Win32) but it turns out to work in the reverse.

Comments