Re: SDL_CreateRGBSurface in second thread?
"mediata" <[email protected]>
| Newsgroups | gmane.comp.lib.sdl |
|---|---|
| Message-ID | <[email protected]> |
I have progress about this question i create simple program to test this case
here is thread function:
Code:
static void
load_texture()
{
SDL_Surface *surface = nullptr;
std::cout << "THREAD STARTED!\n";
while (true)
{
surface = IMG_Load("images/wheel/background.png");
if (surface == nullptr)
{
std::cout << "ERROR LOADNING SURFACE!!!\n";
}
SDL_FreeSurface(surface);
usleep(5000);
}
std::cout << "THREAD END!\n";
}
And i have no problem with drawing and loading for past 10 minutes
_______________________________________________
SDL mailing list
[email protected]
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org