gKit2 light
Loading...
Searching...
No Matches
text.h
Go to the documentation of this file.
1
2#ifndef _TEXT_H
3#define _TEXT_H
4
5#include "glcore.h"
6
7#include "color.h"
8
9
12
52
61struct Text
62{
63 Text( ) : color( White() ), font(0), program(0), vao(0), ubo(0) {}
64
65 int buffer[24][128];
67 GLuint font;
68 GLuint program;
69 GLuint vao;
70 GLuint ubo;
71};
72
76void release_text( Text& text );
77
78
79
81void clear( Text& text );
83void print_background( Text& text, const int x, const int y, const int background, const char c );
85void print_background( Text& text, const int x, const int y, const char *message );
87void print( Text& text, const int x, const int y, const char *message );
89void printf_background( Text& text, const int x, const int y, const char *format, ... );
91void printf( Text& text, const int x, const int y, const char *format, ... );
92
94void default_color( Text& text, const Color& color );
95
97void draw( const Text& text, const int width, const int height );
98
100#endif
void clear(Text &text)
efface le contenu de la console.
Definition text.cpp:72
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 text.cpp:140
Text create_text()
cree une console. a detruire avec release_text( ).
Definition text.cpp:14
void draw(const Text &text, const int width, const int height)
dessine la console.
Definition text.cpp:158
void print(Text &text, const int x, const int y, const char *message)
affiche un texte a la position x, y.
Definition text.cpp:122
void default_color(Text &text, const Color &color)
choisit une couleur par defaut pour le texte.
Definition text.cpp:153
void release_text(Text &text)
detruit une console.
Definition text.cpp:64
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.
Definition text.cpp:106
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 text.cpp:127
Color White()
utilitaire. renvoie une couleur blanche.
Definition color.cpp:23
representation d'une couleur (rgba) transparente ou opaque.
Definition color.h:14
Definition text.h:62
GLuint font
texture contenant les caracteres.
Definition text.h:67
GLuint vao
vertex array object.
Definition text.h:69
GLuint ubo
uniform buffer object, pour transferrer le texte a afficher
Definition text.h:70
GLuint program
shader pour afficher le texte.
Definition text.h:68
Color color
couleur du texte.
Definition text.h:66