X-Git-Url: https://git.ucc.asn.au/?p=ipdf%2Fcode.git;a=blobdiff_plain;f=src%2Fscreen.h;h=2d28db2d734952e901546bead6baa3eb9afc6b43;hp=9666c3259718f0db655f392a63b17889ff3d498d;hb=f71f97f4fd251d02882ace4be3ead033ced434c4;hpb=b2d6929dfb8cd94c0447b350c9bafaa573a4a834 diff --git a/src/screen.h b/src/screen.h index 9666c32..2d28db2 100644 --- a/src/screen.h +++ b/src/screen.h @@ -11,6 +11,7 @@ namespace IPDF { + class View; /* * The "Screen" class handles managing the OS window (using SDL2). */ @@ -41,7 +42,7 @@ namespace IPDF void DebugFontPrintF(const char *fmt, ...); // Handle mouse input. - typedef std::function MouseHandler; + typedef void(*MouseHandler)(int x, int y, int button, int wheel, Screen * scr, View * view); void SetMouseHandler(MouseHandler handler) { m_mouse_handler = handler; @@ -62,6 +63,7 @@ namespace IPDF void RenderPixels(int x, int y, int w, int h, uint8_t * pixels) const; + void SetView(View * new_view) {m_view = new_view;} // Returns the CPU time (in seconds) it took to render the last completed frame. double GetLastFrameTimeCPU() const { return m_last_frame_time / SDL_GetPerformanceFrequency(); } @@ -97,6 +99,7 @@ namespace IPDF GraphicsBuffer m_debug_font_indices; int m_debug_font_vertex_head; int m_debug_font_index_head; + View * m_view; }; }