예제 #1
0
        private void ParseClearMode(string clearmode)
        {
            if (clearmode != null && clearmode.Length > 0)
            {
                bool clearColor = (clearmode.IndexOf("color") >= 0);
                bool clearDepth = (clearmode.IndexOf("depth") >= 0);
                bool clearStencil = (clearmode.IndexOf("stencil") >= 0);

                if (clearColor)
                {
                    if (clearDepth)
                    {
                        if (clearStencil)
                            mClearMode = eClearMode.ColorDepthStencil;
                        else
                            mClearMode = eClearMode.ColorDepth;
                    }
                    else
                    {
                        if (clearStencil)
                            mClearMode = eClearMode.ColorStencil;
                        else
                            mClearMode = eClearMode.Color;
                    }
                }
                else
                {
                    if (clearDepth)
                    {
                        if (clearStencil)
                            mClearMode = eClearMode.DepthStencil;
                        else
                            mClearMode = eClearMode.Depth;
                    }
                    else
                    {
                        if (clearStencil)
                            mClearMode = eClearMode.Stencil;
                        else
                            mClearMode = eClearMode.None;
                    }
                }
            }
        }
예제 #2
0
        private string GetClearModeString(eClearMode cm)
        {
            string val = null;
            switch (cm)
            {
                case eClearMode.None:
                    val = "none";
                    break;
                case eClearMode.Color:
                    val = "color";
                    break;
                case eClearMode.Depth:
                    val = "depth";
                    break;
                case eClearMode.Stencil:
                    val = "stencil";
                    break;
                case eClearMode.ColorDepth:
                    val = "color_depth";
                    break;
                case eClearMode.ColorStencil:
                    val = "color_stencil";
                    break;
                case eClearMode.DepthStencil:
                    val = "depth_stencil";
                    break;
                case eClearMode.ColorDepthStencil:
                    val = "color_depth_stencil";
                    break;
            }

            return val;
        }