2 // Copyright (C) 2006 Matthias Braun <matze@braunis.de>
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation, either version 3 of the License, or
7 // (at your option) any later version.
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
14 // You should have received a copy of the GNU General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
17 #ifndef HEADER_SUPERTUX_VIDEO_GL_TEXTURE_HPP
18 #define HEADER_SUPERTUX_VIDEO_GL_TEXTURE_HPP
20 #include "video/texture.hpp"
23 * This class is a wrapper around a texture handle. It stores the texture width
24 * and height and provides convenience functions for uploading SDL_Surfaces
27 class GLTexture : public Texture
31 unsigned int texture_width;
32 unsigned int texture_height;
33 unsigned int image_width;
34 unsigned int image_height;
37 GLTexture(unsigned int width, unsigned int height);
38 GLTexture(SDL_Surface* image);
41 const GLuint &get_handle() const {
45 void set_handle(GLuint handle) {
46 this->handle = handle;
49 unsigned int get_texture_width() const
54 unsigned int get_texture_height() const
56 return texture_height;
59 unsigned int get_image_width() const
64 unsigned int get_image_height() const
69 void set_image_width(unsigned int width)
74 void set_image_height(unsigned int height)
76 image_height = height;
80 void set_texture_params();