Added some m_ prefixes to member variables in GLRenderer and related classes
[supertux.git] / src / video / gl / gl_texture.hpp
1 //  SuperTux
2 //  Copyright (C) 2006 Matthias Braun <matze@braunis.de>
3 //
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.
8 //
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.
13 //
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/>.
16
17 #ifndef HEADER_SUPERTUX_VIDEO_GL_TEXTURE_HPP
18 #define HEADER_SUPERTUX_VIDEO_GL_TEXTURE_HPP
19
20 #include "video/texture.hpp"
21
22 /**
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
25  * into the texture
26  */
27 class GLTexture : public Texture
28 {
29 protected:
30   GLuint m_handle;
31   unsigned int m_texture_width;
32   unsigned int m_texture_height;
33   unsigned int m_image_width;
34   unsigned int m_image_height;
35
36 public:
37   GLTexture(unsigned int width, unsigned int height);
38   GLTexture(SDL_Surface* image);
39   ~GLTexture();
40
41   const GLuint &get_handle() const {
42     return m_handle;
43   }
44
45   void set_handle(GLuint handle) {
46     m_handle = handle;
47   }
48
49   unsigned int get_texture_width() const
50   {
51     return m_texture_width;
52   }
53
54   unsigned int get_texture_height() const
55   {
56     return m_texture_height;
57   }
58
59   unsigned int get_image_width() const
60   {
61     return m_image_width;
62   }
63
64   unsigned int get_image_height() const
65   {
66     return m_image_height;
67   }
68
69   void set_image_width(unsigned int width)
70   {
71     m_image_width = width;
72   }
73
74   void set_image_height(unsigned int height)
75   {
76     m_image_height = height;
77   }
78
79 private:
80   void set_texture_params();
81 };
82
83 #endif
84
85 /* EOF */