mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-24 16:48:18 -05:00
Cleanup.
This commit is contained in:
parent
c691521563
commit
e8a0e69097
4 changed files with 13 additions and 7 deletions
|
@ -734,6 +734,7 @@ int _main_(int _argc, char** _argv)
|
|||
|
||||
// Submit view 0.
|
||||
bgfx::setTexture(0, s_texCube, lightProbes[currentLightProbe].m_tex);
|
||||
bgfx::setTexture(1, s_texCubeIrr, lightProbes[currentLightProbe].m_texIrr);
|
||||
bgfx::setState(BGFX_STATE_RGB_WRITE|BGFX_STATE_ALPHA_WRITE);
|
||||
screenSpaceQuad( (float)width, (float)height, true);
|
||||
uniforms.submit();
|
||||
|
|
|
@ -459,7 +459,7 @@ class Wireframe : public entry::AppI
|
|||
last = now;
|
||||
const double freq = double(bx::getHPFrequency() );
|
||||
const double toMs = 1000.0/freq;
|
||||
const double deltaTimeSec = double(frameTime)/freq;
|
||||
const float deltaTimeSec = float(double(frameTime)/freq);
|
||||
|
||||
// Use m_debug font to print information about this example.
|
||||
bgfx::dbgTextClear();
|
||||
|
@ -472,7 +472,7 @@ class Wireframe : public entry::AppI
|
|||
bgfx::setViewClear(0, BGFX_CLEAR_COLOR|BGFX_CLEAR_DEPTH, 0x303030ff, 1.0f, 0);
|
||||
|
||||
const bool mouseOverGui = imguiMouseOverArea();
|
||||
m_mouse.update(m_mouseState.m_mx, m_mouseState.m_my, m_mouseState.m_mz, m_width, m_height);
|
||||
m_mouse.update(float(m_mouseState.m_mx), float(m_mouseState.m_my), m_mouseState.m_mz, m_width, m_height);
|
||||
if (!mouseOverGui)
|
||||
{
|
||||
if (m_mouseState.m_buttons[entry::MouseButton::Left])
|
||||
|
@ -497,7 +497,7 @@ class Wireframe : public entry::AppI
|
|||
bx::mtxProj(proj, 60.0f, float(m_width)/float(m_height), 0.1f, 100.0f);
|
||||
bgfx::setViewTransform(0, view, proj);
|
||||
|
||||
m_uniforms.m_drawEdges = (DrawMode::WireframeShaded == m_drawMode) ? 1.0f : 0.0;
|
||||
m_uniforms.m_drawEdges = (DrawMode::WireframeShaded == m_drawMode) ? 1.0f : 0.0f;
|
||||
m_uniforms.submit();
|
||||
|
||||
if (DrawMode::Wireframe == m_drawMode)
|
||||
|
|
|
@ -3717,7 +3717,8 @@ namespace bgfx
|
|||
{
|
||||
BGFX_CHECK_HANDLE_INVALID_OK("submit", m_programHandle, _program);
|
||||
BGFX_CHECK_HANDLE_INVALID_OK("submit", m_occlusionQueryHandle, _occlusionQuery);
|
||||
if (BX_ENABLED(BGFX_CONFIG_DEBUG_UNIFORM) )
|
||||
if (BX_ENABLED(BGFX_CONFIG_DEBUG_UNIFORM)
|
||||
&& !_preserveState)
|
||||
{
|
||||
m_uniformSet.clear();
|
||||
}
|
||||
|
@ -3739,7 +3740,8 @@ namespace bgfx
|
|||
{
|
||||
BGFX_CHECK_HANDLE_INVALID_OK("submit", m_programHandle, _handle);
|
||||
BGFX_CHECK_HANDLE("submit", m_vertexBufferHandle, _indirectHandle);
|
||||
if (BX_ENABLED(BGFX_CONFIG_DEBUG_UNIFORM) )
|
||||
if (BX_ENABLED(BGFX_CONFIG_DEBUG_UNIFORM)
|
||||
&& !_preserveState)
|
||||
{
|
||||
m_uniformSet.clear();
|
||||
}
|
||||
|
|
|
@ -791,13 +791,16 @@ namespace bgfx { namespace d3d11
|
|||
}
|
||||
#endif // USE_D3D11_DYNAMIC_LIB
|
||||
|
||||
HRESULT hr = S_OK;
|
||||
IDXGIFactory* factory = NULL;
|
||||
HRESULT hr;
|
||||
IDXGIFactory* factory;
|
||||
#if BX_PLATFORM_WINRT
|
||||
// WinRT requires the IDXGIFactory2 interface, which isn't supported on older platforms
|
||||
hr = CreateDXGIFactory1(__uuidof(IDXGIFactory2), (void**)&factory);
|
||||
#elif BX_PLATFORM_WINDOWS
|
||||
hr = CreateDXGIFactory(IID_IDXGIFactory, (void**)&factory);
|
||||
#else
|
||||
hr = S_OK;
|
||||
factory = NULL;
|
||||
#endif // BX_PLATFORM_*
|
||||
BX_WARN(SUCCEEDED(hr), "Unable to create DXGI factory.");
|
||||
if (FAILED(hr) )
|
||||
|
|
Loading…
Reference in a new issue