Finishing up wiring gl3w

This commit is contained in:
Hans W. Uhlig 2015-02-28 18:28:18 -08:00
parent 355c1cd8c7
commit 32d5883fc4

View File

@ -79,15 +79,15 @@ if not os.path.exists('src'):
# Download glcorearb.h
if not os.path.exists('include/GL/glcorearb.h'):
print('Downloading glcorearb.h to include/GL...')
print('-- Downloading glcorearb.h to include/GL...')
web = urllib2.urlopen('https://www.opengl.org/registry/api/GL/glcorearb.h')
with open('include/GL/glcorearb.h', 'wb') as f:
f.writelines(web.readlines())
else:
print('Reusing glcorearb.h from include/GL...')
print('-- Reusing glcorearb.h from include/GL...')
# Parse function names from glcorearb.h
print('Parsing glcorearb.h header...')
print('-- Parsing glcorearb.h header...')
procs = []
p = re.compile(r'GLAPI.*APIENTRY\s+(\w+)')
with open('include/GL/glcorearb.h', 'r') as f:
@ -103,7 +103,7 @@ def proc_t(proc):
'p_t': 'PFN' + proc.upper() + 'PROC' }
# Generate gl3w.h
print('Generating gl3w.h in include/GL...')
print('-- Generating gl3w.h in include/GL...')
with open('include/GL/gl3w.h', 'wb') as f:
f.write(UNLICENSE)
f.write(br'''#ifndef __gl3w_h_
@ -142,7 +142,7 @@ GL3WglProc gl3wGetProcAddress(const char *proc);
''')
# Generate gl3w.c
print('Generating gl3w.c in src...')
print('-- Generating gl3w.c in src...')
with open('src/gl3w.c', 'wb') as f:
f.write(UNLICENSE)
f.write(br'''#include <GL/gl3w.h>