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.

The game I've been working on uses opengl/sfml for graphics. I'm currently working on the interface and I've found determining all the proper offsets/positioning etc. to be a pain. To make it configurable, I'll likely end up parsing a making a bunch of xml files to parse that tell my program what images to use/where to position them stc. for the interface.

Since I'm going to need to do that anyways, I was curious if it's possible to embed an html renderer into an app, and have it display over graphics drawn in opengl? That way i could theoretically use html pages to design the interface

If it is possible, how difficult would it be and is it a good idea? are there any projects that do this already?

Thanks

share|improve this question

2 Answers 2

up vote 10 down vote accepted

Try looking at Awesomium - it wraps the Chromium engine in a 3D renderer and HTML UIs are one of their main selling points.

share|improve this answer
    
+1 : I'm using it in a game. Here is a video of an early version of Awesomium (with Navi+Ogre3d) vimeo.com/5654166 –  Klaim Jul 26 '11 at 9:35
    
@Klaim What are the in-game perfs like? I would think HTML5 isn't really suited for interfacing; is it easy to get the results you want? –  Jonathan Connell Jul 26 '11 at 12:51
    
Well I'm in a specific case : first, I don't have the full game yet, it's paused for some reasons and I'll get back on it only at the end of this year; but it's suprisingly fast! There are other games using this version of Awesomium like this indie kart game I can't remember the name... check on the website, eve EVE Online replaced their own solution with this one. About getting your results: what I need in my game is kind of fake/game-specific web pages so it's always what I want...if you can master CSS! I don't use it for everything though, the HUD needs different kind of rendering. –  Klaim Jul 26 '11 at 13:19
2  
Wolfire use Awesomium for their user interface in Overgrowth. Two blog posts describing how they use it are here and here. –  Martin Foot Aug 11 '11 at 6:48

Also, take a look at libRocket.

It's kind of based on HTML4 but it allows you to extend it rather easily with custom components, if you import a reset stylesheet things like h1 and hr will work, and by default it supports these elements.

there are also samples with a SFML renderer available and it's open source (MIT licence, allows you to use it in closed source projects without problems).

I've not used it with SFML yet myself, but with the Ogre3d samples it was really easy to set up.

share|improve this answer

Your Answer

 
discard

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.