+++ /dev/null
-#include "stdafx.h"\r
-/*\r
-* Copyright (c) 2007-2010 SlimDX Group\r
-* \r
-* Permission is hereby granted, free of charge, to any person obtaining a copy\r
-* of this software and associated documentation files (the "Software"), to deal\r
-* in the Software without restriction, including without limitation the rights\r
-* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r
-* copies of the Software, and to permit persons to whom the Software is\r
-* furnished to do so, subject to the following conditions:\r
-* \r
-* The above copyright notice and this permission notice shall be included in\r
-* all copies or substantial portions of the Software.\r
-* \r
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
-* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
-* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r
-* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r
-* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r
-* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\r
-* THE SOFTWARE.\r
-*/\r
-\r
-#include <d3d10_1.h>\r
-\r
-#include "../dxgi/Adapter.h"\r
-\r
-#include "Device10_1.h"\r
-#include "Direct3D10Exception.h"\r
-\r
-using namespace System;\r
-using namespace SlimDX::Direct3D10;\r
-\r
-namespace SlimDX\r
-{\r
-namespace Direct3D10_1\r
-{\r
- Device1::Device1( ID3D10Device1* pointer, ComObject^ owner )\r
- : Device( pointer, owner )\r
- {\r
- }\r
- \r
- Device1::Device1( IntPtr pointer )\r
- : Device( pointer )\r
- {\r
- }\r
- \r
- Device1^ Device1::FromPointer( ID3D10Device1* pointer, ComObject^ owner, ComObjectFlags flags )\r
- {\r
- return ComObject::ConstructFromPointer<Device1,ID3D10Device1>( pointer, owner, flags );\r
- }\r
- \r
- Device1^ Device1::FromPointer( IntPtr pointer )\r
- {\r
- return ComObject::ConstructFromUserPointer<Device1>( pointer );\r
- }\r
-\r
- Device1::Device1( DeviceCreationFlags flags, SlimDX::Direct3D10_1::FeatureLevel hardwareLevel )\r
- {\r
- ID3D10Device1* device = 0;\r
- RECORD_D3D10( D3D10CreateDevice1( 0, D3D10_DRIVER_TYPE_HARDWARE, 0, static_cast<UINT>( flags ),\r
- static_cast<D3D10_FEATURE_LEVEL1>( hardwareLevel ), D3D10_1_SDK_VERSION, &device ) );\r
- if( Result::Last.IsFailure )\r
- throw gcnew Direct3D10Exception( Result::Last );\r
- \r
- Construct( device );\r
- InitializeSubclasses();\r
- }\r
- \r
- Device1::Device1( SlimDX::Direct3D10::DriverType driverType, DeviceCreationFlags flags, SlimDX::Direct3D10_1::FeatureLevel hardwareLevel )\r
- {\r
- ID3D10Device1* device = 0;\r
- RECORD_D3D10( D3D10CreateDevice1( 0, static_cast<D3D10_DRIVER_TYPE>( driverType ), 0, static_cast<UINT>( flags ),\r
- static_cast<D3D10_FEATURE_LEVEL1>( hardwareLevel ), D3D10_1_SDK_VERSION, &device ) );\r
- if( Result::Last.IsFailure )\r
- throw gcnew Direct3D10Exception( Result::Last );\r
- \r
- Construct( device );\r
- InitializeSubclasses();\r
- }\r
- \r
- Device1::Device1( DXGI::Adapter^ adapter, SlimDX::Direct3D10::DriverType driverType, DeviceCreationFlags flags, SlimDX::Direct3D10_1::FeatureLevel hardwareLevel )\r
- {\r
- IDXGIAdapter* nativeAdapter = adapter == nullptr ? 0 : adapter->InternalPointer;\r
- ID3D10Device1* device = 0;\r
- RECORD_D3D10( D3D10CreateDevice1( nativeAdapter, static_cast<D3D10_DRIVER_TYPE>( driverType ), 0,\r
- static_cast<UINT>( flags ), static_cast<D3D10_FEATURE_LEVEL1>( hardwareLevel ), D3D10_1_SDK_VERSION, &device ) );\r
- if( Result::Last.IsFailure )\r
- throw gcnew Direct3D10Exception( Result::Last );\r
- \r
- Construct( device );\r
- InitializeSubclasses();\r
- }\r
-\r
- SlimDX::Direct3D10_1::FeatureLevel Device1::FeatureLevel::get()\r
- {\r
- return static_cast<SlimDX::Direct3D10_1::FeatureLevel>( InternalPointer->GetFeatureLevel() );\r
- }\r
- \r
- Result Device1::CreateWithSwapChain( DXGI::Adapter^ adapter, SlimDX::Direct3D10::DriverType driverType, DeviceCreationFlags flags, SlimDX::Direct3D10_1::FeatureLevel hardwareLevel, DXGI::SwapChainDescription swapChainDescription, [Out] Device1^ %device, [Out] DXGI::SwapChain^ %swapChain )\r
- {\r
- IDXGIAdapter* nativeAdapter = adapter == nullptr ? 0 : adapter->InternalPointer;\r
- ID3D10Device1* resultDevice = 0;\r
- IDXGISwapChain* resultSwapChain = 0;\r
- DXGI_SWAP_CHAIN_DESC nativeDescription = swapChainDescription.CreateNativeVersion();\r
- \r
- if( RECORD_D3D10( D3D10CreateDeviceAndSwapChain1( nativeAdapter, static_cast<D3D10_DRIVER_TYPE>( driverType ),\r
- 0, static_cast<UINT>( flags ), static_cast<D3D10_FEATURE_LEVEL1>( hardwareLevel ), D3D10_1_SDK_VERSION,\r
- &nativeDescription, &resultSwapChain, &resultDevice ) ).IsSuccess )\r
- {\r
- device = FromPointer( resultDevice );\r
- swapChain = DXGI::SwapChain::FromPointer( resultSwapChain );\r
- }\r
- else\r
- {\r
- device = nullptr;\r
- swapChain = nullptr;\r
- }\r
- \r
- return Result::Last;\r
- }\r
-}\r
-}
\ No newline at end of file