Esempio n. 1
0
        public RasterizerStateDesc(RasterizerStateTypes type)
        {
            REIGN_D3DFILLMODE fillMode = REIGN_D3DFILLMODE.POINT;
            REIGN_D3DCULL     cullMode = REIGN_D3DCULL.CCW;
            bool multisampleEnable     = false;

            switch (type)
            {
            case RasterizerStateTypes.Solid_CullNone:
                fillMode          = REIGN_D3DFILLMODE.SOLID;
                cullMode          = REIGN_D3DCULL.NONE;
                multisampleEnable = false;
                break;

            case RasterizerStateTypes.Solid_CullCW:
                fillMode          = REIGN_D3DFILLMODE.SOLID;
                cullMode          = REIGN_D3DCULL.CCW;
                multisampleEnable = false;
                break;

            case RasterizerStateTypes.Solid_CullCCW:
                fillMode          = REIGN_D3DFILLMODE.SOLID;
                cullMode          = REIGN_D3DCULL.CW;
                multisampleEnable = false;
                break;

            default:
                Debug.ThrowError("RasterizerStateDesc", "Unsuported RasterizerStateType");
                break;
            }

            com = new RasterizerStateDescCom(fillMode, cullMode, multisampleEnable);
        }
Esempio n. 2
0
        public RasterizerStateDesc(RasterizerStateTypes type)
        {
            switch (type)
            {
            case RasterizerStateTypes.Solid_CullNone:
                fillMode          = GL.FILL;
                cullMode          = GL.NONE;
                multisampleEnable = false;
                break;

            case RasterizerStateTypes.Solid_CullCW:
                fillMode          = GL.FILL;
                cullMode          = GL.FRONT;
                multisampleEnable = false;
                break;

            case RasterizerStateTypes.Solid_CullCCW:
                fillMode          = GL.FILL;
                cullMode          = GL.BACK;
                multisampleEnable = false;
                break;

            default:
                Debug.ThrowError("RasterizerStateDesc", "Unsuported RasterizerStateType");
                break;
            }
        }
Esempio n. 3
0
        public static IRasterizerStateDesc New(VideoTypes videoType, RasterizerStateTypes type)
        {
            IRasterizerStateDesc api = null;

            #if WIN32
            if (videoType == VideoTypes.D3D9) api = new D3D9.RasterizerStateDesc(type);
            #endif

            #if WIN32 || WINRT || WP8
            if (videoType == VideoTypes.D3D11) api = new D3D11.RasterizerStateDesc(type);
            #endif

            #if WIN32 || OSX || LINUX || iOS || ANDROID || NaCl
            if (videoType == VideoTypes.OpenGL) api = new OpenGL.RasterizerStateDesc(type);
            #endif

            #if XNA
            if (videoType == VideoTypes.XNA) api = new XNA.RasterizerStateDesc(type);
            #endif

            #if VITA
            if (videoType == VideoTypes.Vita) api = new Vita.RasterizerStateDesc(type);
            #endif

            if (api == null) Debug.ThrowError("RasterizerStateDescAPI", "Unsuported InputType: " + videoType);
            return api;
        }
Esempio n. 4
0
        public RasterizerStateDesc(RasterizerStateTypes type)
        {
            switch (type)
            {
            case RasterizerStateTypes.Solid_CullNone:
                fillMode          = X.FillMode.Solid;
                cullMode          = X.CullMode.None;
                multisampleEnable = false;
                break;

            case RasterizerStateTypes.Solid_CullCW:
                fillMode          = X.FillMode.Solid;
                cullMode          = X.CullMode.CullClockwiseFace;
                multisampleEnable = false;
                break;

            case RasterizerStateTypes.Solid_CullCCW:
                fillMode          = X.FillMode.Solid;
                cullMode          = X.CullMode.CullCounterClockwiseFace;
                multisampleEnable = false;
                break;

            default:
                Debug.ThrowError("RasterizerStateDesc", "Unsuported RasterizerStateType");
                break;
            }
        }
        public RasterizerStateDesc(RasterizerStateTypes type)
        {
            switch (type)
            {
                case RasterizerStateTypes.Solid_CullNone:
                    fillMode = GL.FILL;
                    cullMode = GL.NONE;
                    multisampleEnable = false;
                    break;

                case RasterizerStateTypes.Solid_CullCW:
                    fillMode = GL.FILL;
                    cullMode = GL.FRONT;
                    multisampleEnable = false;
                    break;

                case RasterizerStateTypes.Solid_CullCCW:
                    fillMode = GL.FILL;
                    cullMode = GL.BACK;
                    multisampleEnable = false;
                    break;

                default:
                    Debug.ThrowError("RasterizerStateDesc", "Unsuported RasterizerStateType");
                    break;
            }
        }
Esempio n. 6
0
        public static IRasterizerStateDesc New(VideoTypes videoType, RasterizerStateTypes type)
        {
            IRasterizerStateDesc api = null;

                        #if WIN32
            if (videoType == VideoTypes.D3D9)
            {
                api = new D3D9.RasterizerStateDesc(type);
            }
                        #endif

                        #if WIN32 || WINRT || WP8
            if (videoType == VideoTypes.D3D11)
            {
                api = new D3D11.RasterizerStateDesc(type);
            }
                        #endif

                        #if WIN32 || OSX || LINUX || iOS || ANDROID || NaCl
            if (videoType == VideoTypes.OpenGL)
            {
                api = new OpenGL.RasterizerStateDesc(type);
            }
                        #endif

                        #if XNA
            if (videoType == VideoTypes.XNA)
            {
                api = new XNA.RasterizerStateDesc(type);
            }
                        #endif

                        #if VITA
            if (videoType == VideoTypes.Vita)
            {
                api = new Vita.RasterizerStateDesc(type);
            }
                        #endif

            if (api == null)
            {
                Debug.ThrowError("RasterizerStateDescAPI", "Unsuported InputType: " + videoType);
            }
            return(api);
        }
        public RasterizerStateDesc(RasterizerStateTypes type)
        {
            switch (type)
            {
                case RasterizerStateTypes.Solid_CullNone:
                    cullMode = CullFaceMode.None;
                    break;

                case RasterizerStateTypes.Solid_CullCW:
                    cullMode = CullFaceMode.Back;
                    break;

                case RasterizerStateTypes.Solid_CullCCW:
                    cullMode = CullFaceMode.Front;
                    break;

                default:
                    Debug.ThrowError("RasterizerStateDesc", "Unsuported RasterizerStateType");
                    break;
            }
        }
Esempio n. 8
0
        public RasterizerStateDesc(RasterizerStateTypes type)
        {
            switch (type)
            {
            case RasterizerStateTypes.Solid_CullNone:
                cullMode = CullFaceMode.None;
                break;

            case RasterizerStateTypes.Solid_CullCW:
                cullMode = CullFaceMode.Back;
                break;

            case RasterizerStateTypes.Solid_CullCCW:
                cullMode = CullFaceMode.Front;
                break;

            default:
                Debug.ThrowError("RasterizerStateDesc", "Unsuported RasterizerStateType");
                break;
            }
        }
 public static RasterizerStateDesc New(RasterizerStateTypes type)
 {
     return new RasterizerStateDesc(type);
 }
Esempio n. 10
0
 public static RasterizerStateDesc New(RasterizerStateTypes type)
 {
     return(new RasterizerStateDesc(type));
 }
Esempio n. 11
0
        public RasterizerStateDesc(RasterizerStateTypes type)
        {
            try
            {
                REIGN_D3D11_FILL_MODE fillMode = REIGN_D3D11_FILL_MODE.SOLID;
                REIGN_D3D11_CULL_NONE cullMode = REIGN_D3D11_CULL_NONE.NONE;
                bool  frontCounterClockwise = false, depthClipEnable = false, scissorEnable = false, multisampleEnable = false, antialiasedLineEnable = false;
                int   depthBias = 0;
                float depthBiasClamp = 0, slopeScaledDepthBias = 0;
                switch (type)
                {
                case RasterizerStateTypes.Solid_CullNone:
                    fillMode = REIGN_D3D11_FILL_MODE.SOLID;
                    cullMode = REIGN_D3D11_CULL_NONE.NONE;
                    frontCounterClockwise = false;
                    depthBias             = 0;
                    depthBiasClamp        = 0.0f;
                    slopeScaledDepthBias  = 0.0f;
                    depthClipEnable       = true;
                    scissorEnable         = false;
                    multisampleEnable     = false;
                    antialiasedLineEnable = false;
                    break;

                case RasterizerStateTypes.Solid_CullCW:
                    fillMode = REIGN_D3D11_FILL_MODE.SOLID;
                    cullMode = REIGN_D3D11_CULL_NONE.BACK;
                    frontCounterClockwise = false;
                    depthBias             = 0;
                    depthBiasClamp        = 0.0f;
                    slopeScaledDepthBias  = 0.0f;
                    depthClipEnable       = true;
                    scissorEnable         = false;
                    multisampleEnable     = false;
                    antialiasedLineEnable = false;
                    break;

                case RasterizerStateTypes.Solid_CullCCW:
                    fillMode = REIGN_D3D11_FILL_MODE.SOLID;
                    cullMode = REIGN_D3D11_CULL_NONE.FRONT;
                    frontCounterClockwise = false;
                    depthBias             = 0;
                    depthBiasClamp        = 0.0f;
                    slopeScaledDepthBias  = 0.0f;
                    depthClipEnable       = true;
                    scissorEnable         = false;
                    multisampleEnable     = false;
                    antialiasedLineEnable = false;
                    break;

                default:
                    Debug.ThrowError("RasterizerStateDesc", "Unsuported type: " + type.ToString());
                    break;
                }

                com = new RasterizerStateDescCom(fillMode, cullMode, frontCounterClockwise, depthBias, depthBiasClamp, slopeScaledDepthBias, depthClipEnable, scissorEnable, multisampleEnable, antialiasedLineEnable);
            }
            catch (Exception e)
            {
                Dispose();
                throw e;
            }
        }