How ptitseb/gl4es works
GL4ES is a compatibility library that presents legacy OpenGL 1.5 and selected OpenGL 2.x functionality on GLES hardware. An application’s GL calls enter the compatibility wrappers, are handled by stateful emulation and shader conversion, then reach the GLES implementation; GLX/EGL setup supplies contexts and hardware capability information. The README documents the main emulation and backend capabilities. Some implementation files are unsampled, so links beyond the indexed imports and documented behavior are omitted.
Main entry points: gles.h GLES calls · gles.c GL call wrappers · program.c Shader and program API · glx.c GLX interface
Components 20
Compatibility API
- GL declarations
include/GL/gl.h - GL call wrappers
src/gl/wrap/gles.c
OpenGL Emulation
- GL state
src/gl/glstate.c - Fixed pipeline emulation
src/gl/fpe.c - Drawing and raster
src/gl/drawing.c - Texture operations
src/gl/texture.c - Framebuffer operations
src/gl/framebuffers.c - Hash tables
include/khash.h
Shader Support
- Shader and program API
src/gl/program.c - Shader conversion
src/gl/shaderconv.c - ARB program conversion
src/gl/arbparser.c
Context and Platform
- GLX interface
src/glx/glx.c - EGL interface
src/egl/egl.c - Amiga interface
src/agl/amigaos.c - API loader
src/gl/loader.h - Hardware capabilities
src/glx/hardext.c - GLES calls
src/gl/gles.h
Other components
- GL application
- GLES driver
- EGL implementation
Connections 26
- GL application → GL declarations: uses API
- GL application → GL call wrappers: calls
- GL call wrappers → GL state: updates state
- GL call wrappers → Fixed pipeline emulation: emulates calls
- GL call wrappers → Drawing and raster: dispatches draws
- GL call wrappers → Texture operations: handles textures
- GL call wrappers → Framebuffer operations: handles buffers
- Fixed pipeline emulation → Shader conversion: generates shaders
- Shader and program API → Shader conversion: converts shaders
- Shader and program API → ARB program conversion: accepts ARB programs
- Shader and program API → GLES calls: uses GLES programs
src/gl/program.c - ARB program conversion → Shader conversion: produces GLSL
- Fixed pipeline emulation → GLES calls: emits GLES calls
- Drawing and raster → GLES calls: renders through
- Texture operations → GLES calls: uses GLES calls
- Framebuffer operations → GLES calls: uses GLES calls
- GLES calls → GLES driver: dispatches calls
- GLX interface → EGL interface: uses EGL
src/glx/glx.c - GLX interface → API loader: loads APIs
src/glx/glx.c - EGL interface → API loader: loads APIs
src/egl/egl.c - API loader → GLES driver: loads symbols
- EGL interface → EGL implementation: calls EGL
- GLX interface → Hardware capabilities: checks extensions
src/glx/glx.c - Hardware capabilities → GLES calls: informs backend
src/glx/hardext.c - Amiga interface → Hardware capabilities: uses capabilities
src/agl/amigaos.c - Shader and program API → Hash tables: indexes objects
src/gl/program.c