Changeset 2f9f352 in buchla-emu


Ignore:
Timestamp:
07/22/2017 03:27:04 PM (7 years ago)
Author:
Thomas Lopatic <thomas@…>
Branches:
master
Children:
d94a7be
Parents:
de65155
Message:

Added SDL2_ttf.

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • Makefile

    rde65155 r2f9f352  
    1818ifeq ($(OS), Linux)
    1919FLAGS_LNK :=    $(FLAGS) -pthread -Wall -Wextra
    20 LIBS :=                 $(SDL2_LIB)/libSDL2.a -ldl -lm
     20LIBS :=                 $(SDL2_LIB)/libSDL2.a \
     21                                $(SDL2_LIB)/libSDL2_ttf.a \
     22                                $(SDL2_LIB)/libfreetype.a \
     23                                -ldl -lm
    2124endif
    2225
     
    2427FLAGS_LNK :=    $(FLAGS) -Wall -Wextra
    2528LIBS :=                 $(SDL2_LIB)/libSDL2.a \
     29                                $(SDL2_LIB)/libSDL2_ttf.a \
     30                                $(SDL2_LIB)/libfreetype.a \
    2631                                -framework AppKit \
    2732                                -framework AudioToolbox \
  • emu/all.h

    rde65155 r2f9f352  
    2727
    2828#include <SDL2/SDL.h>
     29#include <SDL2/SDL_ttf.h>
    2930
    3031#define inf(...) SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION, __VA_ARGS__);
  • emu/sdl.c

    rde65155 r2f9f352  
    3232
    3333        SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_VERBOSE);
     34
     35        if (TTF_Init() < 0) {
     36                fail("TTF_Init() failed: %s", TTF_GetError());
     37        }
    3438}
    3539
    3640void sdl_quit(void)
    3741{
     42        TTF_Quit();
    3843        SDL_Quit();
    3944}
  • readme.txt

    rde65155 r2f9f352  
    2626  https://libsdl.org/
    2727
     28The SDL2 website also hosts the SDL2_ttf project, which adds support
     29for TrueType fonts to SDL2. SDL2_ttf, in turn, requires the FreeType
     30library, which is available from the FreeType website:
     31
     32  https://www.freetype.org/
     33
    2834Currently, the emulator supports Linux and OS X. A port to Windows
    2935should be pretty easy, given that it doesn't use any platform-specific
    3036features, just C99 and SDL2.
    3137
    32 Our Makefile expects SDL2 to reside in /opt/sdl2. This is how we
    33 typically install it:
     38Our Makefile expects all of the above libraries to reside in
     39/opt/sdl2. This is how we typically install them:
     40
     41  # Build and install FreeType first
     42
     43  tar zxvf freetype-2.7.1.tar.gz
     44  cd freetype-2.7.1
     45  mkdir build
     46  cd build
     47
     48  # Skip the optional features (compressed fonts, etc.) that would
     49  # create more dependencies
     50
     51  ../configure --prefix=/opt/sdl2 \
     52    --without-zlib --without-bzip2 --without-png --without-harfbuzz
     53
     54  make
     55  make install
     56
     57  # Then build and install SDL2
    3458
    3559  tar zxvf SDL2-2.0.5.tar.gz
    3660  cd SDL2-2.0.5
    37 
    3861  mkdir build
    3962  cd build
    4063
    4164  ../configure --prefix=/opt/sdl2
     65
    4266  make
    4367  make install
    4468
    45 Now that we have SDL2 in place, invoke
     69  # Build and install SDL2_ttf last
     70
     71  tar zxvf SDL2_ttf-2.0.14.tar.gz
     72  cd SDL2_ttf-2.0.14
     73  mkdir build
     74  cd build
     75
     76  ../configure --prefix=/opt/sdl2
     77
     78  make
     79  make install
     80
     81Now that we have everything in place, invoke
    4682
    4783  make buchla
Note: See TracChangeset for help on using the changeset viewer.