View Full Version : Texture map (non power of two)

08-02-2009, 11:01 PM
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

08-03-2009, 03:12 AM
Check whether your hardware supports the ARB_texture_non_power_of_two (http://www.opengl.org/registry/specs/ARB/texture_non_power_of_two.txt) extension or not. You may also use the ARB_texture_rectangle (http://www.opengl.org/registry/specs/ARB/texture_rectangle.txt)

08-03-2009, 08:26 PM
Please tell me how to check it.

08-04-2009, 01:54 AM
const GLubyte* c = glGetString(GL_EXTENSIONS);
bool supported = strstr(c,"ARB_texture_non_power_of_two") != 0;

08-04-2009, 02:55 AM
Please tell me how to check it.

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.

08-04-2009, 07:07 PM
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

08-05-2009, 02:52 AM
I can't believe you succeeded to run any Opengl program with such a glx output! :)

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.