Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 21

Thread: Phoenix, Asphyre or Andorra on Mac OS

  1. #11

  2. #12

    Re: Phoenix, Asphyre or Andorra on Mac OS

    Allright, I got an empty window to work with Phoenix using the SDLDevice example.
    Step-by-step:
    1. Download and install Fink from http://www.finkproject.org/
    2. Install the sdl package through Fink (Open a terminal and type "fink install sdl" (without ") and enter your password.)
    3. Download and extract the Phoenix file Andreaz posted in this thread.
    4. Apply the dglOpenGL.pas fixes from http://delphigl.com/forum/viewtopic....&highlight=mac or download the latest GLFW.pas from either this thread or my blog and replace the dglOpenGL.pas unit.
    5. Rename phxOpenGL.SDL.pas to phxOpenGL_SDL.pas (in /inc). Open the unit and change "unit phxOpenGL.SDL" to "unit phxOpenGL_SDL".
    6. Open the DeviceSDL.dpr with Lazaras (it is located in /demos/13_DeviceSDL). I used the latest daily Lazarus and FreePascal snapshots.
    7. Add the following lines to the DeviceSDL.dpr (best between progam and uses):
    [pascal]
    {$IFDEF FPC}
    {$IFDEF DARWIN}
    {$linklib gcc}
    {$linklib SDLmain}
    {$ENDIF}
    {$ENDIF}
    [/pascal]
    8. Remove any references to phxGraphicEx or phxFreeImage (both in the dpr-File and in Main.pas)
    9. Remove (or just add // in front of the line) any reference to Image and Font.
    10. Open "Project | Compiler settings" and click on "Linker" on the left. Click on the checkbox in settings and add the following line:
    Code:
    -L/usr/lib -L/usr/X11R6/lib -L/sw/lib -lSDL
    11. Click on Run and the project compiles and you can see an empty window. Yeah.

    Additional notes:
    - You can link against the SDL framework which is better way to go, because deploying the application is much easier that way, but for some reason when linked against the framework the application produces AV when it's being closed.
    - The generated executable is about 20 MB big. Using strip and upx shrinks the executable to about 1,2 MB.

    Using FreeImage doesn't work because there are too many dependencies to Windows. So I removed the reference to the windows unit and implemented PRGBQuad, PBITMAPINFOHEADER and PBITMAPINFO as suggested by FreeImage.h
    When try to compile with this changes, following errors occur:
    [pascal]
    phxFreeImage.pas:405:junk `@4$stub' after expression
    phxFreeImage.pas:741:junk `@4$stub' after expression
    phxFreeImage.pas:746:junk `@4$stub' after expression
    phxFreeImage.pas:751:junk `@4$stub' after expression
    phxFreeImage.pas:756:junk `@4$stub' after expression
    phxFreeImage.pas:762:junk `@4$stub' after expression
    phxFreeImage.pas:766:junk `@4$stub' after expression
    phxFreeImage.pas:803:junk `@4$stub' after expression
    phxFreeImage.pas:900:junk `@4$stub' after expression
    phxFreeImage.pas:989:junk `@4$stub' after expression
    phxFreeImage.pas:1111:junk `@24$stub' after expression
    phxFreeImage.pas:1118:junk `@4$stub' after expression
    phxFreeImage.pas:1124:junk `@4$stub' after expression
    phxFreeImage.pas:1194:junk `@4$stub' after expression
    phxFreeImage.pas:1212:junk `@24$stub' after expression
    phxFreeImage.pas:1219:junk `@4$stub' after expression
    phxFreeImage.pas:1225:junk `@4$stub' after expression
    phxFreeImage.pas:1290:junk `@4$stub' after expression
    phxFreeImage.pas:1308:junk `@24$stub' after expression
    phxFreeImage.pas:1315:junk `@4$stub' after expression
    phxFreeImage.pas:1321:junk `@4$stub' after expression
    phxFreeImage.pas:1376:junk `@4$stub' after expression
    phxFreeImage.pas:1449:junk `@12$stub' after expression
    phxFreeImage.pas:1461:junk `@4$stub' after expression
    phxFreeImage.pas:1471:junk `@4$stub' after expression
    phxFreeImage.pas:1510:junk `@16$stub' after expression
    phxFreeImage.pas:1524:junk `@4$stub' after expression
    phxFreeImage.pas:1609:junk `@4$stub' after expression
    phxFreeImage.pas:1635:junk `@4$stub' after expression
    phxFreeImage.pas:1677:junk `@20$stub' after expression
    phxFreeImage.pas:1681:junk `@4$stub' after expression
    phxFreeImage.pas:1752:junk `@4$stub' after expression
    phxFreeImage.pas:1756:junk `@4$stub' after expression
    phxFreeImage.pas:2022:junk `@16$stub' after expression
    phxFreeImage.pas:2035:junk `@4$stub' after expression
    phxFreeImage.pas:2103:junk `@20$stub' after expression
    phxFreeImage.pas:2107:junk `@4$stub' after expression
    phxFreeImage.pas:2384:junk `@16$stub' after expression
    phxFreeImage.pas:2397:junk `@4$stub' after expression
    phxFreeImage.pas:2465:junk `@20$stub' after expression
    phxFreeImage.pas:2469:junk `@4$stub' after expression
    phxFreeImage.pas:2746:junk `@16$stub' after expression
    phxFreeImage.pas:2759:junk `@4$stub' after expression
    phxFreeImage.pas:2827:junk `@20$stub' after expression
    phxFreeImage.pas:2831:junk `@4$stub' after expression
    phxFreeImage.pas:3108:junk `@16$stub' after expression
    phxFreeImage.pas:3121:junk `@4$stub' after expression
    phxFreeImage.pas:3189:junk `@20$stub' after expression
    phxFreeImage.pas:3193:junk `@4$stub' after expression
    phxFreeImage.pas:4211:invalid character '_' in mnemonic
    phxFreeImage.pas:4212:Rest of line ignored. 1st junk character valued 64 (@).
    phxFreeImage.pas:4251:invalid character '_' in mnemonic
    phxFreeImage.pas:4252:Rest of line ignored. 1st junk character valued 64 (@).
    phxFreeImage.pas:4261:invalid character '_' in mnemonic
    phxFreeImage.pas:4262:Rest of line ignored. 1st junk character valued 64 (@).
    phxFreeImage.pas:4271:invalid character '_' in mnemonic
    phxFreeImage.pas:4272:Rest of line ignored. 1st junk character valued 64 (@).
    phxFreeImage.pas:4281:invalid character '_' in mnemonic
    phxFreeImage.pas:4282:Rest of line ignored. 1st junk character valued 64 (@).
    phxFreeImage.pas:4291:invalid character '_' in mnemonic
    phxFreeImage.pas:4292:Rest of line ignored. 1st junk character valued 64 (@).
    phxFreeImage.pas:4301:invalid character '_' in mnemonic
    phxFreeImage.pas:4302:Rest of line ignored. 1st junk character valued 64 (@).
    phxFreeImage.pas:4321:invalid character '_' in mnemonic
    phxFreeImage.pas:4322:Rest of line ignored. 1st junk character valued 64 (@).
    phxFreeImage.pas:4341:invalid character '_' in mnemonic
    phxFreeImage.pas:4342:Rest of line ignored. 1st junk character valued 64 (@).
    phxFreeImage.pas:4351:invalid character '_' in mnemonic
    phxFreeImage.pas:4352:Rest of line ignored. 1st junk character valued 64 (@).
    phxFreeImage.pas:4361:invalid character '_' in mnemonic
    phxFreeImage.pas:4362:Rest of line ignored. 1st junk character valued 64 (@).
    phxFreeImage.pas:4371:invalid character '_' in mnemonic
    phxFreeImage.pas:4372:Rest of line ignored. 1st junk character valued 64 (@).
    phxFreeImage.pas:4421:invalid character '_' in mnemonic
    phxFreeImage.pas:4422:Rest of line ignored. 1st junk character valued 64 (@).
    phxFreeImage.pas:4441:invalid character '_' in mnemonic
    phxFreeImage.pas:4442:Rest of line ignored. 1st junk character valued 64 (@).
    phxFreeImage.pas:4451:invalid character '_' in mnemonic
    phxFreeImage.pas:4452:Rest of line ignored. 1st junk character valued 64 (@).
    phxFreeImage.pas:4471:invalid character '_' in mnemonic
    phxFreeImage.pas:4472:Rest of line ignored. 1st junk character valued 64 (@).
    ../../inc/phxFreeImage.pas(14,4 Error: Error while assembling exitcode 1
    ../../inc/phxFreeImage.pas(14,4 Fatal: There were 2 errors compiling module, stopping
    [/pascal]

    I found a reference to phxSDL_image, but I couldn't find that unit in any Phoenix release. Is there a way to include SDL_image instead of FreeImage or GraphicEx?
    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. #13

    Re: Phoenix, Asphyre or Andorra on Mac OS

    Using the latest snapshot Phoenix is finally working on a Mac.
    Here is the screenshot proof:


    There are still some fixes I need to apply, but it wouldn't take more than a few days.
    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.

  4. #14

    Re: Phoenix, Asphyre or Andorra on Mac OS

    What wonderful news!!! Keep on the good work!

  5. #15

    Re: Phoenix, Asphyre or Andorra on Mac OS

    Based on the latest Phoenix snapshot I've put together a little Mac OS demo. Download here (ca. 9 MB)

    There is one bug which still annoys me: When I link against the frameworks, as soon as I close the application I get an access violation. Might it be connected to the fact that I use the Lazarus daily snapshots.
    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. #16

    Re: Phoenix, Asphyre or Andorra on Mac OS

    I tried everything but I still always get two kinds of erros:

    - When I did try to compile with makefile : ld: library not found for -lgcc An error occurred while linking Error: Error while linking
    - When i did compile in Lazarus IDE, it compiles, but It raises "Project Raised Exception Class:External : SIGTRAP.

    I have the lastest SDL and GCC installed... I have MacOS SDK and IPHONE SDK installed.

    Anybody else had success in compiling?

  7. #17

    Re: Phoenix, Asphyre or Andorra on Mac OS

    The SIGTRAP error is probably because the application is not linking against the Cocoa framework. See: http://www.gamedev.net/community/for...opic_id=224420

    I changed the necessary files and: Download here (65 kB)
    Just replace the files. After that, try again to compile. I really hope this does the trick.
    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.

  8. #18

    Re: Phoenix, Asphyre or Andorra on Mac OS

    It is working! It is working! =). You are my hero! Thank you very much!... It only compiles with ./build.sh, but it is working! =)

    But, is there some problem with .jpg? My program crash when I try to load .jpg images!

    And some .png are with changed colors!


  9. #19

    Re: Phoenix, Asphyre or Andorra on Mac OS

    Sorry, my bad.
    I forgot to mention that you need move the images to the right position if you compile in Lazarus.

    That's what the following lines in the main.pas are for:
    [pascal]
    // Path to data
    const
    {$IFDEF DARWIN}
    // Keep the original path to /Contents/Resources in the .app - file
    PATH = '../Resources/';
    {$ELSE}
    PATH = 'DemoRes\';
    {$ENDIF}
    [/pascal]


    The Mac OS applications are basically just a folder. Right-click on the application and click on "Show content" to show the contents of the application.
    /Contents/Frameworks is where the frameworks should be stored if frameworks are needed
    /Contents/MacOS is where the executable is
    /Contents/Resources is where resources like icons, images, sounds should be stored

    When you compile with Lazarus, you can see that Lazarus creates such an application.
    You need to copy the Arial16.phxfnt and the tx09.png to /Contents/Resources of the application.
    The compiled application should now find all files.
    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.

  10. #20

    Re: Phoenix, Asphyre or Andorra on Mac OS

    Wow this look pretty exciting. I am going to have to give it a go on my macbook this weekend.
    The views expressed on this programme are bloody good ones. - Fred Dagg

Page 2 of 3 FirstFirst 123 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
  •