Jump to content
  • Advertisement
Sign in to follow this  
Sangha Im

[D3D] My sprite is stretched, help!!

This topic is 3894 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'm using directX9 and C++. This is a d3dxsprite interface practice program I just wrote. Everything works fine, but the image is weirdly stretched as it is stored as a texture format (does it have to do with mipmap? ex) 256x256 128x128 64x64 512x512) I want my thingies to be printed exactly as shown in pixel size. What can I do to achieve the desired result, except going to mspaint and edit every single images into those mipmap chain sized format? Thanks!

Share this post


Link to post
Share on other sites
Advertisement
Look into D3DXCreateTextureFromFileEx and specify D3DX_DEFAULT_NONPOW2 in the width and height. If the device supports non power of 2 textures it will not be scaled[wink]

Share this post


Link to post
Share on other sites
Quote:
Original post by thallish
Look into D3DXCreateTextureFromFileEx and specify D3DX_DEFAULT_NONPOW2 in the width and height. If the device supports non power of 2 textures it will not be scaled[wink]


Thanks a lot! I found a paragraph about this problem in Frank D. Luna's book, but I did not know where to put D3DX_DEFAULT_NONPOW2. It's working great. :D

D3DXCreateTextureFromFileEx( g_pd3dDevice, TEXT("keen.bmp"), D3DX_DEFAULT_NONPOW2, D3DX_DEFAULT_NONPOW2 , D3DX_FROM_FILE,
D3DUSAGE_RENDERTARGET, D3DFMT_UNKNOWN, D3DPOOL_DEFAULT, D3DX_DEFAULT, D3DX_DEFAULT, NULL, NULL, NULL, &pKeen);

That's my new function call. =] Thanks again!

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!