Skip to content
Snippets Groups Projects
Commit b0f24760 authored by Evy Storozhenko's avatar Evy Storozhenko
Browse files

added getShouldClose in window

parent bb64fb84
No related branches found
No related tags found
No related merge requests found
......@@ -94,7 +94,7 @@ namespace pew {
RenderPassBuffers buffers;
#if !defined(PEW_USE_THREADS)
std::function<void()> pixelUpdateFun;
std::function<bool()> pixelUpdateFun;
#endif
public:
......@@ -133,7 +133,7 @@ namespace pew {
#if !defined(PEW_USE_THREADS)
RenderPass&
setPixelUpdateFunction(const std::function<void()>& fun) {
setPixelUpdateFunction(const std::function<bool()>& fun) {
pixelUpdateFun = fun;
return *this;
}
......
......@@ -43,6 +43,7 @@ namespace pew {
renderPass.setPixelUpdateFunction([&] {
window.handleInput();
window.drawFrame();
return window.getShouldClose();
});
#if defined(__EMSCRIPTEN__)
......
......@@ -155,6 +155,11 @@ namespace pew {
shouldClose = true;
}
auto
getShouldClose() const noexcept {
return shouldClose;
}
void
handleInput() {
SDL_Event event;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment