Fixed MinGW compile errors.

This commit is contained in:
bkaradzic
2012-06-02 18:57:44 -07:00
parent 50a6e41549
commit 8bac68fe7f
4 changed files with 31 additions and 14 deletions

View File

@@ -8,7 +8,7 @@ project "bgfx"
} }
buildoptions { buildoptions {
"-Wall", -- "-Wall",
} }
defines { defines {

View File

@@ -174,6 +174,13 @@ namespace bgfx
return _offset+align-(_offset%align); return _offset+align-(_offset%align);
} }
BX_FORCE_INLINE uint32_t castfi(float _value)
{
union { float fl; uint32_t ui; } un;
un.fl = _value;
return un.ui;
}
void dump(const VertexDecl& _decl); void dump(const VertexDecl& _decl);
struct TextVideoMem struct TextVideoMem

View File

@@ -108,13 +108,13 @@ namespace bgfx
struct RendererContext struct RendererContext
{ {
RendererContext() RendererContext()
: m_initialized(false) : m_flags(BGFX_RESET_NONE)
, m_initialized(false)
, m_fmtNULL(false) , m_fmtNULL(false)
, m_fmtDF16(false) , m_fmtDF16(false)
, m_fmtDF24(false) , m_fmtDF24(false)
, m_fmtINTZ(false) , m_fmtINTZ(false)
, m_fmtRAWZ(false) , m_fmtRAWZ(false)
, m_flags(BGFX_RESET_NONE)
, m_rtMsaa(false) , m_rtMsaa(false)
{ {
m_rt.idx = invalidHandle; m_rt.idx = invalidHandle;
@@ -1693,8 +1693,7 @@ namespace bgfx
if ( (BGFX_STATE_PT_POINTS|BGFX_STATE_POINT_SIZE_MASK) & changedFlags) if ( (BGFX_STATE_PT_POINTS|BGFX_STATE_POINT_SIZE_MASK) & changedFlags)
{ {
float pointSize = (float)( (newFlags&BGFX_STATE_POINT_SIZE_MASK)>>BGFX_STATE_POINT_SIZE_SHIFT); DX_CHECK(s_renderCtx.m_device->SetRenderState(D3DRS_POINTSIZE, castfi( (float)( (newFlags&BGFX_STATE_POINT_SIZE_MASK)>>BGFX_STATE_POINT_SIZE_SHIFT) ) ) );
DX_CHECK(s_renderCtx.m_device->SetRenderState(D3DRS_POINTSIZE, *( (DWORD*)&pointSize) ) );
} }
#if BX_PLATFORM_WINDOWS #if BX_PLATFORM_WINDOWS

View File

@@ -90,15 +90,26 @@ namespace bgfx
# define PIX_ENDEVENT() # define PIX_ENDEVENT()
#endif // BGFX_CONFIG_DEBUG_PIX #endif // BGFX_CONFIG_DEBUG_PIX
#define DX_RELEASE(_ptr, _expected) \ #if BGFX_CONFIG_DEBUG
do { \ # define DX_RELEASE(_ptr, _expected) \
if (NULL != _ptr) \ do { \
{ \ if (NULL != _ptr) \
ULONG count = _ptr->Release(); \ { \
BX_CHECK(_expected == count, "RefCount is %d (expected %d).", count, _expected); \ ULONG count = _ptr->Release(); \
_ptr = NULL; \ BX_CHECK(_expected == count, "RefCount is %d (expected %d).", count, _expected); \
} \ _ptr = NULL; \
} while (0) } \
} while (0)
#else
# define DX_RELEASE(_ptr, _expected) \
do { \
if (NULL != _ptr) \
{ \
_ptr->Release(); \
_ptr = NULL; \
} \
} while (0)
#endif // BGFX_CONFIG_DEBUG
struct Msaa struct Msaa
{ {