GL4ES - The OpenGL driver for GLES Hardware

GL4ES is a OpenGL 2.1/1.5 to GL ES 2.0/1.1 translation library, with support for Pandora, ODroid, OrangePI, CHIP, Raspberry PI, Android and AmigaOS4.

View on GitHub

Usage

There are many environnement variable to control gl4es behavour. All are numeric, except LIBGL_VERSION that take a string, LIBGL_FBO that takes a 2d size (WxH), and both LIBGL_EGL and LIBGL_GLES that take path/filename. You can also change many of this variable at runtime using the glHint(...) function. See gl4eshint.h for the list of #define to use in this function.

LIBGL_FB

Controls the Framebuffer output

LIBGL_ES

Controls the version of GLES to use

LIBGL_GL

Controls the version of OpenGL exposed

LIBGL_XREFRESH

Debug helper in specific cases

LIBGL_STACKTRACE

Automatic Backtrace log

LIBGL_FPS

Print current FPS to the console

LIBGL_VSYNC

VSync control

LIBGL_RECYCLEFBO

Recycling FBO special case (don’t delete a created FBO, but recycle it if needed)

LIBGL_MIPMAP

Handling of Manual and Automatic MIPMAP

LIBGL_FORCENPOT

Forcing NPOT (Non-Power of Two) Texture size.

LIBGL_TEXCOPY

Make a local copy of every texture for easy glGetTexImage2D

LIBGL_SHRINK

Texture shrinking control

LIBGL_TEXDUMP

Texture dump

LIBGL_ALPHAHACK

Experimental: enable Alpha test only when using texture that contains an alpha channel

LIBGL_NODOWNSAMPLING

Texture downsampling control (deprecated, use LIBGL_AVOID16BITS instead)

LIBGL_STREAM

PANDORA only: enable Texture Streaming (works only on RGB textures)

LIBGL_COPY

Removed (Controled the glCopyTex(Sub)Image2D hack, it’s now automatic, depending on how compatible is the readed framebuffer)

LIBGL_NOLUMALPHA

Control the availability of the LUMUNANCE_ALPHA format (can be buggy on Pandora model CC)

LIBGL_BLENDHACK

Experimental: Change Blend GL_SRC_ALPHA, GL_ONE to GL_ONE, GL_ONE

LIBGL_BLENDCOLOR

Hack: Export a (faked) glBlendColor

LIBGL_VERSION

Hack: Control the glGetString version. Overide version string (should be in the form of “1.x”)

LIBGL_BATCH

This has been changed with v1.0.5. Now BATCH simply try to merge subsequents glDrawXXXXX (glDrawArrays, glDrawElements…). It only try to merge if arrays is between MINBATCH and MAXBATCH (inclusive) The Batching stop when there is a change of GL State, but also if an Array of more then 100*N is encountered.

LIBGL_NOERROR

Hack: glGetError() always return GL_NOERROR

LIBGL_GAMMA

Pandora Hack: Set a Gamma value (in decimal formal, 1.0 means no gamma boost)

LIBGL_SRGB

ODROID Hack: Enable sRGB Surface (so Gamma corrected), if Hardware support it

LIBGL_FASTMATH

Hack: Activate some Fast Math in processor/coprocessor

LIBGL_SILENTSTUB

Debug: Hide or Show the Sub / Not found message

LIBGL_NOBANNER

Show/Hide initial text

LIBGL_NPOT

Expose NPOT (Non Power of Two) Support

LIBGL_GLQUERIES

Expose glQueries functions

LIBGL_NOTEXMAT

Handling of Texture Matrix

LIBGL_NOTEST

Initial Hardware test

LIBGL_NOVAOCACHE

VAO Caching

LIBGL_VABGRA

Vertex Array BGRA extension

LIBGL_BEGINEND

Merge of subsequent glBegin/glEnd blocks (will be non-effective if BATCH mode is used)

LIBGL_AVOID16BITS

Try to avoid 16bits textures

LIBGL_AVOID24BITS

Try to avoid 24bits textures (i.e. GL_RGB)

LIBGL_FORCE16BITS

Try to use 16bits textures

LIBGL_POTFRAMEBUFFER

Use only Power Of Two dimension for Framebuffer

LIBGL_NOBGRA

Ignore BGRA Texture hardware extension

LIBGL_NOHIGHP

Usage of highp precision in fragment shader (ES2 backend only)

LIBGL_COMMENTS

Comments in shaders are kept (also for generated shaders by fpe_shaders)

LIBGL_DEFAULTWRAP

Hack to define default WRAP mode for texture

LIBGL_FBOMAKECURRENT

Workaround for FBO and glXMakeCurrent (force unbind/bind FBO when changing context)

LIBL_FBOUNBIND

Workaround on FBO where a binded texture is used for drawing

LIBGL_FBOFORCETEX

For the Color Attachment 0 to be a Texture2D (even if program attachs a Renderbuffer) => may speedup glBlitFramebuffer if used

LIBGL_FBO

Hack: define custom dimension for FBO (only used with LIBGL_FBO=2)

LIBGL_NOTEXARRAY

Hack to force using discrete Texture instead of Array in all shader

LIBGL_LOGSHADERERROR

Log to the console Shader Compile error, with initial and ShaderConv’d source of the shader

LIBGL_SHADERNOGLES

Don’t use GL_ES part in shaders

LIBGL_NODEPTHTEX

Disable the use of Depth texture

LIBGL_FLOAT

Expose support for FLOAT and HALF_FLOAT Texture support (and has attachement to FBO)

LIBGL_GLXRECYCLE

Recycle EGLSurface per Drawable, instead of destroying them

LIBGL_NOCLEAN

Debug: don’t clean GLContext when they are destroy

LIBGL_EGL

Define EGL lib to use. Default folder are the standard one for dynamic librarie loading (LD_LIBRARY_PATH and friend) plus “/opt/vc/lib/”, /usr/local/lib/” and “/usr/lib/”.

LIBGL_GLES

Define GLES(2) lib to use. Default folder are the standard one for dynamic librarie loading (LD_LIBRARY_PATH and friend) plus “/opt/vc/lib/”, /usr/local/lib/” and “/usr/lib/”. Be sure to point to correct GLES library depanding on wich GLES backend you are using.

LIBGL_DBGSHADERCONV

Log to the console all shaders before and after conversion

LIBGL_NOPSA

Disable the use of the Precompiled Shader Archive

LIBGL_USEVBO

Usage of VBO in certain cases. Only for GLES2+. The 2 and 3 mode are experimental and will probably be slower anyway.