Example #1
0
        public void Dispose()
        {
            if (disposed)
            {
                return;
            }

            cube.Dispose();
            sphere.Dispose();
            capsule.Dispose();
            cylinder.Dispose();

            texsampler.Dispose();
            texsampleranis.Dispose();
            texsamplertnt.Dispose();

            foreach (InputLayout layout in layouts.Values)
            {
                layout.Dispose();
            }
            layouts.Clear();

            VSSceneVars.Dispose();
            VSEntityVars.Dispose();
            VSModelVars.Dispose();
            VSGeomVars.Dispose();
            PSSceneVars.Dispose();
            PSGeomVars.Dispose();
            InstGlobalVars.Dispose();
            InstLocalVars.Dispose();
            BoneMatrices.Dispose();

            basicps.Dispose();
            basicvspnct.Dispose();
            basicvspnctt.Dispose();
            basicvspncttt.Dispose();
            basicvspncct.Dispose();
            basicvspncctt.Dispose();
            basicvspnccttt.Dispose();
            basicvspnctx.Dispose();
            basicvspncctx.Dispose();
            basicvspncttx.Dispose();
            basicvspnccttx.Dispose();
            basicvspnctttx.Dispose();
            basicvspncctttx.Dispose();
            basicvspbbnct.Dispose();
            basicvspbbnctx.Dispose();
            basicvspbbnctt.Dispose();
            basicvspbbncttt.Dispose();
            basicvspbbncct.Dispose();
            basicvspbbncctx.Dispose();
            basicvspbbncttx.Dispose();
            basicvsbox.Dispose();
            basicvssphere.Dispose();
            basicvscapsule.Dispose();
            basicvscylinder.Dispose();

            disposed = true;
        }
Example #2
0
        public void Dispose()
        {
            DisposeBuffers();

            if (BlendState != null)
            {
                BlendState.Dispose();
                BlendState = null;
            }
            if (SampleStateLinear != null)
            {
                SampleStateLinear.Dispose();
                SampleStateLinear = null;
            }
            if (SampleStatePoint != null)
            {
                SampleStatePoint.Dispose();
                SampleStatePoint = null;
            }
            if (LightVSVars != null)
            {
                LightVSVars.Dispose();
                LightVSVars = null;
            }
            if (LightPSVars != null)
            {
                LightPSVars.Dispose();
                LightPSVars = null;
            }
            if (LightInstVars != null)
            {
                LightInstVars.Dispose();
                LightInstVars = null;
            }
            if (LightQuadLayout != null)
            {
                LightQuadLayout.Dispose();
                LightQuadLayout = null;
            }
            if (LightQuad != null)
            {
                LightQuad.Dispose();
                LightQuad = null;
            }
            if (LightCone != null)
            {
                LightCone.Dispose();
                LightCone = null;
            }
            if (LightSphere != null)
            {
                LightSphere.Dispose();
                LightSphere = null;
            }
            if (LightCapsule != null)
            {
                LightCapsule.Dispose();
                LightCapsule = null;
            }
            if (DirLightPS != null)
            {
                DirLightPS.Dispose();
                DirLightPS = null;
            }
            if (DirLightMSPS != null)
            {
                DirLightMSPS.Dispose();
                DirLightMSPS = null;
            }
            if (DirLightVS != null)
            {
                DirLightVS.Dispose();
                DirLightVS = null;
            }
            if (LodLightPS != null)
            {
                LodLightPS.Dispose();
                LodLightPS = null;
            }
            if (LodLightMSPS != null)
            {
                LodLightMSPS.Dispose();
                LodLightMSPS = null;
            }
            if (LodLightVS != null)
            {
                LodLightVS.Dispose();
                LodLightVS = null;
            }
            if (LightPS != null)
            {
                LightPS.Dispose();
                LightPS = null;
            }
            if (LightMSPS != null)
            {
                LightMSPS.Dispose();
                LightMSPS = null;
            }
            if (LightVS != null)
            {
                LightVS.Dispose();
                LightVS = null;
            }
            if (SSAAPSVars != null)
            {
                SSAAPSVars.Dispose();
                SSAAPSVars = null;
            }
            if (SSAAPS != null)
            {
                SSAAPS.Dispose();
                SSAAPS = null;
            }
            if (FinalVS != null)
            {
                FinalVS.Dispose();
                FinalVS = null;
            }
        }