Advertisement
xerpi

ds

Apr 12th, 2012
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.09 KB | None | 0 0
  1. void init_gl_screen()
  2. {
  3.  
  4.     // initialize gl
  5.     glInit();
  6.    
  7.     //enable textures
  8.     glEnable(GL_TEXTURE_2D);
  9.    
  10.     // enable antialiasing
  11.     glEnable(GL_ANTIALIAS);
  12.        
  13.     // setup the rear plane
  14.     glClearColor(0,0,0,31); // BG must be opaque for AA to work
  15.     glClearPolyID(63); // BG must have a unique polygon ID for AA to work
  16.    
  17.     glClearDepth(GL_MAX_DEPTH);
  18.  
  19.     //this should work the same as the normal gl call
  20.     glViewport(0,0,255,191);
  21.    
  22.    
  23.     //any floating point gl call is being converted to fixed prior to being implemented
  24.     glMatrixMode(GL_PROJECTION);
  25.     glLoadIdentity();
  26.     gluPerspective(70, 256.0 / 192.0, 1, 200);
  27.    
  28.     gluLookAt(  0.0, 0.0, 1.0,      //camera possition
  29.                 0.0, 0.0, 0.0,      //look at
  30.                 0.0, 1.0, 0.0);     //up
  31.  
  32.     glMaterialf(GL_AMBIENT, RGB15(31,31,31));
  33.     glMaterialf(GL_DIFFUSE, RGB15(31,31,31));
  34.     glMaterialf(GL_SPECULAR, BIT(15) | RGB15(31,31,31));
  35.     glMaterialf(GL_EMISSION, RGB15(31,31,31));
  36.  
  37.     //ds uses a table for shinyness..this generates a half-ass one
  38.     glMaterialShinyness();
  39.  
  40.     //not a real gl function and will likely change
  41.     glPolyFmt(POLY_ALPHA(31) | POLY_CULL_BACK);
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement