]> git.tdb.fi Git - gldbg.git/blobdiff - source/bufferstate.h
Track vertex array state
[gldbg.git] / source / bufferstate.h
index 17462c69927c850c30ff994fb5b0d63ce0d41146..393168d72141a721afa3d8cc055dedc558c6b191 100644 (file)
@@ -1,7 +1,7 @@
 /* $Id$
 
 This file is part of gldbg
-Copyright © 2009  Mikko Rasa, Mikkosoft Productions
+Copyright © 2009-2010  Mikko Rasa, Mikkosoft Productions
 Distributed under the GPL
 */
 
@@ -9,14 +9,41 @@ Distributed under the GPL
 #define BUFFERSTATE_H_
 
 #include <string>
+#include <vector>
 #include <GL/gl.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);