vrshoot

view src/screen.h @ 0:b2f14e535253

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