Re: [AD] Non C program accessing Allegro on OS X

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


I just had a go with a test program (nothing as complicated as Allegro). It confirmed what I thought, i.e [NSApplication run] _does_ have to be called by thread 1, otherwise the icon just bounces for ever in the dock and, as you say, the notifications never run.

Argh!

According to the mzscheme docs, they implement their own thread system. Can you use this to run the message pump, somehow?

Hm, like what do you mean exactly? Do you mean something like

void messagePump(){
    if (osx_gfx_mode == OSX_GFX_WINDOW)
        osx_update_dirty_lines();
     _unix_lock_mutex(osx_event_mutex);
     if (osx_gfx_mode == OSX_GFX_FULL) {
        if ((osx_palette) && (osx_palette_dirty)) {
           CGDisplaySetPalette(kCGDirectMainDisplay, osx_palette);
       osx_palette_dirty = FALSE;
    }
     }
     osx_event_handler();
     _unix_unlock_mutex(osx_event_mutex);
}

then in mzscheme

(while true
   (do-stuff)
   (messagePump))

or something? I suppose this is reasonable but scheme aint the fastest thing in the world and then the overhead of calling Allegro might be costly, but if this is the only way then I will see what I can do.




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