Non power of two texture in DirectX

Started by
3 comments, last by viper110110 11 years, 5 months ago
I am trying to load textures in the same way as the rastertek tutorials do it, but when I get to the font tutorial, the texture for the font won't load. After some thorough detective work, I determined that it was because one of the texture dimensions was not a power of two. How can I get directx to load any texture regardless of size?

Edit: Just figured out that he uses a power of two texture for the font and posted a different texture on his website (with a bad size). Regardless, I would still like to know how to handle non-power-of-two textures
Advertisement
Which version of Direct3D are you using?
Direct3D 10 but with D3D11 installed on windows 8 and the new windows sdk
In D3D9 you have to check the 'CAPS' to see if the GPU supports non-power-of-2 (NPOT) textures or not... but D3D10 instead mandates that all D3D10 GPUs must support NPOT textures, so you shouldn't have to tread POT/NPOT textures differently at all.

What kind of errors are you getting with your NPOT texture?
E_INVALIDARG is the return value of CreateDDSTextureFromFile

I tested this by changing one of my regular textures to 307x256

EDIT: upon further digging, I have found that the function call to CreateD3DResources in DDSTextureLoader.cpp is returning this value

This topic is closed to new replies.

Advertisement