Fenêtre
Composant géré par le système de fenêtrage du système d'exploitation.
Structure
Pour contenir les données d'une fenêtre :
typedef struct SDL_Window SDL_Window;
Instanciation
Pour instancier une fenêtre :
SDL_Window* SDL_CreateWindow(const char* title, int w, int h, SDL_WindowFlags flags);
Indicateurs
Les indicateurs suivants peuvent être combinés :
| Indicateur | Description |
|---|---|
| SDL_WINDOW_FULLSCREEN | Plein écran. |
| SDL_WINDOW_OPENGL | Moteur de rendu OpenGL. |
| SDL_WINDOW_HIDDEN | Cachée. |
| SDL_WINDOW_BORDERLESS | Sans bordures. |
| SDL_WINDOW_RESIZABLE | Redimensionnable. |
| SDL_WINDOW_MAXIMIZED | Maximisée. |
| ... | ... |
Fonctions
Plusieurs fonctions, identifiées « SDL_GetWindow... » et « SDL_SetWindow... », permettent d'obtenir et de définir les données d'une fenêtre.
Identifiant
Pour obtenir l’identifiant d’une fenêtre :
SDL_WindowID SDL_GetWindowID(SDL_Window* window);
Titre
Pour obtenir le titre d’une fenêtre :
void SDL_GetWindowTitle(SDL_Window* window);
Pour définir le titre d’une fenêtre :
void SDL_SetWindowTitle(SDL_Window* window, const char* title);
Position
Pour obtenir la position d’une fenêtre :
bool SDL_GetWindowPosition(SDL_Window* window, int* x, int* y);
Pour définir la position d’une fenêtre :
bool SDL_SetWindowPosition(SDL_Window* window, int x, int y);
Dimensions
Pour obtenir les dimensions d’une fenêtre :
void SDL_GetWindowSize(SDL_Window* window, int* w, int* h);
Pour définir les dimensions d’une fenêtre :
void SDL_SetWindowSize(SDL_Window* window, int w, int h);
Plein écran
Pour définir si une fenêtre est plein écran :
bool SDL_SetWindowFullscreen(SDL_Window* window, bool fullscreen);
...
...
Libération
Pour libérer une instance de fenêtre :
void SDL_DestroyWindow(SDL_Window* window);