X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=flavors%2Fgl%2Fsource%2Farraystate.cpp;h=98d6ed406376ebd0fa86fc7d1b293d308bbd74d7;hb=bc201c7dd5ebef9c0db1142387715c7ad4d53b62;hp=37db75a4f9d6dca8d05eff3e3cc01c2da6500508;hpb=f53057ce9b5eb3c7256a4aca95b4944733e14503;p=gldbg.git diff --git a/flavors/gl/source/arraystate.cpp b/flavors/gl/source/arraystate.cpp index 37db75a..98d6ed4 100644 --- a/flavors/gl/source/arraystate.cpp +++ b/flavors/gl/source/arraystate.cpp @@ -1,12 +1,9 @@ -/* $Id$ - -This file is part of gldbg -Copyright © 2010 Mikko Rasa, Mikkosoft Productions -Distributed under the GPL -*/ - #include "arraystate.h" #include "bufferstate.h" +#include "enums.h" +#include "strformat.h" + +using namespace std; ArrayState::ArrayState(): kind(0), @@ -32,3 +29,18 @@ void ArrayState::set(unsigned s, GLenum t, bool n, unsigned r, BufferState *b, l if(buffer) buffer->content.update(*this); } + +string ArrayState::describe() const +{ + if(enabled) + { + string descr = strformat("%d %s, stride %d", size, describe_enum(type, "DataType"), stride); + if(buffer) + descr += strformat(", buffer %d at %d", buffer->id, pointer); + else + descr += strformat(", at 0x%X", pointer); + return descr; + } + else + return "Disabled"; +}