|
gKit2 light
|
Files | |
| file | app.h |
| file | text.h |
| file | widgets.h |
| file | window.h |
Classes | |
| class | App |
| classe application. More... | |
| struct | Text |
| struct | Widgets |
Typedefs | |
| typedef SDL_Window * | Window |
| typedef SDL_GLContext | Context |
Functions | |
| App::App (const int width, const int height, const int major=3, const int minor=3) | |
| constructeur, dimensions de la fenetre et version d'openGL. More... | |
| virtual int | App::init ()=0 |
| a deriver pour creer les objets openGL. More... | |
| virtual int | App::quit ()=0 |
| a deriver pour detruire les objets openGL. More... | |
| virtual int | App::update (const float time, const float delta) |
| a deriver et redefinir pour animer les objets en fonction du temps. More... | |
| virtual int | App::render ()=0 |
| a deriver pour afficher les objets. More... | |
| int | App::run () |
| execution de l'application. More... | |
| float | App::global_time () |
| renvoie le temps ecoule depuis le lancement de l'application, en millisecondes. More... | |
| float | App::delta_time () |
| renvoie le temps ecoule depuis la derniere frame, en millisecondes. More... | |
| 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... | |
| 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) |
| creation d'une fenetre pour l'application. More... | |
| void | release_window (Window w) |
| destruction de la fenetre. More... | |
| Context | create_context (Window window, const int major=3, const int minor=2) |
| 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 | 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... | |
| int | run (Window window, int(*draw)(void)) |
| fonction principale. gestion des evenements et appel de la fonction draw de l'application. More... | |
| int | events (Window window) |
| fonction interne de gestion d'evenements. More... | |
Variables | |
| Window | App::m_window |
| Context | App::m_context |
| unsigned int | App::m_time |
| unsigned int | App::m_delta |
| App::App | ( | const int | width, |
| const int | height, | ||
| const int | major = 3, |
||
| const int | minor = 3 |
||
| ) |
constructeur, dimensions de la fenetre et version d'openGL.
Definition at line 6 of file app.cpp.
|
pure virtual |
a deriver pour creer les objets openGL.
Implemented in TP, TP, DrawInstanceBuffer, Framebuffer, TP, DrawInstanceID, TP, and TP.
|
pure virtual |
a deriver pour detruire les objets openGL.
Implemented in Framebuffer, DrawInstanceBuffer, TP, DrawInstanceID, TP, TP, TP, and TP.
|
inlinevirtual |
a deriver et redefinir pour animer les objets en fonction du temps.
Reimplemented in Framebuffer, DrawInstanceBuffer, TP, TP, DrawInstanceID, TP, and TP.
|
pure virtual |
a deriver pour afficher les objets.
Implemented in Framebuffer, DrawInstanceBuffer, TP, TP, DrawInstanceID, TP, TP, and TP.
| int App::run | ( | ) |
execution de l'application.
Definition at line 21 of file app.cpp.
| float App::global_time | ( | ) |
| float App::delta_time | ( | ) |
| 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 | ||
| ) |
affiche un texte a la position x, y.
Definition at line 122 of file text.cpp.
| 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.
Definition at line 127 of file text.cpp.
| 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().
Definition at line 140 of file text.cpp.
choisit une couleur par defaut pour le texte.
| 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 232 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 278 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.
| 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 363 of file widgets.cpp.
choisit une couleur par defaut pour le texte.
Definition at line 368 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 373 of file widgets.cpp.
| Window create_window | ( | const int | width, |
| const int | height | ||
| ) |
creation d'une fenetre pour l'application.
Definition at line 186 of file window.cpp.
| void release_window | ( | Window | w | ) |
destruction de la fenetre.
Definition at line 222 of file window.cpp.
| Context create_context | ( | Window | window, |
| const int | major, | ||
| const int | minor | ||
| ) |
cree et configure un contexte opengl.
cree et configure un contexte opengl.
Definition at line 252 of file window.cpp.
| void release_context | ( | Context | context | ) |
detruit le contexte openGL.
Definition at line 306 of file window.cpp.
| int window_width | ( | ) |
renvoie la largeur de la fenetre de l'application.
Definition at line 14 of file window.cpp.
| int window_height | ( | ) |
renvoie la hauteur de la fenetre de l'application.
Definition at line 18 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 24 of file window.cpp.
| void clear_key_state | ( | const SDL_Keycode | key | ) |
desactive une touche du clavier.
Definition at line 30 of file window.cpp.
| SDL_KeyboardEvent key_event | ( | ) |
renvoie le dernier evenement. touche speciales.
Definition at line 38 of file window.cpp.
| void clear_key_event | ( | ) |
desactive l'evenement.
Definition at line 42 of file window.cpp.
| SDL_MouseButtonEvent button_event | ( | ) |
renvoie le dernier evenement. etat des boutons de la souris.
Definition at line 69 of file window.cpp.
| void clear_button_event | ( | ) |
| SDL_MouseWheelEvent wheel_event | ( | ) |
renvoie le dernier evenement. etat de la molette de la souris / glisser sur le pad.
Definition at line 79 of file window.cpp.
| void clear_wheel_event | ( | ) |
desactive l'evenement.
Definition at line 83 of file window.cpp.
| SDL_TextInputEvent text_event | ( | ) |
renvoie le dernier evenement. saisie de texte.
Definition at line 49 of file window.cpp.
| void clear_text_event | ( | ) |
| 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 | ) |
1.8.6