Archived

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

LPD3DXSPRITE drawing problem

This topic is 5010 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

I displayed the 800x600 texture to a 800x600 D3Ddevice with this code and It stretches the destination rect both horizontally and vertically so that I only see about 70% - 75% of the texture. IntroMem->lpD3DSpriteBG->Draw(IntroMem->lpD3DsBackGround, NULL, NULL, NULL, 0.0, NULL, 0xFFFFFFFF ); I''m somewhat lost here because I''m not familiar with D3D and this particular LPD3DXSPRITE interface. Any help would be much appreciated.

Share this post


Link to post
Share on other sites
Whether or not your device requires it, when loading textures with the D3DX functions it will resize them to be powers of 2. In your case 1024x1024. So you''re only seeing the top-left 800x600 of your texture.

An easy solution is to scale the sprite so it fits in 800x600 when you draw it. Exactly how you scale depends on the version of D3DX you''re using.


Stay Casual,

Ken
Drunken Hyena

Share this post


Link to post
Share on other sites