Page 1 of 2 12 LastLast
Results 1 to 10 of 64

Thread: SDL 2.0 Headers for [Object] Pascal?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Sorry, I see reply today.

    This is my SDL2 for Delphi XE4: http://www.remakesonline.com/descargas/SDL2.zip
    It include:
    Code:
    sdl2.inc
    SDL2.pas
    SDL2_Image.pas
    SDL2_Mixer.pas
    SDL2_Net.pas
    SDL2_Ttf.pas
    All tested and working in Win32 and Win64 (not in OSX )

    This is a example of SDL2 and SDL2_Image for Win32, Win64 and OSX(not work ok): http://www.remakesonline.com/descargas/EjemploSDL2.zip

    Kotai.
    Last edited by kotai; 29-07-2013 at 01:08 PM.
    www.kotai.es
    www.remakesonline.com -> Nemesis Online & Bubble Bobble Online & Castlevania Online & Penguin Adventure Online
    www.miniracingonline.com

  2. #2
    I released now the thread-part. It works on Win32 and Win64.

    @kotai:

    May you send me the Errorlog for OSX? (for a sample working with Windows)

    I'll translate sdl_image, if i get the time in the next days.

  3. #3
    Hi.

    I have translated SDL2_Image, SDL2_Mixer, SDL2_Net and SDL2_Tft, you can download at:

    http://www.remakesonline.com/descargas/SDL2.zip

    I can compile for OSX in Delphi XE4 without errors, but latter when I execute in MAC I have a error of SDL not found, but I install framework SDL2.framework in /Library/Frameworks

    Code:
    Last login: Tue Jul 30 14:50:12 on ttys001
    /Users/kotai/Applications/Embarcadero/RADPAServer/10.0/paserver ; exit;
    macosx:~ kotai$ /Users/kotai/Applications/Embarcadero/RADPAServer/10.0/paserver ; exit;
    Platform Assistant Server  Version 2.0.7.05
    Copyright (c) 2009-2012 Embarcadero Technologies, Inc.
    
    
    Remote Profile password <press Enter for no password>: 
    
    
    Acquiring permission to support debugging...succeeded
    
    
    Starting Platform Assistant Server on port 64211
    
    
    Type ? for available commands
    >listen
    Process Control Server Started pid 283 exe  built Aug 21 2012
    sentinelFunc 285
    dyld: Library not loaded: @rpath/SDL2
      Referenced from: /Users/kotai/Applications/Embarcadero/RADPAServer/10.0/scratch-dir/Vicent-MacOSx/juego/juego
      Reason: image not found
    ^Cdbkexe : interrupt sig->exit
    EControlC: Control-C hit
    logout
    
    
    [Proceso completado]
    Then, I copy SDL2 (from /Library/Frameworks/SDL2.framework/Versions/A/SDL2 ) to game folder and get next error:

    Code:
    Last login: Tue Jul 30 15:02:55 on console
    /Users/kotai/Applications/Embarcadero/RADPAServer/10.0/paserver ; exit;
    MacOSx:~ kotai$ /Users/kotai/Applications/Embarcadero/RADPAServer/10.0/paserver ; exit;
    Platform Assistant Server  Version 2.0.7.05
    Copyright (c) 2009-2012 Embarcadero Technologies, Inc.
    
    
    Remote Profile password <press Enter for no password>: 
    
    
    Acquiring permission to support debugging...succeeded
    
    
    Starting Platform Assistant Server on port 64211
    
    
    Type ? for available commands
    >listen
    Process Control Server Started pid 163 exe  built Aug 21 2012
    sentinelFunc 166
    dyld: Library not loaded: @executable_path/../Frameworks/SDL2.framework/Versions/A/SDL2
      Referenced from: /Users/kotai/Applications/Embarcadero/RADPAServer/10.0/scratch-dir/Vicent-MacOSx/juego//SDL2_image
      Reason: image not found
    Then, I copy SDL2.framework to /../Frameworks/SDL2.framework and get next error:

    Code:
    Last login: Tue Jul 30 15:15:45 on ttys001
    /Users/kotai/Applications/Embarcadero/RADPAServer/10.0/paserver ; exit;
    macosx:~ kotai$ /Users/kotai/Applications/Embarcadero/RADPAServer/10.0/paserver ; exit;
    Platform Assistant Server  Version 2.0.7.05
    Copyright (c) 2009-2012 Embarcadero Technologies, Inc.
    
    
    Remote Profile password <press Enter for no password>: 
    
    
    Acquiring permission to support debugging...succeeded
    
    
    Starting Platform Assistant Server on port 64211
    
    
    Type ? for available commands
    >listen
    Process Control Server Started pid 341 exe  built Aug 21 2012
    sentinelFunc 343
    objc[345]: Class SDLAppDelegate is implemented in both /Users/kotai/Applications/Embarcadero/RADPAServer/10.0/scratch-dir/Vicent-MacOSx/juego//SDL2 and /Users/kotai/Applications/Embarcadero/RADPAServer/10.0/scratch-dir/Vicent-MacOSx/juego/../Frameworks/SDL2.framework/Versions/A/SDL2. One of the two will be used. Which one is undefined.
    objc[345]: Class SDLTranslatorResponder is implemented in both /Users/kotai/Applications/Embarcadero/RADPAServer/10.0/scratch-dir/Vicent-MacOSx/juego//SDL2 and /Users/kotai/Applications/Embarcadero/RADPAServer/10.0/scratch-dir/Vicent-MacOSx/juego/../Frameworks/SDL2.framework/Versions/A/SDL2. One of the two will be used. Which one is undefined.
    objc[345]: Class Cocoa_WindowListener is implemented in both /Users/kotai/Applications/Embarcadero/RADPAServer/10.0/scratch-dir/Vicent-MacOSx/juego//SDL2 and /Users/kotai/Applications/Embarcadero/RADPAServer/10.0/scratch-dir/Vicent-MacOSx/juego/../Frameworks/SDL2.framework/Versions/A/SDL2. One of the two will be used. Which one is undefined.
    objc[345]: Class SDLWindow is implemented in both /Users/kotai/Applications/Embarcadero/RADPAServer/10.0/scratch-dir/Vicent-MacOSx/juego//SDL2 and /Users/kotai/Applications/Embarcadero/RADPAServer/10.0/scratch-dir/Vicent-MacOSx/juego/../Frameworks/SDL2.framework/Versions/A/SDL2. One of the two will be used. Which one is undefined.
    objc[345]: Class SDLView is implemented in both /Users/kotai/Applications/Embarcadero/RADPAServer/10.0/scratch-dir/Vicent-MacOSx/juego//SDL2 and /Users/kotai/Applications/Embarcadero/RADPAServer/10.0/scratch-dir/Vicent-MacOSx/juego/../Frameworks/SDL2.framework/Versions/A/SDL2. One of the two will be used. Which one is undefined.
    objc[345]: Class SDLMessageBoxPresenter is implemented in both /Users/kotai/Applications/Embarcadero/RADPAServer/10.0/scratch-dir/Vicent-MacOSx/juego//SDL2 and /Users/kotai/Applications/Embarcadero/RADPAServer/10.0/scratch-dir/Vicent-MacOSx/juego/../Frameworks/SDL2.framework/Versions/A/SDL2. One of the two will be used. Which one is undefined.
    dyld: lazy symbol binding failed: Symbol not found: SDL_Init
      Referenced from: /Users/kotai/Applications/Embarcadero/RADPAServer/10.0/scratch-dir/Vicent-MacOSx/juego/juego
      Expected in: /Users/kotai/Applications/Embarcadero/RADPAServer/10.0/scratch-dir/Vicent-MacOSx/juego//SDL2
    
    
    dyld: Symbol not found: SDL_Init
      Referenced from: /Users/kotai/Applications/Embarcadero/RADPAServer/10.0/scratch-dir/Vicent-MacOSx/juego/juego
      Expected in: /Users/kotai/Applications/Embarcadero/RADPAServer/10.0/scratch-dir/Vicent-MacOSx/juego//SDL2


    I think problem is SDL2.pas:

    Code:
      {$IFDEF MACOS}
        SDL_LibName = 'SDL2';
    //    {$linklib SDL2}
      {$ENDIF}

    I comment line {$linklib SDL2} because Delphi does not recognize that command $linklib

    Kotai
    www.kotai.es
    www.remakesonline.com -> Nemesis Online & Bubble Bobble Online & Castlevania Online & Penguin Adventure Online
    www.miniracingonline.com

  4. #4
    Quote Originally Posted by kotai View Post
    I comment line {$linklib SDL2} because Delphi does not recognize that command $linklib
    If it's FPC specific command, you can do
    Code:
    {$IFDEF fpc}{$linklib SDL2}{$ENDIF}

  5. #5
    Thanks @User137.
    In Delphi what command I need use for load external library or framework in OSX ?
    I use:
    Code:
    function FName(FParams):FType cdecl; external LibraryName;
    like:
    Code:
    function SDL_Init(flags: UInt32): SInt32 cdecl; external SDL2;
    But not work in OSX, not found function SDL_Init
    Thanks
    www.kotai.es
    www.remakesonline.com -> Nemesis Online & Bubble Bobble Online & Castlevania Online & Penguin Adventure Online
    www.miniracingonline.com

  6. #6
    Quote Originally Posted by kotai View Post
    Thanks @User137.
    In Delphi what command I need use for load external library or framework in OSX ?
    I use:
    Code:
    function FName(FParams):FType cdecl; external LibraryName;
    like:
    Code:
    function SDL_Init(flags: UInt32): SInt32 cdecl; external SDL2;
    But not work in OSX, not found function SDL_Init
    Thanks
    I don't know, since i have no mac os. may s.o. can help me?

  7. #7
    Well, StoneyFD says it works now with MacOS, try it with the new Release.

  8. #8

  9. #9
    Now my headers should work with Delphi + MacOS, too. Could you test them, kotai?

  10. #10
    Hi.

    I don't test (I use last sdl.dll and I have more functions and my test program not work) but I think it not work because you can no add "_" at begin of function names:

    My SDL:
    Code:
    function SDL_Init(flags: UInt32): SInt32 cdecl; external SDL_LibName {$IFDEF MACOS} name '_SDL_Init' {$ENDIF};
    Your SDL:
    Code:
    function SDL_Init(flags: UInt32): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name 'SDL_Init' {$ENDIF} {$ENDIF};
    In name '_SDL_Init' you put name 'SDL_Init' without "_"

    Kotai.
    www.kotai.es
    www.remakesonline.com -> Nemesis Online & Bubble Bobble Online & Castlevania Online & Penguin Adventure Online
    www.miniracingonline.com

Page 1 of 2 12 LastLast

Tags for this Thread

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
  •