PDA

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



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

dletozeun
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)

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

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

dletozeun
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:
http://www.realtech-vr.com/glview/download.html

Works on Windows and Mac.

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

jsmith
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

dletozeun
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.