From 6bf5e1c7907cc04e522b6b98f0b3e176aae05eea Mon Sep 17 00:00:00 2001 From: Vectozavr <60608292+vectozavr@users.noreply.github.com> Date: Sat, 6 Nov 2021 01:59:33 +0700 Subject: [PATCH] pushGLStates & popGLStates optimizations --- engine/gui/Window.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/engine/gui/Window.cpp b/engine/gui/Window.cpp index 9a09282..f6251ae 100644 --- a/engine/gui/Window.cpp +++ b/engine/gui/Window.cpp @@ -18,6 +18,7 @@ void Window::addButton(int x, int y, int w, int h, std::function click, void Window::update() { + _screen->pushGLStates(); _screen->setTitle(_name); _screen->drawSprite(_back); @@ -45,6 +46,7 @@ void Window::update() { _screen->drawText(button.text()); } } + _screen->popGLStates(); } void Window::setBackgroundTexture(const std::string &texture, double sx, double sy, int w, int h) {