Page 2 of 2 FirstFirst 12
Results 11 to 19 of 19

Thread: SDL 2.0 for Pascal

  1. #11
    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 ^^.

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

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

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

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

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

  7. #17
    Hi.. I'll try it again. I tried with Ubuntu 12.?? first, now I've installed (ubuntu based) Linux Mint (seems more easy for a Windows guy like me).
    Then do I have tell anything more to Lazarus to find the SDL libraries?
    In windows I just copy the DLL the same folder with .EXE
    Also it rise a new concern, about what a user of my game have to do to successful run my game on Linux, but I can let this for later..
    Thanks

  8. #18
    Member
    Join Date
    Apr 2014
    Location
    Lower Saxony, Germany
    Posts
    38
    I want to thank you (all contributors) for the SDL 2.0 headers!
    Finally I was able to handle focus changing, keyboad input, game controllers etc.
    A great relief!

  9. #19
    PGDCE Developer Carver413's Avatar
    Join Date
    Jun 2010
    Location
    Spokane,WA,Usa
    Posts
    206
    there is also this which seems to be more complete although I have not tested it yet. http://forum.lazarus.freepascal.org/...c,30984.0.html

Page 2 of 2 FirstFirst 12

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
  •