mirror of
https://github.com/bkaradzic/bgfx.git
synced 2026-02-19 05:23:00 +01:00
Added ability to select GPU.
This commit is contained in:
@@ -1977,7 +1977,7 @@ again:
|
||||
return s_rendererCreator[_type].name;
|
||||
}
|
||||
|
||||
void init(RendererType::Enum _type, CallbackI* _callback, bx::ReallocatorI* _allocator)
|
||||
void init(RendererType::Enum _type, uint16_t _vendorId, uint16_t _deviceId, CallbackI* _callback, bx::ReallocatorI* _allocator)
|
||||
{
|
||||
BX_CHECK(NULL == s_ctx, "bgfx is already initialized.");
|
||||
BX_TRACE("Init...");
|
||||
@@ -1989,6 +1989,8 @@ again:
|
||||
g_caps.maxViews = BGFX_CONFIG_MAX_VIEWS;
|
||||
g_caps.maxDrawCalls = BGFX_CONFIG_MAX_DRAW_CALLS;
|
||||
g_caps.maxFBAttachments = 1;
|
||||
g_caps.vendorId = _vendorId;
|
||||
g_caps.deviceId = _deviceId;
|
||||
|
||||
if (NULL != _allocator)
|
||||
{
|
||||
@@ -3015,6 +3017,8 @@ BGFX_C_API const char* bgfx_get_renderer_name(bgfx_renderer_type_t _type)
|
||||
BGFX_C_API void bgfx_init(bgfx_renderer_type_t _type, struct bgfx_callback_interface* _callback, struct bgfx_reallocator_interface* _allocator)
|
||||
{
|
||||
return bgfx::init(bgfx::RendererType::Enum(_type)
|
||||
, BGFX_PCI_ID_NONE
|
||||
, 0
|
||||
, reinterpret_cast<bgfx::CallbackI*>(_callback)
|
||||
, reinterpret_cast<bx::ReallocatorI*>(_allocator)
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user