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>2008-10-10 16:41:38 +0000
committerStijn Buys <ingar@osirion.org>2008-10-10 16:41:38 +0000
commit02fcd22d8cde355aa898a8c6bb4773d9434b8e9a (patch)
tree9397f1f5b61a0978acadc4c15fd330ee7138c59b /src/client/view.h
parent4331f5c17901f46693dcb5c2df96276f6851be25 (diff)
adds KeyPress, DevInfo and Stats widgets
Diffstat (limited to 'src/client/view.h')
-rw-r--r--src/client/view.h69
1 files changed, 68 insertions, 1 deletions
diff --git a/src/client/view.h b/src/client/view.h
index 1f81597..e5e42bc 100644
--- a/src/client/view.h
+++ b/src/client/view.h
@@ -7,12 +7,79 @@
#define __INCLUDED_CLIENT_VIEW_H__
#include "core/zone.h"
+#include "ui/widget.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 DevInfo : public ui::Widget
+{
+public:
+ // default constructor
+ DevInfo(ui::Widget *parent = 0);
+
+protected:
+ // draw developer info
+ void draw();
+};
+
+// a widget that shows engine statistics
+class Stats : public ui::Widget
+{
+public:
+ // default constructor
+ Stats(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 KeyPress : public ui::Widget
+{
+public:
+ // default constructor
+ KeyPress(ui::Widget *parent=0);
+
+protected:
+ // draw keypress events
+ virtual void draw();
+};
+
+/// the client view widget
+/**
+* the client view renders the world and contains the main user interface widgets
+*/
+class View : public ui::Widget
+{
+public:
+ View(ui::Widget *parent=0);
+
+protected:
+ virtual void draw();
+ virtual void resize();
+
+private:
+ DevInfo *view_devinfo;
+ Stats *view_stats;
+ KeyPress *view_keypress;
+};
+
/// functions to draw the client view
-namespace view
+namespace view
{
/// intialize the view
void init();