• Advertisement

Archived

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

irregularly sized textures

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

upto this point I have just been using D3DXCreateTextureFromFileEx to load my textures from bitmaps, but to make distribution more clean looking (2 files) I wrote up a quick packing/unpacking class for a single images file (that contains all frames of animation etc). It's a lame format, but it works Anywho... all of my 32x32 and 128x128 textures work fine, but some (like 800x600) just arent working. Now i'm wondinging how exactly am I supposed to go about getting these irregular sized textures working? Does D3DXCreateTextureFromFileEx do some extra work to make the texture fit (by stretching the existing image to fit the texture?), or is it simple like resizing the texture to something like 1024x1024 and copying the 800x600 there and ignore the rest ?_? (the method im using to get the data on the texture is the CreateTexture() then locking the bits and writing to them) [edited by - drekkar on April 10, 2004 4:05:04 PM]

Share this post


Link to post
Share on other sites
Advertisement
Some video cards can not handle nonpower of 2 textures at all, and would absolutely require you resize the texture (either up or down). Other cards may allow you to use them, but only under certain strict conditions, as listed in the DirectX9 SDK under the D3DCAPS9 Structure section. If you are not going to be meeting those requirements, then again you would be forced to resize the texture. I would not however resize the texture by increasing its size by adding borders and then changing the texture coordinates of everything that uses it. Just resize, i.e. magnify or minify each dimension as needed, so that you don't waste any video or system memory unecessarily.


[edited by - Mastaba on April 10, 2004 5:18:13 PM]

Share this post


Link to post
Share on other sites

  • Advertisement