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 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!

Thanks

share|improve this question
add comment

1 Answer

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
add comment

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.