|
gKit2 light
|
Files | |
| file | text.h |
| file | widgets.h |
| file | window.h |
Classes | |
| struct | Text |
| struct | Widgets |
Typedefs | |
| typedef SDL_Window * | Window |
| typedef SDL_GLContext | Context |
Functions | |
| Text | create_text () |
| cree une console. a detruire avec release_text( ). More... | |
| void | release_text (Text &text) |
| detruit une console. More... | |
| void | clear (Text &text) |
| efface le contenu de la console. More... | |
| void | print_background (Text &text, const int x, const int y, const int background, const char c) |
| affiche un caractere c sur un fond background. More... | |
| void | print_background (Text &text, const int x, const int y, const char *message) |
| affiche un caractere c sur un fond par defaut. More... | |
| void | print (Text &text, const int x, const int y, const char *message) |
| affiche un texte a la position x, y. More... | |
| void | printf_background (Text &text, const int x, const int y, const char *format,...) |
| affiche un texte a la position x, y sur un fond par defaut. More... | |
| void | printf (Text &text, const int x, const int y, const char *format,...) |
| affiche un texte a la position x, y. meme utilisation que printf(). More... | |
| void | default_color (Text &text, const Color &color) |
| choisit une couleur par defaut pour le texte. More... | |
| void | draw (const Text &text, const int width, const int height) |
| dessine la console. More... | |
| Widgets | create_widgets () |
| cree une interface graphique. a detruire avec release_widgets( ). More... | |
| void | release_widgets (Widgets &widgets) |
| detruit l'interface graphique. More... | |
| void | begin (Widgets &widgets) |
| debut de la description des elements de l'interface graphique. More... | |
| void | begin_line (Widgets &widgets) |
| place les prochains elements sur une nouvelle ligne. More... | |
| void | label (Widgets &widgets, const char *format,...) |
| cree un texte. meme fonctionnement que printf(). More... | |
| bool | button (Widgets &widgets, const char *text, int &status) |
| bool | select (Widgets &widgets, const char *text, const int option, int &status) |
| void | text_area (Widgets &w, const int height, const char *text, int &begin_line) |
| bool | edit (Widgets &widgets, const int text_size, char *text) |
| bool | value (Widgets &widgets, const char *label, int &value, const int value_min, const int value_max, const int value_step) |
| valeur editable par increment. More... | |
| bool | value (Widgets &widgets, const char *label, float &value, const float value_min, const float value_max, const float value_step) |
| valeur editable par increment. More... | |
| void | end_line (Widgets &widgets) |
| termine la description des elements de la ligne. More... | |
| void | end (Widgets &widgets) |
| termine la description des elements de l'interface graphique. More... | |
| void | default_color (Widgets &widgets, const Color &color) |
| choisit une couleur par defaut pour le texte. More... | |
| void | draw (Widgets &widgets, const int width, const int height) |
| affiche les elements decrits entre begin() et end(). More... | |
| Window | create_window (const int width, const int height, const int major=3, const int minor=2, const int samples=0) |
| creation d'une fenetre pour l'application. More... | |
| void | release_window (Window w) |
| destruction de la fenetre. More... | |
| Context | create_context (Window window) |
| cree et configure un contexte opengl. More... | |
| void | release_context (Context context) |
| detruit le contexte openGL. More... | |
| int | window_width () |
| renvoie la largeur de la fenetre de l'application. More... | |
| int | window_height () |
| renvoie la hauteur de la fenetre de l'application. More... | |
| int | window_msaa () |
| renvoie le nombre de samples MSAA. More... | |
| int | key_state (const SDL_Keycode key) |
| renvoie l'etat d'une touche du clavier. cf la doc SDL2 pour les codes. More... | |
| void | clear_key_state (const SDL_Keycode key) |
| desactive une touche du clavier. More... | |
| SDL_KeyboardEvent | key_event () |
| renvoie le dernier evenement. touche speciales. More... | |
| void | clear_key_event () |
| desactive l'evenement. More... | |
| SDL_MouseButtonEvent | button_event () |
| renvoie le dernier evenement. etat des boutons de la souris. More... | |
| void | clear_button_event () |
| desactive l'evenement. More... | |
| SDL_MouseWheelEvent | wheel_event () |
| renvoie le dernier evenement. etat de la molette de la souris / glisser sur le pad. More... | |
| void | clear_wheel_event () |
| desactive l'evenement. More... | |
| SDL_TextInputEvent | text_event () |
| renvoie le dernier evenement. saisie de texte. More... | |
| void | clear_text_event () |
| desactive l'evenement. More... | |
| float | global_time () |
| renvoie le temps ecoule depuis le lancement de l'application, en millisecondes. More... | |
| float | delta_time () |
| renvoie le temps ecoule depuis la derniere frame, en millisecondes. More... | |
| int | run (Window window, int(*draw)(void)) |
| fonction principale. gestion des evenements et appel de la fonction draw de l'application. More... | |
| int | last_event_count () |
| int | events (Window window) |
| fonction interne de gestion d'evenements. More... | |
| const char * | smart_path (const char *filename) |
| renvoie le chemin(path) vers le fichier 'filename' apres l'avoir cherche dans un repertoire standard... More... | |
| const char * | drop_event () |
| drag/drop, renvoie le dernier fichier. More... | |
| void | clear_drop_event () |
| desactive drag/drop. More... | |
| const std::vector< std::string > & | drop_events () |
| drag/drop. recupere tous les fichiers. More... | |
| void | clear_drop_events () |
| desactive drag/drop. More... | |
| Text create_text | ( | ) |
cree une console. a detruire avec release_text( ).
Definition at line 14 of file text.cpp.
| void release_text | ( | Text & | text | ) |
detruit une console.
Definition at line 64 of file text.cpp.
| void clear | ( | Text & | text | ) |
| void print_background | ( | Text & | text, |
| const int | x, | ||
| const int | y, | ||
| const int | background, | ||
| const char | c | ||
| ) |
affiche un caractere c sur un fond background.
| void print_background | ( | Text & | text, |
| const int | x, | ||
| const int | y, | ||
| const char * | message | ||
| ) |
affiche un caractere c sur un fond par defaut.
Definition at line 117 of file text.cpp.
| void print | ( | Text & | text, |
| const int | x, | ||
| const int | y, | ||
| const char * | message | ||
| ) |
| void printf_background | ( | Text & | text, |
| const int | x, | ||
| const int | y, | ||
| const char * | format, | ||
| ... | |||
| ) |
| void printf | ( | Text & | text, |
| const int | x, | ||
| const int | y, | ||
| const char * | format, | ||
| ... | |||
| ) |
| void draw | ( | const Text & | text, |
| const int | width, | ||
| const int | height | ||
| ) |
dessine la console.
Definition at line 158 of file text.cpp.
| Widgets create_widgets | ( | ) |
cree une interface graphique. a detruire avec release_widgets( ).
Definition at line 12 of file widgets.cpp.
| void release_widgets | ( | Widgets & | widgets | ) |
| void begin | ( | Widgets & | widgets | ) |
debut de la description des elements de l'interface graphique.
Definition at line 29 of file widgets.cpp.
| void begin_line | ( | Widgets & | widgets | ) |
place les prochains elements sur une nouvelle ligne.
Definition at line 129 of file widgets.cpp.
| void label | ( | Widgets & | widgets, |
| const char * | format, | ||
| ... | |||
| ) |
cree un texte. meme fonctionnement que printf().
Definition at line 142 of file widgets.cpp.
| bool button | ( | Widgets & | widgets, |
| const char * | text, | ||
| int & | status | ||
| ) |
cree un bouton. renvoie true si le bouton a change d'etat.
| text | legende du bouton, |
| status | etat du bouton, 1 selectionne, 0 non selectionne. doit etre initialise a 0 avant la premiere utilisation. |
Definition at line 155 of file widgets.cpp.
| bool select | ( | Widgets & | widgets, |
| const char * | text, | ||
| const int | option, | ||
| int & | status | ||
| ) |
cree un radio bouton. selectionne une seule option parmis une liste. renvoie true si le bouton a change d'etat.
| text | legende du bouton, |
| option | position du bouton dans le groupe, |
| status | option/bouton selectionne. doit etre initialise avec l'option par defaut avant la premiere utilisation. |
Definition at line 173 of file widgets.cpp.
| void text_area | ( | Widgets & | w, |
| const int | height, | ||
| const char * | text, | ||
| int & | begin_line | ||
| ) |
cree une zone de texte scrollable.
| height | nombre de lignes. |
| text | contenu a afficher. |
| begin_line | premiere ligne du texte a afficher. doit etre initialise avant la premiere utilisation. |
Definition at line 273 of file widgets.cpp.
| bool edit | ( | Widgets & | widgets, |
| const int | text_size, | ||
| char * | text | ||
| ) |
cree un champ texte editable. renvoie true si le contenu a change.
| text_size | taille du champ texte et de la chaine text, zero inclus. si text_size fait 10 caracteres, on ne pourra saisir que 9 caracteres. |
| text | contenu du champ, doit etre initialise avant la premiere utilisation. |
Definition at line 319 of file widgets.cpp.
| bool value | ( | Widgets & | widgets, |
| const char * | label, | ||
| int & | value, | ||
| const int | value_min, | ||
| const int | value_max, | ||
| const int | value_step | ||
| ) |
valeur editable par increment.
Definition at line 191 of file widgets.cpp.
| bool value | ( | Widgets & | widgets, |
| const char * | label, | ||
| float & | value, | ||
| const float | value_min, | ||
| const float | value_max, | ||
| const float | value_step | ||
| ) |
| void end_line | ( | Widgets & | widgets | ) |
termine la description des elements de la ligne.
Definition at line 136 of file widgets.cpp.
| void end | ( | Widgets & | widgets | ) |
termine la description des elements de l'interface graphique.
Definition at line 404 of file widgets.cpp.
choisit une couleur par defaut pour le texte.
Definition at line 409 of file widgets.cpp.
| void draw | ( | Widgets & | widgets, |
| const int | width, | ||
| const int | height | ||
| ) |
affiche les elements decrits entre begin() et end().
Definition at line 414 of file widgets.cpp.
| Window create_window | ( | const int | width, |
| const int | height, | ||
| const int | major = 3, |
||
| const int | minor = 2, |
||
| const int | samples = 0 |
||
| ) |
creation d'une fenetre pour l'application.
Definition at line 259 of file window.cpp.
| void release_window | ( | Window | w | ) |
destruction de la fenetre.
Definition at line 325 of file window.cpp.
| Context create_context | ( | Window | window | ) |
cree et configure un contexte opengl.
cree et configure un contexte opengl.
Definition at line 356 of file window.cpp.
| void release_context | ( | Context | context | ) |
detruit le contexte openGL.
Definition at line 422 of file window.cpp.
| int window_width | ( | ) |
renvoie la largeur de la fenetre de l'application.
Definition at line 25 of file window.cpp.
| int window_height | ( | ) |
renvoie la hauteur de la fenetre de l'application.
Definition at line 29 of file window.cpp.
| int window_msaa | ( | ) |
renvoie le nombre de samples MSAA.
Definition at line 34 of file window.cpp.
| int key_state | ( | const SDL_Keycode | key | ) |
renvoie l'etat d'une touche du clavier. cf la doc SDL2 pour les codes.
Definition at line 42 of file window.cpp.
| void clear_key_state | ( | const SDL_Keycode | key | ) |
desactive une touche du clavier.
Definition at line 48 of file window.cpp.
| SDL_KeyboardEvent key_event | ( | ) |
renvoie le dernier evenement. touche speciales.
Definition at line 56 of file window.cpp.
| void clear_key_event | ( | ) |
desactive l'evenement.
Definition at line 60 of file window.cpp.
| SDL_MouseButtonEvent button_event | ( | ) |
renvoie le dernier evenement. etat des boutons de la souris.
Definition at line 102 of file window.cpp.
| void clear_button_event | ( | ) |
desactive l'evenement.
Definition at line 106 of file window.cpp.
| SDL_MouseWheelEvent wheel_event | ( | ) |
renvoie le dernier evenement. etat de la molette de la souris / glisser sur le pad.
Definition at line 112 of file window.cpp.
| void clear_wheel_event | ( | ) |
desactive l'evenement.
Definition at line 116 of file window.cpp.
| SDL_TextInputEvent text_event | ( | ) |
renvoie le dernier evenement. saisie de texte.
Definition at line 67 of file window.cpp.
| void clear_text_event | ( | ) |
| float global_time | ( | ) |
renvoie le temps ecoule depuis le lancement de l'application, en millisecondes.
Definition at line 128 of file window.cpp.
| float delta_time | ( | ) |
renvoie le temps ecoule depuis la derniere frame, en millisecondes.
Definition at line 137 of file window.cpp.
| int run | ( | Window | window, |
| int(*)(void) | draw | ||
| ) |
fonction principale. gestion des evenements et appel de la fonction draw de l'application.
| int events | ( | Window | window | ) |
fonction interne de gestion d'evenements.
Definition at line 170 of file window.cpp.
| const char* smart_path | ( | const char * | filename | ) |
renvoie le chemin(path) vers le fichier 'filename' apres l'avoir cherche dans un repertoire standard...
Definition at line 431 of file window.cpp.
| const char* drop_event | ( | ) |
drag/drop, renvoie le dernier fichier.
Definition at line 82 of file window.cpp.
| void clear_drop_event | ( | ) |
| const std::vector<std::string>& drop_events | ( | ) |
drag/drop. recupere tous les fichiers.
Definition at line 77 of file window.cpp.
| void clear_drop_events | ( | ) |