From 99ed321100d37032cb6bfa7dd8dea85f10c86132 Mon Sep 17 00:00:00 2001 From: crosire Date: Thu, 31 May 2018 14:16:52 +0200 Subject: [PATCH] Fix support for latest "glcorearb.h" which now depends on an additional header "KHR/khrplatform.h" This was introduced in https://github.com/KhronosGroup/OpenGL-Registry/pull/183 --- gl3w_gen.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/gl3w_gen.py b/gl3w_gen.py index 611331a..15d0f73 100755 --- a/gl3w_gen.py +++ b/gl3w_gen.py @@ -95,18 +95,29 @@ def write(f, s): # Create directories if not os.path.exists(os.path.join(args.root, 'include/GL')): os.makedirs(os.path.join(args.root, 'include/GL')) +if not os.path.exists(os.path.join(args.root, 'include/KHR')): + os.makedirs(os.path.join(args.root, 'include/KHR')) if not os.path.exists(os.path.join(args.root, 'src')): os.makedirs(os.path.join(args.root, 'src')) # Download glcorearb.h if not os.path.exists(os.path.join(args.root, 'include/GL/glcorearb.h')): print('Downloading glcorearb.h to {0}...'.format(os.path.join(args.root, 'include/GL/glcorearb.h'))) - web = urllib2.urlopen('http://www.opengl.org/registry/api/GL/glcorearb.h') + web = urllib2.urlopen('https://www.khronos.org/registry/OpenGL/api/GL/glcorearb.h') with open(os.path.join(args.root, 'include/GL/glcorearb.h'), 'wb') as f: f.writelines(web.readlines()) else: print('Reusing glcorearb.h from {0}...'.format(os.path.join(args.root, 'include/GL'))) +# Download khrplatform.h +if not os.path.exists(os.path.join(args.root, 'include/KHR/khrplatform.h')): + print('Downloading khrplatform.h to {0}...'.format(os.path.join(args.root, 'include/KHR/khrplatform.h'))) + web = urllib2.urlopen('https://www.khronos.org/registry/EGL/api/KHR/khrplatform.h') + with open(os.path.join(args.root, 'include/KHR/khrplatform.h'), 'wb') as f: + f.writelines(web.readlines()) +else: + print('Reusing khrplatform.h from {0}...'.format(os.path.join(args.root, 'include/KHR'))) + # Parse function names from glcorearb.h print('Parsing glcorearb.h header...') procs = []