Skip to content

Commit

Permalink
Fix support for latest "glcorearb.h" which now depends on an addition…
Browse files Browse the repository at this point in the history
…al header "KHR/khrplatform.h"

This was introduced in KhronosGroup/OpenGL-Registry#183
  • Loading branch information
crosire committed May 31, 2018
1 parent 8f7f459 commit 99ed321
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion gl3w_gen.py
Expand Up @@ -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 = []
Expand Down

0 comments on commit 99ed321

Please sign in to comment.