Archived

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

SikCiv

Textures and Surfaces? Another SDK error :(

Recommended Posts

Basically what I''m trying to do is copy a part of a texture located in SysMem to a texture in VidMem. The SDK docs are incorrect concerning the texture routines, it mentions you can use device->CopyRects(..) to copy a texture to another texture, but its clearly meant for Surfaces only, which really only leaves UpdateTexture to be used, but when I use it, it returns D3DERR_INVALIDCALL so im left in the cold I even put the src texture in system memory and the dest texture in the MANAGEDPOOL (VidMem), and made sure the texture formats are the same, with no luck. And of course there are no SDK samples using UpdateTexture().. 1) Is there another function I can use? 2) Can you use CopyRects() using a modifier/cast? Textures and surfaces are the same except for a certain flag right? 3) Can you lock the textures and use memcpy to ''blit''? Though I read you cannot lock vidmem textures. Demo Download: www.angelfire.com/realm/zeroone

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
IDirect3DTexture8::GetSurfaceLevel(..) should match your needs...

Share this post


Link to post
Share on other sites
All righty then, so a texture is basically a container for surfaces, thanks ''Anonymous Poster'', it compiles ok now an i''ll try it later when I get to my GeForce card.

Too bad Micro$oft didnt mention that in the SDK

Demo Download: www.angelfire.com/realm/zeroone

Share this post


Link to post
Share on other sites