1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
void Face2D(float x,float y,float z)
{
glTexCoord2f(0.0f, 0.0f);
glVertex3f(-x,-y, z); // Haut Gauche
glTexCoord2f(1.0f, 0.0f);
glVertex3f( x,-y, z); // Haut Droite
glTexCoord2f(1.0f, 1.0f);
glVertex3f( x, y, z); // Bas Droite
glTexCoord2f(0.0f, 1.0f);
glVertex3f(-x, y, z); // Bas Gauche
}
void MNS_Draw(MNS_image *image,float l,float h,MNS_REPERE position,float resl,float resh)
{
glTexImage2D(GL_TEXTURE_2D,0,image->type,image->w,image->h,0,image->format,GL_UNSIGNED_BYTE,image->couleur);
glLoadIdentity();
glTranslated(position.x,position.y,0.0f);
glBegin(GL_QUADS);
Face2D(l*resl,h*resh,0);
glEnd();
} |
Partager