Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can you embed a C++ game into a webpage?

Tags:

c++

embed

Without recoding in flash or making it into a java applet! Keeping it as a C++ app, is there a way to embed it into a web page so site visitors can play the game?

We can assume it's a small game, the size of your average flash game or even thinner.

The game in question was written with the Allegro library in under 1000 lines of code.

Is it possible?

like image 798
temporary_user_name Avatar asked Dec 28 '22 01:12

temporary_user_name


2 Answers

Quick answer: no you can't.

C++ applications cannot be embedded inside a web page, they need to be downloaded and the user has to run them on the client machine.

Details: it's somehow possible but it's absolutely not portable across browsers. For example Internet Explorer has ActiveX components (they can be a C++ application, it'll be downloaded, installed and will run inside the web-page). Other browsers have different mechanism to achieve this (Chrome has its Native Client, for example) but you can't write something really portable and you'll have many limitations whatever you'll use.

like image 126
Adriano Repetti Avatar answered Jan 11 '23 21:01

Adriano Repetti


It is possible

http://doom.pdox.net/

http://code.google.com/p/nativeclient/

In fact, this is old news...

http://www.engadget.com/2010/05/13/googles-native-client-sdk-developer-preview-provides-helpful-re/

like image 35
Malkocoglu Avatar answered Jan 11 '23 20:01

Malkocoglu