From dddf6e265507561545085d56559aa9ec4d617098 Mon Sep 17 00:00:00 2001 From: Zeno Endemann Date: Wed, 11 Jan 2023 17:29:50 +0100 Subject: [PATCH 1/2] Remove one duplicated check for glGetString(GL_VERSION) --- glad/generator/c/templates/gl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glad/generator/c/templates/gl.c b/glad/generator/c/templates/gl.c index 25819a78..ada91e95 100644 --- a/glad/generator/c/templates/gl.c +++ b/glad/generator/c/templates/gl.c @@ -188,8 +188,8 @@ int gladLoad{{ api|api }}{{ 'Context' if options.mx }}UserPtr({{ template_utils. {{ 'glGetString'|ctx }} = (PFNGLGETSTRINGPROC) load(userptr, "glGetString"); if({{ 'glGetString'|ctx }} == NULL) return 0; - if({{ 'glGetString'|ctx }}(GL_VERSION) == NULL) return 0; version = glad_gl_find_core_{{ api|lower }}({{ 'context' if options.mx }}); + if(!version) return 0; {% for feature, _ in loadable(feature_set.features, api=api) %} glad_gl_load_{{ feature.name }}({{'context, ' if options.mx }}load, userptr); From f21c3b325286eb7fa740ddedcae45d977bf58cd4 Mon Sep 17 00:00:00 2001 From: David Herberth Date: Tue, 26 Dec 2023 19:12:42 +0100 Subject: [PATCH 2/2] remove only GL_VERSION check --- glad/generator/c/templates/gl.c | 1 - 1 file changed, 1 deletion(-) diff --git a/glad/generator/c/templates/gl.c b/glad/generator/c/templates/gl.c index ada91e95..123c51c1 100644 --- a/glad/generator/c/templates/gl.c +++ b/glad/generator/c/templates/gl.c @@ -189,7 +189,6 @@ int gladLoad{{ api|api }}{{ 'Context' if options.mx }}UserPtr({{ template_utils. {{ 'glGetString'|ctx }} = (PFNGLGETSTRINGPROC) load(userptr, "glGetString"); if({{ 'glGetString'|ctx }} == NULL) return 0; version = glad_gl_find_core_{{ api|lower }}({{ 'context' if options.mx }}); - if(!version) return 0; {% for feature, _ in loadable(feature_set.features, api=api) %} glad_gl_load_{{ feature.name }}({{'context, ' if options.mx }}load, userptr);