X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=flavors%2Fgl%2Fsource%2Fprofiler.h;fp=flavors%2Fgl%2Fsource%2Fprofiler.h;h=4d5c5a834641300fe247730ca94dd3f1c3f7a79d;hb=f53057ce9b5eb3c7256a4aca95b4944733e14503;hp=0000000000000000000000000000000000000000;hpb=73c55fc88d8bad336fbd6cfecedc0cf18d06167c;p=gldbg.git diff --git a/flavors/gl/source/profiler.h b/flavors/gl/source/profiler.h new file mode 100644 index 0000000..4d5c5a8 --- /dev/null +++ b/flavors/gl/source/profiler.h @@ -0,0 +1,39 @@ +/* $Id$ + +This file is part of gldbg +Copyright © 2010 Mikko Rasa, Mikkosoft Productions +Distributed under the GPL +*/ + +#ifndef PROFILER_H_ +#define PROFILER_H_ + +#include +#include "gldecoder.h" +#include "tool.h" + +class Profiler: public RegisteredTool +{ +private: + GlDecoder *decoder; + bool enabled; + Msp::Time::TimeStamp start; + unsigned frames; + unsigned draw_calls; + unsigned vertices; + unsigned triangles; + +public: + Profiler(GlDbg &); + + virtual void decode(const char *, unsigned); +private: + void cmd_profile(const std::string &); + + static void glDrawArrays(void *, GLenum, int, int); + static void glDrawElements(void *, GLenum, int, GLenum, const void *); + static void glDrawRangeElements(void *, GLenum, unsigned, unsigned, int, GLenum, const void *); + static void glXSwapBuffers(void *, Display *, GLXDrawable); +}; + +#endif