Skip to content

Instantly share code, notes, and snippets.

@alesegdia
Created May 28, 2015 19:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alesegdia/182a8aaa329d2d4e055e to your computer and use it in GitHub Desktop.
Save alesegdia/182a8aaa329d2d4e055e to your computer and use it in GitHub Desktop.
Generate OpenGL function names from a file
import sys
import re
infile = open( sys.argv[1], 'r' )
ret = " return\n"
for line in infile.readlines():
try:
funcname = line.rstrip()
print " PFN" + funcname.upper() + "PROC " + funcname[2:] + ";"
ret += " GetProc( &" + funcname[2:] + ", \"" + funcname + "\" ) &&\n"
except IndexError:
print '';
#( functype, funcname ) = p[0].split()
print ''
print ret[:-4] + ";"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment