Skip to content
Snippets Groups Projects
Select Git revision
  • 621efbfa158e49a33f6ba8a55c267cb10f85b602
  • next default protected
  • fix-1277
  • fix-1258
  • delfile2
  • cleanupmusic
  • gametype-refactor-1
  • custom-map-names
  • extra-textures
  • clipmidtex
  • optimize-storewallrange
  • increase-maxconditionsets
  • acs
  • softcode-info
  • lua-gfx-2
  • better-player-states
  • lua-debug-library
  • any-resolution
  • gametype-refactor-player-spawns
  • custom-teams
  • action-args
  • SRB2_release_2.2.13
  • SRB2_release_2.2.12
  • SRB2_release_2.2.11
  • SRB2_release_2.2.10
  • SRB2_release_2.2.9
  • SRB2_release_2.2.8
  • SRB2_release_2.2.7
  • SRB2_release_2.2.6
  • SRB2_release_2.2.5
  • SRB2_release_2.2.4
  • SRB2_release_2.2.3
  • SRB2_release_2.2.2
  • SRB2_release_2.2.1
  • SRB2_release_2.2.0
  • SRB2_release_2.1.25
  • SRB2_release_2.1.24
  • SRB2_release_2.1.23
  • SRB2_release_2.1.22
  • SRB2_release_2.1.21
  • SRB2_release_2.1.20
41 results

lua_mobjlib.c

Blame
  • Forked from STJr / SRB2
    Source project has a limited visibility.
    README-macos.md 9.60 KiB

    Mac OS X (aka macOS).

    These instructions are for people using Apple's Mac OS X (pronounced "ten"), which in newer versions is just referred to as "macOS".

    From the developer's point of view, macOS is a sort of hybrid Mac and Unix system, and you have the option of using either traditional command line tools or Apple's IDE Xcode.

    Command Line Build

    To build SDL using the command line, use the standard configure and make process:

    mkdir build
    cd build
    ../configure
    make
    sudo make install

    CMake is also known to work, although it continues to be a work in progress:

    mkdir build
    cd build
    cmake -DCMAKE_BUILD_TYPE=Release ..
    make
    sudo make install

    You can also build SDL as a Universal library (a single binary for both 64-bit Intel and ARM architectures), by using the build-scripts/clang-fat.sh script.

    mkdir build
    cd build
    CC=$PWD/../build-scripts/clang-fat.sh ../configure
    make
    sudo make install

    This script builds SDL with 10.9 ABI compatibility on 64-bit Intel and 11.0 ABI compatibility on ARM64 architectures. For best compatibility you should compile your application the same way.

    Please note that building SDL requires at least Xcode 6 and the 10.9 SDK. PowerPC support for macOS has been officially dropped as of SDL 2.0.2. 32-bit Intel and macOS 10.8 runtime support has been officially dropped as of SDL 2.24.0.

    To use the library once it's built, you essential have two possibilities: use the traditional autoconf/automake/make method, or use Xcode.

    Caveats for using SDL with Mac OS X

    If you register your own NSApplicationDelegate (using [NSApp setDelegate:]), SDL will not register its own. This means that SDL will not terminate using SDL_Quit if it receives a termination request, it will terminate like a normal app, and it will not send a SDL_DROPFILE when you request to open a file with the app. To solve these issues, put the following code in your NSApplicationDelegate implementation:

    - (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender
    {
        if (SDL_GetEventState(SDL_QUIT) == SDL_ENABLE) {
            SDL_Event event;
            event.type = SDL_QUIT;
            SDL_PushEvent(&event);
        }
    
        return NSTerminateCancel;
    }
    
    - (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename
    {
        if (SDL_GetEventState(SDL_DROPFILE) == SDL_ENABLE) {
            SDL_Event event;
            event.type = SDL_DROPFILE;
            event.drop.file = SDL_strdup([filename UTF8String]);
            return (SDL_PushEvent(&event) > 0);
        }
    
        return NO;
    }

    Using the Simple DirectMedia Layer with a traditional Makefile

    An existing autoconf/automake build system for your SDL app has good chances to work almost unchanged on macOS. However, to produce a "real" Mac binary that you can distribute to users, you need to put the generated binary into a so called "bundle", which is basically a fancy folder with a name like "MyCoolGame.app".

    To get this build automatically, add something like the following rule to your Makefile.am:

    bundle_contents = APP_NAME.app/Contents
    APP_NAME_bundle: EXE_NAME
    	mkdir -p $(bundle_contents)/MacOS
    	mkdir -p $(bundle_contents)/Resources
    	echo "APPL????" > $(bundle_contents)/PkgInfo
    	$(INSTALL_PROGRAM) $< $(bundle_contents)/MacOS/