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 m_texture_width;
32 unsigned int m_texture_height;
33 unsigned int m_image_width;
34 unsigned int m_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) {
49 unsigned int get_texture_width() const
51 return m_texture_width;
54 unsigned int get_texture_height() const
56 return m_texture_height;
59 unsigned int get_image_width() const
64 unsigned int get_image_height() const
66 return m_image_height;
69 void set_image_width(unsigned int width)
71 m_image_width = width;
74 void set_image_height(unsigned int height)
76 m_image_height = height;
80 void set_texture_params();