1
General / Re: [Advice/Warning] RenderWindow Android Crash
« on: April 14, 2016, 09:08:24 am »
Nope, it's well-known that globals are bad and that global OpenGL/SFML resources tend to blow up.
I cannot remember exactly what goes wrong when you have a global resource (if there is a post explaining that in detail the forum search isn't good enough to find it) but I'm under the impression that this is not the sort of thing SFML can "fix" but rather an inherent problem with using global variables that refer to objects from an extremely stateful API like OpenGL.
Yes, global variables are really error-prone (initialization and destruction order, multithreading, no access control, lots of dependencies). Even more sf::RenderWindow, never make it global.
I cannot remember exactly what goes wrong when you have a global resource (if there is a post explaining that in detail the forum search isn't good enough to find it) but I'm under the impression that this is not the sort of thing SFML can "fix" but rather an inherent problem with using global variables that refer to objects from an extremely stateful API like OpenGL.