SDL2.x/Les fenêtres
< SDL2.x
Aller à la navigation
Aller à la recherche
Voici un exemple minimal d'ouverture d'une fenêtre:
1#include <stdio.h>
2#include <stdlib.h>
3#include <SDL2/SDL.h>
4
5int 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}