Page 6 of 7 FirstFirst ... 4567 LastLast
Results 51 to 60 of 64

Thread: SDL 2.0 Headers for [Object] Pascal?

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

  2. #52
    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}

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

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

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

  6. #56
    Hi

    Thanks for update SDL2. I update my version with your updates except modular, I like more all in same file.
    I add SDL_messagebox.h:

    Code:
    ////////////////////////////////////////////////////////////////////////////////////////////////////////
    //////////////////////       SDL_messagebox.h       ////////////////////////////////////////////////////
    ////////////////////////////////////////////////////////////////////////////////////////////////////////
    
    
    const
    
    
      //SDL_MessageBoxFlags;
      SDL_MESSAGEBOX_ERROR        = $00000010;   //**< error dialog */
      SDL_MESSAGEBOX_WARNING      = $00000020;   //**< warning dialog */
      SDL_MESSAGEBOX_INFORMATION  = $00000040;   //**< informational dialog */
    
    
      //SDL_MessageBoxButtonFlags;
      SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT = $00000001;  //**< Marks the default button when return is hit */
      SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT = $00000002;  //**< Marks the default button when escape is hit */
    
    
    function SDL_ShowSimpleMessageBox(flags : Uint32; const title : PAnsiChar; const message : PAnsiChar; window : PSDL_Window): UInt32 cdecl; external {$IFDEF GPC} name 'SDL_ShowSimpleMessageBox' {$ELSE} SDL_LibName {$ENDIF};
    And support for load and save BMP in surfaces form TmemoryStream for copy TPicture.TBitmap to surface and viceversa.

    I test again to compile for MAC and have same problem:
    Code:
    dyld: lazy symbol binding failed: Symbol not found: SDL_Init
    I search in embarcadero help and I see all functions in OSX need begin with "_".
    I rename SDL_Init function to _SDL_Init and WORK OK !!!!
    I rename several functions and now I can create windows and renderer in OSX.

    But now not compile with win32/win64:
    Code:
    Not found the procedure entry point _SDL_Init in the dynamic link library.
    I do not know how to make function that add "_ " before name function for MACOS.
    I would like the name of the function is always "SDL_Init" but when I compile for MACOS renamed for "_SDL_Init"

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

  7. #57
    with FPC maybe ( public name ) helps
    Last edited by AirPas; 27-08-2013 at 01:34 PM.

  8. #58
    I not use FPC, I use DelphiXE4 and I like compile SDL2 to WIN32, WIN64, OSX and IOS (and Android when DelphiXE5 relased)

    This is article by embarcadero:
    http://docwiki.embarcadero.com/RADSt...ared_Libraries

    I like call always to function SDL_Init in my games/engine and if destination is OSX autimatically rename it to _SDL_Init.

    I can make this:
    Code:
    interface {$IFDEF MACOS}function _SDL_Init(flags: UInt32): SInt32 cdecl; external {$IFDEF GPC} name 'SDL_Init' {$ELSE} SDL_LibName {$ENDIF};
    {$ELSE}
    function SDL_Init(flags: UInt32): SInt32 cdecl; external {$IFDEF GPC} name 'SDL_Init' {$ELSE} SDL_LibName {$ENDIF};
    {$ENDIF}
    But I don't like, because in games/engine I need call to SDL_Init or _SDL_Init and I like call allways to SDL_Init regardless of platform
    Last edited by kotai; 27-08-2013 at 01:57 PM.
    www.kotai.es
    www.remakesonline.com -> Nemesis Online & Bubble Bobble Online & Castlevania Online & Penguin Adventure Online
    www.miniracingonline.com

  9. #59
    This is article by embarcadero:
    http://docwiki.embarcadero.com/RADSt...ared_Libraries

    I like call always to function SDL_Init in my games/engine and if destination is OSX autimatically rename it to _SDL_Init.

    I can make this:
    Code:
    interface 
    {$IFDEF MACOS}
    function _SDL_Init(flags: UInt32): SInt32 cdecl; external;
    {$ELSE}
    function SDL_Init(flags: UInt32): SInt32 cdecl; external;
    {$ENDIF}
    But I don't like, because in games/engine I need call to SDL_Init or _SDL_Init and I like call allways to SDL_Init regardless of platform
    www.kotai.es
    www.remakesonline.com -> Nemesis Online & Bubble Bobble Online & Castlevania Online & Penguin Adventure Online
    www.miniracingonline.com

  10. #60
    I found a solution:

    Code:
    function SDL_Init(flags: UInt32): SInt32 cdecl; external SDL_LibName {$IFDEF MACOS} name '_SDL_Init' {$ENDIF};
    I will delete all {$IFDEF GPC} name 'XXX' {$ELSE} SDL_LibName {$ENDIF};
    and I will use {$IFDEF MACOS} name '_XXX' {$ENDIF};
    I not need compile with GNU Pascal Compliler, I need compile only with DelphiXE4

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

Page 6 of 7 FirstFirst ... 4567 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
  •