Sign in to follow this  

Dissecting Sprites in DirectX9

This topic is 3630 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi everybody, I'm currently working on a 2d game engine which is going to have some obscenely large sprites, and the problem I've ran into is that directx has a texture size limit (depending on the graphics card) where as a surface, can be as large as it needs to be. I figured I'd keep all my graphic files in original (bloody huge) size, then load them into a surface and then cut them up into small tiles and store them as textures (along with different mipmap levels), the idea being I can then make a game with stupidly high res 2d graphics and have a zooming/mipmap system. Anyhow, I found this nice little guide (on this very website).. Dissecting Sprites in direct3D written for Directx8, ported it across to directx9. The only changes I had to make (other than renaming all the direcx8 stuff to 9) was I swapping a couple of fuctions around, but I believe they behave the same way (all the new flags were optional so I left them as null).. 'CreateImageSurface' changed to 'CreateOffscreenPlainSurface' and 'CopyRects' changed to 'UpdateSurface' Alas, after rewriting my entire texture handling system, blit routine and loading system to incorporate it, it doesn't seem to work, the sprites just appear as black squares. I went back and applied the changes to the original 'example' and that had the same result, so it wasn't something else with my game engine messing it up, it just doesn't work when ported to dx9. Any ideas why it might not be working? or any suggestions as to how I can go about doing the same thing with dx9? Thanks!

Share this post


Link to post
Share on other sites

This topic is 3630 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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