How can I get SFML to report the version of OpenGL that is being used by the render window?


1 Answer 1


Create an OpenGL context with sf::RenderWindow and get the context settings with window.getSettings().

sf::RenderWindow window(sf::VideoMode(800, 600, 32), "SFML OpenGL");
sf::ContextSettings settings = window.getSettings();
std::cout << "OpenGL version:"<< settings.majorVersion << "." << settings.minorVersion << std::endl;

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .