mirror of
https://github.com/glfw/glfw.git
synced 2025-10-03 21:30:57 +00:00
Finishing up wiring gl3w
This commit is contained in:
parent
355c1cd8c7
commit
32d5883fc4
10
gl3w_gen.py
10
gl3w_gen.py
@ -79,15 +79,15 @@ if not os.path.exists('src'):
|
|||||||
|
|
||||||
# Download glcorearb.h
|
# Download glcorearb.h
|
||||||
if not os.path.exists('include/GL/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')
|
web = urllib2.urlopen('https://www.opengl.org/registry/api/GL/glcorearb.h')
|
||||||
with open('include/GL/glcorearb.h', 'wb') as f:
|
with open('include/GL/glcorearb.h', 'wb') as f:
|
||||||
f.writelines(web.readlines())
|
f.writelines(web.readlines())
|
||||||
else:
|
else:
|
||||||
print('Reusing glcorearb.h from include/GL...')
|
print('-- Reusing glcorearb.h from include/GL...')
|
||||||
|
|
||||||
# Parse function names from glcorearb.h
|
# Parse function names from glcorearb.h
|
||||||
print('Parsing glcorearb.h header...')
|
print('-- Parsing glcorearb.h header...')
|
||||||
procs = []
|
procs = []
|
||||||
p = re.compile(r'GLAPI.*APIENTRY\s+(\w+)')
|
p = re.compile(r'GLAPI.*APIENTRY\s+(\w+)')
|
||||||
with open('include/GL/glcorearb.h', 'r') as f:
|
with open('include/GL/glcorearb.h', 'r') as f:
|
||||||
@ -103,7 +103,7 @@ def proc_t(proc):
|
|||||||
'p_t': 'PFN' + proc.upper() + 'PROC' }
|
'p_t': 'PFN' + proc.upper() + 'PROC' }
|
||||||
|
|
||||||
# Generate gl3w.h
|
# 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:
|
with open('include/GL/gl3w.h', 'wb') as f:
|
||||||
f.write(UNLICENSE)
|
f.write(UNLICENSE)
|
||||||
f.write(br'''#ifndef __gl3w_h_
|
f.write(br'''#ifndef __gl3w_h_
|
||||||
@ -142,7 +142,7 @@ GL3WglProc gl3wGetProcAddress(const char *proc);
|
|||||||
''')
|
''')
|
||||||
|
|
||||||
# Generate gl3w.c
|
# Generate gl3w.c
|
||||||
print('Generating gl3w.c in src...')
|
print('-- Generating gl3w.c in src...')
|
||||||
with open('src/gl3w.c', 'wb') as f:
|
with open('src/gl3w.c', 'wb') as f:
|
||||||
f.write(UNLICENSE)
|
f.write(UNLICENSE)
|
||||||
f.write(br'''#include <GL/gl3w.h>
|
f.write(br'''#include <GL/gl3w.h>
|
||||||
|
Loading…
Reference in New Issue
Block a user