Guest User

Untitled

a guest
Nov 24th, 2017
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.60 KB | None | 0 0
  1. int main(int argc, char** argv){
  2.   if(SDL_Init(SDL_INIT_VIDEO) != 0){
  3.     printf("Unable to initialize SDL: %s\n", SDL_GetError());
  4.   }
  5.   const SDL_VideoInfo* info = SDL_GetVideoInfo();
  6.   int vidFlags = SDL_OPENGL;
  7.   if(info->hw_available){
  8.       vidFlags |= SDL_HWSURFACE;
  9.   } else {
  10.       vidFlags |= SDL_SWSURFACE;
  11.   }
  12.   int bpp = info->vfmt->BitsPerPixel;
  13.   SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
  14.   SDL_SetVideoMode(W_WIDTH, W_HEIGHT, bpp, vidFlags);
  15.  
  16.   glewInit();
  17.   GL_Setup(W_WIDTH, W_HEIGHT);
  18.   glutInit(&argc, argv);
  19.  
  20.   applicationInit();
  21.  
  22.   main_loop_function();
  23.  
  24.   return 0;
  25. }
Add Comment
Please, Sign In to add comment