11 * The "Screen" class handles managing the OS window (using SDL2).
19 // 'Pumps' the system event queue.
20 // Returns 'false' if the program should quit.
23 // Clears the screen to a given colour.
24 void Clear(float r=1.0, float g=1.0, float b=1.0, float a=1.0);
26 // Finishes rendering a frame, and presents it on the screen.
29 // Get the current width/height of the window's viewport.
30 int ViewportWidth() const { return m_viewport_width; }
31 int ViewportHeight() const { return m_viewport_height; }
33 // Handle mouse input.
34 typedef std::function<void(int x, int y, int button, int wheel)> MouseHandler;
35 void SetMouseHandler(MouseHandler handler)
37 m_mouse_handler = handler;
48 void SetMouseCursor(MouseCursors cursor);
50 void ScreenShot(const char * filename) const;
51 void RenderBMP(const char * filename) const;
53 void ResizeViewport(int width, int height);
55 MouseHandler m_mouse_handler;
60 int m_viewport_height;
62 SDL_GLContext m_gl_context;