Archived

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

Griffithsu

LPD3DXSPRITE drawing problem

Recommended Posts

Griffithsu    122
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
DrunkenHyena    805
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
eFoDay    300
I think you need to have no filtering when you load the texture
in the call to D3DXCreateTextureFromFileEx use D3DX_FILTER_NONE

Share this post


Link to post
Share on other sites