Changeset 37237 in project


Ignore:
Timestamp:
02/14/19 02:25:25 (5 months ago)
Author:
jacius
Message:

Update sdl2-ttf wiki for version 0.2.0.

Location:
wiki/eggref/5
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • wiki/eggref/5/sdl2-image

    r37236 r37237  
    55SDL_image is a library for loading various image formats, compatible
    66with [[http://libsdl.org/|Simple DirectMedia Layer]] version 2 (SDL2),
    7 a popular library used in games and other media-rich software.
     7a popular library used in games and other software.
    88
    99The sdl2-image egg is designed to be compatible with the
     
    7979 export SDL2_LDFLAGS="-F/path/to/your/frameworks -framework SDL2"
    8080 export SDL2_IMAGE_LDFLAGS="-framework SDL2_image"
    81  chicken-install sdl2
     81 chicken-install sdl2-image
    8282
    8383== Usage and Examples
  • wiki/eggref/5/sdl2-ttf

    r37226 r37237  
    55SDL_ttf is a library for rendering text using TTF, OTF, and FON fonts.
    66It is compatible with [[http://libsdl.org/|Simple DirectMedia Layer]] version 2 (SDL2),
    7 a popular library used in games and other media-rich software.
     7a popular library used in games and other software.
    88
    99The sdl2-ttf egg is designed to be compatible with the
     
    2424
    2525The sdl2-ttf egg requires the [[/egg/sdl2|sdl2]] egg,
    26 [[http://libsdl.org/|Simple DirectMedia Layer]] version 2.0.0 or higher,
    27 and [[http://www.libsdl.org/projects/SDL_ttf/|SDL_ttf]] version 2.0 or higher.
     26[[http://libsdl.org/|Simple DirectMedia Layer]] 2.0.0 or higher,
     27and [[http://www.libsdl.org/projects/SDL_ttf/|SDL_ttf]] 2.0 or higher.
    2828It will not work with older versions of SDL or SDL_ttf.
    2929
    3030This egg requires CHICKEN Scheme 4.8 or higher.
    31 Please file an issue or contact the maintainer if you need to use this library with an earlier version of CHICKEN Scheme.
     31As of version 0.2.0, this egg is compatible with both CHICKEN 4 and CHICKEN 5.
    3232
    3333
    3434== Installation
    3535
    36 When installing the egg, you should set the {{SDL2_FLAGS}} environment variable to a string of compiler flags to be used when compiling the egg.
    37 If you have the {{sdl2-config}} helper program installed on your system,
    38 you can set appropriate flags and install the extension like so (notice these are back ticks, not quotes):
    39 
    40  export SDL2_FLAGS=`sdl2-config --cflags --libs`
     36In most cases, you can install the sdl2-ttf egg in the usual way:
     37
    4138 chicken-install sdl2-ttf
    4239
    43 If you do not have the {{sdl2-config}} helper program installed on your computer,
    44 you may manually specify SDL-related compiler flags (notice these are double quotes, not back ticks):
    45 
    46  export SDL2_FLAGS="-I/usr/local/include/SDL2 -L/usr/local/lib -lSDL2"
     40The installer will try to automatically determine the SDL2 compiler and linker flags
     41using the {{sdl2-config}} command.
     42
     43In special cases, you may need to set the
     44{{SDL2_CFLAGS}}, {{SDL2_LDFLAGS}}, {{SDL2_TTF_CFLAGS}}, and/or {{SDL2_TTF_LDFLAGS}}
     45environment variables to provide the compiler and linker flags, then try again.
     46(The {{SDL2_TTF_*}} flags are used in addition to the {{SDL2_*}} flags.)
     47
     48For example:
     49
     50 export SDL2_CFLAGS="-I/usr/local/include/SDL2"
     51 export SDL2_LDFLAGS="-L/usr/local/lib -lSDL2"
     52 export SDL2_TTF_LDFLAGS="-lSDL2_ttf"
    4753 chicken-install sdl2-ttf
    4854
    49 By default, the sdl2-ttf egg will be linked against SDL_ttf using the compiler flag {{-lSDL2_ttf}}.
    50 You can override this by setting the {{SDL2_TTF_FLAGS}} environment variable, if needed.
    51 You can also use that environment variable in case you have installed SDL_ttf in a different location than SDL.
    52 
    53 The {{SDL2_FLAGS}} and {{SDL2_TTF_FLAGS}} environment variables are only needed during installation of the egg.
    54 They do not need to be set during normal use.
    55 
     55These environment variables are needed only when installing the egg itself.
     56They are not needed when compiling or running programs that use the egg.
     57
     58=== Installing on macOS
     59
     60On macOS, the sdl2-ttf egg can be compiled using either
     61UNIX-style libraries (e.g. compiled from source or installed via Homebrew)
     62or Mac-style frameworks (e.g. downloaded from the SDL website).
     63
     64When automatically determining compiler and linker flags on macOS,
     65the installer will first check to see if {{sdl2-config}} is available.
     66If it is available, the installer will use it to determine the flags.
     67
     68If {{sdl2-config}} is not available, the installer will check to see if
     69{{SDL2.framework}} and {{SDL2_ttf.framework}} are available
     70in either the {{/Library/Frameworks}} or {{/System/Library/Frameworks}} directories.
     71If so, the installer will use the frameworks.
     72
     73If the frameworks are installed in some other directory,
     74or if you want to force using the framework even when {{sdl2-config}} is available,
     75set the {{SDL2_CFLAGS}}, {{SDL2_LDFLAGS}}, {{SDL2_TTF_CFLAGS}}, and/or {{SDL2_TTF_LDFLAGS}}
     76enviroment variables to tell the compiler where to find the frameworks:
     77
     78 export SDL2_CFLAGS="-F/path/to/your/frameworks"
     79 export SDL2_LDFLAGS="-F/path/to/your/frameworks -framework SDL2"
     80 export SDL2_TTF_LDFLAGS="-framework SDL2_ttf"
     81 chicken-install sdl2-ttf
    5682
    5783== Usage and Examples
     
    6187
    6288<enscript highlight="scheme">
    63 (use (prefix sdl2     sdl2:)
    64      (prefix sdl2-ttf ttf:))
     89(cond-expand
     90  (chicken-4 (use (prefix sdl2 "sdl2:")
     91                  (prefix sdl2-ttf "ttf:")))
     92  (chicken-5 (import (prefix sdl2 "sdl2:")
     93                     (prefix sdl2-ttf "ttf:"))))
    6594
    6695(sdl2:set-main-ready!)
     
    94123== Version History
    95124
     125; 0.2.0 (2019-02-13) : Ported to be compatible with both CHICKEN 4 and CHICKEN 5. More user-friendly installation process.
    96126; 0.1.0 (2015-12-25) : Initial release.
    97127
    98128For more information about what changed in each version,
    99129see the [[https://gitlab.com/chicken-sdl2/chicken-sdl2-ttf/blob/master/CHANGELOG.md|CHANGELOG]].
    100 
    101130
    102131
Note: See TracChangeset for help on using the changeset viewer.