openGL纹理映射参数解析

GLuinttexture[1];

AUX_RGBImageRec *TextureImage[1];
Status=TRUE; // Set The Status To TRUE

glGenTextures(1, &texture[0]); // Create The Texture,GLuint texture[0]是纹理的名字

// Typical Texture Generation Using Data From The Bitmap
glBindTexture(GL_TEXTURE_2D, texture[0]);
glTexImage2D(GL_TEXTURE_2D, 0, 3, TextureImage[0]->sizeX, TextureImage[0]->sizeY, 0, GL_RGB, GL_UNSIGNED_BYTE, TextureImage[0]->data);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);

GLuint texture 相当于纹理的名字,它指向的地址存着 纹理数据TextureImage, 纹理的设置状态,看是GL_LINEAR还是其他。

glBindTexture是为GLuint texture,即纹理的名字设置对应的纹理数据和纹理状态。

原文地址:https://www.cnblogs.com/qingsunny/p/3338817.html