Changeset ea878ba in buchla-emu


Ignore:
Timestamp:
08/01/2017 05:46:02 PM (7 years ago)
Author:
Thomas Lopatic <thomas@…>
Branches:
master
Children:
bdd5a63
Parents:
74c44d9
Message:

Added SDL_net for networking.

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • Makefile

    r74c44d9 rea878ba  
    3232FLAGS_LNK :=    $(FLAGS) -pthread -Wall -Wextra
    3333LIBS :=                 $(SDL2_LIB)/libSDL2.a \
     34                                $(SDL2_LIB)/libSDL2_net.a \
    3435                                $(SDL2_LIB)/libSDL2_ttf.a \
    3536                                $(SDL2_LIB)/libfreetype.a \
     
    4142FLAGS_LNK :=    $(FLAGS) -Wall -Wextra
    4243LIBS :=                 $(SDL2_LIB)/libSDL2.a \
     44                                $(SDL2_LIB)/libSDL2_net.a \
    4345                                $(SDL2_LIB)/libSDL2_ttf.a \
    4446                                $(SDL2_LIB)/libfreetype.a \
     
    6062                                $(SDL2_LIB)/libSDL2.a \
    6163                                $(SDL2_LIB)/libSDL2main.a \
     64                                $(SDL2_LIB)/libSDL2_net.a \
    6265                                $(SDL2_LIB)/libSDL2_ttf.a \
    6366                                $(SDL2_LIB)/libfreetype.a \
    6467                                -l gdi32 \
    6568                                -l imm32 \
     69                                -l iphlpapi \
    6670                                -l ole32 \
    6771                                -l oleaut32 \
    6872                                -l version \
    69                                 -l winmm
     73                                -l winmm \
     74                                -l ws2_32
    7075endif
    7176
  • emu/all.h

    r74c44d9 rea878ba  
    2828
    2929#include <SDL2/SDL.h>
     30#include <SDL2/SDL_net.h>
    3031#include <SDL2/SDL_ttf.h>
    3132
  • emu/sdl.c

    r74c44d9 rea878ba  
    3333        SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_VERBOSE);
    3434
     35        if (SDLNet_Init() < 0) {
     36                fail("SDLNet_Init() failed: %s", SDLNet_GetError());
     37        }
     38
    3539        if (TTF_Init() < 0) {
    3640                fail("TTF_Init() failed: %s", TTF_GetError());
     
    4448{
    4549        TTF_Quit();
     50        SDLNet_Quit();
    4651        SDL_Quit();
    4752}
  • readme.txt

    r74c44d9 rea878ba  
    2626  https://libsdl.org/
    2727
    28 The SDL2 website also hosts the SDL2_ttf project, which adds support
    29 for TrueType fonts to SDL2. SDL2_ttf, in turn, requires the FreeType
    30 library, which is available from the FreeType website:
     28The SDL2 website also hosts the SDL2_net and SDL2_ttf projects, which
     29add support for networking and TrueType fonts to SDL2
     30
     31SDL2_ttf, in turn, requires the FreeType library, which is available
     32from the FreeType website:
    3133
    3234  https://www.freetype.org/
     
    6769  make install
    6870
    69   # Build and install SDL2_ttf last
     71  # Build and install SDL2_ttf, now that we have FreeType and SDL2
    7072
    7173  tar zxvf SDL2_ttf-2.0.14.tar.gz
     
    7678  ../configure --prefix=/opt/sdl2 \
    7779    --with-sdl-prefix=/opt/sdl2 --with-freetype-prefix=/opt/sdl2
     80
     81  make
     82  make install
     83
     84  # Build and install SDL2_net last
     85
     86  tar zxvf SDL2_net-2.0.1.tar.gz
     87  cd SDL2_net-2.0.1
     88  mkdir build
     89  cd build
     90
     91  ../configure --prefix=/opt/sdl2 --with-sdl-prefix=/opt/sdl2
    7892
    7993  make
Note: See TracChangeset for help on using the changeset viewer.