SANDAL2
A SDL2 Wrapper in C
SANDAL2.h
Go to the documentation of this file.
1 #ifndef MAIN_SANDAL2_KLEVH
2 #define MAIN_SANDAL2_KLEVH
3 
4 #ifdef __cplusplus
5 extern "C" {
6 #endif
7 
8 #include "Element.h"
9 
24 
25 #ifdef DEBUG_SDL2_NO_VIDEO
26 extern Uint32 currentDisplaied;
27 #endif
28 
29 /* -------------------------------------------------------
30  * Initialisation et fermeture des outils
31  */
37 int initAllSANDAL2(int imageFlags);
41 void closeAllSANDAL2(void);
46 int initSANDAL2(void);
52 int initImageSANDAL2(int imageFlags);
57 int initTextSANDAL2(void);
61 void closeSANDAL2(void);
65 void closeImageSANDAL2(void);
69 void closeTextSANDAL2(void);
70 /* ------------------------------------------------------- */
71 
72 /* -------------------------------------------------------
73  * Creation, modification et suppression des fenetres
74  */
85 Uint32 createWindow(int width,int height,const char *title,int SDLFlags,int background[4],int displayCode);
90 int closeWindow(void);
95 int shouldCloseWindow(void);
100 int closeAllWindow(void);
105 int toggleFullScreenWindow(void);
110 int isFullScreenWindow(void);
111 /* ------------------------------------------------------- */
112 
113 /* -------------------------------------------------------
114  * Gestion des Fenetres
115  */
120 int updateWindow(void);
125 int displayWindow(void);
131 int clickWindow(SDL_MouseButtonEvent button);
137 int unclickWindow(SDL_MouseButtonEvent button);
143 int keyPressedWindow(int c);
149 int keyReleasedWindow(int c);
156 int onMouseMotionWindow(int x, int y);
162 int onWheelWindow(int y);
167 int onFocusedWindow(void);
172 int unFocusedWindow(void);
177 unsigned long updateAllWindow(void);
182 unsigned long displayAllWindow(void);
183 /* ------------------------------------------------------- */
184 
185 /* -------------------------------------------------------
186  * Gestion d'evenement et boucle principale
187  */
193 int PollEvent(unsigned long * error);
200 unsigned long mainLoop(unsigned short maxFPS);
201 /* ------------------------------------------------------- */
202 
203 #ifdef __cplusplus
204 }
205 #endif
206 
207 #endif
int unFocusedWindow(void)
activation of the losing focus event
Definition: SANDAL2.c:918
int initAllSANDAL2(int imageFlags)
Initialisation of SANDAL2, its image and fonts (return 1 if initialisation error, 2 if image initiali...
Definition: SANDAL2.c:101
int closeWindow(void)
close the current windows and go to the next, do not use this one in elements' or windows' binded fun...
Definition: SANDAL2.c:316
int initImageSANDAL2(int imageFlags)
Initialisation of images alone.
Definition: SANDAL2.c:141
void closeTextSANDAL2(void)
Close font.
Definition: SANDAL2.c:169
int onFocusedWindow(void)
activation of the gaining focus event
Definition: SANDAL2.c:900
int keyReleasedWindow(int c)
activation of the key released events on the current window
Definition: SANDAL2.c:767
int unclickWindow(SDL_MouseButtonEvent button)
activation of unclick events on the current window
Definition: SANDAL2.c:668
unsigned long updateAllWindow(void)
update all the elements of all the windows
Definition: SANDAL2.c:935
int closeAllWindow(void)
close all windows
Definition: SANDAL2.c:367
unsigned long displayAllWindow(void)
actualise the display of all the windows
Definition: SANDAL2.c:964
int displayWindow(void)
actualise the display of the current window
Definition: SANDAL2.c:508
int keyPressedWindow(int c)
activation of the key pressed events on the current window
Definition: SANDAL2.c:730
int onWheelWindow(int y)
activation of the mouseWheel event on the current window
Definition: SANDAL2.c:885
void closeSANDAL2(void)
Close SDL2.
Definition: SANDAL2.c:161
int isFullScreenWindow(void)
Tells whether or not the window is in full screen mode.
Definition: SANDAL2.c:400
int initSANDAL2(void)
Initialisation of SANDAL2 alone.
Definition: SANDAL2.c:125
int PollEvent(unsigned long *error)
Get the event (if there is one) and apply the corresponding functions.
Definition: SANDAL2.c:1028
int initTextSANDAL2(void)
Initialisation of text alone.
Definition: SANDAL2.c:151
void closeAllSANDAL2(void)
Close SANDAL2, images and font.
Definition: SANDAL2.c:118
unsigned long mainLoop(unsigned short maxFPS)
Run the standard SANDAL2 loop Do PollEvent(), call update then display and wait for a certain amount ...
Definition: SANDAL2.c:1106
Uint32 createWindow(int width, int height, const char *title, int SDLFlags, int background[4], int displayCode)
Add a window to the list of windows.
Definition: SANDAL2.c:193
int toggleFullScreenWindow(void)
Toggle the full screen mode of the current window.
Definition: SANDAL2.c:386
Contains all structures related to Elements.
void closeImageSANDAL2(void)
Close images.
Definition: SANDAL2.c:165
int clickWindow(SDL_MouseButtonEvent button)
activation of click events on the current window
Definition: SANDAL2.c:588
int shouldCloseWindow(void)
tells that the current window should be closed, do not use this one in functions that are not binded ...
Definition: SANDAL2.c:356
list of windows
Definition: Window.h:128
int onMouseMotionWindow(int x, int y)
activate the mouse motion events on the current window
Definition: SANDAL2.c:804
ListWindow * _windows_SANDAL2
list of windows WARNING : do not touch this variable, never ... trust me
Definition: Window.c:3
int updateWindow(void)
update all the elements of the current window
Definition: SANDAL2.c:410