add Window::request_redraw()
This commit is contained in:
parent
1232539495
commit
659a64b367
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user