From d9778546b58ab77d0d4649875209be9b0a2afca8 Mon Sep 17 00:00:00 2001 From: Alberto Torres Date: Wed, 4 Sep 2024 02:43:22 +0200 Subject: [PATCH] Fix GLAD bug where it wasn't reading OpenGL ES version correctly. --- src/platform/glad/gl.nim | 8 ++++---- src/platform/glad/gles32_static.nim | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/platform/glad/gl.nim b/src/platform/glad/gl.nim index 8cf3130..fa7bfef 100644 --- a/src/platform/glad/gl.nim +++ b/src/platform/glad/gl.nim @@ -16237,8 +16237,8 @@ proc findCoreGL(glVersion: string) = version = version.replace(p) break - var major = ord(glVersion[0]) - ord('0') - var minor = ord(glVersion[2]) - ord('0') + var major = ord(version[0]) - ord('0') + var minor = ord(version[2]) - ord('0') glVersionMajor = major glVersionMinor = minor @@ -17861,8 +17861,8 @@ proc findCoreGLES2(glVersion: string) = version = version.replace(p) break - var major = ord(glVersion[0]) - ord('0') - var minor = ord(glVersion[2]) - ord('0') + var major = ord(version[0]) - ord('0') + var minor = ord(version[2]) - ord('0') glVersionMajor = major glVersionMinor = minor diff --git a/src/platform/glad/gles32_static.nim b/src/platform/glad/gles32_static.nim index 6c43b6f..5ed1825 100644 --- a/src/platform/glad/gles32_static.nim +++ b/src/platform/glad/gles32_static.nim @@ -5705,8 +5705,8 @@ proc findCoreGLES2(glVersion: string) = version = version.replace(p) break - var major = ord(glVersion[0]) - ord('0') - var minor = ord(glVersion[2]) - ord('0') + var major = ord(version[0]) - ord('0') + var minor = ord(version[2]) - ord('0') glVersionMajor = major glVersionMinor = minor