What I tried so far:
1. Cloned the source from here https://github.com/zaki/irrlicht
2. Ran make on the ogl-es branch. Had to do the following changes for it to compile:
a- COGLESExtensionHandler.cpp and CEGLManager.h: change #include <GLES/egl.h> to #include <EGL/egl.h>
b- -I/opt/vc/include and -L/opt/vc/lib on the Makefile.
At this point I got the engine to compile into a static lib.
I then tried making and running example01 (loads a simple model: sydney.md2). By default the example renders with the software renderer (E_DRIVER_TYPE::EDT_SOFTWARE).
This worked: it created a new window and rendered the 3d model.
I then tried recompiling and running with E_DRIVER_TYPE::EDT_OGLES2. Does not work. Fails in CEGLManager.cpp:
Code: Select all
#if defined(_IRR_COMPILE_WITH_WINDOWS_DEVICE_)
EglWindow = (NativeWindowType)Data.OpenGLWin32.HWnd;
Data.OpenGLWin32.HDc = GetDC((HWND)EglWindow);
EglDisplay = eglGetDisplay((NativeDisplayType)Data.OpenGLWin32.HDc);
#elif defined(_IRR_COMPILE_WITH_X11_DEVICE_)
EglWindow = (NativeWindowType)Data.OpenGLLinux.X11Window;
EglDisplay = eglGetDisplay((NativeDisplayType)Data.OpenGLLinux.X11Display);
#elif defined(_IRR_COMPILE_WITH_ANDROID_DEVICE_)
EglWindow = (ANativeWindow*)Data.OGLESAndroid.Window;
EglDisplay = eglGetDisplay(EGL_DEFAULT_DISPLAY);
#elif defined(_IRR_COMPILE_WITH_FB_DEVICE_)
EglWindow = (NativeWindowType)Data.OpenGLFB.Window;
EglDisplay = eglGetDisplay(EGL_DEFAULT_DISPLAY);
#endif
// We must check if EGL display is valid.
if (EglDisplay == EGL_NO_DISPLAY)
{
os::Printer::log("Could not get EGL display.");
terminate();
return false;
}
I've been searching for a while online but have not found information on this. So any help would be greatly appreciated.
In case it matters, I am trying to do this because my ultimate goal is to run Minetest on the Pi, which is built on top of Irrlicht. And I want to run it on GL ES 2 because the alternative, the experimental desktop GL 2.1 drivers for Pi, seem to perform worse than using GL ES 2.