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

@ -94,6 +94,13 @@ bool Display::Init()
m_cy = props.cyHeight; m_cy = props.cyHeight;
m_density = props.density; 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 // Create window
if ((m_window = SDL_CreateWindow("Hostile Takeover", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, m_cx, m_cy, videoflags)) == NULL) { if ((m_window = SDL_CreateWindow("Hostile Takeover", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, m_cx, m_cy, videoflags)) == NULL) {
LOG() << "Couldn't create window: " << m_cx << "x" << m_cy << " \nError: " << SDL_GetError(); LOG() << "Couldn't create window: " << m_cx << "x" << m_cy << " \nError: " << SDL_GetError();