We have moved to a new Sailfish OS Forum. Please start new discussions there.

[nearly done] Irrlicht 1.9 OpenGLES2 Engine port

asked 2017-08-17 13:49:47 +0200

sashikknox gravatar image

updated 2018-09-11 09:41:16 +0200

Sources putted to GitHub

Irrlicht engine work nice in SailfishOS now, but not all engine features supported now: in engine not grabbed gyroscope and accelerometer (need more work with it, because i dont use Qt directly in port, only pure Wayland implementation )

There are no SDL2 implementation, if i can, i will put it later... but SDL2 implementation created from SDL1 by migration guide in Official SDL web page, i mean that is not big deal

So I advise you to look in the direction of projects IrrBullet (+ bulllet sources), CAudio (OpenAL wrapper for Irrlciht), IrrLua (Lua bindings for Irrlciht, but seems it's too old).

edit retag flag offensive close delete


Do you have a qtapp loop running? without it, compositor wont know about your application at all.

tortoisedoc ( 2017-08-17 14:29:55 +0200 )edit

@tortoisedoc, no, just pure wayland code )) from some tutorials ))

sashikknox ( 2017-08-17 14:32:34 +0200 )edit

PerPixelLighting shaders works ) image description

sashikknox ( 2017-08-17 14:42:19 +0200 )edit


You can revert your answer here back to a comment and the image will still show. Go to edit this 'answer' and look at the bottom right corner of the controls, it should offer you to 'convert answer to comment' and vice-versa.

Spam Hunter ( 2017-08-17 15:20:11 +0200 )edit

@Edz, thanks! )

sashikknox ( 2017-08-17 15:22:15 +0200 )edit

5 Answers

Sort by » oldest newest most voted

answered 2017-08-18 12:12:46 +0200

sashikknox gravatar image

updated 2017-08-18 12:13:20 +0200

Yes! I didi it! read more Wayland tutorial, i add wl_shell_surface_add_listener to IrrlichtDevice implemetation =) that work! no more "Not Respone" ... =) But application cant launch from Icon in Apps menu ( only from terminal now ) , when i try launch from icon, its lodaing and down.

Next step:

Get Events from OS (mouse, keyboard, touchscreen)

edit flag offensive delete publish link more


but on my Inoi R7 shaders PerPixelLighting not work properly, cant work with 2 light in same time )

sashikknox ( 2017-08-18 12:17:34 +0200 )edit

answered 2017-09-12 11:36:07 +0200

sashikknox gravatar image

updated 2017-09-12 11:36:35 +0200

Nice =) When I try to use SDL2 with Irrlicht rendering ( it has SDL1 implementation, which was easy rewritten to SDL2 ) it work fine, and i can get Close Window Event now, and properly close irrlicht device =)) that mean, Irrlicht engine almost ported to SailfishOS )

When i will end my work, i will put it to GitHub, and share here link to sources and instructions..

edit flag offensive delete publish link more


Tested on Inoi R7 - works fine, close properly )

sashikknox ( 2017-09-12 14:38:31 +0200 )edit

answered 2017-09-14 10:57:22 +0200

sashikknox gravatar image

updated 2017-09-14 11:13:31 +0200

From SDL2 sources i got a way, how i can handle signal when window closing, and now Irrlicht engine works fine on sailfish in pure Wayland code (without SDL2)

Besides, SDL2 is in pause mode consumes a lot of resources (6 - 10% (6% in mostly)) at the same time as Wayland implementation does nothing consumes (0-1% from Lighthouse system monitor)

SDL2 implementation running on Inoi R7

image description

Wayland implementation running on Inoi R7

image description

P.S. I think the implementation of SDL2 version of Irrlicht engine is so demanding because of call of SDL2_PollEvent method placed in main loop with the subsequent analysis of the event type in the big switch {}, while in Wayland all events arrive as signals, and in the main loop was call just one function wl_display_dispatch.

edit flag offensive delete publish link more


i think, if i rewrite SDL_PollEvent to SDL_AddEventWatch callback in Irrlcih, it will be work as in Wayland ... eat just 1% of CPU in pause mode.

sashikknox ( 2017-09-14 11:24:35 +0200 )edit

Please compare the CPU consumption in the same conditions. I would recommend to do that on charger since then the device is not asleep. When device is asleep, CPU % could be artificially increased since it usually takes into account only awake part of time. Its quite probable that the both implementations are fine

rinigus ( 2017-09-14 11:28:44 +0200 )edit

@rinigus, i tested that many times, and always in pause mode SDL2 eat more CPU then Wayland, but when i will public sources, i put both implementations, and you can choose what you want

P.S. I didn't do accurate tests, this is just my observation

sashikknox ( 2017-09-14 11:34:08 +0200 )edit

It's probably busy-looping?

tortoisedoc ( 2017-09-15 12:28:34 +0200 )edit

answered 2017-09-12 13:21:58 +0200

tortoisedoc gravatar image

Please share your work! I think this is a pioneering approach on wayland integration, and is defnitely beneficial for the community! :)

edit flag offensive delete publish link more



Later I will share my work, but now the code is very dirty.

sashikknox ( 2017-09-12 13:26:37 +0200 )edit

answered 2017-08-19 12:48:37 +0200

sashikknox gravatar image

updated 2017-08-19 13:43:37 +0200

Now i connect to Keyboard, Mouse and Touchscreen events in Wayland. But i do not now how tell Irrlicht to close render device, when Sailfish close app.

Next steps:

  • get accelerometer and gyroscope from Sailfish Wayland (need some documentation about that in sailfish, help me who can =) )
  • correct closing of application ( now it's close with error, because GLESContext is destroyed, but Irrilicht try to use them )
  • run application from Sailfish Applications Menu ( that still not work, only from terminal run)
  • add some new Irrlicht UI components, like onscreen joystick =)
  • get display resolution and DPI (now a hardcoded resolution of Irrlicht render)
edit flag offensive delete publish link more


  • while i reading more manuals, i found wl_output_listener... now i can get display resolution and screen orietation (dynamicly, if it changed) ...

  • appliction now run from Sailfish Applications menu =)

  • still cant get app lifecycle, cant properly destroy irrlicht EGLContext when close app, becaus irrlicht still dont now about this =)

Found ProtonSDK engine, based on Irrlicht engine, with included Physics, Sound and other features... maybe later, i try to port it to Sailfish ;)

sashikknox ( 2017-08-24 13:41:36 +0200 )edit
Login/Signup to Answer

Question tools



Asked: 2017-08-17 13:49:47 +0200

Seen: 1,570 times

Last updated: Sep 11 '18