Update PORTING.md

This commit is contained in:
Dethrace Engineering Department 2022-03-21 12:14:17 +13:00 committed by GitHub
parent 7e14a97692
commit 26e766b92f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

@ -6,7 +6,7 @@ See: xxx
Assuming an operating system called _foo_, follow the steps to add support for it.
1. Add a new file `os/foo.h` and implement the required functions defined in `os.h`:
1. Add a new file `os/foo.h` and implement the required functions defined in [os.h](https://github.com/dethrace-labs/dethrace/blob/main/src/harness/include/harness/os.h):
- `OS_GetTime`
- `OS_Sleep`
- `OS_Basename`
@ -32,18 +32,18 @@ target_sources(harness PRIVATE
An `IOPlatform` in _dethrace_ implements windowing and input handling, and points to a _renderer_.
The default IO platform is `SDL_OpenGL`, which uses SDL for windowing and input, and OpenGL for rendering. See `io_platforms/sdl_gl.c`.
The default IO platform is `SDL_OpenGL`, which uses SDL for windowing and input, and OpenGL for rendering. See [io_platforms/sdl_gl.c](https://github.com/dethrace-labs/dethrace/blob/main/src/harness/io_platforms/sdl_gl.c).
To add a new `IOPlatform`:
1. Create `io_platforms/my_platform.c` file and implement the required functions defined in `io_platform.h`:
1. Create `io_platforms/my_platform.c` file and implement the required functions defined in [io_platforms/io_platform.h](https://github.com/dethrace-labs/dethrace/blob/main/src/harness/io_platforms/io_platform.h):
- `Window_Create`
- `Window_PollEvents`
- `Window_Swap`
- `Input_GetKeyMap`
- `Input_IsKeyDown`
`Window_Create` returns a `tRenderer*`, which must implement the interface defined in `renderers/renderer.h`. See `renderers/gl` for an example.
`Window_Create` returns a `tRenderer*`, which must implement the interface defined in [renderers/renderer.h](https://github.com/dethrace-labs/dethrace/blob/main/src/harness/renderers/renderer.h). See [renderers/gl](https://github.com/dethrace-labs/dethrace/tree/main/src/harness/renderers/gl) for an example.
2. Add a new conditional section in `src/harness/CMakeLists.txt` for your new platform