X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=flavors%2Fgl%2Fsource%2Fbufferstate.h;fp=flavors%2Fgl%2Fsource%2Fbufferstate.h;h=c3f504bf593ab5416bf95170a903424b69fbc5a7;hb=f53057ce9b5eb3c7256a4aca95b4944733e14503;hp=0000000000000000000000000000000000000000;hpb=73c55fc88d8bad336fbd6cfecedc0cf18d06167c;p=gldbg.git diff --git a/flavors/gl/source/bufferstate.h b/flavors/gl/source/bufferstate.h new file mode 100644 index 0000000..c3f504b --- /dev/null +++ b/flavors/gl/source/bufferstate.h @@ -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 +#include +#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 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