Hi,
I’d be very grateful if someone could tell me where I’m going wrong in trying to use non power of two dimension textures. Here is my code to setup a rectangular texture:
glGenTextures(1, &tex);
glBindTexture(WGL_TEXTURE_RECTANGLE_NV, tex);
glTexParameteri(WGL_TEXTURE_RECTANGLE_NV, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(WGL_TEXTURE_RECTANGLE_NV, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexImage2D(WGL_TEXTURE_RECTANGLE_NV, 0, 3, xSize, ySize, 0, GL_RGB, GL_UNSIGNED_BYTE, NULL);
Later on I do some rendering and then do this:
glBindTexture(WGL_TEXTURE_RECTANGLE_NV, tex);
glCopyTexSubImage2D(WGL_TEXTURE_RECTANGLE_NV, 0, 0, 0, 0, 0, xSize, ySize);
Finally I draw a quad textured with this texture by doing:
glEnable(WGL_TEXTURE_RECTANGLE_NV);
glBindTexture(WGL_TEXTURE_RECTANGLE_NV, tex);
// draw a textured quad.
All I ever get is a white quad.
My gfx card definetly supports all this (it’s a GeForce4 MX)…
Can anyone tell me what I’m doing wrong?
Many thanks!
-Anthony