glTexImage2D Trick
Moderator: InsideQC Admins
3 posts
• Page 1 of 1
glTexImage2D Trick
Say you're creating a texture object but you don't have the data for it yet. You might think that you need to allocate a dummy buffer of the right size, but you actually don't. Just give glTexImage2D a NULL pointer and it will happily create the texture for you.
It's all there in the documentation (http://www.opengl.org/sdk/docs/man/xhtml/glTexImage2D.xml).
It's all there in the documentation (http://www.opengl.org/sdk/docs/man/xhtml/glTexImage2D.xml).
We had the power, we had the space, we had a sense of time and place
We knew the words, we knew the score, we knew what we were fighting for
We knew the words, we knew the score, we knew what we were fighting for
-

mh - Posts: 2292
- Joined: Sat Jan 12, 2008 1:38 am
In GL version 1.1 or greater, data 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.
When they say 'download' are they referring to selecting a texture already in an array?
- r00k
- Posts: 1110
- Joined: Sat Nov 13, 2004 10:39 pm
3 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest