Porting Echo to a new platform requires quite a bit of work. This document lists each of the things you need to address and explains each in detail.
==Organising your files==
Any source files you want to add should go into `src/Platforms/YourPlatform` and headers in `echo/Platforms/YourPlatform`
==Netbeans project configuration==
Open the project properties window and click on the "Manage Configurations" button. Either create a new configuration or duplicate another one if it is closer to what you already want.
To change the toolchain, configure toolchains in Netbeans preferences. Now you'll be able to select the toolchain in the properties of your configuration under "General".
Add a platform preprocessor definition `ECHO_PLATFORM_YOURPLATFORM`.
==Building dependencies==
To document.
==Types.h==
You may need to configure your platform types if boost cannot give you type sizes. If you can rely on boost to do type size detection then you can skip to the next section.
If that is the case then create `echo/Platforms/YourPlatform/Types.h` Define the following types in this file:
```
u8
u16
u32
u64
s8
s16
s32
s64
f32
f64
```
Define either `ECHO_LITTLE_ENDIAN` or `ECHO_BIG_ENDIAN` to suit your platform.
For example this is compatible with gcc:
```
#ifndef ECHO_ENDIAN_DETECTED
#if defined(__BYTE_ORDER__)&&(__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
#define ECHO_LITTLE_ENDIAN
#define ECHO_ENDIAN_DETECTED
#elif defined(__BYTE_ORDER__)&&(__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
#define ECHO_BIG_ENDIAN
#define ECHO_ENDIAN_DETECTED
#else
#error Could not determine platform endian-ness
#endif
#endif //ECHO_ENDIAN_DETECTED
```
You'll need to modify `echo/Types.h` to include a test for your platform then include the appropriate `Types.h` file. For example:
```
//--------------------- Include types for YOURPLATFORM -----------------------
#ifdef ECHO_PLATFORM_YOURPLATFORM
#ifndef ECHO_USING_BOOST
#include <echo/Platforms/YourPlatform/Types.h>
#endif //ECHO_USING_BOOST
#endif //ECHO_PLATFORM_YOURPLATFORM
```
You may need to remove the check for `ECHO_USING_BOOST`.
==Platform namespace==
Contains all of the functions that give access to creating the various platform specific objects.
==Execution Model==
Implement an `ExecutionModel` class.
==Timing==
Implement the platform methods for `CPUTimer` in `Platforms/YourPlatform/PlaformTimingLibraryCPUTimer.cpp`
==File System==
- If needed create a `FileSystemSource` compatible with your platform.
Otherwise if your operating system manages a file system for you then you can configure `FileSystemSourceFile`.
==Threading==
Need to implement:
- The platform methods for `Thread` in `Platforms/YourPlatform/PlaformThreadingLibraryThread.cpp
- The platform methods for `Mutex` in `Platforms/YourPlatform/PlaformThreadingLibraryMutex.cpp
==Graphics==
Need to implement the following:
- A `RenderTarget`
- A `Texture` as `include/echo/Platforms/YourPlatform/PlatformGraphicsLibraryTexture.h` and `src/Platforms/YourPlatform/PlatformGraphicsLibraryTexture.cpp`
==Audio==
Need to implement the following:
- Audio system
==Shell==
If you want applications to be able to execute commands via the Shell object you'll need to implement a Shell class.