![]() |
SANDAL2
A SDL2 Wrapper in C
|
SANDAL2.h is the file to include which includes everything else. Compilation flags to use : -lSDL2 -lSDL2_ttf -lSDL2_image -lm. More...
#include "Element.h"
Go to the source code of this file.
Functions | |
int | initAllSANDAL2 (int imageFlags) |
Initialisation of SANDAL2, its image and fonts (return 1 if initialisation error, 2 if image initialisation error, 3 if font initialisation error, 0 if not) using SDL2's image flags. More... | |
void | closeAllSANDAL2 (void) |
Close SANDAL2, images and font. | |
int | initSANDAL2 (void) |
Initialisation of SANDAL2 alone. More... | |
int | initImageSANDAL2 (int imageFlags) |
Initialisation of images alone. More... | |
int | initTextSANDAL2 (void) |
Initialisation of text alone. More... | |
void | closeSANDAL2 (void) |
Close SDL2. | |
void | closeImageSANDAL2 (void) |
Close images. | |
void | closeTextSANDAL2 (void) |
Close font. | |
Uint32 | createWindow (int width, int height, const char *title, int SDLFlags, int background[4], int displayCode) |
Add a window to the list of windows. More... | |
int | closeWindow (void) |
close the current windows and go to the next, do not use this one in elements' or windows' binded functions, use shouldCloseWindow() instead More... | |
int | shouldCloseWindow (void) |
tells that the current window should be closed, do not use this one in functions that are not binded to windows or elements, use closeWindow() instead More... | |
int | closeAllWindow (void) |
close all windows More... | |
int | toggleFullScreenWindow (void) |
Toggle the full screen mode of the current window. More... | |
int | isFullScreenWindow (void) |
Tells whether or not the window is in full screen mode. More... | |
int | updateWindow (void) |
update all the elements of the current window More... | |
int | displayWindow (void) |
actualise the display of the current window More... | |
int | clickWindow (SDL_MouseButtonEvent button) |
activation of click events on the current window More... | |
int | unclickWindow (SDL_MouseButtonEvent button) |
activation of unclick events on the current window More... | |
int | keyPressedWindow (int c) |
activation of the key pressed events on the current window More... | |
int | keyReleasedWindow (int c) |
activation of the key released events on the current window More... | |
int | onMouseMotionWindow (int x, int y) |
activate the mouse motion events on the current window More... | |
int | onWheelWindow (int y) |
activation of the mouseWheel event on the current window More... | |
int | onFocusedWindow (void) |
activation of the gaining focus event More... | |
int | unFocusedWindow (void) |
activation of the losing focus event More... | |
unsigned long | updateAllWindow (void) |
update all the elements of all the windows More... | |
unsigned long | displayAllWindow (void) |
actualise the display of all the windows More... | |
int | PollEvent (unsigned long *error) |
Get the event (if there is one) and apply the corresponding functions. More... | |
unsigned long | mainLoop (unsigned short maxFPS) |
Run the standard SANDAL2 loop Do PollEvent(), call update then display and wait for a certain amount of milliseconds. More... | |
Variables | |
ListWindow * | _windows_SANDAL2 |
list of windows WARNING : do not touch this variable, never ... trust me More... | |
SANDAL2.h is the file to include which includes everything else. Compilation flags to use : -lSDL2 -lSDL2_ttf -lSDL2_image -lm.
int clickWindow | ( | SDL_MouseButtonEvent | button | ) |
activation of click events on the current window
button | : Event informations of the button |
int closeAllWindow | ( | void | ) |
close all windows
int closeWindow | ( | void | ) |
close the current windows and go to the next, do not use this one in elements' or windows' binded functions, use shouldCloseWindow() instead
Uint32 createWindow | ( | int | width, |
int | height, | ||
const char * | title, | ||
int | SDLFlags, | ||
int | background[4], | ||
int | displayCode | ||
) |
Add a window to the list of windows.
width | : width of the window |
height | : height of the window |
title | : title of the window |
SDLFlags | : flags of SDL2 |
background | : color of the background |
displayCode | : display code of the window |
unsigned long displayAllWindow | ( | void | ) |
actualise the display of all the windows
int displayWindow | ( | void | ) |
actualise the display of the current window
int initAllSANDAL2 | ( | int | imageFlags | ) |
Initialisation of SANDAL2, its image and fonts (return 1 if initialisation error, 2 if image initialisation error, 3 if font initialisation error, 0 if not) using SDL2's image flags.
imageFlags | : SDL2's image flags |
int initImageSANDAL2 | ( | int | imageFlags | ) |
Initialisation of images alone.
imageFlags | : SDL2's image flags |
int initSANDAL2 | ( | void | ) |
Initialisation of SANDAL2 alone.
int initTextSANDAL2 | ( | void | ) |
Initialisation of text alone.
int isFullScreenWindow | ( | void | ) |
Tells whether or not the window is in full screen mode.
int keyPressedWindow | ( | int | c | ) |
activation of the key pressed events on the current window
c | : key which was pressed |
int keyReleasedWindow | ( | int | c | ) |
activation of the key released events on the current window
c | : key which was released |
unsigned long mainLoop | ( | unsigned short | maxFPS | ) |
Run the standard SANDAL2 loop Do PollEvent(), call update then display and wait for a certain amount of milliseconds.
maxFPS | number of maximum frame per seconds, it will tries to go that quick and will compensate if an iteration is longer than expected. If it is greater than 1000, it will be ignored and will be set to 60 instead. |
int onFocusedWindow | ( | void | ) |
activation of the gaining focus event
int onMouseMotionWindow | ( | int | x, |
int | y | ||
) |
activate the mouse motion events on the current window
x | : new x coordinate of the mouse |
y | : new y coordinate of the mouse |
int onWheelWindow | ( | int | y | ) |
activation of the mouseWheel event on the current window
y | : direction of the wheel |
int PollEvent | ( | unsigned long * | error | ) |
Get the event (if there is one) and apply the corresponding functions.
error | where to store the error flag (0 if it succeeded, a binary code telling which window failed (example : 100101 tells that the second and the fifth window failed, the first bit on the rigth only tells that there was an error), if you have more window than bits for int, you will not be able to tell which of the window failed in those which have a bigger number than the number of bit minus one) |
int shouldCloseWindow | ( | void | ) |
tells that the current window should be closed, do not use this one in functions that are not binded to windows or elements, use closeWindow() instead
int toggleFullScreenWindow | ( | void | ) |
Toggle the full screen mode of the current window.
int unclickWindow | ( | SDL_MouseButtonEvent | button | ) |
activation of unclick events on the current window
button | : Event informations of the button |
int unFocusedWindow | ( | void | ) |
activation of the losing focus event
unsigned long updateAllWindow | ( | void | ) |
update all the elements of all the windows
int updateWindow | ( | void | ) |
update all the elements of the current window
ListWindow* _windows_SANDAL2 |
list of windows WARNING : do not touch this variable, never ... trust me
list of windows WARNING : do not touch this variable, never ... trust me
List of the windows WARNING : do not touch it ... trust me.