Friday, October 14, 2016

Get SFML to report the version of OpenGL that is being used


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



Answer



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;

No comments:

Post a Comment

Simple past, Present perfect Past perfect

Can you tell me which form of the following sentences is the correct one please? Imagine two friends discussing the gym... I was in a good s...