FreeGLUT can initialize an OpenGL ES (GLES) context. It works under platforms that supports EGL:
FreeGLUT ES is provided as a separate library, because OpenGL ES has a distinct, incompatible library for each version (e.g. -lGLESv1_CM and -lGLESv2).
The following explains how to use FreeGLUT ES under Mesa EGL.
Here's how to compile FreeGLUT for GLES2:
cd /usr/src/freeglut-3.0.0/ mkdir native-gles2/ && cd native-gles2/ cmake \ -DCMAKE_INSTALL_PREFIX=/tmp/freeglut-native-gles2 \ -DFREEGLUT_GLES2=ON \ -DFREEGLUT_BUILD_DEMOS=NO \ .. make make install
Get the 'freeglut-gles2' module through pkg-config.
If you use CMake, you can do that with:
include(FindPkgConfig) pkg_check_modules(freeglut REQUIRED freeglut-gles2>=3.0.0) if(freeglut_FOUND) include_directories(${freeglut_STATIC_INCLUDE_DIRS}) link_directories(${freeglut_STATIC_LIBRARY_DIRS}) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${freeglut_STATIC_CFLAGS_OTHER}") add_definitions(${freeglut_STATIC_CFLAGS_OTHER}) endif()
cd your_project/ mkdir native-gles2/ && cd native-gles2/ PKG_CONFIG_PATH=/tmp/freeglut-native-gles2/share/pkgconfig/ cmake ..