GL_TEXTURE_RECTANGLE_NV problem

Started by
2 comments, last by Zipster 16 years, 11 months ago
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
Advertisement
Are you checking for gl errors?

Sprinkle glGetError everywhere.
Sig: http://glhlib.sourceforge.net
an open source GLU replacement library. Much more modern than GLU.
float matrix[16], inverse_matrix[16];
glhLoadIdentityf2(matrix);
glhTranslatef2(matrix, 0.0, 0.0, 5.0);
glhRotateAboutXf2(matrix, angleInRadians);
glhScalef2(matrix, 1.0, 1.0, -1.0);
glhQuickInvertMatrixf2(matrix, inverse_matrix);
glUniformMatrix4fv(uniformLocation1, 1, FALSE, matrix);
glUniformMatrix4fv(uniformLocation2, 1, FALSE, inverse_matrix);
yup I'm checking them. No errors, all is good. :(


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.

This topic is closed to new replies.

Advertisement