Beispiel #1
0
        /// <summary>
        /// Refreshes device dependent resources of this class.
        /// </summary>
        private void RefreshDeviceDependentResources()
        {
            if ((m_renderParameters == null) ||
                (!m_renderParameters.IsLoaded))
            {
                m_renderParameters = m_resources.AddAndLoadResource(
                    GraphicsCore.GetNextGenericResourceKey(),
                    new ViewRenderParameters());
            }

            if ((m_renderPassTransparent == null) ||
                (!m_renderPassTransparent.IsLoaded))
            {
                m_renderPassTransparent = m_resources.GetResourceAndEnsureLoaded(
                    new NamedOrGenericKey(typeof(RenderPassDefaultTransparent)),
                    () => new RenderPassDefaultTransparent());
            }

            if ((m_renderPassLineRender == null) ||
                (!m_renderPassLineRender.IsLoaded))
            {
                m_renderPassLineRender = m_resources.GetResourceAndEnsureLoaded(
                    new NamedOrGenericKey(typeof(RenderPassLineRender)),
                    () => new RenderPassLineRender());
            }

            if ((m_renderPass2DOverlay == null) ||
                (!m_renderPass2DOverlay.IsLoaded))
            {
                m_renderPass2DOverlay = m_resources.GetResourceAndEnsureLoaded(
                    new NamedOrGenericKey(typeof(RenderPass2DOverlay)),
                    () => new RenderPass2DOverlay());
            }
        }
Beispiel #2
0
 /// <summary>
 /// Clears all resources created by this view subset.
 /// </summary>
 internal void ClearResources()
 {
     m_renderParameters      = null;
     m_renderPass2DOverlay   = null;
     m_renderPassLineRender  = null;
     m_renderPassTransparent = null;
 }