#include #include #include #include #pragma comment (lib , "sdl.lib") #pragma comment (lib , "opengl32.lib") int _tmain(int argc, _TCHAR* argv[]) { SDL_Surface * surf = NULL; if (SDL_Init(SDL_INIT_VIDEO) < 0) return 0; SDL_GL_SetAttribute(SDL_GL_SWAP_CONTROL, 1); if ((surf = SDL_SetVideoMode(800, 600, 32, SDL_OPENGL)) == NULL) return 0; glClearColor(1.0f, 0.0f, 0.0f, 1.0f); while(true) { SDL_Event Event; while(SDL_PollEvent(&Event)) { if(Event.type == SDL_QUIT) return 0; } glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); SDL_GL_SwapBuffers(); }; return 0; }