[5/10] d3dx9: Implement D3DXLoadSurfaceFromSurface

Tony Wasserka tony.wasserka at freenet.de
Fri Jun 26 07:02:36 CDT 2009


> Watch out, some surfaces aren't lockable. I don't know the d3dx9 api too well, 
> but are you sure that you have a lockable surface here?
> In some situations IDirect3DDevice9::UpdateSurface or 
> IDirect3DDevice9::StretchRect may be a faster way to achieve what this code 
> does(without colorkeying though).

Hi, 
The function just fails with D3DXERR_INVALIDDATA if the surface is not lockable, just as
D3DXLoadSurfaceFromMemory will when it's implemented.
Of course UpdateSurface could be used, but as you said it doesn't support color keying (nor palettes I guess)
or filtering and it only works in very specific cases (i.e. same dimensions, no color keying, no filtering), applications are more likely to do things like that on their own probably. D3DX has been created for the general case mostly, so optimizations like this would just make the code more complicated ;)

Tony





More information about the wine-devel mailing list