SFML community forums
Help => General => Topic started by: Hydra on August 19, 2015, 03:55:07 pm
-
If for example I created a game in SFML. Is there a way I can then put it on a website like how Unity has it's special plugin for running Unity games?
-
Not really.
You could try Emscripten (https://github.com/kripken/emscripten) I guess...
-
Nope, and SFML's not entirely compatible with emscripten and the like last I checked either (therocode's the guy to ask on that as I believe he investigated it a while back).
-
Okay, I'll try something else then.
-
binary1248 has once played around with a port of SFML that compiles for Emscripten and he ported my last Ludum Dare game to it. You can play it here (http://my-gate.net/pub/Synth-Guitar.html), but it's not officially support for now.
-
binary1248 has once played around with a port of SFML that compiles for Emscripten and he ported my last Ludum Dare game to it. You can play it here (http://my-gate.net/pub/Synth-Guitar.html), but it's not officially support for now.
Okay, so is Emscripten like Java 3D in the fact that it works but isn't up to date or very compatible?
-
No.
IIRC Emscripten requires OpenGL ES 2 and SFML doesn't support that yet.
-
No.
IIRC Emscripten requires OpenGL ES 2 and SFML doesn't support that yet.
Ah okay. Thanks.
-
Emscripten uses WebGL (Not opengl es ;)) , but it can emulate a opengl es 2.0 enviroment, but it can also emulate legacy opengl (it's not complete but most of it: http://kripken.github.io/emscripten-site/docs/porting/multimedia_and_graphics/OpenGL-support.html#opengl-support-legacy-and-mobile) I guess binary used this mode?
Edit: emulate = they implemented the missing functions in WebGL with WebGL (so some parts may be inefficent) :P
AlexAUT
-
No... I actually ported SFML to use non-legacy GL first then ported that to emscripten. It uses the "WebGL-friendly subset of OpenGL" (i.e. OpenGL ES 2.0 without client-side arrays a.k.a. only VBOs) that yields the highest performance when translated to WebGL.
The emscripten port is not complete yet because there is currently no way to implement shared-memory multi-threading and this is why besides sf::Thread things that rely on threads like sf::Music can't work yet. According to the emscripten guys they are also waiting for JavaScript memory sharing between threads to be standardized so that they can implement pthread API emulation.
-
https://emscripten.org/docs/porting/pthreads.html
Seem's pthread is supported now
Do you have your code uploaded somewhere so I can finalize the port @binary1248