OSDN Git Service

Merge branch 'feature/#36529_SlimDXからSharpDXへの移行' into develop
[dtxmania/dtxmania.git] / SlimDXc_Jun2010(VC++2008) / source / direct3d11 / EffectVectorVariable11.cpp
diff --git a/SlimDXc_Jun2010(VC++2008)/source/direct3d11/EffectVectorVariable11.cpp b/SlimDXc_Jun2010(VC++2008)/source/direct3d11/EffectVectorVariable11.cpp
deleted file mode 100644 (file)
index 2371d7b..0000000
+++ /dev/null
@@ -1,169 +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 <d3dx11effect.h>\r
-\r
-#include "Direct3D11Exception.h"\r
-\r
-#include "EffectVectorVariable11.h"\r
-\r
-using namespace System;\r
-\r
-namespace SlimDX\r
-{\r
-namespace Direct3D11\r
-{ \r
-       EffectVectorVariable::EffectVectorVariable( ID3DX11EffectVectorVariable* pointer )\r
-       : EffectVariable( pointer )\r
-       {\r
-               m_Pointer = pointer;\r
-       }\r
-       \r
-       EffectVectorVariable::EffectVectorVariable( IntPtr pointer )\r
-       : EffectVariable( pointer )\r
-       {\r
-               m_Pointer = reinterpret_cast<ID3DX11EffectVectorVariable*>( pointer.ToPointer() );\r
-       }\r
-\r
-       Result EffectVectorVariable::Set( Vector2 value )\r
-       {\r
-               return RECORD_D3D11( m_Pointer->SetFloatVector( reinterpret_cast<float*>( &value ) ) );\r
-       }\r
-\r
-       Result EffectVectorVariable::Set( Vector3 value )\r
-       {\r
-               return RECORD_D3D11( m_Pointer->SetFloatVector( reinterpret_cast<float*>( &value ) ) );\r
-       }\r
-       \r
-       Result EffectVectorVariable::Set( Vector4 value )\r
-       {\r
-               return RECORD_D3D11( m_Pointer->SetFloatVector( reinterpret_cast<float*>( &value ) ) );\r
-       }\r
-\r
-       Result EffectVectorVariable::Set( Color4 value )\r
-       {\r
-               return RECORD_D3D11( m_Pointer->SetFloatVector( reinterpret_cast<float*>( &value ) ) );\r
-       }\r
-       \r
-       Result EffectVectorVariable::Set( array<Vector4>^ values )\r
-       {\r
-               pin_ptr<Vector4> pinnedValues = &values[0];\r
-               return RECORD_D3D11( m_Pointer->SetFloatVectorArray( reinterpret_cast<float*>( pinnedValues ), 0, values->Length ) );\r
-       }\r
-\r
-       Result EffectVectorVariable::Set( array<Color4>^ value )\r
-       {\r
-               pin_ptr<Color4> pinnedValue = &value[0];\r
-               return RECORD_D3D11( m_Pointer->SetFloatVectorArray( reinterpret_cast<float*>( pinnedValue ), 0, value->Length ) );\r
-       }\r
-       \r
-       Result EffectVectorVariable::Set( array<int>^ value )\r
-       {\r
-               if( value->Length % 4 != 0 )\r
-                       throw gcnew ArgumentException( "The length of the array must be a multiple of four." );\r
-                       \r
-               pin_ptr<int> pinnedValue = &value[0];\r
-               return RECORD_D3D11( m_Pointer->SetIntVectorArray( reinterpret_cast<int*>( pinnedValue ), 0, value->Length / 4 ) );\r
-       }\r
-       \r
-       Result EffectVectorVariable::Set( array<bool>^ value )\r
-       {\r
-               if( value->Length % 4 != 0 )\r
-                       throw gcnew ArgumentException( "The length of the array must be a multiple of four." );\r
-                       \r
-               pin_ptr<bool> pinnedValue = &value[0];\r
-               return RECORD_D3D11( m_Pointer->SetBoolVectorArray( reinterpret_cast<BOOL*>( pinnedValue ), 0, value->Length / 4 ) );\r
-       }\r
-\r
-       Vector4 EffectVectorVariable::GetVector()\r
-       {\r
-               Vector4 result;\r
-\r
-               HRESULT hr = m_Pointer->GetFloatVector(reinterpret_cast<float*>(&result));\r
-               if (RECORD_D3D11(hr).IsFailure)\r
-                       return Vector4::Zero;\r
-\r
-               return result;\r
-       }\r
-\r
-       Color4 EffectVectorVariable::GetColor()\r
-       {\r
-               Color4 result;\r
-\r
-               HRESULT hr = m_Pointer->GetFloatVector(reinterpret_cast<float*>(&result));\r
-               if (RECORD_D3D11(hr).IsFailure)\r
-                       return Color4(0, 0, 0, 0);\r
-\r
-               return result;\r
-       }\r
-\r
-       array<Vector4>^ EffectVectorVariable::GetVectorArray(int count)\r
-       {\r
-               array<Vector4>^ result = gcnew array<Vector4>(count);\r
-               pin_ptr<Vector4> pinnedResult = &result[0];\r
-\r
-               HRESULT hr = m_Pointer->GetFloatVectorArray(reinterpret_cast<float*>(pinnedResult), 0, count);\r
-               if (RECORD_D3D11(hr).IsFailure)\r
-                       return nullptr;\r
-\r
-               return result;\r
-       }\r
-\r
-       array<Color4>^ EffectVectorVariable::GetColorArray(int count)\r
-       {\r
-               array<Color4>^ result = gcnew array<Color4>(count);\r
-               pin_ptr<Color4> pinnedResult = &result[0];\r
-\r
-               HRESULT hr = m_Pointer->GetFloatVectorArray(reinterpret_cast<float*>(pinnedResult), 0, count);\r
-               if (RECORD_D3D11(hr).IsFailure)\r
-                       return nullptr;\r
-\r
-               return result;\r
-       }\r
-\r
-       array<bool>^ EffectVectorVariable::GetBoolVectorArray(int count)\r
-       {\r
-               array<int>^ result = gcnew array<int>(count * 4);\r
-               pin_ptr<int> pinnedResult = &result[0];\r
-\r
-               HRESULT hr = m_Pointer->GetBoolVectorArray(reinterpret_cast<BOOL*>(pinnedResult), 0, count);\r
-               if (RECORD_D3D11(hr).IsFailure)\r
-                       return nullptr;\r
-\r
-               return Array::ConvertAll<int, bool>(result, gcnew Converter<int, bool>(Convert::ToBoolean));\r
-       }\r
-\r
-       array<int>^ EffectVectorVariable::GetIntVectorArray(int count)\r
-       {\r
-               array<int>^ result = gcnew array<int>(count * 4);\r
-               pin_ptr<int> pinnedResult = &result[0];\r
-\r
-               HRESULT hr = m_Pointer->GetIntVectorArray(reinterpret_cast<BOOL*>(pinnedResult), 0, count);\r
-               if (RECORD_D3D11(hr).IsFailure)\r
-                       return nullptr;\r
-\r
-               return result;\r
-       }\r
-}\r
-}\r