If context creation fails for some reason (e.g. the specified OpenGL version isn't supported by the driver), how does SFML behave and how can I react to this?
i.e. here
#include <iostream>
#include <string>
#include <stdexcept>
#include <GL/glew.h>
#include <SFML/Window.hpp>
#include <SFML/OpenGL.hpp>
const int MAJOR_VERSION=4;
const int MINOR_VERSION=2;
int main()
{
try {
sf::Window window{sf::VideoMode{800,600,32},"SFML Window", sf::Style::Default,
sf::ContextSettings{24,8,2,MAJOR_VERSION,MINOR_VERSION}};
// I wanna know here if there's a valid OpenGL 4.2 context, and if not,
// throw an std::runtime_error
} catch (std::runtime_error& e) {
std::cerr << e.what() << std::endl;
}
return 0;
}