Page 2 of 5 FirstFirst 1234 ... LastLast
Results 11 to 20 of 43

Thread: MacOS X + JEDI SDL + Fink

  1. #11

    MacOS X + JEDI SDL + Fink

    Quote Originally Posted by technomage
    I found the ]http://www.freepascal.org/wiki/index.php/FPC_and_SDL[/url]
    What a great little tutorial. I especially like the tips about getting JEDI-SDL working on MacOS X.

    I've added another tip to that Wiki page. It being that when using SDL_mixer, the call to Mix_OpenAudio MUST happen before the call to SDL_SetVideoMode, otherwise you will get a ( sometimes load ) audible pop.
    <br /><br />There are a lot of people who are dead while they are still alive. I want to be alive until the day I die.<br />-= Paulo Coelho =-

  2. #12

    MacOS X + JEDI SDL + Fink

    [quote="billly1380"]
    Turns out that sticking the library path into the compiler settings is not enough, you need to tell the ]

    The wiki page does mention that you need to add that to the command line.

    Btw, did it all work?
    How much do you charge to recompile and create a binary under MacOS X ?
    Also, are you using it under Intel or Power PC?
    <br /><br />There are a lot of people who are dead while they are still alive. I want to be alive until the day I die.<br />-= Paulo Coelho =-

  3. #13

    MacOS X + JEDI SDL + Fink

    Hehehe.. Will, looks like you could have yourself a cushy side earner here

    So did you get Guns to compile and run on the Mac? I'd love to see it working.. also, I've got some major updates for you to include.

  4. #14
    Co-Founder / PGD Elder WILL's Avatar
    Join Date
    Apr 2003
    Location
    Canada
    Posts
    6,107
    Blog Entries
    25

    MacOS X + JEDI SDL + Fink

    Oh man... this thread makes me wish C-C was ready for such porting.

    Nice job guys!
    Jason McMillen
    Pascal Game Development
    Co-Founder





  5. #15

    MacOS X + JEDI SDL + Fink

    C-C??
    <br /><br />There are a lot of people who are dead while they are still alive. I want to be alive until the day I die.<br />-= Paulo Coelho =-

  6. #16

    MacOS X + JEDI SDL + Fink

    Quote Originally Posted by savage
    The wiki page does mention that you need to add that to the command line.

    Btw, did it all work?
    How much do you charge to recompile and create a binary under MacOS X ?
    Also, are you using it under Intel or Power PC?
    Since I am using Lazarus I could not play with the command line directly so I had to add all the -k swithches to the additional ]
    I've got some major updates for you to include.
    [/quote]

    bring on the updates...

    Although I think we need to sort out that display issue first! :lol:

  7. #17
    Co-Founder / PGD Elder WILL's Avatar
    Join Date
    Apr 2003
    Location
    Canada
    Posts
    6,107
    Blog Entries
    25

    MacOS X + JEDI SDL + Fink

    Quote Originally Posted by savage
    C-C??
    :lol: My short acronym for Cyber-Crisis!
    Jason McMillen
    Pascal Game Development
    Co-Founder





  8. #18

    MacOS X + JEDI SDL + Fink

    [quote="billly1380"]
    The funny thing (actually not so much) is that it crashes with a bad pointer doing an SDL_Flip... /quote]

    Which version of the FPC compiler are you using? My hunch is that the SDL_Main.o is what is causing the problem. But I could be totally wrong. According to that wiki if you are using FPC v2.0.0...
    The only workaround currently is to edit rtl/bsd/system.pp, and change the line

    procedure main(argcparam: Longint; argvparam: ppchar; envpparam: ppchar); cdecl; [public];

    into

    procedure SDL_main(argcparam: Longint; argvparam: ppchar; envpparam: ppchar); cdecl; [public];

    If you then recompile the RTL, you will obtain an RTL which can be used to compile SDL programs. However, it will only work for SDL programs, since other programs now won't have a main function.
    If you are using FPC v2.0.2+...
    With fpc 2.0.2 or later you do not have to change rtl/bsd/system.pp any longer. -XMSDL_main does the trick :
    1) as before, install SDL, for example using fink.

    2) Add the following to your program:

    {$linklib gcc}
    {$linklib SDLmain}
    uses sdl;

    3) Then, this command line does it:

    fpc -XMSDL_main -k-L/sw/lib -k-lSDL -k-framework -kOpenGL -k-framework -kCocoa -Fu<pathtosdl.pas files> -Fi<pathtosdl.inc files> Guns.dpr
    If neither of these 2 methods work then we need to inform the wiki guys to update their info.
    <br /><br />There are a lot of people who are dead while they are still alive. I want to be alive until the day I die.<br />-= Paulo Coelho =-

  9. #19

    MacOS X + JEDI SDL + Fink

    Quote Originally Posted by savage
    If neither of these 2 methods work then we need to inform the wiki guys to update their info.
    I am using fpc 2.0.4 and the method I used (2.0.2+) was as described in the Wiki... the only thing is that I could not get hold of a version of SDL_Main.o (for ppc)... so I had to build one myself!

    I think the SDLMain bit works because I get a cocoa window (part of their main code) it just has nothing in it...

    The runtime error I am getting is 'External: EXC_BAD_ACCESS'
    error detail 'KERN_PROTECTION_FAILURE'.
    I read this thread...

    http://forums.macosxhints.com/archiv...hp/t-3539.html

    I think I am still in denial :!: !

  10. #20

    MacOS X + JEDI SDL + Fink

    Hmm I'm very keen to see Guns blazing on MacOS X.
    I know you are currently using Lazarus, but would you mind trying to compile the game via the command line, to see if that works instead? Trying both with your SDL_Main and the one that the wiki says is supposed to be there.
    My understanding of the -XMSDL_Main command line switch is that it should rename the system.pp main() to SDL_Main() during compilation to facilitate SDL compilation, hence my surprise that you had to create your own.

    Personally the last time I used Lazarus under Unix I had problems getting some of the JEDI-SDL demos working, so in the end I switched to using the command line compiler. I cannot deny that it may not have worked because of my lack of familiarity with Laz, but at the time it seemed quicker to just get things working using the command line compiler.
    <br /><br />There are a lot of people who are dead while they are still alive. I want to be alive until the day I die.<br />-= Paulo Coelho =-

Page 2 of 5 FirstFirst 1234 ... LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •