texture mapping in opengl

Hey guys,

i am new in opengl and I am trying out texture mapping. I see that Opengl restricts that the texture has to be in squares like 88, 1616…

Is there anyway I can map a texture without this restriction? Like 640*480 or something?

Please let me know, if this can be done.

Thank you,

regards,

Siddharth

You need to use power-of-2 (POT) dimensions, unless you use texture rect (non-normalized texcoords) or non-power-of-2 textures (NPOT) (requires newer cards).

You can always use a texture with the next POT in each dimension and adjust your texcoords accordingly.

Opengl documentation trifecta:
http://www.rush3d.com/reference/opengl-redbook-1.1/
http://www.opengl.org/documentation/spec.html
http://oss.sgi.com/projects/ogl-sample/registry/

Hi !

Please try

*** Chris Leathley’s *** Texture Loader
(Based on Jeff Molofee’s IPicture Basecode)

Link:

http://members.iinet.net.au/~cleathley/openGL/TextureLoader.htm

http://members.iinet.net.au/%7Ecleathley/openGL/TextureLoader.zip

Have Fun !