]> git.tdb.fi Git - gldbg.git/blobdiff - flavors/gl/source/bufferstate.h
Move the profiler and inspector tools to the gl flavor
[gldbg.git] / flavors / gl / source / bufferstate.h
diff --git a/flavors/gl/source/bufferstate.h b/flavors/gl/source/bufferstate.h
new file mode 100644 (file)
index 0000000..c3f504b
--- /dev/null
@@ -0,0 +1,54 @@
+/* $Id$
+
+This file is part of gldbg
+Copyright © 2009-2010  Mikko Rasa, Mikkosoft Productions
+Distributed under the GPL
+*/
+
+#ifndef BUFFERSTATE_H_
+#define BUFFERSTATE_H_
+
+#include <string>
+#include <vector>
+#include "opengl.h"
+
+struct ArrayState;
+
+struct BufferContent
+{
+       struct Array
+       {
+               GLenum kind;
+               unsigned index;
+               unsigned size;
+               GLenum type;
+               int offset;
+
+               Array(const ArrayState &);
+       };
+
+       bool consistent;
+       unsigned stride;
+       std::vector<Array> arrays;
+
+       BufferContent();
+       void update(const ArrayState &);
+       std::string describe() const;
+};
+
+struct BufferState
+{
+       unsigned id;
+       GLenum target;
+       GLenum usage;
+       unsigned size;
+       char *data;
+       BufferContent content;
+
+       BufferState();
+       void set_data(unsigned, const void *, GLenum);
+       void set_sub_data(unsigned, unsigned, const void *);
+       std::string describe() const;
+};
+
+#endif