Set appropriate GL attributes

This commit is contained in:
Nathan Fulton 2016-09-13 14:16:54 -04:00
parent ed1d50c8ea
commit 8800cca7cc

View File

@ -93,6 +93,13 @@ bool Display::Init()
m_cx = props.cxWidth;
m_cy = props.cyHeight;
m_density = props.density;
// Set appropriate GL attributes
SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 8);
SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 8);
SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 8);
SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 24);
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
// Create window
if ((m_window = SDL_CreateWindow("Hostile Takeover", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, m_cx, m_cy, videoflags)) == NULL) {