X-Git-Url: http://git.tdb.fi/?p=gldbg.git;a=blobdiff_plain;f=flavors%2Fgl%2Fsource%2Finspector.cpp;h=6ff3f7033fa86180b2317f85f2e2d6a443f5800b;hp=122c2e45298f340ddfe935a2f5e29375dcde480c;hb=a34325fadec5b2be003bf9af1f081bfc4c83e8b6;hpb=d72ef6d75a11f6cc05ab8ec039520719e1044741 diff --git a/flavors/gl/source/inspector.cpp b/flavors/gl/source/inspector.cpp index 122c2e4..6ff3f70 100644 --- a/flavors/gl/source/inspector.cpp +++ b/flavors/gl/source/inspector.cpp @@ -21,6 +21,8 @@ Inspector::Inspector(GlDbg &d): .set_help("Inspects general GL state", "state vertex\n" " Print current vertex attributes\n\n" + "state array\n" + " Show current vertex arrays\n\n" "state bind\n" " Show current bindings\n"); @@ -55,6 +57,11 @@ Inspector::Inspector(GlDbg &d): decoder->gldBreak = gldBreak; } +Inspector::~Inspector() +{ + gldecoder_delete(decoder); +} + void Inspector::decode(const char *data, unsigned len) { if(query_state) @@ -118,6 +125,28 @@ void Inspector::cmd_state(const string &args) const Vector3 &normal = glstate.get_normal(); printf(" Normal: [%05.3f, %05.3f, %05.3f]\n", normal.x, normal.y, normal.z); } + else if(args=="array") + { + printf("Current vertex arrays:\n"); + string descr = glstate.get_array(GL_VERTEX_ARRAY).describe(); + printf(" Vertex: %s\n", descr.c_str()); + descr = glstate.get_array(GL_NORMAL_ARRAY).describe(); + printf(" Normal: %s\n", descr.c_str()); + descr = glstate.get_array(GL_COLOR_ARRAY).describe(); + printf(" Color: %s\n", descr.c_str()); + unsigned count = glstate.get_max_texture_units(); + for(unsigned i=0; i=10 ? " " : " "), descr.c_str()); + } + } else if(args=="bind") { printf("Current bindings:\n"); @@ -126,10 +155,14 @@ void Inspector::cmd_state(const string &args) { printf(" Texture unit %d:\n", i); const TexUnitState &unit = glstate.get_texture_unit(i); - string descr = unit.describe_binding(GL_TEXTURE_2D); - printf(" GL_TEXTURE_2D: %s\n", descr.c_str()); + string descr = unit.describe_binding(GL_TEXTURE_1D); + printf(" GL_TEXTURE_1D: %s\n", descr.c_str()); + descr = unit.describe_binding(GL_TEXTURE_2D); + printf(" GL_TEXTURE_2D: %s\n", descr.c_str()); descr = unit.describe_binding(GL_TEXTURE_3D); - printf(" GL_TEXTURE_3D: %s\n", descr.c_str()); + printf(" GL_TEXTURE_3D: %s\n", descr.c_str()); + descr = unit.describe_binding(GL_TEXTURE_CUBE_MAP); + printf(" GL_TEXTURE_CUBE_MAP: %s\n", descr.c_str()); } printf(" Buffers:\n"); const BufferState *buf = glstate.get_current_buffer(GL_ARRAY_BUFFER); @@ -174,15 +207,33 @@ void Inspector::cmd_texture(const string &args) printf("Texture object %d\n", id); printf(" Target: %s\n", describe_enum(tex.target, "TextureTarget")); printf(" Images:\n"); - for(unsigned i=0; i