Skip to main content
GameDev.net gamedev.net
🔒 Locked

GL_TEXTURE_RECTANGLE_NV problem

Started by happygolucky Apr 30, 2007 at 4:05 PM 2 replies 2.2k views
Original Post
happygolucky
happygolucky
Hey there, I am trying to use rectangle textures using the GL_TEXTURE_RECTANGLE_NV extension, and for some reason, I can't figure out how to map that damn rectangle texture on an object. On ATI, using the respective functions and enums of GL_TEXTURE_RECTANGLE_EXT extension, it works perfectly. When it comes to use the NV extension, the texture bound on GL_TEXTURE_2D target gets used instead for texturing, even if I explicitely called: glDisable(GL_TEXTURE_2D); glEnable(GL_TEXTURE_RECTANGLE_NV); before rendering my mesh. What is wrong in the way I use that extension? Basically, the calls I make for rendering looks like this: // Render an object using a Pow Of 2 texture. glEnable(GL_TEXTURE_2D); glBind(GL_TEXTURE_2D, Tex2DRef ); // yadda yadda - setting up other stuff using target GL_TEXTURE_2D glDrawElements(); // Works fine, uses the 2D texture correctly. // Render an object using Rectangle texture. glDisable(GL_TEXTURE_2D); glEnable(GL_TEXTURE_RECTANGLE_NV); glBind(GL_TEXTURE_RECTANGLE_NV, TexRectRef ); // yadda yadda - setting up other stuff using target GL_TEXTURE_2D glDrawElements(); // Uses the 2D texture instead of the expected NV Rect texture. Any hint of what is wrong? --HappyGoLucky
V-man
V-man
Are you checking for gl errors?

Sprinkle glGetError everywhere.
happygolucky
happygolucky
yup I'm checking them. No errors, all is good. :(


Zipster
Zipster
Are you trying to use an NV extension on ATI hardware? That could be the problem :) I personally used GL_TEXTURE_RECTANGLE_ARB since it works on both.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.