Regenerating gl.h
masterIf you need to regenerate the gl.h header used by ANGLE GLES 1.0, follow these steps to modify the Khronos OpenGL-Registry generation script to include function pointer types and function prototype guards.
Prerequisites
- Python 3 (Python 2 is not supported).
- The lxml addon for Python. Install it via:
pip install lxml - A clone of the KhronosGroup/OpenGL-Registry repository.
Steps
- Modify the generation script: Open
OpenGL-Registry/xml/genheaders.pyand locate the section# GLES 1.x API + mandatory extensions - GLES/gl.h (no function pointers). Apply the following changes:- Change
prefixText = prefixStrings + gles1PlatformStrings + genDateCommentString,toprefixText = prefixStrings + gles1PlatformStrings + apiEntryPrefixStrings + genDateCommentString, - Change
genFuncPointers = False,togenFuncPointers = True, - Change
protectProto = False,toprotectProto = 'nonzero', - Change
protectProtoStr = 'GL_GLEXT_PROTOTYPES',toprotectProtoStr = 'GL_GLES_PROTOTYPES',
- Change
- Generate the header:
- Set your working directory to
OpenGL-Registry/xml/. - Run the following command:
python genheaders.py ../api/GLES/gl.h
- Set your working directory to
- Update the project:
- Copy the newly generated header from
OpenGL-Registry/api/GLES/gl.hto your local project folder. - Update
scripts/gl.xmlwith the latest version fromOpenGL-Registry/xml/.
- Copy the newly generated header from
python genheaders.py ../api/GLES/gl.h