Page 2 of 4 FirstFirst 1234 LastLast
Results 11 to 20 of 31

Thread: Problem with FreePascal + MacOS

  1. #11
    Yes, but do you use TThread?
    I don't really need cmem unit, so if you can use threads without it, better.
    Also, I can't really get a single window application running, APPTYPE seems to don't work in MacOS?
    My application now opens both a Carbon window and a console window, and while the console is useful for printing info, I want to be able to choose between having it or not.
    Any special switch I need to compile?
    (I don't use SDL or anything else, I create my window directly using Carbon, the code was based on a C++ sample I found on the web.)

  2. #12
    Quote Originally Posted by Relfos
    Yes, but do you use TThread?
    For sound streaming I use BeginThread. And I add unit cthreads to my uses clause.

    Quote Originally Posted by Relfos
    APPTYPE seems to don't work in MacOS?
    If you were read FPC documentation, you would know this...

    Quote Originally Posted by Relfos
    Also, I can't really get a single window application running, APPTYPE seems to don't work in MacOS?
    GUI applications under MacOS X are not an one single executable. You must "build" your own Bundle. Simple description "what is Bundle" can sounds like this: "Bundle is a directory with name which contains part "name" and ".app"(for example - MyApp.app). Inside this directory must be another one - Contents. Inside Contest must be directories Frameworks(for your libs/etc.), MacOS(for your executable, which must be with the same name as your bundle, in our case - MyApp) and Resources(where you must put all your resources)".
    Last edited by Andru; 03-02-2011 at 05:48 PM.

  3. #13
    Thank you, so I only need cthreads
    And, if I understood correctly, what I need to hide the console is create a bundle for the application?
    Seems simple, I will try.

  4. #14
    And, if I understood correctly, what I need to hide the console is create a bundle for the application?
    Yes, you need to create your own bundle for application

  5. #15
    Thank you so much, my Bobs game is now working on Mac
    The only problem is I still can't get the keyboard input to work, I will try to look into Lazarus sources to see how they handle keyboard events in Carbon.
    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

    EDIT: Well, the keys are working now, it was just a stupid bug, one line changed and it is ok now.
    Another problem, I have a method called Engine.Terminate that safely unloads all resources and uses Halt to quit.
    After calling Terminate() on MacOS, it shuts down, but the operating system says "This software did not terminate correctly, open again or ignore?"
    Should I pass another a specific value to halt() instead of zero?
    Last edited by Relfos; 03-02-2011 at 07:08 PM.

  6. #16
    Quote Originally Posted by Relfos
    The only problem is I still can't get the keyboard input to work, I will try to look into Lazarus sources to see how they handle keyboard events in Carbon.
    For Carbon you need to process kEventClassKeyboard event.

  7. #17
    Quote Originally Posted by Andru View Post
    For Carbon you need to process kEventClassKeyboard event.
    Yes, I was already using that.
    The new problem, when calling Halt(), I get the message "Three Bobs quit unexpectedly, open again or ignore?"
    Do you know what is the problem?

  8. #18
    Quote Originally Posted by Relfos
    Do you know what is the problem?
    I don't know how exact you use Carbon(with your own main loop or with RunBlaBlaBla from standard Carbon API), so I can't answer you Anyway, halt is bad way to terminate your application.
    Last edited by Andru; 03-02-2011 at 07:27 PM.

  9. #19
    Hmm, a bad way, why?
    Before calling Halt() I release all allocated memory and resources, and destroy the Carbon window, well, maybe there is still something left to release, and that is causing the problem.

  10. #20
    Quote Originally Posted by Relfos
    Hmm, a bad way, why?
    Because of "maybe there is still something left to release", but halt terminate your application immediately.

Page 2 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
  •