Skip to content

Commit

Permalink
Also complain about too old OpenGL version when using SDL backend
Browse files Browse the repository at this point in the history
  • Loading branch information
jhasse committed Nov 24, 2023
1 parent 62976bd commit b32072d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/sdl/window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,12 @@ Window::Window(const std::string& title, int width, int height, const bool fulls

impl->context = SDL_GL_CreateContext(impl->sdlWindow);
#ifdef GLAD_GL
gladLoadGL(reinterpret_cast<GLADloadfunc>(SDL_GL_GetProcAddress));
const auto glVersion = gladLoadGL(reinterpret_cast<GLADloadfunc>(SDL_GL_GetProcAddress));
if (glVersion < GLAD_MAKE_VERSION(2, 0)) {
throw std::runtime_error("Your graphics card is missing OpenGL 2.0 support (it supports " +
std::to_string(GLAD_VERSION_MAJOR(glVersion)) + "." +
std::to_string(GLAD_VERSION_MINOR(glVersion)) + ").");
}
#endif

if (isMultisampleSupported_) {
Expand Down

0 comments on commit b32072d

Please sign in to comment.