Пример #1
0
void HelpDisplay(GLint ww, GLint wh)
{
    glDisable(GL_LIGHTING);
    glDisable(GL_TEXTURE_2D);
    glColor3f(0.0,0.0,0.0);

    /*  mode projection*/
    glMatrixMode(GL_PROJECTION);
    glPushMatrix();
    glLoadIdentity();
    gluOrtho2D(0, ww, 0, wh);
    glScalef(1, -1, 1);
    glTranslatef(0, -wh, 0);
    glMatrixMode(GL_MODELVIEW);

    glPushMatrix();
    glLoadIdentity();
    linestart = 10;

    HelpRenderBitmapString(20, linestart +=linespace, (void *) Help_Font,"Pour deplacer un pion, cliquer dans la case qui le contient puis dans la case cible");
    HelpRenderBitmapString(20, linestart +=linespace, (void *) Help_Font,"----------------------------------------");
    HelpRenderBitmapString(20, linestart +=linespace, (void *) Help_Font,"H/h = Masquer ou Afficher l'Aide");
    HelpRenderBitmapString(20, linestart +=linespace, (void *) Help_Font,"O/o = Masquer ou Afficher l'ombre");
    HelpRenderBitmapString(20, linestart +=linespace, (void *) Help_Font,"B/b = Activer ou deactiver le brouillard");
    HelpRenderBitmapString(20, linestart +=linespace, (void *) Help_Font,"F/f = Activer ou deactiver le reflet");
    HelpRenderBitmapString(20, linestart +=linespace, (void *) Help_Font,"R/r = La rotation automatique");
    HelpRenderBitmapString(20, linestart +=linespace, (void *) Help_Font,"Fleches = La rotation manuelle");
    HelpRenderBitmapString(20, linestart +=linespace, (void *) Help_Font,"Espace = Affichage en plain ecran ");
    HelpRenderBitmapString(20, linestart +=linespace, (void *) Help_Font,"Esc = Quitter ");
    HelpRenderBitmapString(20, windowsH-40, (void *) Help_Font,"Realise par DIOUBATE SEKOU et ELHAMCHI SOUFIANE, Groupe 10, LSI");
    HelpRenderBitmapString(20, windowsH-20, (void *) Help_Font,"Encadre par Mr AITKBIR, proffesseur de traitement d'image");

    glPopMatrix();
    glMatrixMode(GL_PROJECTION);
    glPopMatrix();
    glMatrixMode(GL_MODELVIEW);


    glEnable(GL_LIGHTING);
    glEnable(GL_TEXTURE_2D);
}
Пример #2
0
} void HelpDisplay(GLint ww, GLint wh)
{
    glDisable(GL_LIGHTING);
    glDisable(GL_TEXTURE_2D);
    glColor3f(1.0f, 1.0f, 1.0f);

    /*  switch to projection mode */
    glMatrixMode(GL_PROJECTION);

    /*  save previous matrix which contains the  */
    /* settings for the perspective projection */
    glPushMatrix();

    /*  reset matrix */
    glLoadIdentity();

    /*  set a 2D orthographic projection */
    gluOrtho2D(0, ww, 0, wh);

    /*  invert the y axis, down is positive */
    glScalef(1, -1, 1);

    /*  mover the origin from the bottom left corner */
    /*  to the upper left corner */
    glTranslatef(0, -wh, 0);
    glMatrixMode(GL_MODELVIEW);
    glPushMatrix();
    glLoadIdentity();
    linestart = 10;
    HelpRenderBitmapString(30, linestart +=
			   linespace, Help_Font, "Help Menu");
    HelpRenderBitmapString(30, linestart +=
			   linespace, Help_Font, "---------");
    HelpRenderBitmapString(30, linestart +=
			   linespace, Help_Font,
			   "H/h = Toggle Help Menu");
    HelpRenderBitmapString(30, linestart +=
			   linespace, Help_Font,
			   "F2  = Toggle Full Screen");
    HelpRenderBitmapString(30, linestart +=
			   linespace, Help_Font,
			   "Esc = Exits Program");
    HelpRenderBitmapString(30, linestart +=
			   linespace, Help_Font,
			   "R/r = Reset Position");
    HelpRenderBitmapString(30, linestart +=
			   linespace, Help_Font,
			   "C/c = Toggle Axis");
    HelpRenderBitmapString(30, linestart +=
			   linespace, Help_Font,
			   "W/w = Toggle Wireframe");
    HelpRenderBitmapString(30, linestart +=
			   linespace, Help_Font,
			   "D/d = Toggle Double Sided Polygons");
    HelpRenderBitmapString(30, linestart +=
			   linespace, Help_Font,
			   "S/s = Toggle Smooth Shading");
    HelpRenderBitmapString(30, linestart +=
			   linespace, Help_Font,
			   "M/m = Toggle Materials");
    HelpRenderBitmapString(30, linestart +=
			   linespace, Help_Font,
			   "T/t = Toggle Textures");

    /* HelpRenderBitmapString(30,linestart+=linespace,(void *)Help_Font, "L/l = Toggle Line Smoothing");    */
#ifdef AVL
    HelpRenderBitmapString(30, linestart +=
			   linespace, Help_Font,
			   "F/f = Flip Textures");

#endif				/*  */
    if (stereo) {
	HelpRenderBitmapString(30, linestart +=
			       linespace, Help_Font,
			       "Stereo Variables");
	HelpRenderBitmapString(30, linestart +=
			       linespace, Help_Font,
			       "----------------");
	HelpRenderBitmapString(30, linestart +=
			       linespace, Help_Font,
			       "</, = Decrease Eye Separation");
	HelpRenderBitmapString(30, linestart +=
			       linespace, Help_Font,
			       ">/. = Increase Eye Separation");
	HelpRenderBitmapString(30, linestart +=
			       linespace, Help_Font,
			       "+/- = Increase/Decrease Focus Distance");
    }
    glPopMatrix();

    /*  set the current matrix to GL_PROJECTION */
    glMatrixMode(GL_PROJECTION);

    /*  restore previous settings */
    glPopMatrix();

    /*  get back to GL_MODELVIEW matrix */
    glMatrixMode(GL_MODELVIEW);
    glEnable(GL_LIGHTING);
    glEnable(GL_TEXTURE_2D);
} void HelpRenderBitmapString(float x, float y, void *font, char *string)