OSDN Git Service

Merge branch 'feature/#36529_SlimDXからSharpDXへの移行' into develop
[dtxmania/dtxmania.git] / SlimDXc_Jun2010(VC++2008) / source / dxgi / SwapChainDxgi.cpp
diff --git a/SlimDXc_Jun2010(VC++2008)/source/dxgi/SwapChainDxgi.cpp b/SlimDXc_Jun2010(VC++2008)/source/dxgi/SwapChainDxgi.cpp
deleted file mode 100644 (file)
index 4c0533b..0000000
+++ /dev/null
@@ -1,154 +0,0 @@
-#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
-#include "DXGIException.h"\r
-\r
-#include "Factory.h"\r
-#include "FrameStatistics.h"\r
-#include "ModeDescription.h"\r
-#include "Output.h"\r
-#include "SwapChainDxgi.h"\r
-#include "SwapChainDescription.h"\r
-\r
-using namespace System;\r
-using namespace System::Reflection;\r
-using namespace System::Globalization;\r
-\r
-namespace SlimDX\r
-{\r
-namespace DXGI\r
-{      \r
-       SwapChain::SwapChain( Factory^ factory, ComObject^ device, SwapChainDescription description )\r
-       {\r
-               if( factory == nullptr )\r
-                       throw gcnew ArgumentNullException( "factory" );\r
-               if( device == nullptr )\r
-                       throw gcnew ArgumentNullException( "device" );\r
-               \r
-               IDXGISwapChain* swapChain = 0;\r
-               DXGI_SWAP_CHAIN_DESC nativeDescription = description.CreateNativeVersion();\r
-               RECORD_DXGI( factory->InternalPointer->CreateSwapChain( device->UnknownPointer, &nativeDescription, &swapChain ) );\r
-               if( Result::Last.IsFailure )\r
-                       throw gcnew DXGIException( Result::Last );\r
-               \r
-               Construct( swapChain );\r
-       }\r
-\r
-       SwapChain::~SwapChain()\r
-       {\r
-               if (InternalPointer)\r
-               {\r
-                       BOOL fullscreen = FALSE;\r
-                       HRESULT hr = InternalPointer->GetFullscreenState(&fullscreen, NULL);\r
-\r
-                       if (SUCCEEDED(hr) && fullscreen)\r
-                               throw gcnew InvalidOperationException("You may not release a swap chain in full-screen mode because doing so may create thread contention (which will cause DXGI to raise a non-continuable exception). Before releasing a swap chain, first switch to windowed mode.");\r
-               }\r
-       }\r
-       \r
-       SwapChainDescription SwapChain::Description::get()\r
-       {\r
-               DXGI_SWAP_CHAIN_DESC description;\r
-               if (RECORD_DXGI( InternalPointer->GetDesc( &description ) ).IsFailure)\r
-                       return SwapChainDescription();\r
-\r
-               return SwapChainDescription( description );\r
-       }\r
-       \r
-       DXGI::FrameStatistics SwapChain::FrameStatistics::get()\r
-       {\r
-               DXGI_FRAME_STATISTICS stats;\r
-               if (RECORD_DXGI( InternalPointer->GetFrameStatistics( &stats ) ).IsFailure)\r
-                       return DXGI::FrameStatistics();\r
-\r
-               return DXGI::FrameStatistics( stats );\r
-       }\r
-       \r
-       int SwapChain::PresentCount::get()\r
-       {\r
-               UINT result = 0;\r
-               RECORD_DXGI( InternalPointer->GetLastPresentCount( &result ) );\r
-               \r
-               return result;\r
-       }\r
-       \r
-       Output^ SwapChain::ContainingOutput::get()\r
-       {\r
-               IDXGIOutput* output = 0;\r
-               if( RECORD_DXGI( InternalPointer->GetContainingOutput( &output ) ).IsFailure )\r
-                       return nullptr;\r
-                       \r
-               return Output::FromPointer( output, this );\r
-       }\r
-\r
-       bool SwapChain::IsFullScreen::get()\r
-       {\r
-               BOOL result = FALSE;\r
-               if (RECORD_DXGI(InternalPointer->GetFullscreenState(&result, NULL)).IsFailure)\r
-                       return false;\r
-\r
-               return result > 0;\r
-       }\r
-\r
-       void SwapChain::IsFullScreen::set(bool value)\r
-       {\r
-               RECORD_DXGI(InternalPointer->SetFullscreenState(value, NULL));\r
-       }\r
-\r
-       Result SwapChain::GetFullScreenState( bool% isFullScreen, Output^% target )\r
-       {\r
-               BOOL result = false;\r
-               IDXGIOutput* output = 0;\r
-               if( RECORD_DXGI( InternalPointer->GetFullscreenState( &result, &output ) ).IsSuccess )\r
-               {\r
-                       isFullScreen = result ? true : false;\r
-                       if( output == 0 )\r
-                               target = nullptr;\r
-                       else\r
-                               target = Output::FromPointer( output, this );\r
-               }\r
-               \r
-               return Result::Last;\r
-       }\r
-       \r
-       Result SwapChain::SetFullScreenState( bool isFullScreen, Output^ target )\r
-       {\r
-               IDXGIOutput* output = target == nullptr ? 0 : target->InternalPointer;\r
-               return RECORD_DXGI( InternalPointer->SetFullscreenState( isFullScreen, output ) );\r
-       }\r
-       \r
-       Result SwapChain::ResizeBuffers( int count, int width, int height, SlimDX::DXGI::Format format, SwapChainFlags flags )\r
-       {\r
-               return RECORD_DXGI( InternalPointer->ResizeBuffers( count, width, height, static_cast<DXGI_FORMAT>( format ), static_cast<UINT>( flags ) ) );\r
-       }\r
-       \r
-       Result SwapChain::ResizeTarget( ModeDescription description )\r
-       {\r
-               return RECORD_DXGI( InternalPointer->ResizeTarget( reinterpret_cast<DXGI_MODE_DESC*>( &description ) ) );\r
-       }\r
-\r
-       Result SwapChain::Present( int syncInterval, PresentFlags flags )\r
-       {\r
-               return RECORD_DXGI( InternalPointer->Present( syncInterval, static_cast<UINT>( flags ) ) );\r
-       }\r
-}\r
-}\r