forked from godotengine/godot
-
Notifications
You must be signed in to change notification settings - Fork 2
Porting Godot 4: Core
c08oprkiua edited this page Jun 11, 2024
·
1 revision
When porting Godot 4 to a platform, there are several specific things to note about Godot is set up:
- The file
platform_config.h
for your platform gets included very early in compilation (it's included incore/typedefs.h
, which is one of the first things compiled in thecore
folder, the first thing to be compiled), meaning you can patch basically any part of the engine where patching may be needed without actually editing engine code to do so. Keep in mind that, since it is included intypedefs.h
, due to how preprocessor parsing works, this means that the actual code (particularly macros) present intypedefs.h
will not be "visible" toplatform_config.h
, so you may need to copy those into yourplatform_config.h
file or any subsequent files included therein. - There are several folders in your platform folder that have special exemptions in their use; Unlike most platform code, which exists to sit between the engine and the platform, some folders in all platform folders get compiled regardless on the target platform being compiled, because they contain special code about that platform that needs to be compiled regardless of target:
-
platform/{your platform}/export
contains code for your platform's Export Plugin. This is covered more on the dedicated page about export code, but to explain briefly, this is code for making your platform show up in the in-engine Export options. -
platform/{your platform}/api
contains code for platform specific APIs, if you would like to have those to access special features for your platform (for example, Xbox Live features, if you were to make an Xbox One/Series port, or amiibo functionality, for a Nintendo Switch port).
-
-
platform_config.h
in the base of your platform's code folder. - It seems that Godot expects some sort of allocation header, eg.
<alloca.h>
, to be included inplatform_config.h
- Compile-able code in
export
andapi
, if you have code in those folders.
-
api
itself is optional, since not all platforms need it. -
export
may be optional (citation needed), but without it your platform will not be visible from the editor.
- 2.x
- 3.x
- Nintendo Wii
- 3.5 for Nintendo Switch
- 3.5 for Playstation Vita
- 4.x
- *New* Nintendo 3DS
- 4.2 for Nintendo Wii U
- Nintendo Switch