Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int main(int argc, char** argv){
- if(SDL_Init(SDL_INIT_VIDEO) != 0){
- printf("Unable to initialize SDL: %s\n", SDL_GetError());
- }
- const SDL_VideoInfo* info = SDL_GetVideoInfo();
- int vidFlags = SDL_OPENGL;
- if(info->hw_available){
- vidFlags |= SDL_HWSURFACE;
- } else {
- vidFlags |= SDL_SWSURFACE;
- }
- int bpp = info->vfmt->BitsPerPixel;
- SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
- SDL_SetVideoMode(W_WIDTH, W_HEIGHT, bpp, vidFlags);
- glewInit();
- GL_Setup(W_WIDTH, W_HEIGHT);
- glutInit(&argc, argv);
- applicationInit();
- main_loop_function();
- return 0;
- }
Add Comment
Please, Sign In to add comment