+++ /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 <d3d11.h>\r
-\r
-#include "RasterizerStateDescription11.h"\r
-\r
-namespace SlimDX\r
-{\r
-namespace Direct3D11\r
-{ \r
- RasterizerStateDescription::RasterizerStateDescription( const D3D11_RASTERIZER_DESC& native )\r
- {\r
- m_FillMode = static_cast<Direct3D11::FillMode>( native.FillMode );\r
- m_CullMode = static_cast<Direct3D11::CullMode>( native.CullMode );\r
- m_FrontCounterClockwise = native.FrontCounterClockwise ? true : false;\r
- m_DepthBias = native.DepthBias;\r
- m_DepthBiasClamp = native.DepthBiasClamp;\r
- m_SlopeScaledDepthBias = native.SlopeScaledDepthBias;\r
- m_DepthClipEnable = native.DepthClipEnable ? true : false;\r
- m_ScissorEnable = native.ScissorEnable ? true : false;\r
- m_MultisampleEnable = native.MultisampleEnable ? true : false;\r
- m_AntialiasedLineEnable = native.AntialiasedLineEnable ? true : false;\r
- }\r
- \r
- D3D11_RASTERIZER_DESC RasterizerStateDescription::CreateNativeVersion()\r
- {\r
- D3D11_RASTERIZER_DESC native;\r
- native.FillMode = static_cast<D3D11_FILL_MODE>( m_FillMode );\r
- native.CullMode = static_cast<D3D11_CULL_MODE>( m_CullMode );\r
- native.FrontCounterClockwise = m_FrontCounterClockwise;\r
- native.DepthBias = m_DepthBias;\r
- native.DepthBiasClamp = m_DepthBiasClamp;\r
- native.SlopeScaledDepthBias = m_SlopeScaledDepthBias;\r
- native.DepthClipEnable = m_DepthClipEnable;\r
- native.ScissorEnable = m_ScissorEnable;\r
- native.MultisampleEnable = m_MultisampleEnable;\r
- native.AntialiasedLineEnable = m_AntialiasedLineEnable;\r
- \r
- return native;\r
- }\r
- \r
- Direct3D11::FillMode RasterizerStateDescription::FillMode::get()\r
- {\r
- return m_FillMode;\r
- }\r
- \r
- void RasterizerStateDescription::FillMode::set( Direct3D11::FillMode value )\r
- {\r
- m_FillMode = value; \r
- }\r
- \r
- Direct3D11::CullMode RasterizerStateDescription::CullMode::get()\r
- {\r
- return m_CullMode;\r
- }\r
- \r
- void RasterizerStateDescription::CullMode::set( Direct3D11::CullMode value )\r
- {\r
- m_CullMode = value; \r
- }\r
- \r
- bool RasterizerStateDescription::IsFrontCounterclockwise::get()\r
- {\r
- return m_FrontCounterClockwise;\r
- }\r
- \r
- void RasterizerStateDescription::IsFrontCounterclockwise::set( bool value )\r
- {\r
- m_FrontCounterClockwise = value; \r
- }\r
- \r
- int RasterizerStateDescription::DepthBias::get()\r
- {\r
- return m_DepthBias;\r
- }\r
- \r
- void RasterizerStateDescription::DepthBias::set( int value )\r
- {\r
- m_DepthBias = value; \r
- }\r
- \r
- float RasterizerStateDescription::DepthBiasClamp::get()\r
- {\r
- return m_DepthBiasClamp;\r
- }\r
- \r
- void RasterizerStateDescription::DepthBiasClamp::set( float value )\r
- {\r
- m_DepthBiasClamp = value; \r
- }\r
- \r
- float RasterizerStateDescription::SlopeScaledDepthBias::get()\r
- {\r
- return m_SlopeScaledDepthBias;\r
- }\r
- \r
- void RasterizerStateDescription::SlopeScaledDepthBias::set( float value )\r
- {\r
- m_SlopeScaledDepthBias = value; \r
- }\r
- \r
- bool RasterizerStateDescription::IsDepthClipEnabled::get()\r
- {\r
- return m_DepthClipEnable;\r
- }\r
- \r
- void RasterizerStateDescription::IsDepthClipEnabled::set( bool value )\r
- {\r
- m_DepthClipEnable = value; \r
- }\r
- \r
- bool RasterizerStateDescription::IsScissorEnabled::get()\r
- {\r
- return m_ScissorEnable;\r
- }\r
- \r
- void RasterizerStateDescription::IsScissorEnabled::set( bool value )\r
- {\r
- m_ScissorEnable = value; \r
- }\r
- \r
- bool RasterizerStateDescription::IsMultisampleEnabled::get()\r
- {\r
- return m_MultisampleEnable;\r
- }\r
- \r
- void RasterizerStateDescription::IsMultisampleEnabled::set( bool value )\r
- {\r
- m_MultisampleEnable = value; \r
- }\r
- \r
- bool RasterizerStateDescription::IsAntialiasedLineEnabled::get()\r
- {\r
- return m_AntialiasedLineEnable;\r
- }\r
- \r
- void RasterizerStateDescription::IsAntialiasedLineEnabled::set( bool value )\r
- {\r
- m_AntialiasedLineEnable = value; \r
- }\r
-\r
- bool RasterizerStateDescription::operator == ( RasterizerStateDescription left, RasterizerStateDescription right )\r
- {\r
- return RasterizerStateDescription::Equals( left, right );\r
- }\r
-\r
- bool RasterizerStateDescription::operator != ( RasterizerStateDescription left, RasterizerStateDescription right )\r
- {\r
- return !RasterizerStateDescription::Equals( left, right );\r
- }\r
-\r
- int RasterizerStateDescription::GetHashCode()\r
- {\r
- return m_FillMode.GetHashCode() + m_CullMode.GetHashCode() + m_FrontCounterClockwise.GetHashCode()\r
- + m_DepthBias.GetHashCode() + m_DepthBiasClamp.GetHashCode() + m_SlopeScaledDepthBias.GetHashCode()\r
- + m_DepthClipEnable.GetHashCode() + m_ScissorEnable.GetHashCode() + m_MultisampleEnable.GetHashCode()\r
- + m_AntialiasedLineEnable.GetHashCode();\r
- }\r
-\r
- bool RasterizerStateDescription::Equals( Object^ value )\r
- {\r
- if( value == nullptr )\r
- return false;\r
-\r
- if( value->GetType() != GetType() )\r
- return false;\r
-\r
- return Equals( safe_cast<RasterizerStateDescription>( value ) );\r
- }\r
-\r
- bool RasterizerStateDescription::Equals( RasterizerStateDescription value )\r
- {\r
- return ( m_FillMode == value.m_FillMode && m_CullMode == value.m_CullMode && m_FrontCounterClockwise == value.m_FrontCounterClockwise\r
- && m_DepthBias == value.m_DepthBias && m_DepthBiasClamp == value.m_DepthBiasClamp && m_SlopeScaledDepthBias == value.m_SlopeScaledDepthBias\r
- && m_DepthClipEnable == value.m_DepthClipEnable && m_ScissorEnable == value.m_ScissorEnable && m_MultisampleEnable == value.m_MultisampleEnable\r
- && m_AntialiasedLineEnable == value.m_AntialiasedLineEnable );\r
- }\r
-\r
- bool RasterizerStateDescription::Equals( RasterizerStateDescription% value1, RasterizerStateDescription% value2 )\r
- {\r
- return ( value1.m_FillMode == value2.m_FillMode && value1.m_CullMode == value2.m_CullMode && value1.m_FrontCounterClockwise == value2.m_FrontCounterClockwise\r
- && value1.m_DepthBias == value2.m_DepthBias && value1.m_DepthBiasClamp == value2.m_DepthBiasClamp && value1.m_SlopeScaledDepthBias == value2.m_SlopeScaledDepthBias\r
- && value1.m_DepthClipEnable == value2.m_DepthClipEnable && value1.m_ScissorEnable == value2.m_ScissorEnable && value1.m_MultisampleEnable == value2.m_MultisampleEnable\r
- && value1.m_AntialiasedLineEnable == value2.m_AntialiasedLineEnable );\r
- }\r
-}\r
-}\r