Building Irrlicht sharedlib from OGL-ES branch on Linux-plat

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
hissingshark
Posts: 13
Joined: Mon Jan 08, 2018 11:58 am

Building Irrlicht sharedlib from OGL-ES branch on Linux-plat

Post by hissingshark »

Hi,

I'm attempting to build Irrlicht on a Vero4K (Amlogic S905x SOC)running OSMC. This is a Debian based distro running in framebuffer - no X environment.

I have SDL2 compiled with FB-dev support which I thought would make this easy but after a few failed attempts I've realised Irrlicht does not yet support SDL2 (unless anyone has an up-to-date patch?). SO I'm building for Linux and a FB Device

Where I am so far:

git cloned the ogl-es branch from https://github.com/zaki/irrlicht.git

Added the following to IrrCompileConfig.h

Code: Select all

// platforms
#define _IRR_LINUX_PLATFORM_
 
#define NO_IRR_WINDOWS_
 
 
// devices
#define _IRR_COMPILE_WITH_FB_DEVICE_
 
#define NO_IRR_COMPILE_WITH_X11_DEVICE_
#define NO_IRR_COMPILE_WITH_WINDOWS_DEVICE_
#define NO_IRR_COMPILE_WITH_SDL_DEVICE_
#define NO_IRR_COMPILE_WITH_CONSOLE_DEVICE_
#define NO_IRR_COMPILE_WITH_SOFTWARE_
#define NO_IRR_COMPILE_WITH_BURNINGSVIDEO_
 
 
// API options
#define _IRR_COMPILE_WITH_OGLES1_
#define _IRR_COMPILE_WITH_OGLES2_
#define _IRR_COMPILE_WITH_WEBGL1_
 
#define NO_IRR_COMPILE_WITH_EGL_MANAGER_
#define NO_IRR_COMPILE_WITH_OPENGL_
 
 
// miscellaneous
#define _IRR_COMPILE_WITH_XML_
#define _IRR_COMPILE_WITH_GUI_
 
#define NO_IRR_COMPILE_WITH_LEAK_HUNTER_
#define NO_IRR_COMPILE_WITH_JOYSTICK_EVENTS_
#define NO_IRR_COMPILE_WITH_PROFILING_
#define NO_IRR_COMPILE_WITH_DIRECT3D_9_
#define NO_IRR_LINUX_X11_VIDMODE_
#define NO_IRR_LINUX_X11_RANDR_
#define NO_IRR_COMPILE_WITH_X11_
#define NO_IRR_LINUX_XCURSOR_
#define NO_IRR_WCHAR_FILESYSTEM
#define NO_IRR_D3D_NO_SHADER_DEBUGGING
I also commented out the references to X based libs in the Makefile.

Code: Select all

make sharedlib
gets me:
In file included from COGLESExtensionHandler.h:17:0,
from COGLESExtensionHandler.cpp:7:
COGLESCommon.h:20:21: fatal error: GLES/gl.h: No such file or directory
#include <GLES/gl.h>
^
compilation terminated.
In file included from COGLESExtensionHandler.h:17:0,
from COGLESDriver.h:18,
from COGLESDriver.cpp:5:
COGLESCommon.h:20:21: fatal error: GLES/gl.h: No such file or directory
#include <GLES/gl.h>
^
compilation terminated.
g++ -Wall -pipe -fno-exceptions -fno-rtti -fstrict-aliasing -g -D_DEBUG -fPIC -I../../include -Izlib -Ijpeglib -Ilibpng -DIRRLICHT_EXPORTS=1 -c -o COGLES2Driver.o COGLES2Driver.cpp
<builtin>: recipe for target 'COGLESExtensionHandler.o' failed
make: *** [COGLESExtensionHandler.o] Error 1
make: *** Waiting for unfinished jobs....
In file included from COGLES2ExtensionHandler.h:17:0,
from COGLES2Driver.h:19,
from COGLES2Driver.cpp:6:
COGLES2Common.h:28:23: fatal error: GLES2/gl2.h: No such file or directory
#include <GLES2/gl2.h>
^
compilation terminated.
<builtin>: recipe for target 'COGLESDriver.o' failed
make: *** [COGLESDriver.o] Error 1
<builtin>: recipe for target 'COGLES2Driver.o' failed
make: *** [COGLES2Driver.o] Error 1
So I changed from absolute path in Makefile

Code: Select all

CXXINCS += -I/opt/vero3/include
to a relative one:

Code: Select all

CXXINCS += -I../../../../../opt/vero3/include
That yielded:
gles2-ext.h:2590:50: error: variable or field ‘glWaitVkSemaphoreNV’ declared void
GL_APICALL void GL_APIENTRY glWaitVkSemaphoreNV (GLuint64 vkSemaphore);
^
gles2-ext.h:2590:50: error: ‘GLuint64’ was not declared in this scope
gles2-ext.h:2591:52: error: variable or field ‘glSignalVkSemaphoreNV’ declared void
GL_APICALL void GL_APIENTRY glSignalVkSemaphoreNV (GLuint64 vkSemaphore);
^
gles2-ext.h:2591:52: error: ‘GLuint64’ was not declared in this scope
gles2-ext.h:2592:48: error: variable or field ‘glSignalVkFenceNV’ declared void
GL_APICALL void GL_APIENTRY glSignalVkFenceNV (GLuint64 vkFence);
^
gles2-ext.h:2592:48: error: ‘GLuint64’ was not declared in this scope
<builtin>: recipe for target 'COGLES2NormalMapRenderer.o' failed
make: *** [COGLES2NormalMapRenderer.o] Error 1
<builtin>: recipe for target 'COGLES2ParallaxMapRenderer.o' failed
make: *** [COGLES2ParallaxMapRenderer.o] Error 1
<builtin>: recipe for target 'COGLES2MaterialRenderer.o' failed
make: *** [COGLES2MaterialRenderer.o] Error 1
<builtin>: recipe for target 'COGLES2Driver.o' failed
make: *** [COGLES2Driver.o] Error 1
I substitued the Irrlicht supplied gles2-ext.h for the one supplied in my system's GLES2 includes.

Code: Select all

/opt/vero3/GLES2/glext.h 
I renamed it to gles2-ext.h to match but it already included the same

Code: Select all

#define __gl2ext_h_ 1
so I take it to be the right file.

The next build gets me:
g++ -Wall -pipe -fno-exceptions -fno-rtti -fstrict-aliasing -g -D_DEBUG -fPIC -I../../../../../opt/vero3/include -I../../include -Izlib -Ijpeglib -Ilibpng -DIRRLICHT_EXPORTS=1 -c -o Irrlicht.o Irrlicht.cpp
CIrrDeviceFB.cpp: In member function ‘void irr::CIrrDeviceFB::createDriver()’:
CIrrDeviceFB.cpp:232:46: error: ‘fbGetDisplay’ was not declared in this scope
NativeDisplayType display = fbGetDisplay(0);
^
CIrrDeviceFB.cpp:233:49: error: ‘fbGetDisplayGeometry’ was not declared in this scope
fbGetDisplayGeometry(display, &width, &height);
^
CIrrDeviceFB.cpp:234:77: error: ‘fbCreateWindow’ was not declared in this scope
data.OpenGLFB.Window = (void*)fbCreateWindow(display, 0, 0, width, height);
^
CIrrDeviceFB.cpp:250:46: error: ‘fbGetDisplay’ was not declared in this scope
NativeDisplayType display = fbGetDisplay(0);
^
CIrrDeviceFB.cpp:251:49: error: ‘fbGetDisplayGeometry’ was not declared in this scope
fbGetDisplayGeometry(display, &width, &height);
^
CIrrDeviceFB.cpp:252:77: error: ‘fbCreateWindow’ was not declared in this scope
data.OpenGLFB.Window = (void*)fbCreateWindow(display, 0, 0, width, height);
^
CIrrDeviceFB.cpp:262:7: error: ‘DEPRECATED_EDT_DIRECT3D8_NO_LONGER_EXISTS’ was not declared in this scope
case DEPRECATED_EDT_DIRECT3D8_NO_LONGER_EXISTS:
^
CIrrDeviceFB.cpp:262:7: note: suggested alternative:
In file included from ../../include/ITexture.h:11:0,
from ../../include/IVideoDriver.h:10,
from ../../include/IrrlichtDevice.h:10,
from CIrrDeviceStub.h:8,
from CIrrDeviceFB.h:13,
from CIrrDeviceFB.cpp:6:
../../include/EDriverTypes.h:43:3: note: ‘DEPRECATED_EDT_DIRECT3D8_NO_LONGER_EXISTS’
DEPRECATED_EDT_DIRECT3D8_NO_LONGER_EXISTS, // keep enum to avoid breaking enumeration order (might be used in ini-files, serialization, etc)
^
CIrrDeviceFB.cpp: In member function ‘virtual bool irr::CIrrDeviceFB::present(irr::video::IImage*, void*, irr::core::rect<int>*)’:
CIrrDeviceFB.cpp:455:33: warning: ‘void* irr::video::IImage::lock()’ is deprecated (declared at ../../include/IImage.h:187) [-Wdeprecated-declarations]
u8* srcdata = (u8*)image->lock();
^
CIrrDeviceFB.cpp:462:16: warning: ‘void irr::video::IImage::unlock()’ is deprecated (declared at ../../include/IImage.h:195) [-Wdeprecated-declarations]
image->unlock();
^
<builtin>: recipe for target 'CIrrDeviceFB.o' failed
make: *** [CIrrDeviceFB.o] Error 1
make: *** Waiting for unfinished jobs....
I can't find references to any of these methods in the Irrlicht source or in my supplied headers, so this is where I'm stuck.

Any advice please?
CuteAlien
Admin
Posts: 9628
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Building Irrlicht sharedlib from OGL-ES branch on Linux-

Post by CuteAlien »

Sorry, no SDL2 support (didn't want to add it before merging ogl-es branch back to trunk).
Not sure what that's about the different OGL ES versions you compile. Do you need them? If you need only one then only use that (ES2 preferably as ES1 is outdated and likely won't be supported in the future).

Not sure right now which header provides functions like fbGetDisplay - will have to check in the evening when I'm back on Linux.
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
hissingshark
Posts: 13
Joined: Mon Jan 08, 2018 11:58 am

Re: Building Irrlicht sharedlib from OGL-ES branch on Linux-

Post by hissingshark »

Ah, silly me, didn't realise I had to build for just one.
Likewise, can't rebuild until tonight, but I'll report back then.

I'll select OGLES2 then, and cancel off OGLES1 and WEBGL1

Thank you for the prompt feedback.
hissingshark
Posts: 13
Joined: Mon Jan 08, 2018 11:58 am

Re: Building Irrlicht sharedlib from OGL-ES branch on Linux-

Post by hissingshark »

How odd. Despite the fact I've just purposefully disabled WEBGL1 and GLES1 I fail instead with:
CWebGL1Driver.cpp:1119:81: error: ‘irr::io::IFileSystem’ has not been declared
IVideoDriver* createWebGL1Driver(const SIrrlichtCreationParameters& params, io::IFileSystem* io, IContextManager* contextManager)
^
<builtin>: recipe for target 'CWebGL1Driver.o' failed
make: *** [CWebGL1Driver.o] Error 1
make: *** Waiting for unfinished jobs..
That's a bit like getting errors about SDL or X11 when I've disabled that isn't it?
hissingshark
Posts: 13
Joined: Mon Jan 08, 2018 11:58 am

Re: Building Irrlicht sharedlib from OGL-ES branch on Linux-

Post by hissingshark »

And if I re-enable WEBGL1, keeping GLES2 (no GLES1)
CIrrDeviceFB.cpp: In member function ‘void irr::CIrrDeviceFB::createDriver()’:
CIrrDeviceFB.cpp:232:46: error: ‘fbGetDisplay’ was not declared in this scope
NativeDisplayType display = fbGetDisplay(0);
^
CIrrDeviceFB.cpp:233:49: error: ‘fbGetDisplayGeometry’ was not declared in this scope
fbGetDisplayGeometry(display, &width, &height);
^
CIrrDeviceFB.cpp:234:77: error: ‘fbCreateWindow’ was not declared in this scope
data.OpenGLFB.Window = (void*)fbCreateWindow(display, 0, 0, width, height);
^
CIrrDeviceFB.cpp:262:7: error: ‘DEPRECATED_EDT_DIRECT3D8_NO_LONGER_EXISTS’ was not declared in this scope
case DEPRECATED_EDT_DIRECT3D8_NO_LONGER_EXISTS:
^
CIrrDeviceFB.cpp:262:7: note: suggested alternative:
In file included from ../../include/ITexture.h:11:0,
from ../../include/IVideoDriver.h:10,
from ../../include/IrrlichtDevice.h:10,
from CIrrDeviceStub.h:8,
from CIrrDeviceFB.h:13,
from CIrrDeviceFB.cpp:6:
../../include/EDriverTypes.h:43:3: note: ‘DEPRECATED_EDT_DIRECT3D8_NO_LONGER_EXISTS’
DEPRECATED_EDT_DIRECT3D8_NO_LONGER_EXISTS, // keep enum to avoid breaking enumeration order (might be used in ini-files, serialization, etc)
^
CIrrDeviceFB.cpp: In member function ‘virtual bool irr::CIrrDeviceFB::present(irr::video::IImage*, void*, irr::core::rect<int>*)’:
CIrrDeviceFB.cpp:455:33: warning: ‘void* irr::video::IImage::lock()’ is deprecated (declared at ../../include/IImage.h:187) [-Wdeprecated-declarations]
u8* srcdata = (u8*)image->lock();
^
CIrrDeviceFB.cpp:462:16: warning: ‘void irr::video::IImage::unlock()’ is deprecated (declared at ../../include/IImage.h:195) [-Wdeprecated-declarations]
image->unlock();
^
<builtin>: recipe for target 'CIrrDeviceFB.o' failed
make: *** [CIrrDeviceFB.o] Error 1
make: *** Waiting for unfinished jobs....
We're back to that again.
So still that problem, but is there also a logic problem with a WEBGL1 include somewhere then?
CuteAlien
Admin
Posts: 9628
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Building Irrlicht sharedlib from OGL-ES branch on Linux-

Post by CuteAlien »

OK, WebGL wasn't tested with disabled define, fixed that now. Also the DEPRECATED_EDT_DIRECT3D8_NO_LONGER_EXISTS should be fixed.
I don't know much about the framebuffer device unfortunately (never worked with that one myself). But googling around - the only place where I found those functions mentioned anywhere was here: https://github.com/spurious/SDL-mirror/ ... ntevideo.h
In they seem to be typedefs around egl functions. I'll try to reach the programmer who wrote that - maybe he still knows.

edit: Don't know how long it will take for fixes to show up in the repository you are using by the way - that's not the official one. Our repositories are here: https://sourceforge.net/p/irrlicht/code/HEAD/tree/
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
hissingshark
Posts: 13
Joined: Mon Jan 08, 2018 11:58 am

Re: Building Irrlicht sharedlib from OGL-ES branch on Linux-

Post by hissingshark »

Ah yes, the Git is an automated mirror isn't it. Good tip. I'll switch to SVN for your project. Not used it before but I'm sure it's a doddle.

Having working framebuffer support will open up all kinds of possibilities for embedded platforms (Minetest for example).
I imagine without the overhead of a system running X/Windows/OSX etc the performance will be better too?

Thanks for continuing to investigate.
hissingshark
Posts: 13
Joined: Mon Jan 08, 2018 11:58 am

Re: Building Irrlicht sharedlib from OGL-ES branch on Linux-

Post by hissingshark »

It looks to me like the functions in your code are geared towards the API header provided by a particular vendor. The case you cited https://github.com/spurious/SDL-mirror/ ... ntevideo.h is SDL2 using the framebuffer API provided in the Vivante headers. It's meant to all be defined there in https://github.com/zOrg1331/fsl-gpu-viv ... lvivante.h, included from <EGL/eglplatform.h>.

My SOC is using a Mali GPU. If you look here https://github.com/mihailescu2m/libsdl2 ... mali-fbdev, Mali framebuffer support had to be explicitly added to SDL2. This is the fork I originally built on my platform (and for that reason I'd hoped for SDL2 support in Irrlicht!), but the changes were never pushed upstream. They have since been pulled in by the Retropie project for their SDL2 fork, giving me access to a more current SDL2 version.

So your code might need an update if it is to support Mali. I'm hoping it's a straight forward substitution for functions of different names with the same functionality. I certainly can't see any headers with the same function names as they used https://github.com/linux-sunxi/sunxi-ma ... er/include.

I may be talking out of my hat, but this is what I'm looking into at this end (and getting thoroughly out of my depth!).
CuteAlien
Admin
Posts: 9628
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Building Irrlicht sharedlib from OGL-ES branch on Linux-

Post by CuteAlien »

Unfortuantely I didn't get any answer from original programmer so far.
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
CuteAlien
Admin
Posts: 9628
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Building Irrlicht sharedlib from OGL-ES branch on Linux-

Post by CuteAlien »

Got an answer from Hybrid (who wrote this code):
I think this came from framebuffer device or fbDirect library. Not sure
really, as these were parts of the RaspberryPi OpenGL environment. I
worked along some FAQs for that device and also tried it on other ARM
devices. Was working basically, but usually didn't use the correct
resolution etc.

Also seems that fbDirect is dead now, not sure whether there are any
support libraries working properly anymore. Maybe the OpenGLES examples
have some guidance on how to do this now.
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
hissingshark
Posts: 13
Joined: Mon Jan 08, 2018 11:58 am

Re: Building Irrlicht sharedlib from OGL-ES branch on Linux-

Post by hissingshark »

OK, thanks.
So this confirms that it's written for another API (now defunct).

And a re-write is needed if it is to work on my platform.
Well I'll look into the straight substitution option and see if it compiles, but I expect it will prove more complicated than that.
hissingshark
Posts: 13
Joined: Mon Jan 08, 2018 11:58 am

Re: Building Irrlicht sharedlib from OGL-ES branch on Linux-

Post by hissingshark »

Progress and Problem.

I've done some research into OpenGL ES on my board and got some basic programs running.

On returning here I now understand the code in question is obtaining a handle to the Native Window. This is down to the local windowing system, so very platform specific. But after that you're using all the regular API calls so we should be ok I think.
I've pulled your latest OGL-ES branch from Sourceforge and made the changes. Looks ok.

But before and after my fix there an error in what immediately follows that portion of the code:

Code: Select all

CIrrDeviceFB.cpp:247:25: error: expected type-specifier before ‘CEGLManager’
    ContextManager = new video::CEGLManager();
                         ^~~~~
I can't find the declaration for ContextManger, a void* (I might have expected

Code: Select all

video::IContextManager* ContextManager
for example, but as it doesn't throw an error I guess I've just missed it somewhere...
But apart from that I don't see the problem. Funny I don't remember this error last time. The line is the same in the out-of-date git mirror I was using previously, so I assume another file has changed?
CuteAlien
Admin
Posts: 9628
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Building Irrlicht sharedlib from OGL-ES branch on Linux-

Post by CuteAlien »

CIrrDeviceFB is derived from CIrrDeviceStub and ContextManager is in there.
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
hissingshark
Posts: 13
Joined: Mon Jan 08, 2018 11:58 am

Re: Building Irrlicht sharedlib from OGL-ES branch on Linux-

Post by hissingshark »

Ah that explains the left side working.

But any ideas on the "new" error that's blocking the build?
CuteAlien
Admin
Posts: 9628
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Building Irrlicht sharedlib from OGL-ES branch on Linux-

Post by CuteAlien »

Means it doesn't find the type. Which is strange as it should include "CEGLManager.h" earlier on. Maybe it compiles without _IRR_COMPILE_WITH_EGL_MANAGER_?
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
Post Reply