Bonjour, j'ai essayé de créer une structure afin que mon timer l'envoie à une fonction, mais je n'ai pas réussi.
Pouvez-vous me dire ce qui ne vas pas svp?
Dans ma fonction principale, j'ai voila comment j'ai déclaré ma structure (ces sous-variables existent deja):

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
struct PourChienr
{
    SDL_Rect positionChienr[16];
    long variable;
};
Ensuite, (premiere erreur*) voila mon timer:

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
while(positionChienr[15].x != 350)
        {
        timer = SDL_AddTimer(1000, animChienr, &PourChienr);
        }
*C:\Users\xavier\heenok\main.c|318|error: expected primary-expression before ')' token|

Et enfin ma fonction(2eme erreur*):

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
Uint32 animChienr(Uint32 intervalle, void *parametre)
{
    SDL_Rect* positionChienr = (SDL_Rect*)parametre;
     /* Conversion de void* en SDL_Rect* */
 
        positionChienr[variable].x = 100;
        positionChienr[variable].y = 100;
 
        variable ++;
 
        positionChienr[variable].x = 200 + variable * 10;
        positionChienr[variable].y = 400;
 
    return intervalle;
 
 
}

* C:\Users\xavier\heenok\main.c|1184|error: `variable' was not declared in this scope|

ps: desolé pour les balises, je n'ai pas trouvé