22 triangle=
Mesh(GL_TRIANGLES);
25 triangle.
vertex(-0.5, -0.5, 0);
28 triangle.
vertex(0.5, 0.5, 0);
31 triangle.
vertex(-0.5, 0.5, 0);
41 glClear(GL_COLOR_BUFFER_BIT);
77 int main(
int argc,
char **argv )
92 printf(
"[error] init failed.\n");
Context create_context(Window window, const int major, const int minor)
cree et configure un contexte opengl
Mesh & color(const vec4 &c)
definit la couleur du prochain sommet.
representation d'un objet / maillage.
representation d'une couleur (rgba) transparente ou opaque.
Transform Identity()
construit la transformation identite.
unsigned int vertex(const vec3 &p)
insere un sommet de position p, et ses attributs (s'ils sont definis par color(), texcoord()...
void draw(Mesh &m, const Transform &model, const Transform &view, const Transform &projection, const GLuint texture)
applique une texture a la surface de l'objet. ne fonctionne que si les coordonnees de textures sont f...
void release()
detruit les objets openGL.
Window create_window(const int w, const int h)
creation d'une fenetre pour l'application.
Transform RotationZ(const float a)
renvoie la matrice representation une rotation de angle degree autour de l'axe Z. ...
void printf(Text &text, const int px, const int py, const char *format,...)
affiche un texte a la position x, y. meme utilisation que printf().
void release_context(Context context)
detruit le contexte openGL.
void release_window(Window window)
destruction de la fenetre.
int run(Window window, int(*draw)(void))
fonction principale. gestion des evenements et appel de la fonction draw de l'application.