PDA

View Full Version : GL_PROXY_TEXTURE_3D



ffish
04-23-2001, 11:35 PM
From the blue book:



void glTexImage3D(GLenum target,
GLint level,
GLenum internalformat,
GLsizei width,
GLsizei height,
GLsizei depth,
GLint border,
GLenum format,
GLenum type,
const GLvoid *pixels)


If target is GL_PROXY_TEXTURE_3D ... if the implementation cannot handle a texture of the requested texture size, it sets all of the image state to 0, but does not generate an error ...

Anyone know what exactly gets set to 0? Is it one of the parameters to glTexImage3D maybe? I know my texture is too big, but the blue book says to use the above to find out if a texture is too large, as opposed to glGet(GL_MAX_TEXTURE_SIZE);

[This message has been edited by ffish (edited 04-24-2001).]

T2k
04-24-2001, 03:35 AM
i think if the texture don't fit into memory all texture-vars like width, height etc. are set to 0, so that you can decide which var to use for errorcheck !?!

ffish
04-24-2001, 04:40 AM
No, I checked before. Also, my width, height, depth parameters are declared const, so they're immutable. The only one that I can't be sure of is the image data itself, maybe that is set to null?

I did a simple test that prints pixels[0] but I'm compiling under Visual C++ and the data files are in (Li/U)nix format so I don't know what value the "correct" one would be - in any case it doesn't print "0", it prints nothing, or maybe "\0" - but I don't know if that is the data value at that point in the file.

Thanks anyway http://www.opengl.org/discussion_boards/ubb/smile.gif

[This message has been edited by ffish (edited 04-24-2001).]

mango
04-24-2001, 02:35 PM
I guess it is the same mechanism as for GL_PROXY_TEXTURE_2D. From the red book:

"A special place holder, or proxy, for a texture image allows the program to query more accurately
whether OpenGL can accommodate a texture of a desired internal format. To use the proxy to query
OpenGL, call glTexImage2D() with a target parameter of GL_PROXY_TEXTURE_2D and the
given level, internalFormat, width, height, border, format, and type. (For one-dimensional textures,
use corresponding 1D routines and symbolic constants.) For a proxy, you should pass NULL as the
pointer for the pixels array.

To find out whether there are enough resources available for your texture, after the texture proxy has
been created, query the texture state variables with glGetTexLevelParameter*(). If there aren't
enough resources to accommodate the texture proxy, the texture state variables for width, height,
border width, and component resolutions are set to 0."

ffish
04-24-2001, 05:27 PM
Oh, thanks Mango. I should have looked harder http://www.opengl.org/discussion_boards/ubb/smile.gif I found the part in the red book on texture proxies now.