Guest User

Untitled

a guest
Jan 14th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. void SDLWrapper::initialise(int flags)
  2. {
  3. SDL_SetVideoMode(width, height, bpp, flags);
  4. //if(!screen)
  5. //{
  6. // throw new SDLException("SDL_SetVideoMode(): returned NULL!");
  7. //}
  8.  
  9. glViewport(0, 0, width, height);
  10.  
  11. glMatrixMode(GL_PROJECTION);
  12. glLoadIdentity();
  13.  
  14. gluPerspective(45.0f, (float)width / (float)height, 0.1f, 100.0f);
  15.  
  16. glMatrixMode(GL_MODELVIEW);
  17. glLoadIdentity();
  18.  
  19. glShadeModel(GL_SMOOTH);
  20. glEnable(GL_TEXTURE_2D);
  21. glClearColor(0, 0, 0, 0);
  22. glClearDepth(1.0f);
  23. glEnable(GL_DEPTH_TEST);
  24. glDepthFunc(GL_LEQUAL);
  25.  
  26. glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);
  27. }
Add Comment
Please, Sign In to add comment