*Hello,*

I have this error when porting a game written in C to HTML with emscripten :

SDL_Delay called on the main thread! Potential infinite loop, quitting. 


     
*some c code using emscripten :*

int main ( int argc, char** argv )
{
#ifdef EMSCRIPTEN

    emscripten_set_main_loop(playgame, 0, 1);

#endif
}

void playgame()
{
    if (collision_with_enemy==1 )
    {
        SDL_BlitSurface(image1, NULL, screen, &position);
        SDL_Flip(screen);

        SDL_Delay(10);
       

        SDL_BlitSurface(image2, NULL, screen, &position);
        SDL_Flip(screen);
    }
}




If i delete the delay between the display of the two images I will see only 
the last image because there is not a delay I do not know how to replace 
the SDL_Delay();
I want to do a little animation during the collision between the player and 
the enemy. 

Thank you.

-- 
You received this message because you are subscribed to the Google Groups 
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to