Copy from gl4es: https://github.com/ptitSeb/gl4es/blob/3b926be6f2fb47a8befd0604e64008db3 e0d779a/src/gl/wrap/gl4eswraps.c#L670-L704
Copy from gl4es: https://github.com/ptitSeb/gl4es/blob/3b926be6f2fb47a8befd0604e64008db3 e0d779a/src/gl/wrap/gl4eswraps.c#L670-L704