Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I usually code cross-platform, to build as native code for Mac Linux and Windows, but I clearly see the value in being able to display my game in a browser.

Could you guide me in doing such a task? How could i have something like Unity Web Player? Cross-browser is preferable, but Chrome would already be great :)

I use technologies such as SFML, libRocket, Box2D and more.. If that is pertinent to the question!


share|improve this question

First of all, the standard interface for browser plugins is NPAPI (Netscape Plugin API). More recently, there's been a move towards Pepper. However, I would strongly discourage you from making a browser plugins. Users hate it and it's generally really suspicious since plugins let you do more or less anything with a user's computer.

If you're really set on using native code, your best bet is probably Google Native Client (NaCL). This lets you run native code at near native speeds within a sandboxed environment. It's already been used to port Bastion to the Chrome web store thingy. This also has the advantage over a normal plugin of being at least somewhat cross-platform. It requires a specialised compiler toolchain which (from memory) currently uses GCC/G++. Mono has also been ported to NaCL, so you can run C#, F#, Java (via IKVM), etc.

That said, it still requires your users to install a plugin if they aren't using a very recent version of Chrome, but at least they only need to trust Google as opposed to some random developer they've never heard of before.

share|improve this answer
If you strongly discourage that, i will certaintly take it into account. I enjoyed the NaCL solution, and i will leave it in the table for the future. For now, i think i will drag myself into mobile phones more than browsers. Why try to copy flash if i could have just started with it? If i am using C++, it must be for a reason! Thanks for the answer! :) – Grimshaw Feb 24 '12 at 1:21

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.