View Full Version : Texture Proxy & glGetTexParameter()

02-08-2002, 07:03 AM
I tried running the following bit of code but I keep getting the result:
"Texture Width = 0"


GLint Max_Size;
glTexImage2D(GL_PROXY_TEXTURE_2D, 0, GL_RGB, 255, 255, 1, GL_RGB, GL_BYTE, NULL);
glGetTexLevelParameteriv(GL_PROXY_TEXTURE_2D, 0, GL_TEXTURE_WIDTH, &Max_Size);
printf("Texture Width = %d\n\n", Max_Size);


... which is rather strange cos I have an NVIDIA GeForce 3 Ti200!!! Besides I tried

glGetIntegerv(GL_MAX_TEXTURE_SIZE, &Max_Size);
printf("The Maximum texture size is %d pixels\n", Max_Size);

and I got:
"The Maximum texture size is 4096 pixels"

Ok, so what am I doing wrong? ...

02-08-2002, 07:27 AM
"255" is not a power of two.

Specifically, because you use one border pixel, the teximage specification needs to be for size 258,258. Further details on page 120 of the OpenGL spec, version 1.3, the PDF of which is available on this web site.

[This message has been edited by jwatte (edited 02-08-2002).]

02-08-2002, 07:44 AM
Originally posted by jwatte:
[B]"255" is not a power of two.

How silly of me. Thanks ;-)