Added shared library support.
This commit is contained in:
parent
b176ad42c1
commit
4b5159394c
@ -253,16 +253,38 @@ typedef enum bgfx_fatal
|
|||||||
|
|
||||||
} bgfx_fatal_t;
|
} bgfx_fatal_t;
|
||||||
|
|
||||||
|
#ifndef BGFX_SHARED_LIB_BUILD
|
||||||
|
# define BGFX_SHARED_LIB_BUILD 0
|
||||||
|
#endif // BGFX_SHARED_LIB_BUILD
|
||||||
|
|
||||||
|
#ifndef BGFX_SHARED_LIB_USE
|
||||||
|
# define BGFX_SHARED_LIB_USE 0
|
||||||
|
#endif // BGFX_SHARED_LIB_USE
|
||||||
|
|
||||||
#if defined(_MSC_VER)
|
#if defined(_MSC_VER)
|
||||||
# define BGFX_VTBL_CALL __stdcall
|
# define BGFX_VTBL_CALL __stdcall
|
||||||
# define BGFX_VTBL_THIS // passed via ecx
|
# define BGFX_VTBL_THIS // passed via ecx
|
||||||
# define BGFX_VTBL_THIS_ // passed via ecx
|
# define BGFX_VTBL_THIS_ // passed via ecx
|
||||||
|
# if BGFX_SHARED_LIB_BUILD
|
||||||
|
# define BGFX_SHARED_LIB_API __declspec(dllexport)
|
||||||
|
# elif BGFX_SHARED_LIB_USE
|
||||||
|
# define BGFX_SHARED_LIB_API __declspec(dllimport)
|
||||||
|
# else
|
||||||
|
# define BGFX_SHARED_LIB_API
|
||||||
|
# endif // BGFX_SHARED_LIB_*
|
||||||
#else
|
#else
|
||||||
# define BGFX_VTBL_CALL _cdecl
|
# define BGFX_VTBL_CALL
|
||||||
# define BGFX_VTBL_THIS BGFX_VTBL_INTEFRACE _this
|
# define BGFX_VTBL_THIS BGFX_VTBL_INTEFRACE _this
|
||||||
# define BGFX_VTBL_THIS_ BGFX_VTBL_INTEFRACE _this,
|
# define BGFX_VTBL_THIS_ BGFX_VTBL_INTEFRACE _this,
|
||||||
|
# define BGFX_SHARED_LIB_API
|
||||||
#endif // defined(_MSC_VER)
|
#endif // defined(_MSC_VER)
|
||||||
|
|
||||||
|
#if defined(__cplusplus)
|
||||||
|
# define BGFX_C_API extern "C" BGFX_SHARED_LIB_API
|
||||||
|
#else
|
||||||
|
# define BGFX_C_API BGFX_SHARED_LIB_API
|
||||||
|
#endif // defined(__cplusplus)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
typedef struct bgfx_callback_interface
|
typedef struct bgfx_callback_interface
|
||||||
@ -355,12 +377,6 @@ typedef struct bgfx_reallocator_vtbl
|
|||||||
|
|
||||||
} bgfx_reallocator_vtbl_t;
|
} bgfx_reallocator_vtbl_t;
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
|
||||||
# define BGFX_C_API extern "C"
|
|
||||||
#else
|
|
||||||
# define BGFX_C_API
|
|
||||||
#endif // defined(__cplusplus)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Start vertex declaration.
|
* Start vertex declaration.
|
||||||
*/
|
*/
|
||||||
@ -1283,6 +1299,4 @@ BGFX_C_API void bgfx_discard();
|
|||||||
*/
|
*/
|
||||||
BGFX_C_API void bgfx_save_screen_shot(const char* _filePath);
|
BGFX_C_API void bgfx_save_screen_shot(const char* _filePath);
|
||||||
|
|
||||||
#undef BGFX_C_API
|
|
||||||
|
|
||||||
#endif // BGFX_C99_H_HEADER_GUARD
|
#endif // BGFX_C99_H_HEADER_GUARD
|
||||||
|
@ -53,3 +53,55 @@ project "bgfx"
|
|||||||
}
|
}
|
||||||
|
|
||||||
copyLib()
|
copyLib()
|
||||||
|
|
||||||
|
project "bgfx-shared-lib"
|
||||||
|
uuid "09986168-e9d9-11e3-9c8e-f2aef940a72a"
|
||||||
|
kind "SharedLib"
|
||||||
|
|
||||||
|
includedirs {
|
||||||
|
BGFX_DIR .. "../bx/include",
|
||||||
|
}
|
||||||
|
|
||||||
|
defines {
|
||||||
|
"BGFX_SHARED_LIB_BUILD=1",
|
||||||
|
-- "BGFX_CONFIG_RENDERER_OPENGL=1",
|
||||||
|
}
|
||||||
|
|
||||||
|
configuration { "Debug" }
|
||||||
|
defines {
|
||||||
|
"BGFX_CONFIG_DEBUG=1",
|
||||||
|
}
|
||||||
|
|
||||||
|
configuration { "windows" }
|
||||||
|
includedirs {
|
||||||
|
"$(DXSDK_DIR)/include",
|
||||||
|
}
|
||||||
|
|
||||||
|
configuration { "osx or ios*" }
|
||||||
|
files {
|
||||||
|
BGFX_DIR .. "src/**.mm",
|
||||||
|
}
|
||||||
|
|
||||||
|
configuration { "vs* or linux or mingw or osx or ios*" }
|
||||||
|
includedirs {
|
||||||
|
--nacl has GLES2 headers modified...
|
||||||
|
BGFX_DIR .. "3rdparty/khronos",
|
||||||
|
}
|
||||||
|
|
||||||
|
configuration {}
|
||||||
|
|
||||||
|
includedirs {
|
||||||
|
BGFX_DIR .. "include",
|
||||||
|
}
|
||||||
|
|
||||||
|
files {
|
||||||
|
BGFX_DIR .. "include/**.h",
|
||||||
|
BGFX_DIR .. "src/**.cpp",
|
||||||
|
BGFX_DIR .. "src/**.h",
|
||||||
|
}
|
||||||
|
|
||||||
|
excludes {
|
||||||
|
BGFX_DIR .. "src/**.bin.h",
|
||||||
|
}
|
||||||
|
|
||||||
|
copyLib()
|
||||||
|
@ -2619,8 +2619,6 @@ BX_STATIC_ASSERT(sizeof(bgfx::TransientVertexBuffer) == sizeof(bgfx_transient_ve
|
|||||||
BX_STATIC_ASSERT(sizeof(bgfx::InstanceDataBuffer) == sizeof(bgfx_instance_data_buffer_t) );
|
BX_STATIC_ASSERT(sizeof(bgfx::InstanceDataBuffer) == sizeof(bgfx_instance_data_buffer_t) );
|
||||||
BX_STATIC_ASSERT(sizeof(bgfx::TextureInfo) == sizeof(bgfx_texture_info_t) );
|
BX_STATIC_ASSERT(sizeof(bgfx::TextureInfo) == sizeof(bgfx_texture_info_t) );
|
||||||
|
|
||||||
#define BGFX_C_API extern "C"
|
|
||||||
|
|
||||||
BGFX_C_API void bgfx_vertex_decl_begin(bgfx_vertex_decl_t* _decl, bgfx_renderer_type_t _renderer)
|
BGFX_C_API void bgfx_vertex_decl_begin(bgfx_vertex_decl_t* _decl, bgfx_renderer_type_t _renderer)
|
||||||
{
|
{
|
||||||
bgfx::VertexDecl* decl = (bgfx::VertexDecl*)_decl;
|
bgfx::VertexDecl* decl = (bgfx::VertexDecl*)_decl;
|
||||||
|
Loading…
Reference in New Issue
Block a user