Archived

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

maymer75

Loading compressed textures with DX8

Recommended Posts

Hi, I''ve got a question about using compressed textures with DX8. Basically I''d like to use the D3DPOOL_DEFAULT pool for my textures but I can''t find a way to load them (I don''t have a .DDS file for individual textures but just the raw bytes that I need to put into the surface). With the MANAGED pool it''s easy, just lock the texture and copy it. DEFAULT pool won''t let me lock it. So what I did is use CreateImageSurface() to get a surface I can lock, copy the data into that surface, then use D3DXLoadSurfaceFromSurface() to copy the image surface into the first surface level of the texture. This works fine for non-compressed formats but when I try to do this with a compressed texture the D3DXLoadSurfaceFromSurface() gives me this error in the debug console: Direct3D8: (ERROR) :Hardware Blt failed. CopyRects failed None of the documentation I can find suggests that this function should fail in this case but I guess it does. Anyway so has anybody found a way to load a compressed texture into the DEFAULT pool?

Share this post


Link to post
Share on other sites