| 1234567891011121314151617181920212223242526272829303132333435 |
- package karl2d
- CONFIG_RENDER_BACKEND_NAME :: #config(KARL2D_RENDER_BACKEND, "")
- when ODIN_OS == .Windows {
- DEFAULT_RENDER_BACKEND_NAME :: "d3d11"
- AVAILABLE_RENDER_BACKENDS :: "d3d11, gl"
- } else when ODIN_OS == .Linux || ODIN_OS == .Darwin {
- DEFAULT_RENDER_BACKEND_NAME :: "gl"
- AVAILABLE_RENDER_BACKENDS :: "gl"
- } else when ODIN_OS == .JS {
- DEFAULT_RENDER_BACKEND_NAME :: "webgl"
- AVAILABLE_RENDER_BACKENDS :: "webgl"
- } else {
- DEFAULT_RENDER_BACKEND_NAME :: "nil"
- AVAILABLE_RENDER_BACKENDS :: "nil"
- }
- when CONFIG_RENDER_BACKEND_NAME == "" {
- RENDER_BACKEND_NAME :: DEFAULT_RENDER_BACKEND_NAME
- } else {
- RENDER_BACKEND_NAME :: CONFIG_RENDER_BACKEND_NAME
- }
- when RENDER_BACKEND_NAME == "gl" {
- RENDER_BACKEND :: RENDER_BACKEND_GL
- } else when RENDER_BACKEND_NAME == "d3d11" {
- RENDER_BACKEND :: RENDER_BACKEND_D3D11
- } else when RENDER_BACKEND_NAME == "webgl" {
- RENDER_BACKEND :: RENDER_BACKEND_WEBGL
- } else when RENDER_BACKEND_NAME == "nil" {
- RENDER_BACKEND :: RENDER_BACKEND_NIL
- } else {
- #panic("'" + RENDER_BACKEND_NAME + "' is not a valid value for 'KARL2D_RENDER_BACKEND' on Operating System " + ODIN_OS_STRING + ". Available backends are: " + AVAILABLE_RENDER_BACKENDS)
- }
|