xref: /aosp_15_r20/external/angle/include/GLES/README.md (revision 8975f5c5ed3d1c378011245431ada316dfb6f244)
1*8975f5c5SAndroid Build Coastguard Worker#  ANGLE GLES 1.0 Headers
2*8975f5c5SAndroid Build Coastguard Worker
3*8975f5c5SAndroid Build Coastguard WorkerThe GLES 1.0 headers ANGLE uses are generated using the Khronos tools but modified to include function pointer types and function prototype guards.
4*8975f5c5SAndroid Build Coastguard Worker
5*8975f5c5SAndroid Build Coastguard Worker### Regenerating gl.h
6*8975f5c5SAndroid Build Coastguard Worker
7*8975f5c5SAndroid Build Coastguard Worker1. Install **Python 3** (not 2) with the **lxml** addon. You can do this using `pip install lxml` from your Python's Scripts folder.
8*8975f5c5SAndroid Build Coastguard Worker1. Clone [https://github.com/KhronosGroup/OpenGL-Registry.git](https://github.com/KhronosGroup/OpenGL-Registry.git).
9*8975f5c5SAndroid Build Coastguard Worker1. Edit `OpenGL-Registry/xml/genheaders.py`:
10*8975f5c5SAndroid Build Coastguard Worker
11*8975f5c5SAndroid Build Coastguard Worker   1. Look for the section titled `# GLES 1.x API + mandatory extensions - GLES/gl.h (no function pointers)`
12*8975f5c5SAndroid Build Coastguard Worker   1. Change `prefixText        = prefixStrings + gles1PlatformStrings + genDateCommentString,` to `prefixText        = prefixStrings + gles1PlatformStrings + apiEntryPrefixStrings + genDateCommentString,`
13*8975f5c5SAndroid Build Coastguard Worker   1. Change `genFuncPointers   = False,` to `genFuncPointers   = True,`
14*8975f5c5SAndroid Build Coastguard Worker   1. Change `protectProto      = False,` to `protectProto      = 'nonzero',`
15*8975f5c5SAndroid Build Coastguard Worker   1. Change `protectProtoStr   = 'GL_GLEXT_PROTOTYPES',` to `protectProtoStr   = 'GL_GLES_PROTOTYPES',`
16*8975f5c5SAndroid Build Coastguard Worker
17*8975f5c5SAndroid Build Coastguard Worker1. Set your working directory to `OpenGL-Registry/xml/`.
18*8975f5c5SAndroid Build Coastguard Worker1. Run `python genheaders.py ../api/GLES/gl.h`
19*8975f5c5SAndroid Build Coastguard Worker1. The generated header will now be in `OpenGL-Registry/api/GLES/gl.h`. You can copy the header over to this folder.
20*8975f5c5SAndroid Build Coastguard Worker1. Also update `scripts/gl.xml` with the latest version from `OpenGL-Registry/xml/`.
21