22 triangle=
Mesh(GL_TRIANGLES);
24 triangle.color(
Color(1, 0, 0));
25 triangle.vertex(-0.5, -0.5, 0);
27 triangle.color(
Color(0, 1, 0));
28 triangle.vertex(0.5, 0.5, 0);
30 triangle.color(
Color(0, 0, 1));
31 triangle.vertex(-0.5, 0.5, 0);
41 glClear(GL_COLOR_BUFFER_BIT);
78int main(
int argc,
char **argv )
95 printf(
"[error] init failed.\n");
representation d'un objet / maillage.
Context create_context(Window window)
cree et configure un contexte opengl
void release_window(Window window)
destruction de la fenetre.
int run(Window window, int(*draw)())
boucle de gestion des evenements de l'application.
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().
Window create_window(const int w, const int h, const int major, const int minor)
creation d'une fenetre pour l'application.
void release_context(Context context)
detruit le contexte openGL.
Transform Identity()
construit la transformation identite.
Transform RotationZ(const float a)
renvoie la matrice representation une rotation de angle degree autour de l'axe Z.
int init(std::vector< const char * > &options)
representation d'une couleur (rgba) transparente ou opaque.