OpenGL



17 OpenGL. - 4


glGenTextures() . glGenTexture, . , glGenTextures() . , . , , , glGenTextures(), . glGenTextures() .

 

glGenTextures(2, &texture[0]);// 2-

for (loop=0; loop<2; loop++)//

{

//

glBindTexture(GL_TEXTURE_2D, texture[loop]);

glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);

glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR);

glTexImage2D(GL_TEXTURE_2D, 0, 3,

TextureImage[loop]->sizeX, TextureImage[loop]->sizeY, 0,

GL_RGB, GL_UNSIGNED_BYTE, TextureImage[loop]->data);

}

}

, rgb . , . , . , - 3- .

for (loop=0; loop<2; loop++)

{

if (TextureImage[loop]) //

{

if (TextureImage[loop]->data) //

{

//

free(TextureImage[loop]->data);

}

free(TextureImage[loop]);//

}

}

return Status; //