Compiling with GL ES

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Iron Oxidizer
Posts: 3
Joined: Tue Sep 22, 2020 2:26 pm

Compiling with GL ES

Post by Iron Oxidizer »

I'm trying to compile Minetest with GL ES support on the PinePhone (aarch64 musl postmarketOS). Currently, I am able to build irrlicht without any issues, and minetest builds fine, until linking, where many errors due to undefined references to gl symbols occur:

https://pastebin.com/raw/37mcrYV5

Here's the link.txt file:

https://pastebin.com/raw/i0Zvt32g

This is my build process:

Code: Select all

sudo apk add build-base git cmake bzip2-dev libpng-dev jpeg-dev libxxf86vm-dev mesa-dev sqlite-dev libogg-dev libvorbis-dev openal-soft-dev curl-dev freetype-dev zlib-dev gmp-dev jsoncpp-dev luajit-dev
 
git clone --recursive --depth 1 -b ogl-es https://github.com/zaki/irrlicht
git clone https://github.com/minetest/minetest
 
cd irrlicht/source/Irrlicht
sed -i '1s/^/#define NO_IRR_COMPILE_WITH_OGLES1_ \n/' ../../include/IrrCompileConfig.h
sed -i 's/<GLES\/egl\.h>/<EGL\/egl\.h>/g' CEGLManager.h
make -j$(nproc)
 
cd ../../../minetest
cmake . -DRUN_IN_PLACE=TRUE -DENABLE_GLES=1 \
  -DBUILD_SERVER=NO \
  -DEGL_INCLUDE_DIR=/usr/include/EGL/egl.h \
  -DEGL_LIBRARY=/usr/lib/libEGL.so \
  -DOPENGLES2_INCLUDE_DIR=/usr/include/GLES2/gl2.h \
  -DOPENGLES2_LIBRARY=/usr/lib/libGLESv2.so \
  -DIRRLICHT_SOURCE_DIR=../irrlicht/source/Irrlicht/ \
  -DIRRLICHT_LIBRARY=../irrlicht/lib/Linux/libIrrlicht.a \
  -DIRRLICHT_INCLUDE_DIR=../irrlicht/include/
make -j$(nproc)
I compile without GLES1 because no such header or lib exists in my distro, only EGL and GLES2.

How would I resolve these errors? Any help is appreciated.
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Compiling with GL ES

Post by CuteAlien »

No guarantee as I don't know the platform, but from errors I suppose you have to exclude opengl (you already have gles2, so that's fine).
Try passing -DNO_IRR_COMPILE_WITH_OPENGL_ it might work if you are lucky.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Iron Oxidizer
Posts: 3
Joined: Tue Sep 22, 2020 2:26 pm

Re: Compiling with GL ES

Post by Iron Oxidizer »

Your solution worked and minetest builds successfuly. Thanks!

Here's my updated script for anyone else who's trying to get this working:

https://gist.github.com/IronOxidizer/0a ... fa1e5454c9

Code: Select all

sudo apk add build-base git cmake bzip2-dev libpng-dev jpeg-dev libxxf86vm-dev mesa-dev sqlite-dev libogg-dev libvorbis-dev openal-soft-dev curl-dev freetype-dev zlib-dev gmp-dev jsoncpp-dev luajit-dev
 
git clone --recursive --depth 1 -b ogl-es https://github.com/zaki/irrlicht
git clone https://github.com/minetest/minetest
 
cd irrlicht/source/Irrlicht
sed -i '1s/^/#define NO_IRR_COMPILE_WITH_OGLES1_\n#define NO_IRR_COMPILE_WITH_OPENGL_\n/' ../../include/IrrCompileConfig.h
sed -i 's/<GLES\/egl\.h>/<EGL\/egl\.h>/g' CEGLManager.h
make -j$(nproc)
 
cd ../../../minetest
cmake . -DRUN_IN_PLACE=TRUE -DENABLE_GLES=1 \
  -DBUILD_SERVER=NO \
  -DEGL_INCLUDE_DIR=/usr/include/EGL/egl.h \
  -DEGL_LIBRARY=/usr/lib/libEGL.so \
  -DOPENGLES2_INCLUDE_DIR=/usr/include/GLES2/gl2.h \
  -DOPENGLES2_LIBRARY=/usr/lib/libGLESv2.so \
  -DIRRLICHT_SOURCE_DIR=../irrlicht/source/Irrlicht/ \
  -DIRRLICHT_LIBRARY=../irrlicht/lib/Linux/libIrrlicht.a \
  -DIRRLICHT_INCLUDE_DIR=../irrlicht/include/
make -j$(nproc)
 
cp -r ../irrlicht/media/Shaders client/shaders/Irrlicht
echo -e 'default_game=devtest\nenable_shaders=false\nvideo_driver=ogles2' > minetest.conf
Post Reply