Ask / Submit
18

Irrlicht Engine port

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

sashikknox gravatar image

updated 2017-08-18 09:21:06 +0300

the first attempt of port Irrlicht engine to Wayland used resources:

Wayland programming client

wayland egl

but now application always "Not Respone", no Inpust Events .. just first test or Rendering...

maybe some one ported some other c++ engines to Sailfish ( Ogre, OSG ) ?

maybe any body can port irrlicht, use QOpenGLWidget or QQuickItem

QtQuick scene graph custom OpenGL

QtQuick cube example

image description

image description

edit retag flag offensive close delete

Comments

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

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

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

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

PerPixelLighting shaders works ) image description

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

@sashikknox

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.

Edz ( 2017-08-17 15:20:11 +0300 )edit
1

@Edz, thanks! )

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

5 Answers

Sort by » oldest newest most voted
10

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

sashikknox gravatar image

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

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

Comments

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 +0300 )edit
7

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

sashikknox gravatar image

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

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

Comments

Tested on Inoi R7 - works fine, close properly )

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

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

sashikknox gravatar image

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

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

Comments

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 +0300 )edit
1

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 +0300 )edit
1

@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 +0300 )edit

It's probably busy-looping?

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

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

sashikknox gravatar image

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

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

Comments

1
  • 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 +0300 )edit
3

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

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

Comments

1

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

sashikknox ( 2017-09-12 13:26:37 +0300 )edit
Login/Signup to Answer

Question tools

Follow
5 followers

Stats

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

Seen: 769 times

Last updated: Sep 14