internal void OnDestroyDevice() { foreach (var val in m_nameV4CameraIndex) { MCBaseCamera tmp; if (val.Value.TryGetTarget(out tmp)) { tmp.OnDestroyDevice(); } } m_default = null; }
/// <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); }
/// <summary> /// デバイス作成時の処理 /// </summary> /// <returns></returns> internal int OnCreateDevice(SharpDX.Direct3D11.Device device) { //if (CreatePerthCamera("DebugPerth", m_spDebugPerth)) //{ // Set4VCamera(m_spDebugPerth, 0); //} var desc = App.SwapChain.Description.ModeDescription; MCBaseCamera defTmpCamera; if (MCTextureCamera.Create(App, "DefaultCamera", desc.Width, desc.Height, out defTmpCamera)) { m_default = (MCTextureCamera)defTmpCamera; m_default.SetCameraPosition(new MCVector2(desc.Width * 0.5f, desc.Height * -0.5f)); Set4VCamera(m_default, 0); } return(0); }