This commit is contained in:
Branimir Karadžić 2016-01-15 21:59:02 -08:00
parent 5e061f4395
commit 42a8fdd95d
4 changed files with 14 additions and 2 deletions

View File

@ -6,7 +6,7 @@
#ifndef BGFX_DEFINES_H_HEADER_GUARD
#define BGFX_DEFINES_H_HEADER_GUARD
#define BGFX_API_VERSION UINT32_C(3)
#define BGFX_API_VERSION UINT32_C(4)
///
#define BGFX_STATE_RGB_WRITE UINT64_C(0x0000000000000001) //!< Enable RGB write.

View File

@ -60,14 +60,20 @@ namespace bgfx
///
void setPlatformData(const PlatformData& _data);
/// Internal data.
///
/// @attention C99 equivalent is `bgfx_internal_data_t`.
///
struct InternalData
{
const struct Caps* caps; //!< Renderer capabilities.
void* context; //!< GL context, or D3D device.
};
/// Get internal data for interop.
///
/// @warning Must be called only on render thread.
///
/// @attention C99 equivalent is `bgfx_get_internal_data`.
///
const InternalData* getInternalData();

View File

@ -45,6 +45,7 @@ BGFX_C_API void bgfx_set_platform_data(const bgfx_platform_data_t* _data);
typedef struct bgfx_internal_data
{
const struct bgfx_caps* caps;
void* context;
} bgfx_internal_data_t;

View File

@ -310,6 +310,7 @@ namespace bgfx
const InternalData* getInternalData()
{
BGFX_CHECK_RENDER_THREAD();
return &g_internalData;
}
@ -1223,6 +1224,8 @@ namespace bgfx
frame();
}
g_internalData.caps = getCaps();
return true;
}
@ -1269,6 +1272,7 @@ namespace bgfx
m_render->destroy();
#endif // BGFX_CONFIG_MULTITHREADED
memset(&g_internalData, 0, sizeof(InternalData) );
s_ctx = NULL;
m_submit->destroy();
@ -3510,6 +3514,7 @@ BX_STATIC_ASSERT(sizeof(bgfx::InstanceDataBuffer) == sizeof(bgfx_instance_dat
BX_STATIC_ASSERT(sizeof(bgfx::TextureInfo) == sizeof(bgfx_texture_info_t) );
BX_STATIC_ASSERT(sizeof(bgfx::Caps) == sizeof(bgfx_caps_t) );
BX_STATIC_ASSERT(sizeof(bgfx::PlatformData) == sizeof(bgfx_platform_data_t) );
BX_STATIC_ASSERT(sizeof(bgfx::InternalData) == sizeof(bgfx_internal_data_t) );
namespace bgfx
{