FIFE forums

Please login or register.

Login with username, password and session length
Advanced search  

News:

FIFE 0.4.0 has been released on 15th of January, 2017!

Author Topic: libRocket Implementation Patch  (Read 2400 times)

Technomage

  • Newbie
  • Posts: 2
    • View Profile
libRocket Implementation Patch
« on: June 29, 2011, 05:56:34 pm »

I've posted the libRocket patch I was talking about earlier at codepad: http://pastebin.com/N15H8jsZ. In summary, the changes were:
  * Added a new RocketGUIManager class which can be used to implement a libRocket GUI in FIFE. To use, simply create an instance and pass it to FIFE::Engine::setGuiManager (works from Python, too).
  * Added a new demo program, rocket_demo, to demonstrate the new libRocket GUI.
  * Updated the build/<platform>-config.py files to look for RocketCore, RocketControls and RocketDebugger.
  * Modified FIFE::Engine::setGuiManager to automatically register the new GUI manager with the SDL event system and clean up the previous GUI Manager.
  * Modified the Python bindings for FIFE::Engine::setGuiManager so that it automatically assigns ownership of the new GUI Manager to the Engine.
  * Updated the Python GUIChan extensions to utilize the new behavior of the FIFE::Engine::setGuiManager method.
  * Added "castTo" static functions to the Python bindings for GUIChanManager and RocketGUIManager which downcast an IGUIManager pointer from Engine::getGuiManager, allowing Python code to utilize these IGUIManager pointers.

The last couple of commits to fife-0.3.3dev broke my rocket_demo.py code somehow and it raises a RuntimeError when it tries to set the default font for the GuiChanManager. This may have something to do with the fact that I didn't bother to stop GUIChan initialization in ApplicationBase's __init__ method for the demo program, but simply clean up GUIChan and replace it with a RocketGUIManager instance. Regardless, I don't know enough about the changes to debug it so you'll have to take a look.

I couldn't figure out how to interface libRocket with the RenderBackend, specifically to render textures. So I just copied the OpenGL renderer from the libRocket samples "shell" framework. It seems to work fine within fife, though this might not be portable.

I should note that I haven't tested this on Windows or Mac.

Let me know if you have any questions.
Logged
M. George Hansen

vtchill

  • Developer
  • Full Member
  • *
  • Posts: 206
    • View Profile
Re: libRocket Implementation Patch
« Reply #1 on: June 30, 2011, 07:09:58 am »

This sounds like a great start. Thanks for the patch Technomage.

As for the rendering interface to FIFE I am thinking we may need to expand the gui manager interface a bit to allow libRocket to pass FIFE batches of geometry data for rendering. There is a decent tutorial on setting this up on the libRocket page so we should be able to handle it.

thanks again.
Logged

prock

  • Developer
  • Full Member
  • *
  • Posts: 236
    • View Profile
Re: libRocket Implementation Patch
« Reply #2 on: August 03, 2011, 10:49:40 am »

Hi Technomage,

It seems your paste is no longer valid.  Could you repost it please?  I'd like to make a ticket in trac for this.


prock
Logged