From 00f633afb62ed6914205639b44dcdaf839a2c2f7 Mon Sep 17 00:00:00 2001 From: Clyne Sullivan Date: Mon, 27 Jun 2016 21:06:31 -0400 Subject: redid trees, fixed indoors? --- src/texture.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/texture.cpp') diff --git a/src/texture.cpp b/src/texture.cpp index 0f01c83..bdac28e 100644 --- a/src/texture.cpp +++ b/src/texture.cpp @@ -46,7 +46,7 @@ namespace Texture{ GLuint loadTexture(std::string fileName) { SDL_Surface *image; - GLuint object = 0; + static GLuint object = 0; // check if texture is already loaded for(auto &t : LoadedTexture) { @@ -71,9 +71,8 @@ namespace Texture{ /* * Load texture through OpenGL. */ - - glGenTextures(1,&object); // Turns "object" into a texture - glBindTexture(GL_TEXTURE_2D,object); // Binds "object" to the top of the stack + //glGenTextures(1,&object); // Turns "object" into a texture + glBindTexture(GL_TEXTURE_2D,++object); // Binds "object" to the top of the stack glPixelStoref(GL_UNPACK_ALIGNMENT,1); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); // Sets the "min" filter -- cgit v1.2.3