MCPcopy Create free account
hub / github.com/OGRECave/ogre-next / validateDevice

Method validateDevice

RenderSystems/Direct3D11/src/OgreD3D11RenderSystem.cpp:1761–1793  ·  view source on GitHub ↗

---------------------------------------------------------------------

Source from the content-addressed store, hash-verified

1759 }
1760 //---------------------------------------------------------------------
1761 bool D3D11RenderSystem::validateDevice( bool forceDeviceElection )
1762 {
1763 if( mDevice.isNull() )
1764 return false;
1765
1766 // The D3D Device is no longer valid if the elected adapter changes or if
1767 // the device has been removed.
1768
1769 bool anotherIsElected = false;
1770 if( forceDeviceElection )
1771 {
1772 // elect new device
1773 D3D11Driver *newDriver = getDirect3DDrivers( true )->findByName( mDriverName );
1774
1775 // check by LUID
1776 LUID newLUID = newDriver->getAdapterIdentifier().AdapterLuid;
1777 LUID prevLUID = mActiveD3DDriver.getAdapterIdentifier().AdapterLuid;
1778 anotherIsElected =
1779 ( newLUID.LowPart != prevLUID.LowPart ) || ( newLUID.HighPart != prevLUID.HighPart );
1780#if OGRE_DEBUG_MODE >= OGRE_DEBUG_HIGH
1781 anotherIsElected = true; // simulate switching device
1782#endif
1783 }
1784
1785 if( anotherIsElected || mDevice.IsDeviceLost() )
1786 {
1787 handleDeviceLost();
1788
1789 return !mDevice.IsDeviceLost();
1790 }
1791
1792 return true;
1793 }
1794 //---------------------------------------------------------------------
1795 VertexElementType D3D11RenderSystem::getColourVertexElementType() const { return VET_COLOUR_ABGR; }
1796 //---------------------------------------------------------------------

Callers 3

_fireFrameStartedMethod · 0.80
keyReleasedMethod · 0.80

Calls 3

findByNameMethod · 0.80
IsDeviceLostMethod · 0.80
isNullMethod · 0.45

Tested by

no test coverage detected