Lesson 6 on nehe only loads 256x256 bmp

Started by Fcuk, May 06, 2006, 18:32:23

Previous topic - Next topic

Fcuk

hi everybody

i tried the lesson6 tutorial on nehe and tried to do the same but the problem is that the loadTexture method only loads 256x256 bitmaps.

I can't understand why.. how could I load other resolutions bitmaps?

thx

WiESi

With GL_TEXTURE_2D you can only load textures with the size 2^n, like 1x1, 2x2, 4x4, 8x8, 16x16, 32x32, 64x64, 128x128, 256x256, 512x512, ...
If you want to use textures with other sizes use something like GL_TEXTURE_RECTANGLE_ARB.
You first have to call glEnable with ARBTextureRectangle.GL_TEXTURE_RECTANGLE_ARB and then use ARBTextureRectangle.GL_TEXTURE_RECTANGLE_ARB instead of GL_TEXTURE_2D in all the other methods.

WiESi

darkprophet

256x128 is valid ;)

The length of each dimension has to be POT, but older cards (im thinking Voodoo) can only deal with square textures, but anything newer than a voodoo will be fine with each dimension being POT but not necessarily the same..

DP