Guest User

Untitled

a guest
Jun 22nd, 2012
44
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     glViewport(0,0,128,128);
  2.  
  3.     //Render Object
  4.  
  5.     glBindTexture(GL_TEXTURE_2D, Texture);
  6.     glCopyTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE, 0, 0, 128, 128, 0);
  7.  
  8.     glClearColor(0.0f, 0.0f, 0.0f, 0.0f);  
  9.     glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
  10.     //Reset View-port
  11.     glViewport(0 , 0,768 ,480);
  12.  
  13.     glBindTexture (GL_TEXTURE_2D, Texture);
  14.     glEnable(GL_TEXTURE_2D);
  15.    
  16.     glBegin(GL_QUADS);
  17.         glTexCoord2f(0.0f, 1.0f); glVertex3f(0.0f, 0.0f,  0.0f);    // bot left
  18.         glTexCoord2f(1.0f, 1.0f); glVertex3f((float) 128, 0.0f,  0.0f);  // bot right
  19.         glTexCoord2f(1.0f, 0.0f); glVertex3f((float) 128,  (float) 128,  0.0f);  // top right
  20.         glTexCoord2f(0.0f, 0.0f); glVertex3f(0.0f,  (float) 128,  0.0f);  // top left
  21.     glEnd();
  22.     glDisable(GL_TEXTURE_2D);
RAW Paste Data