vrshoot

annotate src/screen.h @ 2:334d17aed7de

visual studio project files
author John Tsiombikas <nuclear@member.fsf.org>
date Sun, 02 Feb 2014 18:36:38 +0200
parents
children
rev   line source
nuclear@0 1 #ifndef SCREEN_H_
nuclear@0 2 #define SCREEN_H_
nuclear@0 3
nuclear@0 4 class Screen;
nuclear@0 5
nuclear@0 6 void push_screen(Screen *screen);
nuclear@0 7 Screen *pop_screen();
nuclear@0 8 Screen *current_screen();
nuclear@0 9 Screen *previous_screen();
nuclear@0 10
nuclear@0 11
nuclear@0 12 class Screen {
nuclear@0 13 public:
nuclear@0 14 virtual ~Screen();
nuclear@0 15
nuclear@0 16 virtual const char *get_name() const;
nuclear@0 17
nuclear@0 18 virtual bool init();
nuclear@0 19 virtual void cleanup();
nuclear@0 20
nuclear@0 21 /// start will be called just before a screen is going to be activated
nuclear@0 22 virtual void start();
nuclear@0 23 /// stop will be called when a screen is being deactivated
nuclear@0 24 virtual void stop();
nuclear@0 25
nuclear@0 26 /** each Screen subclass should override this function to specify
nuclear@0 27 * the required redisplay interval:
nuclear@0 28 * - 0 means no implcit redisplays are to be performed.
nuclear@0 29 * Use request_redisplay to queue up a redisplay.
nuclear@0 30 * - Any values > 0 are treated as inter-frame intervals in milliseconds
nuclear@0 31 * The default (if not overriden) is 0.
nuclear@0 32 */
nuclear@0 33 virtual long redisplay_interval() const;
nuclear@0 34
nuclear@0 35 /// update will be called every frame before display
nuclear@0 36 virtual void update(unsigned long tmsec);
nuclear@0 37
nuclear@0 38 /// pre_draw will be called before display
nuclear@0 39 virtual void pre_draw() const;
nuclear@0 40 /// display will be called whenever a screen needs to redraw itself
nuclear@0 41 virtual void display() const;
nuclear@0 42 /// post_draw will be called after display
nuclear@0 43 virtual void post_draw() const;
nuclear@0 44
nuclear@0 45 /// keyboard event
nuclear@0 46 virtual void keyboard(int key, bool pressed);
nuclear@0 47 /// mouse motion event
nuclear@0 48 virtual void motion(int x, int y, bool pressed);
nuclear@0 49 /// mouse button event
nuclear@0 50 virtual void button(int bn, bool pressed, int x, int y);
nuclear@0 51 /// reshape event
nuclear@0 52 virtual void reshape(int x, int y);
nuclear@0 53 };
nuclear@0 54
nuclear@0 55 #endif // SCREEN_H_