2013-02-22 00:07:31 -05:00
|
|
|
/*
|
2014-02-11 01:07:04 -05:00
|
|
|
* Copyright 2011-2014 Branimir Karadzic. All rights reserved.
|
2013-02-22 00:07:31 -05:00
|
|
|
* License: http://www.opensource.org/licenses/BSD-2-Clause
|
|
|
|
*/
|
|
|
|
|
2013-11-14 00:54:36 -05:00
|
|
|
#ifndef BGFX_CONFIG_H_HEADER_GUARD
|
|
|
|
#define BGFX_CONFIG_H_HEADER_GUARD
|
2013-02-22 00:07:31 -05:00
|
|
|
|
2013-04-28 15:27:35 -04:00
|
|
|
#ifndef BGFX_CONFIG_DEBUG
|
|
|
|
# define BGFX_CONFIG_DEBUG 0
|
|
|
|
#endif // BGFX_CONFIG_DEBUG
|
|
|
|
|
2013-02-22 00:07:31 -05:00
|
|
|
#if !defined(BGFX_CONFIG_RENDERER_DIRECT3D9) \
|
|
|
|
&& !defined(BGFX_CONFIG_RENDERER_DIRECT3D11) \
|
|
|
|
&& !defined(BGFX_CONFIG_RENDERER_OPENGL) \
|
|
|
|
&& !defined(BGFX_CONFIG_RENDERER_OPENGLES2) \
|
|
|
|
&& !defined(BGFX_CONFIG_RENDERER_OPENGLES3) \
|
|
|
|
&& !defined(BGFX_CONFIG_RENDERER_NULL)
|
|
|
|
|
|
|
|
# ifndef BGFX_CONFIG_RENDERER_DIRECT3D9
|
|
|
|
# define BGFX_CONFIG_RENDERER_DIRECT3D9 (0 \
|
2013-10-21 23:56:23 -04:00
|
|
|
| (BX_PLATFORM_WINDOWS && BX_PLATFORM_WINDOWS < 0x0602 /*_WIN32_WINNT_WIN8*/) \
|
2013-02-22 00:07:31 -05:00
|
|
|
| BX_PLATFORM_XBOX360 \
|
|
|
|
)
|
|
|
|
# endif // BGFX_CONFIG_RENDERER_DIRECT3D9
|
|
|
|
|
|
|
|
# ifndef BGFX_CONFIG_RENDERER_DIRECT3D11
|
|
|
|
# define BGFX_CONFIG_RENDERER_DIRECT3D11 (0 \
|
2013-10-21 23:56:23 -04:00
|
|
|
| (BX_PLATFORM_WINDOWS && BX_PLATFORM_WINDOWS >= 0x0602 /*_WIN32_WINNT_WIN8*/) \
|
2013-02-22 00:07:31 -05:00
|
|
|
)
|
|
|
|
# endif // BGFX_CONFIG_RENDERER_DIRECT3D11
|
|
|
|
|
|
|
|
# ifndef BGFX_CONFIG_RENDERER_OPENGL
|
|
|
|
# define BGFX_CONFIG_RENDERER_OPENGL (0 \
|
|
|
|
| BX_PLATFORM_LINUX \
|
|
|
|
| BX_PLATFORM_OSX \
|
|
|
|
)
|
|
|
|
# endif // BGFX_CONFIG_RENDERER_OPENGL
|
|
|
|
|
|
|
|
# ifndef BGFX_CONFIG_RENDERER_OPENGLES2
|
|
|
|
# define BGFX_CONFIG_RENDERER_OPENGLES2 (0 \
|
|
|
|
| BX_PLATFORM_EMSCRIPTEN \
|
|
|
|
| BX_PLATFORM_NACL \
|
|
|
|
| BX_PLATFORM_ANDROID \
|
|
|
|
| BX_PLATFORM_IOS \
|
2013-04-13 02:43:46 -04:00
|
|
|
| BX_PLATFORM_QNX \
|
2013-02-22 00:07:31 -05:00
|
|
|
)
|
|
|
|
# endif // BGFX_CONFIG_RENDERER_OPENGLES2
|
|
|
|
|
|
|
|
# ifndef BGFX_CONFIG_RENDERER_OPENGLES3
|
|
|
|
# define BGFX_CONFIG_RENDERER_OPENGLES3 (0 \
|
|
|
|
)
|
|
|
|
# endif // BGFX_CONFIG_RENDERER_OPENGLES3
|
|
|
|
|
|
|
|
# ifndef BGFX_CONFIG_RENDERER_NULL
|
|
|
|
# define BGFX_CONFIG_RENDERER_NULL (!(0 \
|
|
|
|
| BGFX_CONFIG_RENDERER_DIRECT3D9 \
|
|
|
|
| BGFX_CONFIG_RENDERER_DIRECT3D11 \
|
|
|
|
| BGFX_CONFIG_RENDERER_OPENGL \
|
|
|
|
| BGFX_CONFIG_RENDERER_OPENGLES2 \
|
|
|
|
| BGFX_CONFIG_RENDERER_OPENGLES3 \
|
|
|
|
) )
|
|
|
|
# endif // BGFX_CONFIG_RENDERER_NULL
|
|
|
|
#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_OPENGL
|
|
|
|
# define BGFX_CONFIG_RENDERER_OPENGL 0
|
|
|
|
# endif // BGFX_CONFIG_RENDERER_OPENGL
|
|
|
|
|
|
|
|
# ifndef BGFX_CONFIG_RENDERER_OPENGLES2
|
|
|
|
# define BGFX_CONFIG_RENDERER_OPENGLES2 0
|
|
|
|
# endif // BGFX_CONFIG_RENDERER_OPENGLES2
|
|
|
|
|
|
|
|
# ifndef BGFX_CONFIG_RENDERER_OPENGLES3
|
|
|
|
# define BGFX_CONFIG_RENDERER_OPENGLES3 0
|
|
|
|
# endif // BGFX_CONFIG_RENDERER_OPENGLES3
|
|
|
|
|
|
|
|
# ifndef BGFX_CONFIG_RENDERER_NULL
|
|
|
|
# define BGFX_CONFIG_RENDERER_NULL 0
|
|
|
|
# endif // BGFX_CONFIG_RENDERER_NULL
|
|
|
|
#endif // !defined...
|
|
|
|
|
2013-12-21 00:42:24 -05:00
|
|
|
#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
|
|
|
|
|
2013-02-22 00:07:31 -05:00
|
|
|
#ifndef BGFX_CONFIG_DEBUG_PERFHUD
|
|
|
|
# define BGFX_CONFIG_DEBUG_PERFHUD 0
|
|
|
|
#endif // BGFX_CONFIG_DEBUG_NVPERFHUD
|
|
|
|
|
2013-09-09 00:03:03 -04:00
|
|
|
#ifndef BGFX_CONFIG_RENDERER_USE_EXTENSIONS
|
2014-03-19 01:50:24 -04:00
|
|
|
# define BGFX_CONFIG_RENDERER_USE_EXTENSIONS 1
|
2013-09-09 00:03:03 -04:00
|
|
|
#endif // BGFX_CONFIG_RENDERER_USE_EXTENSIONS
|
|
|
|
|
2013-02-22 00:07:31 -05:00
|
|
|
/// DX9 PIX markers
|
|
|
|
#ifndef BGFX_CONFIG_DEBUG_PIX
|
2013-06-09 18:28:25 -04:00
|
|
|
# define BGFX_CONFIG_DEBUG_PIX BGFX_CONFIG_DEBUG
|
2013-02-22 00:07:31 -05:00
|
|
|
#endif // BGFX_CONFIG_DEBUG_PIX
|
|
|
|
|
|
|
|
/// DX11 object names
|
|
|
|
#ifndef BGFX_CONFIG_DEBUG_OBJECT_NAME
|
|
|
|
# define BGFX_CONFIG_DEBUG_OBJECT_NAME BGFX_CONFIG_DEBUG
|
|
|
|
#endif // BGFX_CONFIG_DEBUG_OBJECT_NAME
|
|
|
|
|
|
|
|
#ifndef BGFX_CONFIG_MULTITHREADED
|
2014-01-13 00:43:47 -05:00
|
|
|
# define BGFX_CONFIG_MULTITHREADED ( (!BGFX_CONFIG_RENDERER_NULL)&&(0 \
|
2013-04-21 02:13:44 -04:00
|
|
|
| BX_PLATFORM_ANDROID \
|
|
|
|
| BX_PLATFORM_IOS \
|
2013-07-24 23:18:04 -04:00
|
|
|
| BX_PLATFORM_LINUX \
|
2013-04-21 02:13:44 -04:00
|
|
|
| BX_PLATFORM_NACL \
|
|
|
|
| BX_PLATFORM_OSX \
|
|
|
|
| BX_PLATFORM_QNX \
|
|
|
|
| BX_PLATFORM_WINDOWS \
|
|
|
|
| BX_PLATFORM_XBOX360 \
|
|
|
|
) )
|
2013-02-22 00:07:31 -05:00
|
|
|
#endif // BGFX_CONFIG_MULTITHREADED
|
|
|
|
|
|
|
|
#ifndef BGFX_CONFIG_MAX_DRAW_CALLS
|
2014-01-13 00:43:47 -05:00
|
|
|
# define BGFX_CONFIG_MAX_DRAW_CALLS ( (64<<10)-1)
|
2013-02-22 00:07:31 -05:00
|
|
|
#endif // BGFX_CONFIG_MAX_DRAW_CALLS
|
|
|
|
|
|
|
|
#ifndef BGFX_CONFIG_MAX_MATRIX_CACHE
|
2014-01-13 00:43:47 -05:00
|
|
|
# define BGFX_CONFIG_MAX_MATRIX_CACHE (64<<10)
|
2013-02-22 00:07:31 -05:00
|
|
|
#endif // BGFX_CONFIG_MAX_MATRIX_CACHE
|
|
|
|
|
2013-07-27 18:27:54 -04:00
|
|
|
#ifndef BGFX_CONFIG_MAX_RECT_CACHE
|
|
|
|
# define BGFX_CONFIG_MAX_RECT_CACHE 512
|
|
|
|
#endif // BGFX_CONFIG_MAX_RECT_CACHE
|
|
|
|
|
2013-02-22 00:07:31 -05:00
|
|
|
#ifndef BGFX_CONFIG_MAX_VIEWS
|
|
|
|
# define BGFX_CONFIG_MAX_VIEWS 32
|
|
|
|
#endif // BGFX_CONFIG_MAX_VIEWS
|
|
|
|
|
|
|
|
#ifndef BGFX_CONFIG_MAX_VERTEX_DECLS
|
|
|
|
# define BGFX_CONFIG_MAX_VERTEX_DECLS 64
|
|
|
|
#endif // BGFX_CONFIG_MAX_VERTEX_DECLS
|
|
|
|
|
|
|
|
#ifndef BGFX_CONFIG_MAX_INDEX_BUFFERS
|
|
|
|
# define BGFX_CONFIG_MAX_INDEX_BUFFERS (4<<10)
|
|
|
|
#endif // BGFX_CONFIG_MAX_INDEX_BUFFERS
|
|
|
|
|
|
|
|
#ifndef BGFX_CONFIG_MAX_VERTEX_BUFFERS
|
|
|
|
# define BGFX_CONFIG_MAX_VERTEX_BUFFERS (4<<10)
|
|
|
|
#endif // BGFX_CONFIG_MAX_VERTEX_BUFFERS
|
|
|
|
|
|
|
|
#ifndef BGFX_CONFIG_MAX_DYNAMIC_INDEX_BUFFERS
|
|
|
|
# define BGFX_CONFIG_MAX_DYNAMIC_INDEX_BUFFERS (4<<10)
|
|
|
|
#endif // BGFX_CONFIG_MAX_DYNAMIC_INDEX_BUFFERS
|
|
|
|
|
|
|
|
#ifndef BGFX_CONFIG_MAX_DYNAMIC_VERTEX_BUFFERS
|
|
|
|
# define BGFX_CONFIG_MAX_DYNAMIC_VERTEX_BUFFERS (4<<10)
|
|
|
|
#endif // BGFX_CONFIG_MAX_DYNAMIC_VERTEX_BUFFERS
|
|
|
|
|
|
|
|
#ifndef BGFX_CONFIG_DYNAMIC_INDEX_BUFFER_SIZE
|
|
|
|
# define BGFX_CONFIG_DYNAMIC_INDEX_BUFFER_SIZE (1<<20)
|
|
|
|
#endif // BGFX_CONFIG_DYNAMIC_INDEX_BUFFER_SIZE
|
|
|
|
|
|
|
|
#ifndef BGFX_CONFIG_DYNAMIC_VERTEX_BUFFER_SIZE
|
|
|
|
# define BGFX_CONFIG_DYNAMIC_VERTEX_BUFFER_SIZE (3<<20)
|
|
|
|
#endif // BGFX_CONFIG_DYNAMIC_VERTEX_BUFFER_SIZE
|
|
|
|
|
2014-03-29 22:42:57 -04:00
|
|
|
#ifndef BGFX_CONFIG_MAX_SHADERS
|
|
|
|
# define BGFX_CONFIG_MAX_SHADERS 512
|
2013-02-22 00:07:31 -05:00
|
|
|
#endif // BGFX_CONFIG_MAX_FRAGMENT_SHADERS
|
|
|
|
|
|
|
|
#ifndef BGFX_CONFIG_MAX_PROGRAMS
|
|
|
|
# define BGFX_CONFIG_MAX_PROGRAMS 512
|
|
|
|
#endif // BGFX_CONFIG_MAX_PROGRAMS
|
|
|
|
|
|
|
|
#ifndef BGFX_CONFIG_MAX_TEXTURES
|
|
|
|
# define BGFX_CONFIG_MAX_TEXTURES (4<<10)
|
|
|
|
#endif // BGFX_CONFIG_MAX_TEXTURES
|
|
|
|
|
2014-02-06 02:07:11 -05:00
|
|
|
#ifndef BGFX_CONFIG_MAX_FRAME_BUFFERS
|
|
|
|
# define BGFX_CONFIG_MAX_FRAME_BUFFERS 64
|
|
|
|
#endif // BGFX_CONFIG_MAX_FRAME_BUFFERS
|
|
|
|
|
|
|
|
#ifndef BGFX_CONFIG_MAX_FRAME_BUFFER_ATTACHMENTS
|
|
|
|
# define BGFX_CONFIG_MAX_FRAME_BUFFER_ATTACHMENTS 4
|
|
|
|
#endif // BGFX_CONFIG_MAX_FRAME_BUFFER_ATTACHMENTS
|
2013-02-22 00:07:31 -05:00
|
|
|
|
|
|
|
#ifndef BGFX_CONFIG_MAX_UNIFORMS
|
|
|
|
# define BGFX_CONFIG_MAX_UNIFORMS 512
|
|
|
|
#endif // BGFX_CONFIG_MAX_CONSTANTS
|
|
|
|
|
|
|
|
#ifndef BGFX_CONFIG_MAX_COMMAND_BUFFER_SIZE
|
|
|
|
# define BGFX_CONFIG_MAX_COMMAND_BUFFER_SIZE (64<<10)
|
|
|
|
#endif // BGFX_CONFIG_MAX_COMMAND_BUFFER_SIZE
|
|
|
|
|
|
|
|
#ifndef BGFX_CONFIG_TRANSIENT_VERTEX_BUFFER_SIZE
|
|
|
|
# define BGFX_CONFIG_TRANSIENT_VERTEX_BUFFER_SIZE (6<<20)
|
|
|
|
#endif // BGFX_CONFIG_TRANSIENT_VERTEX_BUFFER_SIZE
|
|
|
|
|
|
|
|
#ifndef BGFX_CONFIG_TRANSIENT_INDEX_BUFFER_SIZE
|
|
|
|
# define BGFX_CONFIG_TRANSIENT_INDEX_BUFFER_SIZE (2<<20)
|
|
|
|
#endif // BGFX_CONFIG_TRANSIENT_INDEX_BUFFER_SIZE
|
|
|
|
|
|
|
|
#ifndef BGFX_CONFIG_MAX_CONSTANT_BUFFER_SIZE
|
|
|
|
# define BGFX_CONFIG_MAX_CONSTANT_BUFFER_SIZE (512<<10)
|
|
|
|
#endif // BGFX_CONFIG_MAX_CONSTANT_BUFFER_SIZE
|
|
|
|
|
|
|
|
#ifndef BGFX_CONFIG_USE_TINYSTL
|
2013-09-23 00:40:17 -04:00
|
|
|
# define BGFX_CONFIG_USE_TINYSTL 1
|
2013-02-22 00:07:31 -05:00
|
|
|
#endif // BGFX_CONFIG_USE_TINYSTL
|
|
|
|
|
|
|
|
#ifndef BGFX_CONFIG_MAX_INSTANCE_DATA_COUNT
|
|
|
|
# define BGFX_CONFIG_MAX_INSTANCE_DATA_COUNT 5
|
|
|
|
#endif // BGFX_CONFIG_MAX_INSTANCE_DATA_COUNT
|
|
|
|
|
2013-03-23 19:02:34 -04:00
|
|
|
#ifndef BGFX_CONFIG_CLEAR_QUAD
|
|
|
|
# define BGFX_CONFIG_CLEAR_QUAD (BGFX_CONFIG_RENDERER_DIRECT3D11|BGFX_CONFIG_RENDERER_OPENGL)
|
|
|
|
#endif // BGFX_CONFIG_CLEAR_QUAD
|
|
|
|
|
2013-11-14 00:54:36 -05:00
|
|
|
#endif // BGFX_CONFIG_H_HEADER_GUARD
|