OSDN Git Service

Merge branch 'feature/#36529_SlimDXからSharpDXへの移行' into develop
[dtxmania/dtxmania.git] / SlimDXc_Jun2010(VC++2008) / source / direct3d11 / InputAssemblerWrapper11.cpp
diff --git a/SlimDXc_Jun2010(VC++2008)/source/direct3d11/InputAssemblerWrapper11.cpp b/SlimDXc_Jun2010(VC++2008)/source/direct3d11/InputAssemblerWrapper11.cpp
deleted file mode 100644 (file)
index 36c1741..0000000
+++ /dev/null
@@ -1,142 +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
-\r
-#include <d3d11.h>\r
-#include <d3dx11.h>\r
-\r
-#include "Buffer11.h"\r
-#include "InputAssemblerWrapper11.h"\r
-#include "InputLayout11.h"\r
-\r
-using namespace System;\r
-\r
-namespace SlimDX\r
-{\r
-namespace Direct3D11\r
-{ \r
-       InputAssemblerWrapper::InputAssemblerWrapper( ID3D11DeviceContext* device )\r
-       {\r
-               if( device == 0 )\r
-                       throw gcnew ArgumentNullException( "device" );\r
-               deviceContext = device;\r
-       }\r
-\r
-       Direct3D11::InputLayout^ InputAssemblerWrapper::InputLayout::get()\r
-       {\r
-               ID3D11InputLayout *layout;\r
-               deviceContext->IAGetInputLayout( &layout );\r
-\r
-               return layout == NULL ? nullptr : Direct3D11::InputLayout::FromPointer( layout );\r
-       }\r
-\r
-       void InputAssemblerWrapper::InputLayout::set( Direct3D11::InputLayout^ value )\r
-       {\r
-               if( value == nullptr )\r
-                       deviceContext->IASetInputLayout( 0 );\r
-               else\r
-                       deviceContext->IASetInputLayout( value->InternalPointer );\r
-       }\r
-\r
-       Direct3D11::PrimitiveTopology InputAssemblerWrapper::PrimitiveTopology::get()\r
-       {\r
-               D3D11_PRIMITIVE_TOPOLOGY topo;\r
-               deviceContext->IAGetPrimitiveTopology( &topo );\r
-\r
-               return static_cast<Direct3D11::PrimitiveTopology>( topo );\r
-       }\r
-       \r
-       void InputAssemblerWrapper::PrimitiveTopology::set( Direct3D11::PrimitiveTopology value )\r
-       {\r
-               deviceContext->IASetPrimitiveTopology( static_cast<D3D11_PRIMITIVE_TOPOLOGY>( value ) );\r
-       }\r
-       \r
-       void InputAssemblerWrapper::SetIndexBuffer( Buffer^ indexBuffer, DXGI::Format format, int offset )\r
-       {\r
-               if( indexBuffer == nullptr )\r
-               {\r
-                       deviceContext->IASetIndexBuffer( 0, DXGI_FORMAT_UNKNOWN, 0 );\r
-               }\r
-               else\r
-               {\r
-                       deviceContext->IASetIndexBuffer( static_cast<ID3D11Buffer*>( indexBuffer->InternalPointer ), static_cast<DXGI_FORMAT>( format ), offset );\r
-               }\r
-       }\r
-\r
-       void InputAssemblerWrapper::GetIndexBuffer( [Out] Buffer^ %indexBuffer, [Out] DXGI::Format %format, [Out] int %offset )\r
-       {\r
-               ID3D11Buffer *buffer;\r
-               DXGI_FORMAT nativeFormat;\r
-               UINT nativeOffset;\r
-\r
-               deviceContext->IAGetIndexBuffer( &buffer, &nativeFormat, &nativeOffset );\r
-\r
-               indexBuffer = Buffer::FromPointer( buffer );\r
-               format = static_cast<DXGI::Format>( nativeFormat );\r
-               offset = nativeOffset;\r
-       }\r
-       \r
-       void InputAssemblerWrapper::SetVertexBuffers( int slot, VertexBufferBinding vertexBufferBinding )\r
-       {\r
-               ID3D11Buffer* buffers[] = { static_cast<ID3D11Buffer*>( vertexBufferBinding.Buffer == nullptr ? 0 : vertexBufferBinding.Buffer->InternalPointer ) };\r
-               UINT strides[] = { vertexBufferBinding.Stride };\r
-               UINT offsets[] = { vertexBufferBinding.Offset };\r
-               \r
-               deviceContext->IASetVertexBuffers( slot, 1, buffers, strides, offsets );\r
-       }\r
-       \r
-       void InputAssemblerWrapper::SetVertexBuffers( int firstSlot, ... array<VertexBufferBinding>^ vertexBufferBinding )\r
-       {\r
-               ID3D11Buffer* buffers[D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT];\r
-               UINT strides[D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT];\r
-               UINT offsets[D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT];\r
-               \r
-               for( int i = 0; i < vertexBufferBinding->Length; ++i )\r
-               {\r
-                       buffers[i] = vertexBufferBinding[ i ].Buffer == nullptr ? 0 : static_cast<ID3D11Buffer*>( vertexBufferBinding[ i ].Buffer->InternalPointer );\r
-                       strides[i] = vertexBufferBinding[ i ].Stride;\r
-                       offsets[i] = vertexBufferBinding[ i ].Offset;\r
-               }\r
-               \r
-               deviceContext->IASetVertexBuffers( firstSlot, vertexBufferBinding->Length, buffers, strides, offsets );\r
-       }\r
-\r
-       array<VertexBufferBinding>^ InputAssemblerWrapper::GetVertexBuffers( int firstSlot, int count )\r
-       {\r
-               ID3D11Buffer* buffers[D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT];\r
-               UINT strides[D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT];\r
-               UINT offsets[D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT];\r
-               array<VertexBufferBinding>^ results = gcnew array<VertexBufferBinding>( count );\r
-               \r
-               deviceContext->IAGetVertexBuffers( firstSlot, count, buffers, strides, offsets );\r
-\r
-               for( int i = 0; i < count; ++i )\r
-               {\r
-                       results[i].Buffer = buffers[i] == NULL ? nullptr : Buffer::FromPointer( buffers[i] );\r
-                       results[i].Stride = strides[i];\r
-                       results[i].Offset = offsets[i];\r
-               }\r
-\r
-               return results;\r
-       }\r
-}\r
-}\r