2023-09-20 07:44:02 -04:00
Although ClassiCube strives to be as platform independent as possible, in some cases it will need to use system specific code
For instance:
* Texture creation for 3D graphics rendering
* Buffer allocation for audio output
* High resolution time measurement
* Window creation
For simplicity, related system specific code is grouped together as a Module (e.g. `Audio` ), which can then be implemented using a backend (e.g. `WinMM` , `OpenAL` , `OpenSL ES` , etc)
#### Note: By default, ClassiCube automatically selects the recommended backends for the system. <br> It is recommended that you do *NOT* change the backends unless you know exactly what you are doing.
2024-12-23 03:38:54 -05:00
Some systems may provide multiple potential backends for a Module. For example on Windows:
2023-09-20 07:44:02 -04:00
* OpenGL could be used instead of Direct3D 9 for the 3D rendering backend
* SDL could be used instead of the native WinAPI for the window backend
2023-06-09 09:25:21 -04:00
2023-06-08 08:15:37 -04:00
TODO finish this
2023-06-09 09:25:21 -04:00
TODO introduction (explaining platform specific modules, and how classicube has to integrate with one of them)
2023-06-08 08:15:37 -04:00
2023-09-20 07:44:02 -04:00
There are two ways of changing the backend that gets used for the system:
2024-12-23 03:38:54 -05:00
1) Changing the default defines in `Core.h`
2) Using additional compilation flags to override default module backend(s)
3) Adding `-DCC_BUILD_MANUAL` to compilation flags and then manually defining all module backends via additional compilation flags
2023-06-08 08:15:37 -04:00
2023-06-12 04:59:22 -04:00
When manually compiling the source code, 1) is usually the easiest. < br >
For automated scripts compiling every single commit, 2) is the recommended approach
2023-09-20 07:44:02 -04:00
TODO: Move this into table
2023-06-12 04:59:22 -04:00
2024-12-23 03:38:54 -05:00
### 3D Graphics backends (`CC_GFX_BACKEND`)
* CC_GFX_BACKEND_SOFTGPU - Software rasteriser
* CC_GFX_BACKEND_D3D9 - Direct3D 9
* CC_GFX_BACKEND_D3D11 - Direct3D 11
* CC_GFX_BACKEND_GL1 - OpenGL 1.2/1.5
* CC_GFX_BACKEND_GL2 - OpenGL 2 (shaders)
2023-06-12 04:59:22 -04:00
The OpenGL backend can be further customised:
2024-12-23 03:38:54 -05:00
* CC_BUILD_GL11 (must be using CC_GFX_BACKEND_GL1)
* CC_BUILD_GLES (must be using CC_GFX_BACKEND_GL2)
2023-06-08 08:15:37 -04:00
2023-06-12 04:59:22 -04:00
### OpenGL context backends
2023-06-09 09:25:21 -04:00
* CC_BUILD_EGL
* CC_BUILD_WGL
2023-06-08 08:15:37 -04:00
2024-12-23 03:38:54 -05:00
### HTTP backends (`CC_NET_BACKEND`)
* CC_NET_BACKEND_BUILTIN - custom HTTP client
* CC_NET_BACKEND_LIBCURL
2023-06-09 09:25:21 -04:00
* CC_BUILD_CFNETWORK
2024-12-23 03:38:54 -05:00
### SSL backends (`CC_SSL_BACKEND`)
* CC_SSL_BACKEND_NONE
* CC_SSL_BACKEND_BEARSSL
* CC_SSL_BACKEND_SCHANNEL
2023-06-08 08:15:37 -04:00
2024-12-23 03:38:54 -05:00
### Window backends (`CC_WIN_BACKEND`)
* CC_WIN_BACKEND_TERMINAL
* CC_WIN_BACKEND_SDL2
* CC_WIN_BACKEND_SDL3
* CC_WIN_BACKEND_X11
* CC_WIN_BACKEND_WIN32
### Audio backends (`CC_AUD_BACKEND`)
* CC_AUD_BACKEND_OPENAL
* CC_AUD_BACKEND_WINMM
* CC_AUD_BACKEND_OPENSLES
2023-06-08 08:15:37 -04:00
2023-06-12 04:59:22 -04:00
### Platform backends
2023-06-09 09:25:21 -04:00
* CC_BUILD_POSIX
* CC_BUILD_WIN
2023-06-08 08:15:37 -04:00
2024-12-23 03:38:54 -05:00
TODO fill in rest