17

We've been looking at adding decent browser support to our C++ application; this question is about GUI-independent browser libraries since our project involves 3D rendering and doesn't quite fit a normal GUI.

The two I've seen so far are Berkelium and Awesomium. Both seem to work in a similar way from my quick investigation, rendering to an offscreen-buffer which you blt into your own window/game/anything. Awesomium is proprietary and costs a fair amount ($5k), Berkelium is open-source and free. Has anyone compared these (and other) such tools? Cross-platform is a benefit but not 100% essential.

Mr. Boy
  • 60,845
  • 93
  • 320
  • 589

3 Answers3

13

Take a look at the Chromium Embedded Framework. CEF 3 supports off-screen rendering on all operating systems: Windows/Mac/Linux.

Czarek Tomczak
  • 20,079
  • 5
  • 49
  • 56
11

Disclaimer: I created Awesomium. Nevertheless, I will practice the utmost objectivity in my response.

Awesomium does cost a bit of money but it is definitely the best tool for the job, I'll defend my reasons with a bulleted list:

  • Simple, well-documented API; we've tried our best to keep the API as intuitive and readable as possible. That's really important when you're embedded something as large and complex as an entire browser framework. (Believe me, you don't want to embed WebKit directly-- that's like swallowing the sun.)

  • Windowless rendering; the library was designed from the outset to be used outside of a standard "windowing framework". We make it really easy to render a WebView to a texture:

void update()
{
    if(webView->isDirty())
        webView->render()->copyTo(texture, width * bpp, bpp, false);
}
  • Solid Javascript integration; if you use Awesomium as an HTML GUI renderer for your 3D game, you'll definitely want to take advantage of our Javascript <-> C++ integration. You can call Javascript functions directly from C++ and vice-versa, set callbacks, expose global properties, and more. I wrote up a big guide on my blog here.

  • Well-supported; we use the money we get from our top-tier commercial licenses to fund support and development of the library. If you need help, please visit http://support.awesomium.com and we'll be glad to lend a hand.

The library is free for non-commercial use and very affordable for indie developers. If you'd like to use Awesomium in your next project and are worried about the price-point, please email me at adam@khrona.com and I'll see if I can't help you out. :-)

Adam
  • 576
  • 3
  • 6
  • Thanks for your reply. Out of interest, have you got any direct comparison with the other library I mentioned? I have _no_ interest in starting from scratch, I agree it's way too much work! – Mr. Boy Apr 07 '11 at 17:37
  • 1
    Sure, Berkelium's API is a bit more bare (you have to implement a little extra) but it does many of the same core things as Awesomium (no coincidence there, Berkelium was created after Awesomium). Both support Windows and Mac OSX, Berkelium also supports Linux. Awesomium has a lot extra modifications: global stylesheets (to style scrollbars, etc), JS callbacks, header re-writing, URL filtering, custom resource loading, HTML-string loading, custom cookies, pause/resume, and more. You can add all that yourself to Berkelium/Chromium source, would just take a lot longer. – Adam Apr 07 '11 at 18:18
  • Some other frameworks to look at as well: CEF (more for windowed-embedding of Chromium), QtWebKit (great if you're using Qt already), Mozilla Gecko (ugh, XPCOM), EAWebKit (pretty raw but it supports PS3 and xbox360). Hope this helps. – Adam Apr 07 '11 at 18:21
  • My main problem with both of them is neither seem to have a 64-bit version on OSX with breaks my build system... don't have time to deal with that. – Matthew Clark Jan 02 '13 at 08:34
  • Any plans on 64 Bit versions? EVERYTHING on Awesomium looks promising except this ;) – Andy Reimann Aug 20 '15 at 06:54
  • Awesomium doesn't offer x86_64 builds on mac :/ I don't want to have to degrade my toolchain just to use it. – Qix - MONICA WAS MISTREATED Feb 08 '16 at 10:02
3

Berkelium is really painless to use. I integrated it into my game in 6 days, you can read all about it (and some other options) here: http://www.onemanmmo.com/index.php?cmd=newsitem&comment=news.1.31.0

The only downside is no debug build and 40MB of binaries.

Robert Basler
  • 371
  • 2
  • 9