README-porting.txt
author David Ludwig <dludwig@pobox.com>
Wed, 25 Dec 2013 21:39:48 -0500
changeset 8563 c0e68f3b6bbb
parent 7222 2435b221d77d
permissions -rw-r--r--
WinRT: compiled the d3d11 renderer's shaders into SDL itself

Previously, the shaders would get compiled separately, the output of which would need to be packaged into the app. This change should make SDL's dll be the only binary needed to include SDL in a WinRT app.
slouken@7222
     1
slouken@7222
     2
* Porting To A New Platform
slouken@7222
     3
slouken@7222
     4
  The first thing you have to do when porting to a new platform, is look at
slouken@7222
     5
include/SDL_platform.h and create an entry there for your operating system.
slouken@7222
     6
The standard format is __PLATFORM__, where PLATFORM is the name of the OS.
slouken@7222
     7
Ideally SDL_platform.h will be able to auto-detect the system it's building
slouken@7222
     8
on based on C preprocessor symbols.
slouken@7222
     9
slouken@7222
    10
There are two basic ways of building SDL at the moment:
slouken@7222
    11
slouken@7222
    12
1. The "UNIX" way:  ./configure; make; make install
slouken@7222
    13
slouken@7222
    14
   If you have a GNUish system, then you might try this.  Edit configure.in,
slouken@7222
    15
   take a look at the large section labelled:
slouken@7222
    16
	"Set up the configuration based on the target platform!"
slouken@7222
    17
   Add a section for your platform, and then re-run autogen.sh and build!
slouken@7222
    18
slouken@7222
    19
2. Using an IDE:
slouken@7222
    20
slouken@7222
    21
   If you're using an IDE or other non-configure build system, you'll probably
slouken@7222
    22
   want to create a custom SDL_config.h for your platform.  Edit SDL_config.h,
slouken@7222
    23
   add a section for your platform, and create a custom SDL_config_{platform}.h,
slouken@7222
    24
   based on SDL_config.h.minimal and SDL_config.h.in
slouken@7222
    25
slouken@7222
    26
   Add the top level include directory to the header search path, and then add
slouken@7222
    27
   the following sources to the project:
slouken@7222
    28
	src/*.c
slouken@7222
    29
	src/atomic/*.c
slouken@7222
    30
	src/audio/*.c
slouken@7222
    31
	src/cpuinfo/*.c
slouken@7222
    32
	src/events/*.c
slouken@7222
    33
	src/file/*.c
slouken@7222
    34
	src/haptic/*.c
slouken@7222
    35
	src/joystick/*.c
slouken@7222
    36
	src/power/*.c
slouken@7222
    37
	src/render/*.c
slouken@7222
    38
	src/stdlib/*.c
slouken@7222
    39
	src/thread/*.c
slouken@7222
    40
	src/timer/*.c
slouken@7222
    41
	src/video/*.c
slouken@7222
    42
	src/audio/disk/*.c
slouken@7222
    43
	src/audio/dummy/*.c
slouken@7222
    44
	src/video/dummy/*.c
slouken@7222
    45
	src/haptic/dummy/*.c
slouken@7222
    46
	src/joystick/dummy/*.c
slouken@7222
    47
	src/main/dummy/*.c
slouken@7222
    48
	src/thread/generic/*.c
slouken@7222
    49
	src/timer/dummy/*.c
slouken@7222
    50
	src/loadso/dummy/*.c
slouken@7222
    51
slouken@7222
    52
slouken@7222
    53
Once you have a working library without any drivers, you can go back to each
slouken@7222
    54
of the major subsystems and start implementing drivers for your platform.
slouken@7222
    55
slouken@7222
    56
If you have any questions, don't hesitate to ask on the SDL mailing list:
slouken@7222
    57
	http://www.libsdl.org/mailing-list.php
slouken@7222
    58
slouken@7222
    59
Enjoy!
slouken@7222
    60
	Sam Lantinga				(slouken@libsdl.org)
slouken@7222
    61