Skip to content

Commit

Permalink
Sort OpenGL functions by name and more formatting.
Browse files Browse the repository at this point in the history
  • Loading branch information
skaslev committed Jan 27, 2015
1 parent 3f477b9 commit 8c727cd
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions gl3w_gen.py
Expand Up @@ -95,6 +95,7 @@
m = p.match(line)
if m:
procs.append(m.group(1))
procs.sort()

def proc_t(proc):
return { 'p': proc,
Expand Down Expand Up @@ -128,7 +129,7 @@ def proc_t(proc):
/* OpenGL functions */
''')
for proc in procs:
f.write('extern {0[p_t]} {0[p_s]};\n'.format(proc_t(proc)).encode("utf-8"))
f.write('extern {0[p_t]: <52} {0[p_s]};\n'.format(proc_t(proc)).encode("utf-8"))
f.write(b'\n')
for proc in procs:
f.write('#define {0[p]: <45} {0[p_s]}\n'.format(proc_t(proc)).encode("utf-8"))
Expand Down Expand Up @@ -273,7 +274,7 @@ def proc_t(proc):
''')
for proc in procs:
f.write('{0[p_t]} {0[p_s]};\n'.format(proc_t(proc)).encode("utf-8"))
f.write('{0[p_t]: <52} {0[p_s]};\n'.format(proc_t(proc)).encode("utf-8"))
f.write(br'''
static void load_procs(void)
{
Expand Down

0 comments on commit 8c727cd

Please sign in to comment.