From 0f86204daa4fa28b4762f30e621e7d8819c8fc63 Mon Sep 17 00:00:00 2001 From: Garett Bass Date: Tue, 26 Feb 2013 18:17:20 -0800 Subject: [PATCH 1/2] Fix conflict between sal.h and MinGW STL Moved #include after #include to avoid conflicts between sal.h and MinGW STL usage of __in and __out as function parameters. --- src/bgfx_p.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/bgfx_p.h b/src/bgfx_p.h index 76222bd4..e4bd57d9 100755 --- a/src/bgfx_p.h +++ b/src/bgfx_p.h @@ -66,13 +66,6 @@ extern void dbgPrintfData(const void* _data, uint32_t _size, const char* _format #include #include -#if BX_PLATFORM_WINDOWS -# include -#elif BX_PLATFORM_XBOX360 -# include -# include -#endif // BX_PLATFORM_* - #include "dds.h" #define BGFX_CHUNK_MAGIC_FSH BX_MAKEFOURCC('F', 'S', 'H', 0x1) @@ -107,6 +100,13 @@ namespace stl { #endif // BGFX_CONFIG_USE_TINYSTL #include +#if BX_PLATFORM_WINDOWS +# include +#elif BX_PLATFORM_XBOX360 +# include +# include +#endif // BX_PLATFORM_* + #include "config.h" #include From 295059564e92e1dc45aea99506713170f1d3f68e Mon Sep 17 00:00:00 2001 From: Garett Bass Date: Tue, 26 Feb 2013 18:54:03 -0800 Subject: [PATCH 2/2] Fix MSVC warnings renderer_d3d11.cpp(615): warning C4389: '==' : signed/unsigned mismatch renderer_d3d11.cpp(1100): warning C4189: 'deviceCtx' : local variable is initialized but not referenced --- src/renderer_d3d11.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/renderer_d3d11.cpp b/src/renderer_d3d11.cpp index 6a87a6e0..6ebcac06 100644 --- a/src/renderer_d3d11.cpp +++ b/src/renderer_d3d11.cpp @@ -592,7 +592,7 @@ namespace bgfx } D3D11_INPUT_ELEMENT_DESC* elem = fillVertexDecl(vertexElements, Attrib::Count, decl); - ptrdiff_t num = elem-vertexElements; + uint32_t num = uint32_t(elem-vertexElements); const D3D11_INPUT_ELEMENT_DESC inst = { "TEXCOORD", 0, DXGI_FORMAT_R32G32B32A32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_INSTANCE_DATA, 1 }; @@ -602,7 +602,7 @@ namespace bgfx uint32_t jj; D3D11_INPUT_ELEMENT_DESC* curr; - for (jj = 0; jj < (uint32_t)num; ++jj) + for (jj = 0; jj < num; ++jj) { curr = &vertexElements[jj]; if (0 == strcmp(curr->SemanticName, "TEXCOORD") @@ -624,9 +624,9 @@ namespace bgfx curr->AlignedByteOffset = ii*16; } - num = elem-vertexElements; + num = uint32_t(elem-vertexElements); DX_CHECK(m_device->CreateInputLayout(vertexElements - , uint32_t(num) + , num , _program.m_vsh->m_code->data , _program.m_vsh->m_code->size , &layout @@ -1097,8 +1097,6 @@ namespace bgfx void ConstantBuffer::commit() { - ID3D11DeviceContext* deviceCtx = s_renderCtx.m_deviceCtx; - reset(); do