Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Porting my C++ app to run in a browser

Is there an easy way to port a C++ OpenGL app to a browser? It's already ported to PC, Mac and iOS. If there is some relatively easy way, would that be portable between computer browsers? I would have to use different binaries for different platforms, of course. I remember hearing something about some sandboxed environment for Chrome some time ago, but that would exclude the other browsers. How did they (id?) do with Quake in the browser?

like image 839
Jonas Byström Avatar asked Jan 26 '12 22:01

Jonas Byström


2 Answers

If you're already targeting ES 2.0 for iOS your shaders should work as-is with WebGL. JavaScript ahoy!

id Software uses a giant plugin for Quake Live.

like image 151
genpfault Avatar answered Sep 23 '22 22:09

genpfault


Try Google's Native Client or NaCl, if you want a lazy port.

But if you want to do a real port - refer to those two examples:

  • blog series about porting existing C++ game to html5 (sponsored by Opera)
  • short article about porting existing Objective-C game to html5 (sponsored by Microsoft).
  • sad example of porting popular copyrighted game from C to JavaScript (sponsored by Mozilla, with extra help of Zenimax)

If you was asking about QuakeLive - that is a custom plugin, made by Id Software. Similar functionality can be achieved with Flash or Unity plugins.

like image 38
c69 Avatar answered Sep 21 '22 22:09

c69