Advertisement
TheVarins

menu salominixa

Jan 30th, 2020
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.21 KB | None | 0 0
  1. void RysujTekstRastrowy(void* font, char* tekst)
  2. {
  3.     int i;
  4.  
  5.     for (i = 0; i < (int)strlen(tekst); i++)
  6.         glutBitmapCharacter(font, tekst[i]);
  7. }
  8.  
  9. void RysujNakladke(void) {
  10.     char buf[255];
  11.     glMatrixMode(GL_PROJECTION);
  12.     glPushMatrix();
  13.     glLoadIdentity();
  14.     glOrtho(0.0, szerokoscOkna, 0.0, wysokoscOkna, -100.0, 100.0);
  15.     glMatrixMode(GL_MODELVIEW);
  16.     glPushMatrix();
  17.     glLoadIdentity();
  18.     glDisable(GL_LIGHTING);
  19.  
  20.     int x = 140, y = 550;
  21.  
  22.     sprintf(buf, "Szymon Grzesiukiewicz");
  23.     glRasterPos2i(x, y);
  24.     RysujTekstRastrowy(GLUT_BITMAP_8_BY_13, buf);
  25.     y = y - 15;
  26.  
  27.     sprintf(buf, "Grupa: I8Y6S1");
  28.     glRasterPos2i(x, y);
  29.     RysujTekstRastrowy(GLUT_BITMAP_8_BY_13, buf);
  30.     y = y - 15;
  31.  
  32.     sprintf(buf, "Parametry bryly:");
  33.     glRasterPos2i(x, y);
  34.     RysujTekstRastrowy(GLUT_BITMAP_8_BY_13, buf);
  35.     y = y - 15;
  36.  
  37.     sprintf(buf, "R=1; H=3");
  38.     glRasterPos2i(x, y);
  39.     RysujTekstRastrowy(GLUT_BITMAP_8_BY_13, buf);
  40.     y = y - 15;
  41.  
  42.     sprintf(buf, "przyciski:");
  43.     glRasterPos2i(x, y);
  44.     RysujTekstRastrowy(GLUT_BITMAP_8_BY_13, buf);
  45.     y = y - 15;
  46.     sprintf(buf, "Strzalki oraz [] - poruszanie perspektywa");
  47.     glRasterPos2i(x, y);
  48.     RysujTekstRastrowy(GLUT_BITMAP_8_BY_13, buf);
  49.     y = y - 15;
  50.     sprintf(buf, "s,S ; d,D - wlaczanie i wylaczanie swiatel 1,2");
  51.     glRasterPos2i(x, y);
  52.     RysujTekstRastrowy(GLUT_BITMAP_8_BY_13, buf);
  53.     y = y - 15;
  54.     sprintf(buf, "3-5 - materialy");
  55.     glRasterPos2i(x, y);
  56.     RysujTekstRastrowy(GLUT_BITMAP_8_BY_13, buf);
  57.     y = y - 15;
  58.     sprintf(buf, "b,B - zobrazowanie wektorow");
  59.     glRasterPos2i(x, y);
  60.     RysujTekstRastrowy(GLUT_BITMAP_8_BY_13, buf);
  61.     y = y - 15;
  62.     sprintf(buf, "n,N - Tryby cieniowania");
  63.     glRasterPos2i(x, y);
  64.     RysujTekstRastrowy(GLUT_BITMAP_8_BY_13, buf);
  65.     y = y - 15;
  66.     sprintf(buf, "m - Fill/Lines");
  67.     glRasterPos2i(x, y);
  68.     RysujTekstRastrowy(GLUT_BITMAP_8_BY_13, buf);
  69.     y = y - 15;
  70.     sprintf(buf, "O,P - odleglosc obserwatora");
  71.     glRasterPos2i(x, y);
  72.     RysujTekstRastrowy(GLUT_BITMAP_8_BY_13, buf);
  73.     y = y - 15;
  74.     sprintf(buf, "1,2 - zmiany podzialow poziomych i pionowych");
  75.     glRasterPos2i(x, y);
  76.     RysujTekstRastrowy(GLUT_BITMAP_8_BY_13, buf);
  77.     y = y - 15;
  78.    
  79.  
  80.     glMatrixMode(GL_PROJECTION);
  81.     glPopMatrix();
  82.     glMatrixMode(GL_MODELVIEW);
  83.     glPopMatrix();
  84.     glEnable(GL_LIGHTING);
  85.  
  86. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement