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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.