Documentation: engine-porting-guide: finalize document

This commit is contained in:
Alibek Omarov 2019-11-24 02:31:48 +03:00
parent bf9840c2a8
commit 2e180d5548
1 changed files with 20 additions and 8 deletions

View File

@ -54,6 +54,18 @@ If you got anything compiling, it's nice time to make a commit. Commit your chan
4) Here is most interesting, building the client part.
If you have SDL for your platform, you can use it and everything will be simple for you. If you don't have SDL 2.0, we have limited SDL1.2 support which is enabled with `--enable-legacy-sdl` passed to `waf configure`.
There are three possible situations for you, by increasing difficulty.
To be continued...
1. Do you have SDL2 for your platform? If yes, go ahead and compile engine with client part enabled.
2. Do you have SDL1.2 for your platform? If yes, try to compile it, but SDL1.2 support is very limited and not tested well.
3. You don't have SDL and you can't port it for some reason by yourself or SDL port just don't stable for your platform? Then you need to implement an engine backend.
How to implement engine backend? Well, we have a backends system that was introduced in Old Engine. It's simply two files: backends.h and defaults.h in `common` folder in repository root. You will need to add a macros for your backends in `backends.h` and define a logic in `defaults.h`. We have already have some, check them out, as they may be handy for you.
Once you did it, go back to `platform` directory and open `platform.h` headers. Create new subdirectory in `platform` folder and start implementing missing platform-specific backends one by one. I can't explain this as for obvious reasons it's too specific. You can use macros you defined before in `build.h` to check that you're compiling for your platform and `backends.h` macros to check if platform-specific backend must be enabled.
As you finished, compile engine, fix errors and commit your changes and push to repository.
Remember, if something doesn't work and you can't figure out why, you can join our Discord server at discord.me/fwgs. Ping me (@a1batross) or other engine developer and attach link to your repository, so we can discuss and help you in porting.