Compiling the ogl-es branch

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!
Post Reply
Dingo_aus
Posts: 5
Joined: Wed Apr 01, 2009 11:48 am

Compiling the ogl-es branch

Post by Dingo_aus »

Ok I hoping the community (Hybrid?) can help me to compile the ogl-es branch using OGLES2 in an ARM7l Ubuntu system (hardware is the Pandaboard - www.pandaboard.org). Please note that this is not the pandora which has been talked about else on the forum, similar style hardware though.

So my environment is Ubuntu running on an ARM7l with OpenGL ES 2 hardware support.

Here are the steps I've taken:

1) Checkout the SVN version of Irrlicht

2) Install the libgles2-mesa-dev package from the Ubuntu Repositories

3) Modify the IrrCompileConfig.h file to define OGLES2 defines

4) Modify CIrrDeviceLinux.cpp to define "createOGLES2Driver" and then define it based on the GLES1 version of this method

5) Modify the Irrlicht Makefile to point to the libgles2-mesa-dev headers and libraries.

6) "make" the Irrlicht Static Library.

7) Attempt to "make" the example 07.Collison

This step fails with 3 pages of errors staring with:
g++ -I../../include -I/usr/X11R6/include -O3 -ffast-math main.cpp -o ../../bin/Linux/07.Collision -L/usr/X11R6/lib -L../../lib/Linux -lIrrlicht -L/usr/lib -lGLES_CM -lXxf86vm -lXext -lX11 -lXcursor
../../lib/Linux/libIrrlicht.a(COGLES2Driver.o): In function `COGLES2Driver':
/media/restore/pandaboard/irrlichtogles/irrlicht/branches/ogl-es/source/Irrlicht/COGLES2Driver.cpp:154: undefined reference to `eglBindAPI'
/media/restore/pandaboard/irrlichtogles/irrlicht/branches/ogl-es/source/Irrlicht/COGLES2Driver.cpp:154: undefined reference to `eglBindAPI'
../../lib/Linux/libIrrlicht.a(COGLES2Driver.o): In function `irr::video::COGLES2Driver::genericDriverInit(irr::core::dimension2d<unsigned int> const&, bool)':
/media/restore/pandaboard/irrlichtogles/irrlicht/branches/ogl-es/source/Irrlicht/COGLES2Driver.cpp:224: undefined reference to `irr::video::COGLES2FixedPipelineShader::COGLES2FixedPipelineShader(irr::video::COGLES2Driver*, irr::io::IFileSystem*)'
/media/restore/pandaboard/irrlichtogles/irrlicht/branches/ogl-es/source/Irrlicht/COGLES2Driver.cpp:225: undefined reference to `irr::video::COGLES2SLMaterialRenderer::useProgram()'
/media/restore/pandaboard/irrlichtogles/irrlicht/branches/ogl-es/source/Irrlicht/COGLES2Driver.cpp:227: undefined reference to `irr::video::COGLES2Renderer2d::COGLES2Renderer2d(irr::video::COGLES2Driver*, irr::io::IFileSystem*)'
/media/restore/pandaboard/irrlichtogles/irrlicht/branches/ogl-es/source/Irrlicht/COGLES2Driver.cpp:265: undefined reference to `glUseProgram'
../../lib/Linux/libIrrlicht.a(COGLES2Driver.o): In function `irr::video::COGLES2Driver::createMaterialRenderers()':
/media/restore/pandaboard/irrlichtogles/irrlicht/branches/ogl-es/source/Irrlicht/COGLES2Driver.cpp:303: undefined reference to `irr::video::COGLES2NormalMapRenderer::COGLES2NormalMapRenderer(irr::video::COGLES2Driver*, irr::io::IFileSystem*, int&, irr::video::IMaterialRenderer*)'
/media/restore/pandaboard/irrlichtogles/irrlicht/branches/ogl-es/source/Irrlicht/COGLES2Driver.cpp:305: undefined reference to `irr::video::COGLES2NormalMapRenderer::COGLES2NormalMapRenderer(irr::video::COGLES2Driver*, irr::io::IFileSystem*, int&, irr::video::IMaterialRenderer*)'
Can anyone see what I should do to compile the example successfully?
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

The eglBindAPI should be somewhere in the ogl-es libraries. The COpenGLES2* methods should be in the Irrlicht code. Either you did not compile in all object files, or the methods are incorrectly protected by some ifdef which does not match the places where the method is used.
Dingo_aus
Posts: 5
Joined: Wed Apr 01, 2009 11:48 am

Post by Dingo_aus »

Well I'm having no luck.

I've tried for a couple of days to compile the ogl-es branch for OpenGL ES 2.0.

I've even tried starting from scratch.

Since I'm using the PowerVR SDK, the location of certain headers is more compliant with the Khronos suggested way to doing things, like GLES/egl.h should be EGL/egl.h.

Whilst I've gone through updating things like this I'm still getting linker errors telling me that certain OGLES2 functions can't be found:

Makefile:31: Building...
g++ -I../../include -I/usr/X11R6/include -I/usr/include -I/usr/include/GLES2 -I/usr/include/EGL -I/media/restore/pandaboard/irrlichtogles/irrlicht/branches/ogl-es/source/Irrlicht -O3 -ffast-math main.cpp -o ../../bin/Linux/07.Collision -L/usr/X11R6/lib -L../../lib/Linux -lIrrlicht -L/usr/lib -L/usr/lib/X11 -lGLESv2 -lEGL -lGLES_CM -L/usr/lib/egl -L/media/restore/pandaboard/irrlichtogles/irrlicht/branches/ogl-es/lib/Linux -lXxf86vm -lXext -lX11 -lXcursor
../../lib/Linux/libIrrlicht.a(COGLES2Driver.o): In function `irr::video::COGLES2Driver::genericDriverInit(irr::core::dimension2d<unsigned int> const&, bool)':
/media/restore/pandaboard/irrlichtogles/irrlicht/branches/ogl-es/source/Irrlicht/COGLES2Driver.cpp:224: undefined reference to `irr::video::COGLES2FixedPipelineShader::COGLES2FixedPipelineShader(irr::video::COGLES2Driver*, irr::io::IFileSystem*)'


Does anyone have a list of steps expected to be undertaken to get the current SVN code to compile for OGL ES 2.0?

Cheers,

Dingo.
darkphoenix16
Posts: 8
Joined: Thu Nov 04, 2010 2:50 am

Missing libraries

Post by darkphoenix16 »

Hey, you may be missing the library linker flags (-lGLESv2 and -lEGL)
Dingo_aus
Posts: 5
Joined: Wed Apr 01, 2009 11:48 am

Post by Dingo_aus »

Thanks for that tip.

I've gone through my Makefile and ensured I've referenced the GLESv2 and EGL libraries but I'm still getting the same errors.

Here is the relevant extract from the Makefile for the 07.Collision example I'm trying to build:

Code: Select all

OGLESLIBS := -L/usr/lib -L/usr/lib/X11 -lGLESv2 -lEGL -lGLES_CM -L/usr/lib/egl -L/media/restore/pandaboard/irrlichtogles/irrlicht/branches/ogl-es/lib/Linux

# target specific settings

all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht $(OGLESLIBS) -lXxf86vm -lXext -lX11 -lXcursor

all_linux clean_linux: SYSTEM=Linux
[/code]

I've also confirmed I have the libraries in the /usr/lib directory (at least symlinks to the real thing).

When using make with the "--debug" switch I don't see any issues about missing libraries/header.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Well, the output above shows a different command line, without the ogl-es 2.x libs. It is also sometimes a problem to link both ogl-es 1 and ogl-es 2 into one binary. The emulation libraries on PCs often don't support this properly. So maybe disable one of the two, and only link in the lib you're using.
Dingo_aus
Posts: 5
Joined: Wed Apr 01, 2009 11:48 am

Post by Dingo_aus »

I took out "-lGLES_CM" in the Makefile and recompiled but got the same errors.

I'm not using emulation, I'm compiling natively on the hardware under Ubuntu.

I'm now going to try starting from scratch again with the SVN code to avoid any errors introduced by my changes.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Re: Compiling the ogl-es branch

Post by hybrid »

Dingo_aus wrote:This step fails with 3 pages of errors staring with:
g++ -I../../include -I/usr/X11R6/include -O3 -ffast-math main.cpp -o ../../bin/Linux/07.Collision -L/usr/X11R6/lib -L../../lib/Linux -lIrrlicht -L/usr/lib -lGLES_CM -lXxf86vm -lXext -lX11 -lXcursor
Can anyone see what I should do to compile the example successfully?
I meant this here. As you can see, it just uses GLES_CM and not ogl-es2 libs. Make sure that you also change the example Makefiles, not just the main engine Makefile in sources/Irrlicht
darkphoenix16
Posts: 8
Joined: Thu Nov 04, 2010 2:50 am

Slightly off topic

Post by darkphoenix16 »

Hey,

I have this compiling in Linux (I use eclipse managed make files though). I'm just wondering why OGLES2 support for linux requires the end-user to modify the linux driver to call createOGLES2Driver.

Is something not working properly in the X11/GLES2 combo?

Here is what I get when I run:


Code: Select all

Irrlicht Engine version 1.8.0-alpha
Linux 2.6.38-8-generic #42-Ubuntu SMP Mon Apr 11 03:31:24 UTC 2011 x86_64
Using plain X visual
EglDisplay initialized. Egl version 1.4

Could not get config for OpenGL-ES2 display.
 Creating EglSurface with nativeWindow...
FAILED

Creating EglSurface without nativeWindows...
FAILED

Could not create surface for OpenGL-ES2 display.
Creating EglContext...
Using renderer: 
OpenGL OpenGL_ES OpenGL_ES2 OpenVG 

EGL_KHR_image_base EGL_KHR_image_pixmap EGL_KHR_image EGL_KHR_reusable_sync EGL_KHR_fence_sync EGL_KHR_surfaceless_gles1 EGL_KHR_surfaceless_gles2 EGL_KHR_surfaceless_opengl 

Loading shader: data/shaders/COGLES2FixedPipeline.vsh
GLSL shader failed to compile : d/d/LFdeeh

Error reading fixed pipeline vertex shader.
Loading shader: data/shaders/COGLES2FixedPipeline.fsh
GLSL shader failed to compile : d/d/LFdeeh
ұ��
Error reading fixed pipeline fragment shader.
GLSL shader program failed to link
ұ��
Error linking fixed pipeline shader program.
Loading shader: data/shaders/COGLES2Renderer2D.vsh
GLSL shader failed to compile : d/d/LRe2s
ұ��
Error reading fixed pipeline vertex shader.
Loading shader: data/shaders/COGLES2Renderer2D.fsh
GLSL shader failed to compile : d/d/LRe2so
(ұ��
Error reading fixed pipeline fragment shader.
GLSL shader program failed to link
ұ��
Error linking fixed pipeline shader program.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Should just be working as expected. But I currently have mostly Windows development machines, so I can only act on feedback from externals for Linux atm.
darkphoenix16
Posts: 8
Joined: Thu Nov 04, 2010 2:50 am

Post by darkphoenix16 »

hybrid wrote:Should just be working as expected. But I currently have mostly Windows development machines, so I can only act on feedback from externals for Linux atm.
No problem hybrid. Knowing that it should work is enough to start on. How would I upload or point to patches if I have any? Also, is there a way to suggest the integration of some features I mad add to irrlicht throughout the development of a few games I am working on?

thx
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Discussions should be kept in here, patches should go into the tracker: http://sourceforge.net/tracker/?group_id=74339
Of course, adding those patches is not that easy for me while I have no system to test them on. But the tracker will safely keep all those files and some day I will also have a proper Linux machine again :wink: Actually, we plan to integrate the ogl-es branch into Irrlicht 1.8, so I guess I have to hurry with that new machine... Or maybe I switch to virtual machines...
Post Reply