2 * Copyright (c) 2007-2010 SlimDX Group
\r
4 * Permission is hereby granted, free of charge, to any person obtaining a copy
\r
5 * of this software and associated documentation files (the "Software"), to deal
\r
6 * in the Software without restriction, including without limitation the rights
\r
7 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
\r
8 * copies of the Software, and to permit persons to whom the Software is
\r
9 * furnished to do so, subject to the following conditions:
\r
11 * The above copyright notice and this permission notice shall be included in
\r
12 * all copies or substantial portions of the Software.
\r
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
\r
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
\r
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
\r
17 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
\r
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
\r
19 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
\r
24 #include "Direct3D11Exception.h"
\r
25 #include "Debug11.h"
\r
26 #include "Device11.h"
\r
27 #include "DeviceContext11.h"
\r
29 using namespace System;
\r
33 namespace Direct3D11
\r
35 Debug::Debug( Device^ device )
\r
37 if( device == nullptr )
\r
38 throw gcnew ArgumentNullException( "device" );
\r
41 if( RECORD_D3D11( device->InternalPointer->QueryInterface( IID_ID3D11Debug, &result ) ).IsFailure )
\r
42 throw gcnew Direct3D11Exception( Result::Last );
\r
44 Construct( reinterpret_cast<ID3D11Debug*>( result ) );
\r
47 DebugFeatureFlags Debug::FeatureFlags::get()
\r
49 UINT flags = InternalPointer->GetFeatureMask();
\r
50 return static_cast<DebugFeatureFlags>( flags );
\r
53 void Debug::FeatureFlags::set( DebugFeatureFlags value )
\r
55 RECORD_D3D11( InternalPointer->SetFeatureMask( static_cast<UINT>( value ) ) );
\r
58 int Debug::PresentDelay::get()
\r
60 return InternalPointer->GetPresentPerRenderOpDelay();
\r
63 void Debug::PresentDelay::set( int value )
\r
65 RECORD_D3D11( InternalPointer->SetPresentPerRenderOpDelay( value ) );
\r
68 DXGI::SwapChain^ Debug::SwapChain::get()
\r
70 IDXGISwapChain* swapChain = 0;
\r
71 if( RECORD_D3D11( InternalPointer->GetSwapChain( &swapChain ) ).IsFailure )
\r
74 return DXGI::SwapChain::FromPointer( swapChain );
\r
77 void Debug::SwapChain::set( DXGI::SwapChain^ value )
\r
79 RECORD_D3D11( InternalPointer->SetSwapChain( value->InternalPointer ) );
\r
82 Result Debug::ValidateContext(DeviceContext^ context)
\r
84 HRESULT hr = InternalPointer->ValidateContext(context->InternalPointer);
\r
85 return RECORD_D3D11(hr);
\r
88 Result Debug::ValidateContextForDispatch(DeviceContext^ context)
\r
90 HRESULT hr = InternalPointer->ValidateContextForDispatch(context->InternalPointer);
\r
91 return RECORD_D3D11(hr);
\r
94 Result Debug::ReportLiveDeviceObjects(ReportingLevel level)
\r
96 HRESULT hr = InternalPointer->ReportLiveDeviceObjects(static_cast<D3D11_RLDO_FLAGS>(level));
\r
97 return RECORD_D3D11(hr);
\r