Texture map (non power of two)

i rendered image using texture map 1024*512 (power of two) correctly. but i am not able to do it using non power of two. can any one help me what to do to render non power of two images using texture maps.

Thanks in advance

Check whether your hardware supports the ARB_texture_non_power_of_two extension or not. You may also use the ARB_texture_rectangle

Please tell me how to check it.

const GLubyte* c = glGetString(GL_EXTENSIONS);
bool supported = strstr(c,“ARB_texture_non_power_of_two”) != 0;

And if you want to quickly see the hardware capabilities there are some opengl extension viewer like:

Works on Windows and Mac.

On linux, with X window system, just type: “glxinfo” in command line.

I am getting error as below

[root@localhost ~]# glxinfo
name of display: :0.0
X Error of failed request: BadAlloc (insufficient resources for operation)
Major opcode of failed request: 143 (GLX)
Minor opcode of failed request: 3 (X_GLXCreateContext)
Serial number of failed request: 16
Current serial number in output stream: 17

I can’t believe you succeeded to run any Opengl program with such a glx output! :slight_smile:

Looks like the driver hasn’t been installed correctly. Try to reinstall it, reconfigure the X server (dpkg-reconfigure xserver-xorg) and reboot.
If the problem persists I advise you to ask on your linux distribution forums.