Bonjour, excusez moi j'essaye d'intégrer SDL à mon code afin de pouvoir afficher graphiquement les différents processus. Seulement rien ne se passe


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
18
19
20
21
22
23
24
25
26
27
28
29
30
31
SDL_Surface*image1;
SDL_Rect positionimg1;
void image1(int number, int id) {
    voiture1 = SDL_LoadBMP("image1.bmp");
    SDL_SetColorKey(image1, SDL_SRCCOLORKEY, SDL_MapRGB(image1->format, 255, 255, 255));
 
    positionimg1.x = 0;
    positionimg1.y = 180;
 
    SDL_BlitSurface(image1, NULL, ecran, &positionimage1);
 
    printf("\t img1 arrive, id, number);
 
    ....
 
    SDL_Flip(ecran);
}
 
int main (int n, char *args[]) {
 
    switch (pid = fork()) {
        case -1: perror("Creation de processus");
            return 2;
        case 0:
            srandom (pid);
            img1(1,1);
            return 0;
    }
 
    ....
}
Merci de votre aide