Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2009-01-26 20:18:22 +0000
committerStijn Buys <ingar@osirion.org>2009-01-26 20:18:22 +0000
commit597b3e0921dd24fa5e224377da4754da93a782c1 (patch)
treea096cf3ade876d09dcdf5501908fe24efc50539f /src/client/infowidget.h
parent60749486f978b8220b707541cf478fc87d8d0b36 (diff)
new widgets to replace the "View" class
Diffstat (limited to 'src/client/infowidget.h')
-rw-r--r--src/client/infowidget.h65
1 files changed, 65 insertions, 0 deletions
diff --git a/src/client/infowidget.h b/src/client/infowidget.h
new file mode 100644
index 0000000..2cea366
--- /dev/null
+++ b/src/client/infowidget.h
@@ -0,0 +1,65 @@
+/*
+ client/infowidget.h
+ This file is part of the Osirion project and is distributed under
+ the terms and conditions of the GNU General Public License version 2
+*/
+
+#ifndef __INCLUDED_CLIENT_INFOWIDGET_H__
+#define __INCLUDED_CLIENT_INFOWIDGET_H__
+
+#include "ui/widget.h"
+#include "ui/bitmap.h"
+
+namespace client
+{
+
+const size_t fps_counter_size = 32; // fps is the average of 32 frames
+const size_t net_counter_size = 128; // net is the average of 128 frames
+
+/// a widget to show developer info
+class DevInfoWidget : public ui::Widget
+{
+public:
+ /// default constructor
+ DevInfoWidget(ui::Widget *parent = 0);
+
+protected:
+ /// draw developer info
+ virtual void draw();
+};
+
+/// a widget that shows engine statistics
+class StatsInfoWidget : public ui::Widget
+{
+public:
+ /// default constructor
+ StatsInfoWidget(ui::Widget *parent=0);
+
+protected:
+ /// draw engine statistics
+ virtual void draw();
+
+private:
+ float fps_counter_time[fps_counter_size];
+ size_t fps_counter_index;
+
+ float net_counter_time[net_counter_size];
+ size_t net_counter_traffic[net_counter_size];
+ size_t net_counter_index;
+};
+
+/// a widget to show keypress events
+class KeyInfoWidget : public ui::Widget
+{
+public:
+ // default constructor
+ KeyInfoWidget(ui::Widget *parent=0);
+
+protected:
+ // draw keypress events
+ virtual void draw();
+};
+
+}
+
+#endif // __INCLUDED_CLIENT_INFOWIDGET_H__