Esempio n. 1
0
        public void Dispose()
        {
            // Release all resources

            figures.Dispose();

            if (ctx != null)
            {
                ctx.ClearState();
                ctx.Flush();
                ctx.Dispose();
            }

            if (il != null)
            {
                il.Dispose();
            }
            if (effect != null)
            {
                effect.Dispose();
            }

            if (hmd != null)
            {
                keyboard.Dispose();
                directInput.Dispose();

                mtex.Dispose();
                layers.Dispose();

                eye_texes[0].Dispose();
                eye_texes[1].Dispose();

                default_rasterizer_state.Dispose();
                default_depth_stencil_state.Dispose();
                default_blend_state.Dispose();

                ztex_view.Dispose();
                ztex.Dispose();

                buf0_view.Dispose();
                buf0.Dispose();

                swap_chain.Dispose();
                dxgi_factory.Dispose();

                // Disposing the device, before the hmd, will cause the hmd to fail when disposing.
                // Disposing the device, after the hmd, will cause the dispose of the device to fail.
                // It looks as if the hmd steals ownership of the device and destroys it, when it's shutting down.
                // device.Dispose();

                hmd.Dispose();
            }
            oculus.Dispose();
        }
Esempio n. 2
0
        /// <summary>
        /// 内部objectを破棄します。
        /// </summary>
        public void Dispose()
        {
            figures.Dispose();

            if (ctx != null)
            {
                ctx.ClearState();
                ctx.Flush();
                ctx.Dispose();
            }

            default_rasterizer_state.Dispose();
            default_depth_stencil_state.Dispose();
            default_blend_state.Dispose();

            if (ztex_view != null)
            {
                ztex_view.Dispose();
            }
            if (ztex != null)
            {
                ztex.Dispose();
            }

            if (buf0_view != null)
            {
                buf0_view.Dispose();
            }
            if (buf0 != null)
            {
                buf0.Dispose();
            }

            if (swap_chain != null)
            {
                swap_chain.Dispose();
            }

            if (il != null)
            {
                il.Dispose();
            }
            if (effect != null)
            {
                effect.Dispose();
            }
            if (device != null)
            {
                device.Dispose();
            }
        }