Try to but your `SDL_GL_SetAttribute()` calls after `SDL_Init()`.