Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I'm writing a platform game which uses SDL for the main graphics code. There is a chance that I may be using OpenGL for the rendering at a later stage, so answers could relate to either.

I'm needing a good method to include vector animations (such as a starting video) within the game.

Being a platform game, I would prefer to limit the dependents and size of the data. This rules out using Theora as the resulting vector animations would be needlessly lossy and overly large compared to the rest of the content. Flash sounds like an OK option, however it is finicky to embed (or even use) on non-windows platforms, and requires significant amounts of dependencies.

My idea is to use HTML5 animations, rendered by Gecko (the embeddable Firefox rendering engine) or WebKit (the Chrome rendering engine) in SDL, or rendered to an OpenGL surface in SDL. Quite simply - is this feasable? Are there any other examples as to how I should embed it? Is there a better (read: smaller and simpler) solution?

share|improve this question
It would be helpful if somebody with 300+ reputation could tag this 'Gecko' - it is a new tag, hence I can't do it –  lochok Aug 1 '11 at 8:14

1 Answer 1

up vote 2 down vote accepted

One solution (probably the easiest at the moment but not necessary the best) is to include a complete web browser engine into your game.

I'm currently trying some solutions which wrap Chromium/WebKit in C++ (and C# or C) to use some HTML5 as GUI.

  • Awesomium seems to be the more popular.
  • Berkelium is an alternative solution, that I didn't tried yet.

The both are based on Chromium/WebKit and can be used under Windows / OSX / Linux. As they both render the browser content into off-screen buffers, you can do what you want (save to file, display etc.) with them.

I'm almost certain you can find similar frameworks for other web browser engines, but as I don't know them I can tell for sure.

A best practice is probably to integrate the web browser engine directly instead of using some frameworks but it request more time and work indeed.

share|improve this answer
This seems that it may work. My only issue is I can't find whether either of them have a method to output the sound that a page (or in my case, an animation) produces. Will I need to integrate it directly? –  lochok Aug 3 '11 at 5:06
Ok, I did the test with Awesomium (because I'm currently testing it). I tried an HTML5 sound, and the page displayed "Your browser does not support the audio element." then I tried to load my own flash website (after plugin activation) and I had the sound. So the sound does work but the Chromium version used in the current Awesomium version doesn't support the HTML5 audio tag. –  Valkea Aug 3 '11 at 5:24

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.