Exemple #1
0
        void iContent.releaseCachedResources(eReleaseResources what)
        {
            try
            {
                if (null == timersHardPause)
                {
                    timersHardPause = animation.timers.hardPause();
                }

                foreach (var rr in releaseResources)
                {
                    rr(what);
                }

                ComUtils.clear(ref cachedRtv);
                ComUtils.clear(ref cachedDsv);
                context?.SetRenderTargets(0, null, null, ResourceStateTransitionMode.None);

                if (what == eReleaseResources.Buffers)
                {
                    return;
                }

                context?.Dispose();
                context = null;
                if (what == eReleaseResources.Context)
                {
                    return;
                }

                swapChain?.Dispose();
                swapChain = null;
            }
            catch (Exception ex)
            {
                NativeContext.cacheException(ex);
                throw;
            }
        }
Exemple #2
0
 void onReleaseResources(eReleaseResources what)
 {
     d2dDevice?.releaseResources(what);
 }