51 Uint32
flags,
bool double_buffer) : width(w), height(h)
53 SDL_InitSubSystem(SDL_INIT_VIDEO);
54 SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE);
55 SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3);
56 SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 3);
59 SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 0);
69 throw std::runtime_error(
"Failed to create SDL window!");
72 SDL_SetWindowMinimumSize(
sdl_window, 200, 200);
76 throw std::runtime_error(
"Failed to create gl context!");
80 glewExperimental = GL_TRUE;
81 GLenum glewError = glewInit();
82 if(glewError != GLEW_OK){
83 throw std::runtime_error(
"Failed to initialize gl context!");
87 glClearColor(0,0,0,1);
88 glClear(GL_COLOR_BUFFER_BIT);