Hello everyone,

In the previous post, Etham kindly entrusted me to talk about behind the scene : how do you display web pages in a game?

Initially , we used Awesomium ” HTML UI Engine” . It can be seen as an old version of Chromium, well packaged, which allows rapid integration into any engine .

To sum it up, it can instantiate multiple Web views, and provides access to an offscreen buffer for each of them. An event is called as soon as a view rectangle changes, and getting connected to it is enough to update the graphics resource used in the engine. Long story short, it is not very complicated, not more than two hours are needed to display a first page.

Last week , we changed for the Chromium Embedded Framework with Xlium.CefGlue as a .Net wrapper. The principle remains the same, but the integration is a bit more complicated. Indeed, Chromium’s architecture is multithreaded and multiprocess. Display events are issued in a different thread for each view, which complicates matters a lot when it comes to updating the corresponding texture in the engine. So the full integration took me a small week and it took Etham less than a day to migrate our pages to the new system (due to an improvement of the interface that I had found useful !)

But it was worth it, the rendering is now very fast, and the support for HTML 5, the same as a recent Chrome, is excellent.

Enough bullshit, here goes a small tech demo :

See you next week,

Doom