]> git.tdb.fi Git - gldbg.git/blobdiff - flavors/gl/source/texturestate.h
Move the profiler and inspector tools to the gl flavor
[gldbg.git] / flavors / gl / source / texturestate.h
diff --git a/flavors/gl/source/texturestate.h b/flavors/gl/source/texturestate.h
new file mode 100644 (file)
index 0000000..37cbfdd
--- /dev/null
@@ -0,0 +1,61 @@
+/* $Id$
+
+This file is part of gldbg
+Copyright © 2009  Mikko Rasa, Mikkosoft Productions
+Distributed under the GPL
+*/
+
+#ifndef TEXTURESTATE_H_
+#define TEXTURESTATE_H_
+
+#include <string>
+#include <vector>
+#include "opengl.h"
+#include "autoconstptr.h"
+
+struct TexImageState
+{
+       unsigned width;
+       unsigned height;
+       unsigned depth;
+       GLenum internal_format;
+
+       TexImageState();
+       void set_2d(GLenum, unsigned, unsigned);
+       std::string describe() const;
+};
+
+struct TextureState
+{
+       unsigned id;
+       GLenum target;
+       std::vector<TexImageState> images;
+       GLenum min_filter;
+       GLenum mag_filter;
+       GLenum wrap_s;
+       GLenum wrap_t;
+       GLenum wrap_r;
+       GLenum compare_mode;
+       GLenum compare_func;
+       bool generate_mipmap;
+
+       TextureState();
+       void set_image_2d(unsigned, GLenum, unsigned, unsigned);
+       void set_parameter(GLenum, const int *);
+       std::string describe() const;
+};
+
+struct TexUnitState
+{
+       AutoConstPtr<TextureState> current_2d;
+       AutoConstPtr<TextureState> current_3d;
+
+       TexUnitState();
+
+       void set_current_texture(GLenum, TextureState *);
+       TextureState *get_current_texture(GLenum);
+       const TextureState *get_current_texture(GLenum) const;
+       std::string describe_binding(GLenum) const;
+};
+
+#endif