Results 1 to 10 of 19

Thread: SDL 2.0 for Pascal

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Ah, thanks! I even registered at the DGL community and wanted to ask you there. Any chance of iOS/Android support soon?
    Best regards,
    Cybermonkey

  2. #2
    Quote Originally Posted by Cybermonkey View Post
    Ah, thanks! I even registered at the DGL community and wanted to ask you there. Any chance of iOS/Android support soon?
    If i get the time. I even have a Android Handy now

    But DGL is good, there i'm way more active ^^.

  3. #3
    That would be nice. I've got a tablet and want to play my own games on it ...
    Best regards,
    Cybermonkey

  4. #4
    Another one from me trying to improve SDL2_Mixer this time. This is the original part with still C code in it (starting at line 115):
    Code:
      {* Good default values for a PC soundcard *}
    const
      MIX_DEFAULT_FREQUENCY = 22050; {
    #if SDL_BYTEORDER == SDL_LIL_ENDIAN
      MIX_DEFAULT_FORMAT = AUDIO_S16LSB;
    #else
      MIX_DEFAULT_FORMAT = AUDIO_S16MSB
    #endif                            }
      MIX_DEFAULT_CHANNELS = 2;
      MIX_MAX_VOLUME       = 128; {* Volume of a chunk *}

    I made this out of it:
    Code:
    {* Good default values for a PC soundcard *}
    const
      MIX_DEFAULT_FREQUENCY = 22050; 
    {$IFDEF ENDIAN_LITTLE}
      MIX_DEFAULT_FORMAT = AUDIO_S16LSB;
    {$ELSE}
      MIX_DEFAULT_FORMAT = AUDIO_S16MSB;
    {$ENDIF}
      MIX_DEFAULT_CHANNELS = 2;
      MIX_MAX_VOLUME       = 128; {* Volume of a chunk *}

    I have to admit that I don't know if Delphi has that compiler switch (ENDIAN_LITTLE) but Free Pascal does.
    Best regards,
    Cybermonkey

  5. #5
    Hi Junior! Hi Cybermonkey!

    Seem this is a lonely road that of working with pascal and SDL2
    I've started working with your headers Junior, working great with Delphi XE3 and Lazarus for Win32.

    Now I'm trying Lazarus + Linux + SDL2 ... but I'm a total newbie on Linux
    I'm read from you Cybermonkey googling in another forum this:
    "If someone has questions about SDL2 with FPC under Linux, don‘t hesitate to ask. "
    Then i'm here

    I "think" I've successfully installed SDL2 via PPA : https://launchpad.net/~zoogie/+archive/sdl2-snapshots (a friend help me )
    Then successfully installed Lazarus 1.0.2.. can't remember how after many tries... but it works!

    Now i'm trying a simply Hello World and Lazarus can't find the library lSDL2

    ------
    /usr/bin/ld: warning: link.res contains output sections; did you forget -T?
    /usr/bin/ld: cannot find -lSDL2
    project1.lpr(66,1) Error:Error while linking
    ------

    I have not experience with Linux or Freepascal, i'm Windows Delphi user :-/
    I think can contribute with some "fancy" examples after I could manage to compile in these
    three environments: FreePascal-Linux, FreePascal-Windows, Delphi XE3-(no-VCL, no-Firemonkey), Delphi XE3 + VCL

    Any help very appreciated!

  6. #6
    My guess would be you don't have the appropriate developer packages installed. Try installing "SDL2-devel" and whatever other packages (_gfx, _net, et cetera) you may need.

  7. #7
    Hi, and yes, either the sdl2-devel is missing or the linker can't find the appr. libraries. What Linux do you use? I assume it's an Ubuntu distro, so I'd rather recommend to use the official libraries from your package manager.
    sdl2libs.jpg
    Best regards,
    Cybermonkey

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
  •