Hello guys
I’m having some sort of issue with the SDL 2.0.3 during OpenGL context creation. In fact personally I do not have any issues, but I do have few users who are experiencing this specific error.
My OpenGL context creation looks like this:
Code:
SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 1);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1);
SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 3);
SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 3);
SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 2);
SDL_GL_SetAttribute(SDL_GL_BUFFER_SIZE, 0);
SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 0);
SDL_DisplayMode displayMode;
if(SDL_GetDisplayMode(0, 0, &displayMode) != 0)
g_logger.fatal(stdext::format("Failed to get display mode!\n%s", SDL_GetError()));
// find out whether pixel format supports alpha bits
if(SDL_ISPIXELFORMAT_ALPHA(displayMode.format) || SDL_BYTESPERPIXEL(displayMode.format) == 4)
SDL_GL_SetAttribute(SDL_GL_ALPHA_SIZE, 1);
// create window
m_window = SDL_CreateWindow(NULL, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, m_size.width(), m_size.height(), SDL_WINDOW_OPENGL | SDL_WINDOW_HIDDEN | SDL_WINDOW_RESIZABLE);
if(m_window == NULL)
g_logger.fatal(stdext::format("Failed to create window!\n%s", SDL_GetError()));
// create OpenGL context
m_context = SDL_GL_CreateContext(m_window);
if(m_context == NULL)
g_logger.fatal(stdext::format("Failed to create OpenGL context!\n%s", SDL_GetError()));
As you can see I’m requesting at least 3/3/2 pixel format and one alpha bit if pixel format has alpha channel and nothing besides that. However, I have currently two users experiencing following issue on their computers:
[Image: http://i.imgur.com/imJEIV3.png ]
I told them to use GLView to find out more about their OpenGL and graphics card. Here is what I’ve got:
User with Geforce 7300 SE:
As you can see it supports core 1.1 just fine.
Also, another User with Geforce 9300M:
As far as I know they have up to date graphics driver. As far as I can tell everything is just fine, all of those graphics card should be capable of creating the context just fine. It’s worth noticing that those strange symbols in error message comes from SDL itself.