Tweak Makefile to make testing nicer
[ipdf/code.git] / src / screen.h
1 #ifndef _SCREEN_H
2 #define _SCREEN_H
3
4 #include <SDL.h>
5
6 namespace IPDF
7 {
8         /*
9          * The "Screen" class handles managing the OS window (using SDL2).
10          */
11         class Screen
12         {
13         public:
14                 Screen();
15                 ~Screen();
16
17                 // 'Pumps' the system event queue.
18                 // Returns 'false' if the program should quit.
19                 bool PumpEvents();
20
21                 // Finishes rendering a frame, and presents it on the screen.
22                 void Present();
23
24                 // Get the current width/height of the window's viewport.
25                 int ViewportWidth() { return m_viewport_width; }
26                 int ViewportHeight() { return m_viewport_height; }
27         private:
28                 void ResizeViewport(int width, int height);
29
30                 int m_viewport_width;
31                 int m_viewport_height;
32                 SDL_Window *m_window;
33                 SDL_GLContext m_gl_context;
34         };
35 }
36
37 #endif // _SCREEN_H

UCC git Repository :: git.ucc.asn.au