Porting my C ++ application to work in a browser

Is there an easy way to port a C ++ OpenGL application to a browser? It has already been ported to PC, Mac and iOS. If there is a relatively easy way, will it be transferred between computer browsers? Of course, I have to use different binaries for different platforms. I remember hearing something about some of the Chrome sandboxes some time ago, but that would exclude other browsers. How did they (id?) Do with Quake in the browser?

+6
source share
4 answers

Try Google Native Client or NaCl if you need a lazy port.

But if you want to make a real port, refer to these two examples:

  • blog series on porting an existing C ++ game to html5 (sponsored by Opera)
  • short article on porting an existing Objective-C game to html5 (sponsored by Microsoft).
  • A sad example of porting a popular copyright protection game from C to JavaScript (sponsored by Mozilla, with additional help from Zenimax)

If you asked about QuakeLive , this is a custom plugin created by Id Software. Similar functionality can be achieved using Flash or Unity plugins.

+2
source

If you are already targeting ES 2.0 for iOS, your shaders should work as they are with WebGL . JavaScript ahoy!

id Software uses the giant plugin for Quake Live.

+4
source

You can use Mandreel if you want the least amount of work. Another option is Emscripten , but it only converts your C ++, it does not provide all APIs like Mandreel.

+2
source

Is there an easy way to port a C ++ OpenGL application to a browser? It has already been ported to PC, Mac and iOS. If there is a relatively easy way, will it be transferred between computer browsers?

You could try recompiling it into JavaScript, which browsers do. If you do not expect the user to install any browser plug-in, you will not be able to give them your own code. Of course, when in the JavaScript environment, many of the things youโ€™re used to from your own executables don't work. For example, you can no longer access the file system. You must use the DOM storage, cookies, upload / download resources from the server.

+1
source

Source: https://habr.com/ru/post/906988/


All Articles