]> git.tdb.fi Git - gldbg.git/blob - source/texturestate.h
Add some virtual destructors to shut up older gcc versions
[gldbg.git] / source / texturestate.h
1 /* $Id$
2
3 This file is part of gldbg
4 Copyright © 2009  Mikko Rasa, Mikkosoft Productions
5 Distributed under the GPL
6 */
7
8 #ifndef TEXTURESTATE_H_
9 #define TEXTURESTATE_H_
10
11 #include <string>
12 #include <vector>
13 #include "opengl.h"
14 #include "autoconstptr.h"
15
16 struct TexImageState
17 {
18         unsigned width;
19         unsigned height;
20         unsigned depth;
21         GLenum internal_format;
22
23         TexImageState();
24         void set_2d(GLenum, unsigned, unsigned);
25         std::string describe() const;
26 };
27
28 struct TextureState
29 {
30         unsigned id;
31         GLenum target;
32         std::vector<TexImageState> images;
33         GLenum min_filter;
34         GLenum mag_filter;
35         GLenum wrap_s;
36         GLenum wrap_t;
37         GLenum wrap_r;
38         GLenum compare_mode;
39         GLenum compare_func;
40         bool generate_mipmap;
41
42         TextureState();
43         void set_image_2d(unsigned, GLenum, unsigned, unsigned);
44         void set_parameter(GLenum, const int *);
45         std::string describe() const;
46 };
47
48 struct TexUnitState
49 {
50         AutoConstPtr<TextureState> current_2d;
51         AutoConstPtr<TextureState> current_3d;
52
53         TexUnitState();
54
55         void set_current_texture(GLenum, TextureState *);
56         TextureState *get_current_texture(GLenum);
57         const TextureState *get_current_texture(GLenum) const;
58         std::string describe_binding(GLenum) const;
59 };
60
61 #endif