Jump to content
  • Advertisement
Sign in to follow this  

Basic question about ID3DXSprite

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

Should the texture be in power of 2 so for the ID3DXSprite::Draw method works correctly? When I use a texture with size in power of 2, like 1024x1024 or 512x2048, the second parameter from that method works fine, that is to say the portion of the source texture defined by the RECT structure is showed correctly. But in other sizes (not power of 2), the method captures a portion different from that that was defined for the RECT structure. Thanks in advance.

Share this post


Link to post
Share on other sites
Advertisement
Some video cards require power-of-two textures. Some don't. Newer ones generally don't. You can check the device capabilities either from DirectX or with the utility included in the SDK.

Chris

Share this post


Link to post
Share on other sites
For 2D, you can use non-pow2 textures too, just make sure you use D3DX_FILTER_NONE for the filters in D3DXCreateTextureFromFileEx(). Look up that function in the SDK documentation and you will get more information.

Share this post


Link to post
Share on other sites
Thanks Pipo, It was that.

Just other question: - Is there some restriction to the texture size?
For example: If each frame from the sprite has a size of 256x256, and I have 25 frames, so could I use 256x6400 instead 1280x1280?

Share this post


Link to post
Share on other sites
Texture size limits are specified in D3DCAPS9.MaxTextureWidth and D3DCAPS9.MaxTextureHeight, the limits depend on the hardware.

[Edit] yes, you could do that by then altering U and V coordinates of the texture, but be aware of texture size limitations.

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.

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

Sign me up!