From 4e9851aebaac1f7ecc2422108aff84424d478a63 Mon Sep 17 00:00:00 2001 From: Brick <6098371+0x1F9F1@users.noreply.github.com> Date: Wed, 13 Mar 2024 02:56:05 +0000 Subject: [PATCH] OpenGL: Require at least version 1.2 --- code/midtown/agigl/glpipe.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/code/midtown/agigl/glpipe.cpp b/code/midtown/agigl/glpipe.cpp index e708a035..e6f02f33 100644 --- a/code/midtown/agigl/glpipe.cpp +++ b/code/midtown/agigl/glpipe.cpp @@ -86,10 +86,19 @@ i32 agiGLPipeline::BeginGfx() } if (context == nullptr) - Quitf("Failed to create OpenGL context: %s", SDL_GetError()); + { + Errorf("Failed to create OpenGL context: %s", SDL_GetError()); + return AGI_ERROR_NO_DEVICE; + } gl_context_ = arnew agiGLContext(window_, context, debug_level); + if (!gl_context_->HasVersion(120)) + { + Errorf("Unsupported OpenGL version"); + return AGI_ERROR_UNSUPPORTED; + } + SDL_GL_GetDrawableSize(window_, &horz_res_, &vert_res_); Displayf("Window Resolution: %u x %u", horz_res_, vert_res_);