Jump to content
  • Advertisement

Archived

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

Griffithsu

LPD3DXSPRITE drawing problem

This topic is 5196 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
Advertisement
hm. i don''t think 800x600 is a power of 2. i''m not sure it that''s the problem, though. probably not.

ciph

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
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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!