Hello,
My program was running fine with sfml 2.3.2 but after updating it didn't work anymore.
after some debugging I came to the conclusion that trying to use sf::Texture in a sf::Thread doesn't work anymore.
I used sf::Thread to call a method that loads my texture while the current thread would keep running , allowing me to animate the loading screen without it freezing while the files were loading
void Media::load(void (*f)()){
// ...
delete t;
t = new sf::Thread(f);
t->launch();
}
then the f() function loads some textures and creates sf::Sprite from them
but it doesn't work anymore.
as soon as I try to create a sf::Texture in the f() function it crashes.
I was previously using sfml 2.3.2 with TDM 4.7.1
I now use 2.4.0 with TDM 4.9.2
my program still works normally if I simply call f(); directly in the loading function, but that breaks my loading screens
information from debugging tool when trying to use texture from thread (also see attachment):
Program received signal SIGSEGV, Segmentation fault.
In ntdll!RtlUlonglongByteSwap () (C:\Windows\system32\ntdll.dll)
217 D:\sfml-release\_Sources\SFML\src\SFML\Window\GlContext.cpp: No such file or directory.
#12 0x6e181f76 in sf::priv::GlContext::ensureContext () at D:\sfml-release\_Sources\SFML\src\SFML\Window\GlContext.cpp:217
Debugger finished with status 0
Is there a solution other than "stop using threads" ?
Thanks in advance!