/* client/view.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_VIEW_H__ #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 { /// intialize the view void init(); /// shutdown the view void shutdown(); /// draw the next frame void frame(float seconds); /// reset OpenGL state void reset(); /// clear client-side assets of a zone void clear_zone(core::Zone *zone); } // namespace view } // namespace client #endif // __INCLUDED_CLIENT_VIEW_H__