replace some of the glBegin,glEnd calls with glDrawArrays
[supertux.git] / src / video / texture_manager.cpp
index 7b556a6..d9ff2a7 100644 (file)
 #include <sstream>
 #include <stdexcept>
 #include "physfs/physfs_sdl.hpp"
+#include "video_systems.hpp"
 #include "gl_texture.hpp"
-#include "sdl_texture.hpp"
 #include "glutil.hpp"
 #include "gameconfig.hpp"
 #include "file_system.hpp"
 #include "log.hpp"
+#include "texture.hpp"
 
 TextureManager* texture_manager = NULL;
 
@@ -103,16 +104,7 @@ TextureManager::create_image_texture(const std::string& filename)
 
   Texture* result = 0;
   try {
-#ifdef HAVE_OPENGL
-    if(config->video == "opengl")
-    {
-      result = new GL::Texture(image);
-    }
-    else
-#endif
-    {
-      result = new SDL::Texture(image);
-    }
+    result = new_texture(image);
     result->set_filename(filename);
   } catch(...) {
     delete result;