salut, essaye quelque chose comme ça :
/*** pour l'initialisation ***/ glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB); glutInitWindowSize(LARGEUR_FENETRE, HAUTEUR_FENETRE); glutInitWindowPosition(0, 0); // A ce niveau, les coordonnées sont calculées par rapport au coin haut-gauche *pIdF = glutCreateWindow("DrawPixelTest"); glutFullScreen();
/*** fonction rafraichir ***/ void rafraichir(int l, int h) { glViewport(0, 0, l, h); glMatrixMode(GL_PROJECTION); glLoadIdentity(); gluOrtho2D(0, l, h, 0); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); }
l'origine de l'ecran est en haut a gauche,pour tracer l'image il faut donc se decaler,car opengl tracera l'image par rapport au coin inferieur gauche,de l'image _________ | | | Image | O----------
glRasterPos2i(0,HAUTEUR_FENETRE);
glDrawPixels(image.bmiHeader.biWidth, image.bmiHeader.biHeight, GL_BGR_EXT,GL_UNSIGNED_BYTE, image.image_data);
/* DETRUIRE DATA IMAGE */ free(image.image_data);
kawito ------------------------------- Réponse au message : -------------------------------
> Bonjour, > j'afficher une image dans ma fenetre avec la fonction glDrawPixels mais je voudrais pouvoir l'afficher a des coordonnes precises sur la fenetre. > Existe-t-il une fonction me permettant de realiser cette fonctionnalite ? > D'avance merci
|