add Window::request_redraw()

This commit is contained in:
josh committed 2016-12-11 20:39:02 -05:00
1 parent 1232539495
commit 659a64b367
2 files changed
+7

No files matched your search

+5
View File
@@ -139,6 +139,11 @@ void Window::run_event_loop()
while ((!m_exit_requested) && SDL_WaitEvent(&event))
{
handle_event(event);
if (m_redraw_requested)
{
m_redraw_requested = false;
redraw();
}
}
}
+2
View File
@@ -15,6 +15,7 @@ class Window
public:
bool create(std::shared_ptr<Buffer> buffer);
void run_event_loop();
void request_redraw() { m_redraw_requested = true; }
protected:
enum : uint32_t
@@ -35,6 +36,7 @@ protected:
SDL_Window * m_window;
bool m_exit_requested;
bool m_redraw_requested;
int m_width;
int m_height;