PDA

View Full Version : Generating Texture Name



wbarrow
06-21-2004, 07:13 PM
I'm having a problem with calling glGenTextures(). It seems that the texture name does not get changed by the call.
Could somebody please tell me why that would be?
Thanks,
WES.

yooyo
06-21-2004, 10:45 PM
Texture name is not string object. It is a GLuint. Example:



GLuint MyTexHandle;
...
// gen name for 1 texture
glGenTextures(1, &MyTexHandle);
glBindTexture(GL_TEXTURE_2D, MyTexHandle);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB8, m_Xres, m_Yres, 0, GL_RGB, GL_UNSIGNED_BYTE, m_Data);yooyo