From 30e7bd90a430cc2f37670f7e826949fb91b1481e Mon Sep 17 00:00:00 2001
From: Alug <alufoliehorst@gmail.com>
Date: Thu, 1 Feb 2024 21:03:28 +0100
Subject: [PATCH] Better Opengl version check

somehow forgor about vendor information in the version string lmao
---
 src/sdl/ogl_sdl.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/sdl/ogl_sdl.c b/src/sdl/ogl_sdl.c
index 81b1314e07..9b66784015 100644
--- a/src/sdl/ogl_sdl.c
+++ b/src/sdl/ogl_sdl.c
@@ -155,6 +155,7 @@ boolean OglSdlSurface(INT32 w, INT32 h)
 {
 	INT32 cbpp = cv_scr_depth.value < 16 ? 16 : cv_scr_depth.value;
 	static boolean first_init = false;
+	static int majorGL = 0, minorGL = 0;
 
 	oglflags = 0;
 
@@ -189,7 +190,8 @@ boolean OglSdlSurface(INT32 w, INT32 h)
 	else
 		maximumAnisotropy = 1;
 
-	if (atof((const char*)gl_version) >= 1.4)
+	if (sscanf((const char*)gl_version, "%d.%d", &majorGL, &minorGL)
+		&& (!(majorGL == 1 && minorGL <= 3)))
 		supportMipMap = true;
 	else
 		supportMipMap = false;
-- 
GitLab