pushGLStates & popGLStates optimizations

master
Vectozavr 2021-11-06 01:59:33 +07:00
parent cc0f0022aa
commit 6bf5e1c790
1 changed files with 2 additions and 0 deletions

View File

@ -18,6 +18,7 @@ void Window::addButton(int x, int y, int w, int h, std::function<void()> click,
void Window::update() { void Window::update() {
_screen->pushGLStates();
_screen->setTitle(_name); _screen->setTitle(_name);
_screen->drawSprite(_back); _screen->drawSprite(_back);
@ -45,6 +46,7 @@ void Window::update() {
_screen->drawText(button.text()); _screen->drawText(button.text());
} }
} }
_screen->popGLStates();
} }
void Window::setBackgroundTexture(const std::string &texture, double sx, double sy, int w, int h) { void Window::setBackgroundTexture(const std::string &texture, double sx, double sy, int w, int h) {