Hi.
I got my game running on Windows, Linux, OS X and iOS, but I have an issue with Android. Whenever I create a texture inside a thread (which is used to load assets while still rendering/updating/animating the UI fluidly), the app crashes. Using current git branch "feature/system-handle". Mind that the following code works on the other 4 operation-systems without a problem.
Minimal sample:
#include <SFML/Window/Event.hpp>
#include <SFML/System/Thread.hpp>
#include <SFML/Graphics/RenderWindow.hpp>
#include <SFML/Graphics/Texture.hpp>
int main(int argc, char* argv[])
{
sf::RenderWindow window(sf::VideoMode::getDesktopMode(), "access violation in constructor");
bool loaded = false;
sf::Texture* tex;
sf::Thread thread([&]()
{
tex = new sf::Texture(); // crashing in this line on Android only
loaded = tex->loadFromFile("res/img/gui/Window.png");
});
thread.launch() ;
while ( window.isOpen() )
{
sf::Event event ;
while ( window.pollEvent(event) )
{
if ( event.type == sf::Event::Closed )
window.close() ;
}
if(loaded)
window.setTitle("Thread done, close now");
}
delete tex;
return 0;
}