Embedding Chromium/Webkit in Panda

I’m on a mission to make my game’s GUI in HTML/CSS, and I’ve been trying to find out what rendering APIs are Panda-friendly.

librocket was my first pick, but it’s missing a lot of CSS features I need (primarily CSS3-related features like border-radius), and the lack of a UA style sheet makes testing somewhat tedious and difficult.

Berkelium was what I looked at next, and if I did my research correctly, Gogg integrated it into the Panda 2.0 branch some time ago, but there is no indication of whether it was backported to the main Panda branch, or whether the integration includes Python support.

cefpython is the most recent option I’ve found, and like Berkelium, is basically an embedded version of Chromium rendering to a texture. What’s more, it comes out of the box with Panda integration, so I shouldn’t have any issues there. Unfortunately, it doesn’t come bundled with Panda, compiling it looks like a pain, and there’s no clear indication of whether it supports Python 2.5 - I need to support OSX and, correct me if I’m wrong, 1.8.0 is compiled with Python 2.5 on OSX.

If anyone could help me solve the problems I’m having (especially with Berkelium or librocket), it’d be much appreciated. :slight_smile:

Those chrome bindings look mighty tasty. Is it windows only?

cefpython offscreen rendering is not complete yet. whats missing:

  1. widgets not implemented yet, for example triggering element crashes process. i was going to implement this but currently i am too busy with other things to continue, maybe some time in the future!
  2. there is no support for protocol apis (if i call that right). inventing your own protocol would allow you to navigate to url like gui/some/index.html (did this with berkelium in c++), you would provide file reading function and serve files possibly from pak file or wherever you like. This effectively would circumvent same origin security policy that cef has. This security policy forbids good deal of ajax-ish stuff when serving local files so you pretty much depend on setting up a webserver.

You do not need to compile it either, and even if you do - it is pretty easy, just use bat script for windows which is bundled with project. If everything is set up correctly it will compile easily.
But as i said - you dont have to, because panda runs on python 2.7.3 (hardly anyone uses 2.6 any more, let alone 2.5…)

All in all - should anyone wish integrating something into panda itself then in my opinion it should be cefpython due to its license. Berkelium is same thing as cef except there is no python wrapper afaik (but it has missing pieces of cefpython). Awesomium may be nice too but it costs, i would leave it for big companies.

From what I could gather, cefpython’s prebuilt binaries are Windows-only - I could not find any Linux or OSX builds (and I need to support all three operating systems).

Also, Panda does not necessarily run on Python 2.7 - the Ubuntu 10.04 build (which I use) uses 2.6, and all OSX builds of Panda use 2.5, so I need to support 2.5 and 2.6 in addition to 2.7.

I see…

I guess that berkelium port someone was about to commit to cvs never reached it, at least i cant find it.

another thought on berkelium - it really lacks when it comes to updating to new chromium versions. bunch of vulnerabilities get yanked with every chromium release. should you decide to have actual web browser in your game - it becomes major security hole. and even if no browser bug game is online - soon enough it would be exploited.

cef gets updates quick, and cefpython can be compiled for other platforms. afaik it does not contain platform dependant code. i assume if you go as far as supporting 3 platforms you are competent enough to recompile all required libs.

For the record, Panda3D has support for Awesomium.

yeah… including awesome licensing fees. hobbyist developers are cheap =|