|
|
| Allegro in the browser (asm.js) |
|
wonsungi
Member #11,799
March 2010
|
Anyone know how much effort is needed to port Allegro like the Unreal Engine 3 was ported to JavaScript and WebGL? Apparently, the Citadel demo and this game, Monster Madness, only took a few days. These are the possibilities an asm.js-powered Allegro offers:
I guess I'm imagining two slightly different use cases:
|
|
ks
Member #1,086
March 2001
|
Have you tried to compile with Emscripten? It ships with SDL 1.2x which I've been using for the last couple of weeks. I just haven't gotten around to see how far a basic Allegro build gets. So, I'm also curious.
|
|
Peter Wang
Member #23
April 2000
|
The web is stupid, and getting stupider. (That's not to imply a web backend for Allegro would be unwelcome, at least after the dust settles.)
|
|
bamccaig
Member #7,536
July 2006
|
I seem to vaguely remember something about an "HTML5" "port" of Allegro... I'm not sure if it was a proposition, a completed work, or completely in my imagination. In any case, I think that the general consensus (at least from Web developers) was that the Allegro APIs don't make sense in JavaScript (which is to say, they are not JavaScript-like, and there would be better ways to do it in JavaScript). Append: And as a full-time Web developer I agree with Peter Wang. The Web is getting stupider... -- acc.js | al4anim - Allegro 4 Animation library | Allegro 5 VS/NuGet Guide | Allegro.cc Mockup | Allegro.cc <code> Tag | Allegro 4 Timer Example (w/ Semaphores) | Allegro 5 "Winpkg" (MSVC readme) | Bambot | Blog | C++ STL Container Flowchart | Castopulence Software | Check Return Values | Derail? | Is This A Discussion? Flow Chart | Filesystem Hierarchy Standard | Clean Code Talks - Global State and Singletons | How To Use Header Files | GNU/Linux (Debian, Fedora, Gentoo) | rot (rot13, rot47, rotN) | Streaming |
|
Arthur Kalliokoski
Second in Command
February 2005
|
bamccaig said: The Web is getting stupider... What else would you expect? The first people on the Web (or rather, Arpanet) were very sharp individuals indeed, and internet access is getting easier all the time. Of course that may change as the business world gets everything declared illegal for their own benefit. They all watch too much MSNBC... they get ideas. |
|
ks
Member #1,086
March 2001
|
For me,exploring Emscripten makes for a zero hurdle test of generating experiments for the web. You're not treating C or C++ as web languages (needing all of the trappings), rather developing something specific and restricted that runs in a browser - HTML5 game. In these recent excursions, it's essentially C & SDL, nothing else, compiling C to javascript. And, if I were paying closer attention that same code would compile on the desktop. Now that said, in this instance I haven't yet crossed the 'what do I do with data' bridge. I have considered several free and commercially available Javascript libraries to replace dependency on Allegro (e.g., Turbulenze, PixiJS, ImpactJS, and the list goes on). In a similar vein to Emscripten, I also think environments (e.g., Haxe) that target multiple platforms serve a role for these niche cases. Here too the intent is not to replace javascript but to add another tool for game-like applications. Is there harm in targeting HTML5, Flash, or some mobile device all with the same code? Then there are languages like Google's Dart, do they serve a purpose, and in this case is it a better language? If for no other reason I will in part migrate to javascript because of the wealth of libraries available. That said, as someone completely naive in web technologies, just really a huge topic, I am genuinely curious about the less than positive reaction and whether a case can be made targeted usage as describe above.
|
|
Elias
Member #358
May 2000
|
bamccaig said: I seem to vaguely remember something about an "HTML5" "port" of Allegro... I'm not sure if it was a proposition, a completed work, or completely in my imagination. I mentioned several times that I want to port it to emscripten/HTML5/webgl, but I never got very far. Quote: In any case, I think that the general consensus (at least from Web developers) was that the Allegro APIs don't make sense in JavaScript (which is to say, they are not JavaScript-like, and there would be better ways to do it in JavaScript).
The beauty of what I had in mind is that you would never touch a single line of Javascript. You take your Allegro game written in C/C++, compile it (to javascript, using emscripten) and it will run in any browser. Basically making the web less stupid since now my C/Allegro apps will run on it -- |
|
Edgar Reynaldo
Major Reynaldo
May 2007
|
I dabbled with the idea of turning my function parser into an allegro interpreter, so you could just issue allegro commands from a console and see what they do. My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
|
Peter Wang
Member #23
April 2000
|
Elias said: I mentioned several times that I want to port it to emscripten/HTML5/webgl, but I never got very far. In terms of porting Allegro, I think the biggest problem would be that asm.js doesn't support threads (yet). PNaCl doesn't suffer in that regard.
|
|
wonsungi
Member #11,799
March 2010
|
Peter Wang said: In terms of porting Allegro, I think the biggest problem would be that asm.js doesn't support threads (yet). Interesting.. how dependent is Allegro on threads? ks said: Have you tried to compile with Emscripten [github.com]? It ships with SDL 1.2x ... Wow, I did not realize Emscripten comes with SDL baked in. Emscripten is the natural choice for porting Allegro's code to JS. For the more visual people, here is an example of seeing your code changes immediately, without a compile cycle delay: Notch (the creator of MineCraft) live coded his Ludem Dare entry in Dart (Google's new version of JavaScript). He added a snow effect to his game and the snow was added while the game was running. He saw saw the snow was falling in the wrong direction so he modified it, without ever stopping or resetting the game. I was blown away the first time I saw him doing this with Java... Anyways, searching the forums for "webgl" and "emscripten" uncovered some previous topics discussing such a port of Allegro. I can see some of the arguments why the Allegro API is not a good fit for the web, but I still want to try it... some day, when I finally get to Hacker School, perhaps.
|
|
Peter Wang
Member #23
April 2000
|
I didn't think about it hard enough. Allegro is not very dependent on threads. It's just that we use threads-with-shared-state on normal platforms because that's what we get. But in the places where we use threads on normal platforms, we probably wouldn't need them in a browser runtime, or we could use threads-with-message-passing instead. As for asm.js itself: I finally read between the lines. I get it.
|
|
bamccaig
Member #7,536
July 2006
|
wonsungi said: I can see some of the arguments why the Allegro API is not a good fit for the web, but I still want to try it... some day, when I finally get to Hacker School, perhaps. I've never heard of this place before. It sounds like a very sexist organization. Every post by them seems to be about giving women special attention... -- acc.js | al4anim - Allegro 4 Animation library | Allegro 5 VS/NuGet Guide | Allegro.cc Mockup | Allegro.cc <code> Tag | Allegro 4 Timer Example (w/ Semaphores) | Allegro 5 "Winpkg" (MSVC readme) | Bambot | Blog | C++ STL Container Flowchart | Castopulence Software | Check Return Values | Derail? | Is This A Discussion? Flow Chart | Filesystem Hierarchy Standard | Clean Code Talks - Global State and Singletons | How To Use Header Files | GNU/Linux (Debian, Fedora, Gentoo) | rot (rot13, rot47, rotN) | Streaming |
|
l j
Member #10,584
January 2009
|
bamccaig said: I've never heard of this place before. It sounds like a very sexist organization. Every post by them seems to be about giving women special attention... But gender equality is all about giving women more rights!
|
|
LennyLen
Member #5,313
December 2004
|
bamccaig said: I've never heard of this place before. It sounds like a very sexist organization. Every post by them seems to be about giving women special attention... There are THREE posts that mention grants for women. THREE! Nowhere near every post. And if you can't figure out why they want to get women to enroll, I'll spell it out for you in very simple terms - because companies like Google give them lots of money to do so. Turning down offers like that is sheer stupidity.
|
|
bamccaig
Member #7,536
July 2006
|
Every post that I opened up did... And I don't really care what financial incentives there are for doing it. Those companies paying are equally sexist. From what I've read though it sounds like it is the school's ideals though. They aim for a 50/50 mix of males and females, which means that men are probably going to get turned away to make room for women. Women that get free money for signing up... *facepalm* -- acc.js | al4anim - Allegro 4 Animation library | Allegro 5 VS/NuGet Guide | Allegro.cc Mockup | Allegro.cc <code> Tag | Allegro 4 Timer Example (w/ Semaphores) | Allegro 5 "Winpkg" (MSVC readme) | Bambot | Blog | C++ STL Container Flowchart | Castopulence Software | Check Return Values | Derail? | Is This A Discussion? Flow Chart | Filesystem Hierarchy Standard | Clean Code Talks - Global State and Singletons | How To Use Header Files | GNU/Linux (Debian, Fedora, Gentoo) | rot (rot13, rot47, rotN) | Streaming |
|
Max Savenkov
Member #4,613
May 2004
|
I would support any effort to cross-compile Allegro-based C++ programs into something web-usable (emscripten or Crossbridge/FlasCC, the later being a bad, but still usable option), because I'm tired of my friend taunting me with Unity demos he can show to everyone who has a browser.
|
|
|