Adding WinRT platform function and setting it to use multithreaded rendering.

This commit is contained in:
Mike Popoloski 2014-11-14 08:19:33 -05:00
parent 3d662e1211
commit 0b55cb1348
4 changed files with 25 additions and 0 deletions

View File

@ -91,6 +91,16 @@ namespace bgfx
} // namespace bgfx
#elif BX_PLATFORM_WINRT
# include <Unknwn.h>
namespace bgfx
{
///
void winrtSetWindow(IUnknown* _window);
} // namespace bgfx
#endif // BX_PLATFORM_
#if defined(_SDL_H)

View File

@ -46,6 +46,13 @@ namespace bgfx
{
g_bgfxHwnd = _window;
}
#elif BX_PLATFORM_WINRT
::IUnknown* g_bgfxCoreWindow = NULL;
void winrtSetWindow(::IUnknown* _window)
{
g_bgfxCoreWindow = _window;
}
#endif // BX_PLATFORM_*
#if BGFX_CONFIG_USE_TINYSTL
@ -1386,6 +1393,10 @@ again:
{
_type = RendererType::OpenGLES;
}
else if (BX_ENABLED(BX_PLATFORM_WINRT))
{
_type = RendererType::Direct3D11;
}
else
{
_type = RendererType::OpenGL;

View File

@ -198,6 +198,8 @@ namespace bgfx
extern void* g_bgfxNSWindow;
#elif BX_PLATFORM_WINDOWS
extern ::HWND g_bgfxHwnd;
#elif BX_PLATFORM_WINRT
extern ::IUnknown* g_bgfxCoreWindow;
#endif // BX_PLATFORM_*
struct Clear

View File

@ -29,6 +29,7 @@
# ifndef BGFX_CONFIG_RENDERER_DIRECT3D11
# define BGFX_CONFIG_RENDERER_DIRECT3D11 (0 \
|| (BX_PLATFORM_WINDOWS && BX_PLATFORM_WINDOWS >= 0x0601 /*_WIN32_WINNT_WIN7*/) \
|| BX_PLATFORM_WINRT \
? 1 : 0)
# endif // BGFX_CONFIG_RENDERER_DIRECT3D11
@ -149,6 +150,7 @@
|| BX_PLATFORM_RPI \
|| BX_PLATFORM_WINDOWS \
|| BX_PLATFORM_XBOX360 \
|| BX_PLATFORM_WINRT \
? 1 : 0) )
#endif // BGFX_CONFIG_MULTITHREADED