1 // $Id: gl_texture.hpp 4063 2006-07-21 21:05:23Z anmaster $
4 // Copyright (C) 2006 Matthias Braun <matze@braunis.de>
6 // This program is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU General Public License
8 // as published by the Free Software Foundation; either version 2
9 // of the License, or (at your option) any later version.
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License
17 // along with this program; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 #ifndef __GL_TEXTURE_HPP__
21 #define __GL_TEXTURE_HPP__
28 #include "texture.hpp"
32 * This class is a wrapper around a texture handle. It stores the texture width
33 * and height and provides convenience functions for uploading SDL_Surfaces
38 class Texture : public ::Texture
42 unsigned int texture_width;
43 unsigned int texture_height;
44 unsigned int image_width;
45 unsigned int image_height;
48 Texture(unsigned int width, unsigned int height);
49 Texture(SDL_Surface* image);
52 const GLuint &get_handle() const {
56 void set_handle(GLuint handle) {
57 this->handle = handle;
60 unsigned int get_texture_width() const
65 unsigned int get_texture_height() const
67 return texture_height;
70 unsigned int get_image_width() const
75 unsigned int get_image_height() const
80 void set_image_width(unsigned int width)
85 void set_image_height(unsigned int height)
87 image_height = height;
91 void set_texture_params();