From 8f808180ca159b6bb006cb6cae217fbecdf75e9d Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Wed, 2 Nov 2022 20:29:34 +0100 Subject: gl version check --- shaders/tile.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'shaders') diff --git a/shaders/tile.cpp b/shaders/tile.cpp index a8d423ed..4fb7fe1b 100644 --- a/shaders/tile.cpp +++ b/shaders/tile.cpp @@ -11,10 +11,11 @@ namespace floormat { tile_shader::tile_shader() { using V = GL::Version; - const auto version = GL::Context::current().supportedVersion({ V::GL460, V::GL450, V::GL440, }); + constexpr V min_version = GL::Version::GL430; + const auto version = GL::Context::current().supportedVersion({ V::GL460, V::GL450, V::GL440, V::GL430, }); - if (version < GL::Version::GL430) - fm_abort("floormat requires OpenGL version 430, only %d is supported", (int)version); + if (version < min_version) + fm_abort("floormat requires OpenGL version %d, only %d is supported", (int)min_version, (int)version); GL::Shader vert{version, GL::Shader::Type::Vertex}; GL::Shader frag{version, GL::Shader::Type::Fragment}; -- cgit v1.2.3