SFML community forums
Help => Graphics => Topic started by: Flaze07 on July 10, 2017, 06:09:58 am
-
hi so I checked these out because I want to draw with both sfgui and sfml
and with this code nothing is drawn
win.pushGLStates();
if (option == Option::rectangle)
{
win.draw(rect);
}
win.popGLStates();
sfgui.Display(win)
but this one works
win.resetGLStates();
sfgui.Display(win);
win.resetGLStates();
if (option == Option::rectangle)
{
win.draw(rect);
}
full code
https://gist.github.com/Flaze07/7b10a4762523180a0169f49848d648cb (https://gist.github.com/Flaze07/7b10a4762523180a0169f49848d648cb)
-
The basic promise is simple: Keep the OpenGL state vs. starting fresh. If you're using `ressetGLSStates()`, you're always starting fresh, which is perfectly fine. It's just a different approach to the same problem.