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
    @End I use your headers and work OK in DelphiXE4 (I add it to sdl.inc) with WIN32 and WIN64 but not with OSX ("uses windows" error).
    I change:
    Code:
    {$IFDEF Delphi}
         {$DEFINE Windows}
        ........
    for:

    Code:
    {$IFDEF Delphi}
      {$IFDEF MSWINDOWS}
         {$DEFINE Windows}
      {$ENDIF} 
        ........
    but is not enough for compile sdl.pas in OSX.
    You plan to make it compatible with DelphiXE4 and OSX ?

    I use last SDL2.dll download from libsdl.org (I change in sdl.pas SDL_LibName = 'SDL2.dll') and work fine. Not need use SDL2_x86.dll and SDL2_x86_x64.dll

    You plan to make headers for SDL2_mixer ?
    I convert SDL2_image, SDL2_net and SDL2_ttf from jedi-sdl and work OK, but SDL2_mixer not work .
    SDL2_mixer generate an access violation in function Mix_LoadWAV_RW of SDL2_mixer.dll (same function in SDL_mixer.dll of SDL1.2 work ok)

    In SDL2 not exist SDL_CreateThread and SDL_KillThread ? My games use SDL_Thread and I need to upgrade to SDL2

    Kotai.
    I've corrected the first mistake, XE4 should be supported now, thanks.

    unfortunately i don't own any OSX Version, but i want to support it of course. May you send me your compiler output? Maybe you have to compile the libraries yourself on OSX, cause there was in the RC an bug...

    I don't know when I translate the other SDL-Libs, but I'll do that if I finished the main SDL-Lib.

    I've translated already Thread (see in the branch "thread") but i don't get it working on 32 Bit... it works only in 64 Bit :/

    On 32 Bit I get an Access Violation, maybe is sth. wrong with the pointer sizes, i'm working on this...

    Greetings

    P.S.
    And this _x86.dll Endings:

    I've done this, cause i'm using many compilers, 32 and 64 Bit and I was tired of changing the Libnames

  2. #2
    Quote Originally Posted by End View Post
    I've translated already Thread (see in the branch "thread") but i don't get it working on 32 Bit... it works only in 64 Bit :/

    On 32 Bit I get an Access Violation, maybe is sth. wrong with the pointer sizes, i'm working on this...
    Make sure yoiu have both 32 bit and 64 bit verson of every dynamic link libraries (dll's) that your library depends upon.
    32 bit programs can only use 32 bit dynamic link libraries, 64 bit programs can only use 64 bit libraries.

  3. #3
    PGD Staff / News Reporter phibermon's Avatar
    Join Date
    Sep 2009
    Location
    England
    Posts
    524
    I started a SDL 2.x header translation a few years ago (stopped as at the time there were license issues, the API was changing a lot) and would be willing to put some work into this if needed.

    I'm surprised to learn that they've got multi-window support covering OpenGL, I will have to look thru the code and see what threading setups they allow, I'm guessing they only support a single thread for all GL windows due to Linux + OSX context sharing abstraction. Tricky on Cocoa in general as well! I disabled multi-window support in my framework as the design required to handle per window thread setups with seperate GL contexts made things very messy, requiring a whole layer of abstraction and another set of concurrency wrappers to upload and track data across multiple contexts.
    When the moon hits your eye like a big pizza pie - that's an extinction level impact event.

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

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

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

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

  8. #8
    This is my SDL2 for Delphi XE4 with support for MACOS: http://www.remakesonline.com/descargas/SDL2.zip

    Only work with latest SDL2 library (
    Sun Aug 18 2013) because SDL_CreateWindow now return new param between "title" and "x" param ¿?.

    It include:
    Code:
    sdl2.inc
     SDL2.pas
     SDL2_Image.pas
     SDL2_Mixer.pas
     SDL2_Net.pas
     SDL2_Ttf.pas

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

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
  •