Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
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();