您的位置:首页 > 运维架构

openGL纹理映射参数解析

2013-09-25 15:14 316 查看
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,即纹理的名字设置对应的纹理数据和纹理状态。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: