Results 1 to 10 of 31

Thread: Problem with FreePascal + MacOS

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    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.

  2. #2
    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?

  3. #3
    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





  4. #4
    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?

  5. #5
    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.

  6. #6
    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.

  7. #7
    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.

  8. #8
    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.

  9. #9
    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.

  10. #10
    Quote Originally Posted by Stoney View Post
    Carbon has marked as deprecated by Apple since Mac OS X 10.5.
    For Cocoa you should take a look at Objective-Pascal.
    Actually, the deprecation stigma has been vague at best concerning Carbon. Up to 2007, Carbon was a "prime citizen", although Apple engineers kept recommending developer to move to Cocoa. Then 64-bit Carbon was cancelled, but Carbon was still not officially deprecated. Some parts, like QuickDraw, are officially deprecated, but a lot of stuff is, as far as I can tell, in a strange non-deprecated state despite 32-bit only, while Apple is silently removing support for it. "Carbon" gives fewer and fewer hits on Apple's pages. Of course, part of the confusion is the vague border between "Carbon" and "Core". File Manager and Resource Manager are pre-Carbon/Carbon managers but are now "Core".

    In practice, however, Carbon was deprecated when 64-bit Carbon was cancelled, we all know that.

    I have been working quite a bit on finding a nice path from Carbon to Cocoa, and the result, the Cocoa version of the old TransSkel framework, complemented with some Carbon-style functionality (including QuickDraw!) is getting pretty good. However, the process of installing Objective-Pascal (with its Cocoa interfaces) is not perfect, but once you get it right it is quite nice and works amazingly well. Unlike Objective C, Objective Pascal syntax is not a confusing mix between two languages.

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
  •