diff --git a/freeglut/web-src/docs/gles.php b/freeglut/web-src/docs/gles.php index a8d2e49..2c90de9 100644 --- a/freeglut/web-src/docs/gles.php +++ b/freeglut/web-src/docs/gles.php @@ -27,63 +27,51 @@ generateHeader($_SERVER['PHP_SELF']); from libraspeberrypi-dev which will shortcut X11 - see [#71] -

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).
- TODO: it seems it's possible to link both without incompatibility, so we need to remove - double-compilation.

+

FreeGLUT ES is provided as a separate library, because OpenGL ES +has a distinct library from plain OpenGL (-lGLESv1_CM +-lGLESv2 instead of -lGL, and different headers too). +We could consider dynamically loading the OpenGL symbols we need, +like libSDL.

-

When compiled for OpenGL ES 2.0, it is possible to use OpenGL ES 3.0 and higher if the device or -driver supports it by calling glutInitContextVersion(3.0, 0.0) before creating a window.

- -

The following explains how to use FreeGLUT ES under Mesa EGL.

+

It is possible to select OpenGL ES 1, 2 or 3 (if the device and +driver supports it) by calling +e.g. glutInitContextVersion(3,0) before creating a +window.

Compiling

-

Here's how to compile FreeGLUT for GLES2:

+

The following explains how to use FreeGLUT ES for Mesa EGL.
+See also the Android page.

First, check README.cmake to install the dependencies for your system.

-
-aptitude install libgles2-mesa-dev
-cd /usr/src/freeglut-3.0.0/
-mkdir native-gles2/ && cd native-gles2/
-cmake \
-  -DCMAKE_INSTALL_PREFIX=/tmp/freeglut-native-gles2 \
-  -D CMAKE_BUILD_TYPE=Debug \
-  -DFREEGLUT_GLES2=ON \
-  -DFREEGLUT_BUILD_DEMOS=NO \
-  ..
-make
-make install
-
- -

For GLES1:

+

Then:

-aptitude install libgles1-mesa-dev
+apt-get install libgles1-mesa-dev libgles2-mesa-dev
 cd /usr/src/freeglut-3.0.0/
-mkdir native-gles1/ && cd native-gles1/
+mkdir native-gles/ && cd native-gles/
 cmake \
-  -DCMAKE_INSTALL_PREFIX=/tmp/freeglut-native-gles1 \
+  -DCMAKE_INSTALL_PREFIX=/tmp/freeglut-native-gles \
   -D CMAKE_BUILD_TYPE=Debug \
-  -DFREEGLUT_GLES1=ON \
+  -DFREEGLUT_GLES=ON \
   -DFREEGLUT_BUILD_DEMOS=NO \
   ..
-make
+make -j4
 make install
 

Using in your projects

-

Get the 'freeglut-gles2' module through pkg-config.

+

Get the 'freeglut-gles' 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)
+pkg_check_modules(freeglut REQUIRED freeglut-gles>=3.0.0)
 if(freeglut_FOUND)
   include_directories(${freeglut_STATIC_INCLUDE_DIRS})
   link_directories(${freeglut_STATIC_LIBRARY_DIRS})
@@ -94,17 +82,17 @@ endif()
 
 
 cd your_project/
-mkdir native-gles2/ && cd native-gles2/
-PKG_CONFIG_PATH=/tmp/freeglut-native-gles2/share/pkgconfig/ cmake ..
+mkdir native-gles/ && cd native-gles/
+PKG_CONFIG_PATH=/tmp/freeglut-native-gles/share/pkgconfig/ cmake ..
 
-

See for instance:

+

Examples: