X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fvideo%2Ftexture_manager.hpp;h=1431c68ea6565154c74a3b3c61cf99ea7598e632;hb=e7a12ed844f040d270e50ce25f74de5f017c1157;hp=4d89b06c68ec15ca046436905ec4d851df77cf7d;hpb=5a4ba5e7cfc6b0eaaa5a9f021443bec3a30adca2;p=supertux.git diff --git a/src/video/texture_manager.hpp b/src/video/texture_manager.hpp index 4d89b06c6..1431c68ea 100644 --- a/src/video/texture_manager.hpp +++ b/src/video/texture_manager.hpp @@ -1,14 +1,35 @@ +// $Id$ +// +// SuperTux +// Copyright (C) 2006 Matthias Braun +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + #ifndef __IMAGE_TEXTURE_MANAGER_HPP__ #define __IMAGE_TEXTURE_MANAGER_HPP__ -#include +#include + +#include "glutil.hpp" #include #include #include #include class Texture; -class ImageTexture; +namespace GL { class Texture; } class TextureManager { @@ -16,33 +37,36 @@ public: TextureManager(); ~TextureManager(); - ImageTexture* get(const std::string& filename); - - void register_texture(Texture* texture); - void remove_texture(Texture* texture); + Texture* get(const std::string& filename); + +#ifdef HAVE_OPENGL + void register_texture(GL::Texture* texture); + void remove_texture(GL::Texture* texture); void save_textures(); void reload_textures(); +#endif private: - friend class ImageTexture; - void release(ImageTexture* texture); - - typedef std::map ImageTextures; + friend class Texture; + void release(Texture* texture); + + typedef std::map ImageTextures; ImageTextures image_textures; - ImageTexture* create_image_texture(const std::string& filename); + Texture* create_image_texture(const std::string& filename); - typedef std::set Textures; +#ifdef HAVE_OPENGL + typedef std::set Textures; Textures textures; struct SavedTexture { - Texture* texture; + GL::Texture* texture; GLint width; GLint height; char* pixels; - GLint border; + GLint border; GLint min_filter; GLint mag_filter; @@ -51,10 +75,10 @@ private: }; std::vector saved_textures; - void save_texture(Texture* texture); + void save_texture(GL::Texture* texture); +#endif }; extern TextureManager* texture_manager; #endif -