Advertisement
Guest User

Untitled

a guest
Jul 11th, 2017
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. glShadeModel(GL_SMOOTH);
  2.         glMatrixMode(GL_PROJECTION);
  3.     glPushMatrix();
  4.     glLoadIdentity();
  5.  
  6.     glMatrixMode(GL_MODELVIEW);
  7.     glPushMatrix();
  8.     glLoadIdentity();
  9.  
  10.   //      glOrtho(0.0f,640,480, 0.0f,-1.0f,1.0f);
  11.         //glOrtho(0.0, 640, 0.0, 480, -1.0, 1.0);
  12.  
  13.     // render
  14.     glClearColor(0.0f, 0.0f, 0.0f, 0.5f);
  15.     glClear(GL_COLOR_BUFFER_BIT ); //| GL_DEPTH_BUFFER_BIT);
  16.     //glDisable(GL_DEPTH_TEST);
  17.     glBindTexture(GL_TEXTURE_2D, color_tex);
  18.     glEnable(GL_TEXTURE_2D);
  19.     glColor4f(1.0f,1.0f,1.0f,1.0f);
  20.  
  21.  
  22.  
  23.     // inverted y-TexCoord!
  24.     glBegin(GL_QUADS);
  25.                 glTexCoord2f (0.0, 0.0);
  26.             glVertex3f (-1, -1, -0.5);
  27.             glTexCoord2f (1.0, 0.0);
  28.             glVertex3f (1, -1, -0.5);
  29.             glTexCoord2f (1.0, 1.0);
  30.             glVertex3f (1, 1, -0.5);
  31.             glTexCoord2f (0.0, 1.0);
  32.             glVertex3f (-1, 1, -0.5);
  33.     glEnd();
  34.  
  35.     // end
  36.  
  37.  
  38.         glMatrixMode(GL_PROJECTION);
  39.     glPopMatrix();
  40.  
  41.         glMatrixMode(GL_MODELVIEW);
  42.     glPopMatrix();
  43.  
  44.         glFlush();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement