Mac OS X?

General FreeBASIC programming questions.
cha0s
Site Admin
Posts: 5317
Joined: May 27, 2005 6:42
Location: Illinois
Contact:

Postby cha0s » Jul 16, 2011 0:41

A patch? Wow! Anyone with a Mac tried it?
jboadas
Posts: 3
Joined: Jul 13, 2011 18:37

Postby jboadas » Jul 18, 2011 13:11

Yes I Tryed with the precompiled binaries a simple "hello world" and work good also tryed to compile a simple sdl example but no works, making a further reading in the page of the gameengine they are using this for making games with sdl on OSX with FreeBasic
angros47
Posts: 1821
Joined: Jun 21, 2005 19:04

Postby angros47 » Jul 20, 2011 9:17

So... you made a mac port? GREAT!
jboadas
Posts: 3
Joined: Jul 13, 2011 18:37

Postby jboadas » Jul 21, 2011 13:47

I made nothing for now just use google and found a site of very good programmers that made a mac port for their game engine.

Here is the link:

http://rpg.hamsterrepublic.com/ohrrpgce/Getting_FreeBasic
angros47
Posts: 1821
Joined: Jun 21, 2005 19:04

Postby angros47 » Jul 21, 2011 20:21

TeeEmCee
Posts: 320
Joined: Jul 22, 2006 0:54
Location: Auckland

Postby TeeEmCee » Jul 23, 2011 3:21

I replied on Castle Paradox. I gave details on my port in parkovski's At&t syntax emitter thread. Look there for details. I haven't done a thing since then (see CP for details on that). I don't know what became of his port, anyone know? It's a much better approach than mine.

jboadas, to link to SDL on OS X you have to link to SDLMain and change the entry point of the FB program from "main" to "SDL_main". My port adds a new compiler flag, "-entry" to allow this. (In C, this is accomplished by a macro included in SDL.h.) You're actually meant to do this on all platforms, but as it happens it's not actually necessary on BSD, GNU/Linux or Windows. The OHRRPGCE's build line looks something like this:
fbc -lang deprecated mainfile.bas -Wl -framework,SDL -Wl -framework,Cocoa -Wl -F~/Library/Frameworks SDLMain.o -entry SDL_main

Note that's it's not necessary to use frameworks: you can compile SDL using its Makefile rather than XCode, and use plain-old unix libraries instead. However, I can't remember where you're meant to get SDLMain.o if you don't compile it from SDLMain.m yourself, as I do: is it in the framework?

BTW, although the OHRRPGCE is licensed under the GPL I'll grant anyone right to do whatever they want (public domain) with the OSX-related parts (I'm the sole author of those parts, except SDLMain.m which is forked from the SDL source), including anything related to compiling, packaging for OSX or in a #IFDEF FB_DARWIN block, and the AppleScript. Not that there's much.

Return to “General”

Who is online

Users browsing this forum: No registered users and 16 guests