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
    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}

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

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

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

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

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

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

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

  9. #9

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

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
  •