Loading Textures ..

Well yes another question … sorry.

All the textureloaders so far have need of a texture with size a power of 2, and I know that standard OpenGL requires this, but I though that was a way to go around this and load textures with just any size … do I make this up, or can someone help me here ?

http://www.realityflux.com/abba/loadImage.java
My very basic texture loader…
I do have another one too ;D

I think the newest cards can use textures that is not power of two. I hope I’ve not dreamed this up :slight_smile: If so there might be a vendor specific extension or there might be something in opengl 1.4, i don’t know ???

But you probably still want to use pow2 textures to be backward compatible. Then you need a texture loader that somhow makes your free size images into pow2 when they are loaded. Either the image is stretched/scaled to closest pow2, or the image is copied to a larger pow 2 texture. Although the second method requires that you change your uv coords.

I looked it up. GL_ARB_texture_non_power_of_two extension. http://oss.sgi.com/projects/ogl-sample/registry/

Thanx for the help … bu my card doesn’t have this extension I think. So it will have to be a better loader than. But the problem is off coarse then, that the loader should be transparent if you load the texture with non power of 2 for teh rest of the application …

will perhaps take a look into it later. First check the code Java Cool Dude :slight_smile: