TerraForge3D  2.3.1
3D Terrain And Landscape Generator

◆ UploadFaceToGPU()

bool TextureCubemap::UploadFaceToGPU ( int  face)

Definition at line 116 of file TextureCubemap.cpp.

117{
118 glBindTexture(GL_TEXTURE_CUBE_MAP, rendereID);
119
120 if (facesData[face])
121 {
122 if (textures[face])
123 {
124 delete textures[face];
125 textures[face] = nullptr;
126 }
127
128 textures[face] = new Texture2D(facesSizes[face].x, facesSizes[face].y);
129 textures[face]->Bind();
130 textures[face]->SetData(facesData[face], facesSizes[face].x * facesSizes[face].y * 3);
131 glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X + face, 0, GL_RGB, facesSizes[face].x, facesSizes[face].y, 0, GL_RGB, GL_UNSIGNED_BYTE, facesData[face]);
132 return true;
133 }
134
135 return false;
136}