Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » [A5] Mac magic main initialization

This thread is locked; no one can reply to it. rss feed Print
[A5] Mac magic main initialization
DanielDLee
Member #14,808
December 2012

Hello,
I was trying to get Allegro 5 working on a Mac
with the allua Lua bindings. The allua dynamic library
compiles fine, but when trying to call al_create_display()
via the Lua allegro5.display.create() binding, I get
the following exception:

Initialized allegro
2012-12-28 23:08:46.916 lua[60096:707] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Error (1000) creating CGSWindow on line 259'

I'm assuming this is because the lua script does not
go through the proper Allegro magic main initialization.
Does anyone know if there is a way to make explicit function
calls to initialize the Allegro NSApplication properly
on Mac OS X?
Thanks!

Elias
Member #358
May 2000

Yes, al_run_main. It will never return, but you pass it a C function which we be called from another thread. Call al_init and so on from that other function then as if it was your main() function.

--
"Either help out or stop whining" - Evert

Go to: