Re: [AD] Allegro JavaScript port using Emscripten (First version complete)

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


I don't see how would they help. They just specify that a given function should be run after a delay, but will not pause execution of calling code, so I can't use them to interrupt a loop in user code and give control back to browser. And using them to call user's function from Allegro-supplied frame function will not work for the same reason: endless loop in user's function will still freeze the browser.

20.06.2014 2:40, Daniel Leslie пишет:
Have you considered setTimeout and setInterval?

-Dan


On Thu, Jun 19, 2014 at 12:27 PM, Max Savenkov <max.savenkov@xxxxxxxxxx> wrote:
OK, I have looked into using coroutines to allow create
main-addon-powered abstraction. It seems to be possible, but
unfortunately coroutines currently only available in Firefox and Chrome
(with Experimental _javascript_ flag enabled:
http://kangax.github.io/compat-table/es6/, look for Generators (yield)
). No other browser support it, and even in Chrome, users would have to
dig around settings to make such code work. So, no, I believe that we
can't presently use coroutines to implement endless loops with yield.
The trouble is, Generators (and the whole ECMAScript 6 standard isn't
finalized yet, so relying on it would be a bad idea, especially if my
port is to be merged into the main library. Maybe in experimental,
separate port, it may be possible to use such a feature.

So, for now I'm stuck. I can see no other way to avoid having frame
function.

18.06.2014 1:57, SiegeLord пишет:
> On 06/14/2014 05:11 AM, Max Savenkov wrote:
>> Here's a result of my work for the last two months: a port of Allegro
>> to _javascript_ via Emscripten. Patch for the latest Git version is
>> attached. The port isn't fully complete, but it has most of
>> functionality working, so I decided to present it to community for
>> testing and to generate interest.
> One part I don't understand are the changes to the audio addon. Why is
> the thread emulation you coded into the core not sufficient? What are
> the OpenAL changes for?
>
> Additionally, the way you've done the time/timer etc (by literally
> copying files over) is just terrible. Can none of it be refactored to
> use the system driver abstraction?
>
> In terms of the main loop... is there no main-addon-powered abstraction
> that can be made there? E.g. the Allegro main would register the thread
> emulator dispatch loop as the main loop which would then call the user
> main? Overall, even with this it's very sad that emscripten will force
> people to rewrite their code like that.
>
> These are just the first few things I noticed as I glanced at the code.
> As I have get more free time, I'll look over it some more.
>
> -SL
>
> ------------------------------------------------------------------------------
> HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
> Find What Matters Most in Your Big Data with HPCC Systems
> Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
> Leverages Graph Analysis for Fast Processing & Easy Data Exploration
> http://p.sf.net/sfu/hpccsystems


------------------------------------------------------------------------------
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems
--
https://lists.sourceforge.net/lists/listinfo/alleg-developers



------------------------------------------------------------------------------
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems





Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/