]> git.tdb.fi Git - gldbg.git/blobdiff - source/profiler.h
Decouple the existing tools from the debugger core
[gldbg.git] / source / profiler.h
index fa6bcac65c1ddce7b397f87e0fa38af13bc228a4..4d5c5a834641300fe247730ca94dd3f1c3f7a79d 100644 (file)
@@ -1,10 +1,18 @@
+/* $Id$
+
+This file is part of gldbg
+Copyright © 2010  Mikko Rasa, Mikkosoft Productions
+Distributed under the GPL
+*/
+
 #ifndef PROFILER_H_
 #define PROFILER_H_
 
 #include <msp/time/timestamp.h>
 #include "gldecoder.h"
+#include "tool.h"
 
-class Profiler
+class Profiler: public RegisteredTool<Profiler>
 {
 private:
        GlDecoder *decoder;
@@ -16,12 +24,12 @@ private:
        unsigned triangles;
 
 public:
-       Profiler();
+       Profiler(GlDbg &);
 
-       void enable();
-       void disable();
-       int decode(const char *, unsigned);
+       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 *);