Page 3 of 4 FirstFirst 1234 LastLast
Results 21 to 30 of 31

Thread: Problem with FreePascal + MacOS

  1. #21
    I think, traditionally, Halt is used to preemptively terminate a program. It should of course work okay, which could indicate a bug in the termination code. But usually would use just exiting the normal "PASCALMAIN" procedure as usual
    Peregrinus, expectavi pedes meos in cymbalis
    Nullus norvegicorum sole urinat

  2. #22
    Quote Originally Posted by Relfos View Post
    I know people will call me masochist for not using SDL, but in iPhone SDL needs a paid license for comercial projects, and I don't want to shell out 500$ for one, so I'm writing my own window/event handling for all platforms. Only iPhone and Wii to go
    You got the prices wrong. One SDL iPhone license costs 100$ and -10% for every following iPhone license you purchase and finally down to 50$. I know it, I bought a license.
    Also your Carbon code won't work on the iPhone as only Cocoa is allowed on iOS. Carbon has marked as deprecated by Apple since Mac OS X 10.5.
    For Cocoa you should take a look at Objective-Pascal.
    Freeze Development | Elysion Game Framework | Twitter: @Stoney_FD
    Check out my new book: Irrlicht 1.7.1 Realtime 3D Engine Beginner's Guide (It's C++ flavored though)

    Programmer: A device for converting coffein into software.

  3. #23
    Oh I see, it's not that bad then, but since I already have code for all SOs, well, I just need to switch from Carbon to Cocoa then.
    Hmm, objective Pascal, does FPC have Cocoa headers?

  4. #24
    Co-Founder / PGD Elder WILL's Avatar
    Join Date
    Apr 2003
    Location
    Canada
    Posts
    6,107
    Blog Entries
    25
    This has probably been found by any of those looking into Objective-Pascal or Cocoa for Pascal, but here it is just the same: http://wiki.freepascal.org/FPC_PasCocoa

    It outlines the initial idea behind Objective-Pascal and how it was implemented by the Free Pascal compiler team. It also tells you how to enable it for your projects too.
    Jason McMillen
    Pascal Game Development
    Co-Founder





  5. #25
    Thanks! I've been reading about Cocoa, and Objective Pascal, and how it all works, I still need some days to understand it correctly.
    My next question, tough, this should be probably in a new topic:
    Today I managed to compile a Free Pascal program for iPhone using XCode and the included template.
    However when reading the code, I found that it was not 100% pascal, at least half of the code were Objective C, and the pascal code was declared as external in a library.
    I understand how this works, but is it the only way?
    Or can one create an app for iPhone that uses only pascal, and is compiled just using the command line?

  6. #26
    Quote Originally Posted by Relfos View Post
    I understand how this works, but is it the only way?
    There are two other ways:
    1. Use SDL which takes care of most things. Remember, you can use SDL free of charge if you're application is released as GPL, only if you to release your application as freeware or commercial you need to buy a license before the application is released.

    2. Use Objective-Pascal as explained here: http://www.thealchemistguild.org/pascal/ <-- Take a look at the iArkanoid example.
    Freeze Development | Elysion Game Framework | Twitter: @Stoney_FD
    Check out my new book: Irrlicht 1.7.1 Realtime 3D Engine Beginner's Guide (It's C++ flavored though)

    Programmer: A device for converting coffein into software.

  7. #27
    Thank you Stoney, I did not know that website, it contains really useful information
    I'm planning to release comercial applications, but SDL price is okay, I will look how much work is needed to replace it tough.

  8. #28
    Quote Originally Posted by Relfos View Post
    Thanks! I've been reading about Cocoa, and Objective Pascal, and how it all works, I still need some days to understand it correctly.
    My next question, tough, this should be probably in a new topic:
    Today I managed to compile a Free Pascal program for iPhone using XCode and the included template.
    However when reading the code, I found that it was not 100% pascal, at least half of the code were Objective C, and the pascal code was declared as external in a library.
    I understand how this works, but is it the only way?
    Or can one create an app for iPhone that uses only pascal, and is compiled just using the command line?
    You mean the Objective-C library called FPC code? I have messed a lot with mixing C and FPC code, and recently learned the right way to do that, and that is indeed to put all the FPC code in a separate dylib library (shared library). It is theoretically possible to do static linking, but don't even try, it is not worth it.

    However, the Objective Pascal dialect works very well (Stoney's suggestion #2). That's what you should use. It is still changing, which can be a bit frustrating at times, but it works.

  9. #29
    Quote Originally Posted by Ingemar
    to put all the FPC code in a separate dylib library
    Not a solution for iOS, where dylib's are not allowed.

  10. #30
    I don't know if I already said so, but I got this working, for both Mac and iOS (here I use the solution of mixing pascal with Objective-C, since I had some problems with the objective pascal compiler). I will probably try to move into Objective Pascal later tough.

Page 3 of 4 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
  •