/* * Copyright 2011-2018 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause */ #ifndef BGFX_CONFIG_H_HEADER_GUARD #define BGFX_CONFIG_H_HEADER_GUARD #include #ifndef BGFX_CONFIG_DEBUG # define BGFX_CONFIG_DEBUG 0 #endif // BGFX_CONFIG_DEBUG #if !defined(BGFX_CONFIG_RENDERER_DIRECT3D9) \ && !defined(BGFX_CONFIG_RENDERER_DIRECT3D11) \ && !defined(BGFX_CONFIG_RENDERER_DIRECT3D12) \ && !defined(BGFX_CONFIG_RENDERER_METAL) \ && !defined(BGFX_CONFIG_RENDERER_OPENGL) \ && !defined(BGFX_CONFIG_RENDERER_OPENGLES) \ && !defined(BGFX_CONFIG_RENDERER_VULKAN) \ && !defined(BGFX_CONFIG_RENDERER_GNM) # ifndef BGFX_CONFIG_RENDERER_DIRECT3D9 # define BGFX_CONFIG_RENDERER_DIRECT3D9 (0 \ || BX_PLATFORM_WINDOWS \ ? 1 : 0) # endif // BGFX_CONFIG_RENDERER_DIRECT3D9 # ifndef BGFX_CONFIG_RENDERER_DIRECT3D11 # define BGFX_CONFIG_RENDERER_DIRECT3D11 (0 \ || BX_PLATFORM_WINDOWS \ || BX_PLATFORM_WINRT \ || BX_PLATFORM_XBOXONE \ ? 1 : 0) # endif // BGFX_CONFIG_RENDERER_DIRECT3D11 # ifndef BGFX_CONFIG_RENDERER_DIRECT3D12 # define BGFX_CONFIG_RENDERER_DIRECT3D12 (0 \ || BX_PLATFORM_WINDOWS \ || BX_PLATFORM_WINRT \ || BX_PLATFORM_XBOXONE \ ? 1 : 0) # endif // BGFX_CONFIG_RENDERER_DIRECT3D12 # ifndef BGFX_CONFIG_RENDERER_METAL # define BGFX_CONFIG_RENDERER_METAL (0 \ || (BX_PLATFORM_IOS && BX_CPU_ARM) \ || (BX_PLATFORM_OSX >= 101100) \ ? 1 : 0) # endif // BGFX_CONFIG_RENDERER_METAL # ifndef BGFX_CONFIG_RENDERER_OPENGL # define BGFX_CONFIG_RENDERER_OPENGL (0 \ || BX_PLATFORM_BSD \ || BX_PLATFORM_LINUX \ || BX_PLATFORM_OSX \ || BX_PLATFORM_WINDOWS \ ? 1 : 0) # endif // BGFX_CONFIG_RENDERER_OPENGL # ifndef BGFX_CONFIG_RENDERER_OPENGLES # define BGFX_CONFIG_RENDERER_OPENGLES (0 \ || BX_PLATFORM_ANDROID \ || BX_PLATFORM_EMSCRIPTEN \ || BX_PLATFORM_IOS \ || BX_PLATFORM_RPI \ || BX_PLATFORM_STEAMLINK \ || BX_PLATFORM_NX \ ? 1 : 0) # endif // BGFX_CONFIG_RENDERER_OPENGLES # ifndef BGFX_CONFIG_RENDERER_VULKAN # define BGFX_CONFIG_RENDERER_VULKAN (0 \ || BX_PLATFORM_ANDROID \ || BX_PLATFORM_LINUX \ || BX_PLATFORM_WINDOWS \ || BX_PLATFORM_NX \ ? 1 : 0) # endif // BGFX_CONFIG_RENDERER_VULKAN # ifndef BGFX_CONFIG_RENDERER_GNM # define BGFX_CONFIG_RENDERER_GNM (0 \ || BX_PLATFORM_PS4 \ ? 1 : 0) # endif // BGFX_CONFIG_RENDERER_GNM #else # ifndef BGFX_CONFIG_RENDERER_DIRECT3D9 # define BGFX_CONFIG_RENDERER_DIRECT3D9 0 # endif // BGFX_CONFIG_RENDERER_DIRECT3D9 # ifndef BGFX_CONFIG_RENDERER_DIRECT3D11 # define BGFX_CONFIG_RENDERER_DIRECT3D11 0 # endif // BGFX_CONFIG_RENDERER_DIRECT3D11 # ifndef BGFX_CONFIG_RENDERER_DIRECT3D12 # define BGFX_CONFIG_RENDERER_DIRECT3D12 0 # endif // BGFX_CONFIG_RENDERER_DIRECT3D12 # ifndef BGFX_CONFIG_RENDERER_METAL # define BGFX_CONFIG_RENDERER_METAL 0 # endif // BGFX_CONFIG_RENDERER_METAL # ifndef BGFX_CONFIG_RENDERER_OPENGL # define BGFX_CONFIG_RENDERER_OPENGL 0 # endif // BGFX_CONFIG_RENDERER_OPENGL # ifndef BGFX_CONFIG_RENDERER_OPENGLES # define BGFX_CONFIG_RENDERER_OPENGLES 0 # endif // BGFX_CONFIG_RENDERER_OPENGLES # ifndef BGFX_CONFIG_RENDERER_VULKAN # define BGFX_CONFIG_RENDERER_VULKAN 0 # endif // BGFX_CONFIG_RENDERER_VULKAN # ifndef BGFX_CONFIG_RENDERER_GNM # define BGFX_CONFIG_RENDERER_GNM 0 # endif // BGFX_CONFIG_RENDERER_GNM #endif // !defined... #if BGFX_CONFIG_RENDERER_OPENGL && BGFX_CONFIG_RENDERER_OPENGL < 21 # undef BGFX_CONFIG_RENDERER_OPENGL # define BGFX_CONFIG_RENDERER_OPENGL 21 #endif // BGFX_CONFIG_RENDERER_OPENGL && BGFX_CONFIG_RENDERER_OPENGL < 21 #if BGFX_CONFIG_RENDERER_OPENGLES && BGFX_CONFIG_RENDERER_OPENGLES < 20 # undef BGFX_CONFIG_RENDERER_OPENGLES # define BGFX_CONFIG_RENDERER_OPENGLES 20 #endif // BGFX_CONFIG_RENDERER_OPENGLES && BGFX_CONFIG_RENDERER_OPENGLES < 20 #if BGFX_CONFIG_RENDERER_OPENGL && BGFX_CONFIG_RENDERER_OPENGLES # error "Can't define both BGFX_CONFIG_RENDERER_OPENGL and BGFX_CONFIG_RENDERER_OPENGLES" #endif // BGFX_CONFIG_RENDERER_OPENGL && BGFX_CONFIG_RENDERER_OPENGLES /// Enable use of extensions. #ifndef BGFX_CONFIG_RENDERER_USE_EXTENSIONS # define BGFX_CONFIG_RENDERER_USE_EXTENSIONS 1 #endif // BGFX_CONFIG_RENDERER_USE_EXTENSIONS /// Enable use of tinystl. #ifndef BGFX_CONFIG_USE_TINYSTL # define BGFX_CONFIG_USE_TINYSTL 1 #endif // BGFX_CONFIG_USE_TINYSTL /// Enable nVidia PerfHUD integration. #ifndef BGFX_CONFIG_DEBUG_PERFHUD # define BGFX_CONFIG_DEBUG_PERFHUD 0 #endif // BGFX_CONFIG_DEBUG_NVPERFHUD /// Enable PIX markers. #ifndef BGFX_CONFIG_DEBUG_PIX # define BGFX_CONFIG_DEBUG_PIX BGFX_CONFIG_DEBUG #endif // BGFX_CONFIG_DEBUG_PIX /// Enable DX11 object names. #ifndef BGFX_CONFIG_DEBUG_OBJECT_NAME # define BGFX_CONFIG_DEBUG_OBJECT_NAME BGFX_CONFIG_DEBUG #endif // BGFX_CONFIG_DEBUG_OBJECT_NAME /// Enable Metal markers. #ifndef BGFX_CONFIG_DEBUG_MTL # define BGFX_CONFIG_DEBUG_MTL BGFX_CONFIG_DEBUG #endif // BGFX_CONFIG_DEBUG_MTL /// Enable uniform debug checks. #ifndef BGFX_CONFIG_DEBUG_UNIFORM # define BGFX_CONFIG_DEBUG_UNIFORM BGFX_CONFIG_DEBUG #endif // BGFX_CONFIG_DEBUG_UNIFORM /// Enable occlusion debug checks. #ifndef BGFX_CONFIG_DEBUG_OCCLUSION # define BGFX_CONFIG_DEBUG_OCCLUSION BGFX_CONFIG_DEBUG #endif // BGFX_CONFIG_DEBUG_OCCLUSION #ifndef BGFX_CONFIG_MULTITHREADED # define BGFX_CONFIG_MULTITHREADED ( (0 == BX_PLATFORM_EMSCRIPTEN) ? 1 : 0) #endif // BGFX_CONFIG_MULTITHREADED #ifndef BGFX_CONFIG_MAX_DRAW_CALLS # define BGFX_CONFIG_MAX_DRAW_CALLS ( (64<<10)-1) #endif // BGFX_CONFIG_MAX_DRAW_CALLS #ifndef BGFX_CONFIG_MAX_BLIT_ITEMS # define BGFX_CONFIG_MAX_BLIT_ITEMS (1<<10) #endif // BGFX_CONFIG_MAX_BLIT_ITEMS #ifndef BGFX_CONFIG_MAX_MATRIX_CACHE # define BGFX_CONFIG_MAX_MATRIX_CACHE (BGFX_CONFIG_MAX_DRAW_CALLS+1) #endif // BGFX_CONFIG_MAX_MATRIX_CACHE #ifndef BGFX_CONFIG_MAX_RECT_CACHE # define BGFX_CONFIG_MAX_RECT_CACHE (4<<10) #endif // BGFX_CONFIG_MAX_RECT_CACHE #ifndef BGFX_CONFIG_SORT_KEY_NUM_BITS_DEPTH # define BGFX_CONFIG_SORT_KEY_NUM_BITS_DEPTH 32 #endif // BGFX_CONFIG_SORT_KEY_NUM_BITS_DEPTH #ifndef BGFX_CONFIG_SORT_KEY_NUM_BITS_SEQ # define BGFX_CONFIG_SORT_KEY_NUM_BITS_SEQ 20 #endif // BGFX_CONFIG_SORT_KEY_NUM_BITS_SEQ #ifndef BGFX_CONFIG_SORT_KEY_NUM_BITS_PROGRAM # define BGFX_CONFIG_SORT_KEY_NUM_BITS_PROGRAM 9 #endif // BGFX_CONFIG_SORT_KEY_NUM_BITS_PROGRAM // Cannot be configured via compiler options. #define BGFX_CONFIG_MAX_PROGRAMS (1<