31 objet.bounds(pmin, pmax);
34 camera.lookat(pmin, pmax);
47 glClearColor(0.2f, 0.2f, 0.2f, 1.f);
52 glEnable(GL_DEPTH_TEST);
62 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
66 update_camera( camera );
69 draw(objet, camera, texture);
79 glDeleteTextures(1, &texture);
85int main(
int argc,
char **argv )
100 printf(
"[error] init failed.\n");
representation d'un objet / maillage.
representation de la camera, type orbiter, placee sur une sphere autour du centre de l'objet.
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.
Mesh read_mesh(const char *filename)
charge un fichier wavefront .obj et renvoie un mesh compose de triangles non indexes....
GLuint read_texture(const int unit, const char *filename, const GLenum texel_type)
int init(std::vector< const char * > &options)
representation d'un point 3d.