X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fvideo%2Ftexture_manager.hpp;h=e4047905980d84264ae640100d9c4059cb7446f7;hb=d9ec4134c6d3a1c444199ba894bf5e9c084185f3;hp=0b0854faa595a58c841c0c638459cd1910bc6267;hpb=86181b0a14d89cf45daf97199c3556c4dd1ee7b7;p=supertux.git diff --git a/src/video/texture_manager.hpp b/src/video/texture_manager.hpp index 0b0854faa..e40479059 100644 --- a/src/video/texture_manager.hpp +++ b/src/video/texture_manager.hpp @@ -1,14 +1,33 @@ -#ifndef __IMAGE_TEXTURE_MANAGER_HPP__ -#define __IMAGE_TEXTURE_MANAGER_HPP__ +// 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 3 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, see . + +#ifndef HEADER_SUPERTUX_VIDEO_TEXTURE_MANAGER_HPP +#define HEADER_SUPERTUX_VIDEO_TEXTURE_MANAGER_HPP + +#include -#include -#include -#include #include #include +#include +#include + +#include "video/glutil.hpp" class Texture; -class ImageTexture; +class GLTexture; class TextureManager { @@ -16,45 +35,50 @@ 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(GLTexture* texture); + void remove_texture(GLTexture* 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; - int width; - int height; + GLTexture* texture; + GLint width; + GLint height; char* pixels; - int border; + GLint border; - int min_filter; - int mag_filter; - int wrap_s; - int wrap_t; + GLint min_filter; + GLint mag_filter; + GLint wrap_s; + GLint wrap_t; }; std::vector saved_textures; - void save_texture(Texture* texture); + void save_texture(GLTexture* texture); +#endif }; extern TextureManager* texture_manager; #endif +/* EOF */