can't load non power of 2 textures!?

I’ve loaded textures for a long time, and I thought I knew what I was doing, but I’m posting this in beginners since it seems like such a simple problem. I load my texture something like:

glTexImage2D(GL_TEXTURE_2D,0,3,512,256,0,
GL_RGB,GL_UNSIGNED_BYTE,TexFile);

This works just fine, but if I would have substituted say a 200x100 texture file, and put 200 in the place of 512 and 100 in the place of 256, the texture always shows up as white! Note: I’ve loaded textures with alpha channels, different mipmap levels, different file formats, etc., so I at least somewhat know what I’m doing here. I read ogl can handle any arbitrary texture size, isn’t this true?
I’d appreciate anything that would help me resolve this seemingly simple problem.
-bill

Read: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/opengl/glfunc03_16jo.asp
and: http://oss.sgi.com/projects/ogl-sample/registry/NV/texture_rectangle.txt

Wow, I’m suprised. Thanks much… I’ll look into using that extension. Its an NV extension, does that mean it won’t work with ATI cards?

Check if your card advertises an extension which allows to use rectangular textures.

A simpler way would be to use gluScaleImage or gluBuild2DMipmaps which itself uses gluScaleImage to scale the textures to the next power of two sizes for you.

Alright great… couldn’t be a simpler answer, but I appreciate it cause it would have taken me hours to figure out wtf is going on on my own. I’ll see how distorted the textures are using those commands, thx again!

ATI ICDs advertise EXT_texture_rectangle since Cat 3.2, I think. Good news: the enumerant values are the same as for NV_texture_rectangle.

A simpler way would be to use gluScaleImage or gluBuild2DMipmaps which itself uses gluScaleImage to scale the textures to the next power of two sizes for you.
Note that glu functions aren’t aware of GL extensions, and don’t understand packed pixels and compressed textures.