< SDL2.x
fin de la boite de navigation du chapitre

Voici un exemple minimal d'ouverture d'une fenêtre:

 1 #include <stdio.h>
 2 #include <stdlib.h>
 3 #include <SDL2/SDL.h>
 4  
 5 int main (int argc , char *argv[])
 6 {
 7     // initalisation
 8     SDL_Init(SDL_INIT_VIDEO);
 9 
10     // création d’une fenêtre
11     SDL_Window *win =
12         SDL_CreateWindow(
13             "SDL2 Window",
14             SDL_WINDOWPOS_CENTERED,
15             SDL_WINDOWPOS_CENTERED,
16             640, 480,
17             SDL_WINDOW_RESIZABLE);
18 
19     // attendre 3 secondes
20     SDL_Delay(3000);
21 
22     return 0;
23 }
Cet article est issu de Wikiversity. Le texte est sous licence Creative Commons - Attribution - Partage dans les Mêmes. Des conditions supplémentaires peuvent s'appliquer aux fichiers multimédias.