SFML community forums

Help => General => Topic started by: ZakirG on August 14, 2014, 04:29:08 am

Title: Is it possible to embed an SFML game on a site?
Post by: ZakirG on August 14, 2014, 04:29:08 am
How would one go about packaging/uploading an SFML game to a website and displaying it in a frame?
Title: AW: Is it possible to embed an SFML game on a site?
Post by: eXpl0it3r on August 14, 2014, 08:08:36 am
Not at all. ;)
Title: Re: AW: Is it possible to embed an SFML game on a site?
Post by: Jesper Juhl on August 14, 2014, 09:11:41 am
Not at all. ;)
That's not entirely true. It might not be simple or easy to do, but in theory it should be possible to use emscripten (http://emscripten.org) to compile the SFML C++ application to Javascript and then run it in a browser. Take a look at their examples (https://github.com/kripken/emscripten/wiki/Porting-Examples-and-Demos) - it's pretty impressive what they have gotten to work that way.
Title: Re: Is it possible to embed an SFML game on a site?
Post by: eXpl0it3r on August 14, 2014, 09:23:49 am
Guess I'm not enough of a web-scale hipster to consider such a thing. ;D
Title: Re: Is it possible to embed an SFML game on a site?
Post by: zsbzsb on August 14, 2014, 02:34:19 pm
SFML is unable to work with emscripten so you can forget that idea.


http://kripken.github.io/emscripten-site/docs/coding/multimedia_and_graphics/OpenGL-support.html
Title: Re: Is it possible to embed an SFML game on a site?
Post by: thomas9459 on August 14, 2014, 07:32:33 pm
How much work do you think it would take to port SFML to emscripten? Would it require rewriting the entire rendering system or only a few minor changes?
Title: Re: Is it possible to embed an SFML game on a site?
Post by: Kojay on August 14, 2014, 09:56:53 pm
This seems like an obvious place to mention Featherkit (http://en.sfml-dev.org/forums/index.php?topic=14193.0). It is not unlike SFML and it can use it as a back end. Then, one can switch to SDL as back end and use emscripten.