X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=src%2Fscreen.h;h=f5ae7533a14e21272140b32470d8b04e58fd324d;hb=4e0ddbcec6e182430a31e0f1c661f2c93c9e0308;hp=ebe9da29ba0c71e49aa99d58d70075f1f0126ee5;hpb=245ccc8576d4bd29ab04d506ddb0c44b04a67e39;p=ipdf%2Fcode.git diff --git a/src/screen.h b/src/screen.h index ebe9da2..f5ae753 100644 --- a/src/screen.h +++ b/src/screen.h @@ -3,6 +3,8 @@ #include +#include + namespace IPDF { /* @@ -22,16 +24,40 @@ namespace IPDF void Present(); // Get the current width/height of the window's viewport. - int ViewportWidth() { return m_viewport_width; } - int ViewportHeight() { return m_viewport_height; } + int ViewportWidth() const { return m_viewport_width; } + int ViewportHeight() const { return m_viewport_height; } + + // Handle mouse input. + typedef std::function MouseHandler; + void SetMouseHandler(MouseHandler handler) + { + m_mouse_handler = handler; + } + + enum MouseCursors + { + CursorArrow, + CursorWait, + CursorWaitArrow, + CursorMove, + CursorHand + }; + void SetMouseCursor(MouseCursors cursor); + + void ScreenShot(const char * filename) const; private: void ResizeViewport(int width, int height); + + MouseHandler m_mouse_handler; + int m_last_mouse_x; + int m_last_mouse_y; int m_viewport_width; int m_viewport_height; SDL_Window *m_window; SDL_GLContext m_gl_context; }; + } #endif // _SCREEN_H