package karl2d

when ODIN_OS == .Windows {
	DEFAULT_RENDER_BACKEND :: RENDER_BACKEND_INTERFACE_D3D11
} else when ODIN_OS == .Linux || ODIN_OS == .Darwin {
	DEFAULT_RENDER_BACKEND :: RENDER_BACKEND_INTERFACE_GL
} else when ODIN_OS == .JS {
	//DEFAULT_RENDER_BACKEND :: RENDER_BACKEND_INTERFACE_WEBGL
} else when ODIN_OS == .Freestanding {
	DEFAULT_RENDER_BACKEND :: RENDER_BACKEND_NIL
}

CUSTOM_RENDER_BACKEND_STR :: #config(KARL2D_RENDER_BACKEND, "")

when CUSTOM_RENDER_BACKEND_STR != "" {
	when CUSTOM_RENDER_BACKEND_STR == "gl" {
		RENDER_BACKEND :: RENDER_BACKEND_INTERFACE_GL
	} else when CUSTOM_RENDER_BACKEND_STR == "d3d11" {
		RENDER_BACKEND :: RENDER_BACKEND_INTERFACE_D3D11
	} else when CUSTOM_RENDER_BACKEND_STR == "nil" {
		RENDER_BACKEND :: RENDER_BACKEND_NIL
	} else {
		#panic(CUSTOM_RENDER_BACKEND_STR + " is not a valid value for KARL2D_RENDER_BACKEND. Available backends are: gl, d3d11")
		//RENDER_BACKEND :: DEFAULT_RENDER_BACKEND
	}
} else {
	RENDER_BACKEND :: DEFAULT_RENDER_BACKEND
}