Mike Gorchak
|
glTexImage2D with NULL pointer to texture memory
|
Mike Gorchak
03/26/2009 8:12 AM
post25308
|
glTexImage2D with NULL pointer to texture memory
Just question, not a bug report, as usual :)
This is quote from OpenGL 1.5 spec:
"In OpenGL version 1.1 or greater, pixels may be a null pointer. In this case texture memory is allocated to accommodate
a texture of width width and height height. You can then download subtextures to initialize this texture memory. The
image is undefined if the user tries to apply an uninitialized portion of the texture image to a primitive."
I can't find this notice in OpenGL ES 1.0 and 1.1 specs.
I tried to do this in QNX, Looks like glTexImage2D checks for NULL pointer as pixel data and doesn't set an error. But
later when I upload subimage using glTexSubImage2D it also doesn't set an error, but texture contains of trash pixels in
which I can't recognize even a part of my texture.
Construction looks like:
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, texture_w, texture_h, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);
glTexSubImage2D(GL_TEXTURE_2D, 0, x, y, w, h, GL_RGBA, GL_UNSIGNED_BYTE, data->pixels);
Is this behavior is supported under QNX's implementation of OpenGL ES 1.0 ?
The reason to use this construction is constantly modified texture, which is need to be re-uploaded each time after
modification. But I do not want to pass any texture an initialization time, just allocate it for future usage.
|
|
|