Want more features on Pastebin? Sign Up, it's FREE!
Guest

Resolution

By: a guest on Mar 11th, 2012  |  syntax: C++  |  size: 0.46 KB  |  views: 70  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. class Resolution{
  2.  
  3. public:
  4.  
  5. static void ChangeResolution(SDL_Surface* Screen,int Width,int Height){
  6. Screen = SDL_SetVideoMode(Width, Height, 32, SDL_HWSURFACE | SDL_GL_DOUBLEBUFFER | SDL_OPENGL);
  7. glClearColor(0, 0, 0, 0);
  8. glClearDepth(1.0f);
  9.  
  10. glViewport(0, 0, Width, Height);
  11.  
  12. glMatrixMode(GL_PROJECTION);
  13. glLoadIdentity();
  14.  
  15. glOrtho(0, Width, Height, 0, 1, -1);
  16.  
  17. glMatrixMode(GL_MODELVIEW);
  18.  
  19. glEnable(GL_TEXTURE_2D);
  20.  
  21. glLoadIdentity();
  22. }
  23.  
  24. };
clone this paste RAW Paste Data