Problème de mise en place de thread
Bonjour,
J'essaye en vain d'instaurer un système de thread dans mon code mais j'ai une belle erreur à la compilation :
Code:
error:*argument*of*type*'int*(mainwindow::)(void*)'*does*not*match*'int*(*)(void*)'|
Voici ma fonction thread :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
|
int mainwindow::my_thread(void *data)
{
while(quitThread == false)
{
SDL_BlitSurface(feu1, NULL, screen, &positionFond);
SDL_Delay(1000);
SDL_BlitSurface(feu2, NULL, screen, &positionFond);
SDL_Delay(1000);
SDL_BlitSurface(feu3, NULL, screen, &positionFond);
}
return 0;
} |
et la déclaration de SDL_thread dans une autre fonction :
Code:
1 2
| SDL_Thread *thread;
thread = SDL_CreateThread(my_thread, NULL); |
Merci