gen-opengl-h.sh (575B)
1 #!/bin/bash 2 3 echo '/* WARNING - MACHINE GENERATED FILE - DO NOT EDIT */' 4 echo '#ifndef _OPEN_GL_H_' 5 echo '#define _OPEN_GL_H_' 6 echo '#include "glcorearb.h"' 7 echo '#ifndef GLXTN' 8 echo '#define GLXTN extern' 9 echo '#define __NO_GLXTN_TABLE__' 10 echo '#endif' 11 awk '{ print "GLXTN PFN" toupper($1) "PROC " $1 ";" }' < gl-api.txt 12 echo '#ifndef __NO_GLXTN_TABLE__' 13 echo '#define __GLFN__(n) { (void**) &n, #n }' 14 echo 'struct {' 15 echo ' void **func;' 16 echo ' const char *name;' 17 echo '} fntb[] = {' 18 awk '{ print "\t__GLFN__(" $1 ")," }' < gl-api.txt 19 echo '};' 20 echo '#endif' 21 echo '#endif'