/// <summary>
        /// 終了時の処理
        /// </summary>
        public void Destroy()
        {
            m_debugPerth = null;
            for (int i = 0; i < 4; ++i)
            {
                m_aBaseCamera[i] = null;
            }

            int    n           = 0;
            string strDebugTmp = "";


            foreach (var val in m_nameV4CameraIndex)
            {
                MCBaseCamera camera;
                if (val.Value.TryGetTarget(out camera))
                {
                    ++n;
                    strDebugTmp += val.Key + "\n";
                }
            }
            m_nameV4CameraIndex.Clear();

            if (n != 0)
            {
                MessageBox.Show(strDebugTmp, "カメラが解放されてない。",
                                MessageBoxButtons.OK,
                                MessageBoxIcon.Error);
            }
        }
        public bool Set4VCamera(MCBaseCamera camera, int viewNo)
        {
            Debug.Assert(!(viewNo < 0 || viewNo > 3));

            m_aBaseCamera[viewNo] = camera;

            return(true);
        }
        public int InsertCamera(string cameraName, MCBaseCamera camera)
        {
            // 古い物がある場合掃除
            if (m_nameV4CameraIndex.ContainsKey(cameraName))
            {
                MCBaseCamera cameraTmp;
                if (!m_nameV4CameraIndex[cameraName].TryGetTarget(out cameraTmp))
                {
                    m_nameV4CameraIndex.Remove(cameraName);
                }
            }
            m_nameV4CameraIndex.Add(cameraName, new WeakReference <MCBaseCamera>(camera));

            return(0);
        }
        /// <summary>
        /// 指定サイズのレンダーターゲットテクスチャー専用のカメラを作成する
        /// </summary>
        /// <param name="app"></param>
        /// <param name="name">任意のカメラ名</param>
        /// <param name="witdh">対象テクスチャーの幅</param>
        /// <param name="height">対象テクスチャーの高さ</param>
        /// <param name="camera"></param>
        /// <returns></returns>
        public static bool Create(
            Application app,
            string name,
            int witdh, int height,
            out MCBaseCamera camera
            )
        {
            camera = new MCTextureCamera(app, name, witdh, height);
            if (app.CameraMgr.InsertCamera(name, camera) != 0)
            {
                camera = null;
                return(false);
            }

            return(true);
        }
        public bool GetCamera(string cameraName, out MCBaseCamera camera)
        {
            camera = null;
            if (!m_nameV4CameraIndex.ContainsKey(cameraName))
            {
                return(false);
            }

            MCBaseCamera cameraTmp;

            if (!m_nameV4CameraIndex[cameraName].TryGetTarget(out cameraTmp))
            {
                m_nameV4CameraIndex.Remove(cameraName);
                return(false);
            }

            camera = cameraTmp;

            return(true);
        }