Moved OpenGL texture generation to the Texture class

This commit is contained in:
Teo-CD 2019-11-03 15:50:37 +01:00
parent d0b533608a
commit 37e525d6ee
3 changed files with 19 additions and 8 deletions

View file

@ -103,17 +103,9 @@ int main(int argc, char** argv)
// Load and generate tree texture
tree_texture.load_rgba_tga("resources/arbre.tga","resources/arbre_masque.tga");
glGenTextures(1,tree_texture.opengl_id);
// TODO : Put in the Texture class
glBindTexture(GL_TEXTURE_2D,tree_texture.opengl_id[0]);
gluBuild2DMipmaps(GL_TEXTURE_2D,GL_RGBA8,tree_texture.width,tree_texture.height,GL_RGBA,GL_UNSIGNED_BYTE,tree_texture.image_data);
// Load and generate raptor texture
raptor_texture.load_rgb_tga("resources/RAPTOR.tga");
glGenTextures(1, raptor_texture.opengl_id);
// TODO : Put in the Texture class
glBindTexture(GL_TEXTURE_2D, raptor_texture.opengl_id[0]);
gluBuild2DMipmaps(GL_TEXTURE_2D, GL_RGB8, raptor_texture.width, raptor_texture.height, GL_RGB, GL_UNSIGNED_BYTE, raptor_texture.image_data);
// Load raptor model
raptor.load_ascii_off_file("resources/RAPTOR.off");