Texture file theory question

Started by
2 comments, last by DividedByZero 10 years, 2 months ago

With functions like D3DXCreateTextureFromFile() and the likes, does this effectively create a new texture page for each call?

I am planning on creating only a few texture files and have each sprite etc.. drawn from this, having each frame on the one bitmap image. Would doing this be more efficent for the graphics card or does it not really make a difference?

Thanks in advance :)

Advertisement

D3DXCreateTextureFromFile Create a new texture from a file on disk for u. And load it into your GPU!

After created u can use it freely! until u release it!

It seems that u want to use it for your 2d project! with d3dxSprite. It's adviced to use texture atlas, group many sprite into 1 texture for performance!

If you were to put multiple frames of a sprite onto the same texture, then you can potentially make rendering of many instances of that sprite more efficient since you'll have to change textures less often. But honestly, it's probably not going to matter unless you get into the range of > 1000 draw calls. So I would just go ahead and do whatever is easiest.

Awesome. Pretty much how I understood it then.

Thanks guys!

(voted up) :)

This topic is closed to new replies.

Advertisement