Advertisement
Guest User

Untitled

a guest
Jan 25th, 2015
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.78 KB | None | 0 0
  1. void menu::render(){
  2.     glDisable(GL_LIGHTING);
  3.     glMatrixMode(GL_PROJECTION);
  4.     glPushMatrix();
  5.     glLoadIdentity();
  6.     gluOrtho2D(0.0, 0, 0.0, 0);
  7.  
  8.     glMatrixMode(GL_MODELVIEW);
  9.     glPushMatrix();
  10.     glLoadIdentity();
  11.     // Napisy
  12.        
  13.     string s1="Chuj do dupy!";
  14.     DrawString(-0.8,0.8,s1,1,0,0);
  15.  
  16.     glMatrixMode(GL_MODELVIEW);
  17.     glPopMatrix();
  18.  
  19.     glMatrixMode(GL_PROJECTION);
  20.     glPopMatrix();
  21.     glEnable(GL_LIGHTING);
  22. }
  23. void menu::DrawString( GLfloat x, GLfloat y, string string, float c1, float c2, float c3  )
  24. {
  25.     //kolor
  26.     glColor4f(c1,c2,c3,1);
  27.     // położenie napisu
  28.     glRasterPos2f( x, y );
  29.    
  30.     // wyświetlenie napisu
  31.     for( int i = 0; i < string.length(); i++ ){
  32.             //cout<<string[i];
  33.          glutBitmapCharacter( GLUT_BITMAP_TIMES_ROMAN_24, string[ i ] );
  34.     }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement