LWJGL Forum

Archive => DevIL => Topic started by: Fcuk on May 06, 2006, 18:32:23

Title: Lesson 6 on nehe only loads 256x256 bmp
Post by: Fcuk on May 06, 2006, 18:32:23
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
Title: Lesson 6 on nehe only loads 256x256 bmp
Post by: WiESi on May 07, 2006, 06:28:14
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
Title: Lesson 6 on nehe only loads 256x256 bmp
Post by: darkprophet on May 07, 2006, 10:47:13
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