Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

libtcod & mac os x & python

267 views
Skip to first unread message

Konstantin Stupnik

unread,
Mar 26, 2010, 6:56:12 AM3/26/10
to
Hello there.

I spent some time trying to run libtcod version of Harmless7DRL.
Here is what I finally got:
I managed to compile and link libtcod.dylib
and sample_c is working fine with it.
But! I had to add SDLMain to libraries to be linked.
Without this sample_c is crashing on start with
some ObjectiveC errors about memory pools.
And I commented out #define _SDL_main_h_
But! sample_py isn't working with this.
It crashes the same way as sample_c with
libtcod.dylib not linked with SDLMain.
As far as I can tell SDL.h redefines main to SDL_main,
and defines main in libSDLMain.a
Looks like libSDL can't be used without being initialized in it's main.
But when using python bindings, libtdoc.dylib is loaded
and main of SDL isn't executed...
With uninitialized SDL it's not working.
Calling main from libtdoc.dylib won't help - SDL_main
is unresolved symbol in this case, and all this
will break python badly.

But pygame was written with SDL and works fine!
So there must be some kind of workaround...
Anyone familiar with SDL & python have ideas?

Konstantin Stupnik

unread,
Mar 29, 2010, 2:43:31 AM3/29/10
to
Konstantin Stupnik wrote:
> Hello there.
>
> I spent some time trying to run libtcod version of Harmless7DRL.
I succeeded :)

There is module macosx in pygame.
Just importing it in libtcodpy.py and calling macosx.init()
makes all the magic.

hmp

unread,
Mar 29, 2010, 6:14:22 AM3/29/10
to
Cool!
You should submit to jice what you managed to build, so that Mac
+Python libtcod version will be publicly available.

Konstantin Stupnik

unread,
Mar 29, 2010, 9:21:29 AM3/29/10
to

I'm trying to make it as patch to his CMake files.

I decided to play with libtcod-lua bindings a little.
With little tweaking I made working example.
Is it worth to make and maintain libtcod enabled lua scripting host?

Pender

unread,
Mar 29, 2010, 11:58:30 AM3/29/10
to
On Mar 29, 9:21 am, Konstantin Stupnik <konstantin.stup...@gmail.com>
wrote:

Does it compile in Xcode? If so, can you send me a copy of the source
folder? I have been trying to get an Xcode version of libtcod for
months so that Brogue could be made available to Windows and Linux
users, but it requires a level of fluency well beyond this hobbyist
coder.

Konstantin Stupnik

unread,
Mar 29, 2010, 12:11:44 PM3/29/10
to
No, right now it doesn't.
I'm adept of command line :)
I'll see if I can make XCode project with libtcod.
I think it's pretty much possible.
Ideally it should be wrapped as framework.
But I never tried to do this before.

Pender

unread,
Mar 29, 2010, 12:56:35 PM3/29/10
to
On Mar 29, 12:11 pm, Konstantin Stupnik <konstantin.stup...@gmail.com>
wrote:

> No, right now it doesn't.
> I'm adept of command line :)
> I'll see if I can make XCode project with libtcod.
> I think it's pretty much possible.
> Ideally it should be wrapped as framework.
> But I never tried to do this before.

I'd be eternally grateful if you could. Please email me if there is
any way I can help.

jice

unread,
Mar 29, 2010, 4:24:07 PM3/29/10
to
On 29 mar, 18:11, Konstantin Stupnik <konstantin.stup...@gmail.com>

That might be a bit on the bleeding edge, but Killer_X made an XCode
port of libtcod 1.5.1wip :
http://libxtcod.sess-on.net/

Enjoy ;)

--
jice

Pender

unread,
Mar 29, 2010, 5:03:21 PM3/29/10
to

oh em gee

0 new messages