// Disposer
 public override void Dispose()
 {
     // Not already disposed?
     if (!isdisposed)
     {
         // Clean up
         if (texture1 != null)
         {
             texture1.Dispose();
         }
         if (rendersettings != null)
         {
             rendersettings.Dispose();
         }
         if (transformsettings != null)
         {
             transformsettings.Dispose();
         }
         if (fillcolor != null)
         {
             fillcolor.Dispose();                                   //mxd
         }
         // Done
         base.Dispose();
     }
 }
        // Disposer
        public override void Dispose()
        {
            // Not already disposed?
            if (!isdisposed)
            {
                // Clean up
                if (texture1 != null)
                {
                    texture1.Dispose();
                }
                if (rendersettings != null)
                {
                    rendersettings.Dispose();
                }
                if (transformsettings != null)
                {
                    transformsettings.Dispose();
                }
                if (filtersettings != null)
                {
                    filtersettings.Dispose();
                }
                if (desaturationHandle != null)
                {
                    desaturationHandle.Dispose();
                }

                // Done
                base.Dispose();
            }
        }
Esempio n. 3
0
        static Circle()
        {
            VertexBuffer = new VertexBuffer(Render.Device, Utilities.SizeOf <Vector4>() * 3, Usage.WriteOnly, VertexFormat.None, Pool.Managed);

            using (var ds = VertexBuffer.Lock(0, 0, LockFlags.None))
            {
                ds.WriteRange(new[] { new Vector4(-Radius, 0f, -Radius, 1.0f), new Vector4(0f, 0f, Radius, 1.0f), new Vector4(Radius, 0f, -Radius, 1.0f) });
            }

            VertexBuffer.Unlock();

            var vertexElements = new[] { new VertexElement(0, 0, DeclarationType.Float4, DeclarationMethod.Default, DeclarationUsage.Position, 0), VertexElement.VertexDeclarationEnd };

            VertexDeclaration = new VertexDeclaration(Render.Device, vertexElements);

            Effect       = Effect.FromMemory(Render.Device, Resources.RenderEffectCompiled, ShaderFlags.None);
            EffectHandle = Effect.GetTechnique(0);

            Render.OnLostDevice  += Effect.OnLostDevice;
            Render.OnResetDevice += Effect.OnResetDevice;

            Render.OnDispose += () =>
            {
                Effect.Dispose();
                EffectHandle.Dispose();
                VertexBuffer.Dispose();
                VertexDeclaration.Dispose();
            };
        }
Esempio n. 4
0
        // Disposer
        public override void Dispose()
        {
            // Not already disposed?
            if (!isdisposed)
            {
                // Clean up
                if (texture1 != null)
                {
                    texture1.Dispose();
                }
                if (worldviewproj != null)
                {
                    worldviewproj.Dispose();
                }
                if (minfiltersettings != null)
                {
                    minfiltersettings.Dispose();
                }
                if (magfiltersettings != null)
                {
                    magfiltersettings.Dispose();
                }
                if (modulatecolor != null)
                {
                    modulatecolor.Dispose();
                }
                if (highlightcolor != null)
                {
                    highlightcolor.Dispose();
                }

                // Done
                base.Dispose();
            }
        }
Esempio n. 5
0
        public void Free()
        {
            if (_handleTechnique != null)
            {
                _handleTechnique.Dispose();
            }
            if (_handleTexture != null)
            {
                _handleTexture.Dispose();
            }
            if (_handleWorldProjection != null)
            {
                _handleWorldProjection.Dispose();
            }
            _handleTechnique       = null;
            _handleWorldProjection = null;
            _handleTexture         = null;

            if (_effect != null)
            {
                _effect.Dispose();
                _effect = null;
            }
        }
Esempio n. 6
0
        // Disposer
        public override void Dispose()
        {
            // Not already disposed?
            if (!isdisposed)
            {
                // Clean up
                if (texture1 != null)
                {
                    texture1.Dispose();
                }
                if (worldviewproj != null)
                {
                    worldviewproj.Dispose();
                }
                if (minfiltersettings != null)
                {
                    minfiltersettings.Dispose();
                }
                if (magfiltersettings != null)
                {
                    magfiltersettings.Dispose();
                }
                if (mipfiltersettings != null)
                {
                    mipfiltersettings.Dispose();
                }
                if (highlightcolor != null)
                {
                    highlightcolor.Dispose();
                }
                if (maxanisotropysetting != null)
                {
                    maxanisotropysetting.Dispose();
                }

                //mxd
                if (vertexColorHandle != null)
                {
                    vertexColorHandle.Dispose();
                }
                if (lightColorHandle != null)
                {
                    lightColorHandle.Dispose();
                }
                if (ignoreNormalsHandle != null)
                {
                    ignoreNormalsHandle.Dispose();
                }
                if (lightPositionAndRadiusHandle != null)
                {
                    lightPositionAndRadiusHandle.Dispose();
                }
                if (camPosHandle != null)
                {
                    camPosHandle.Dispose();
                }
                if (stencilColorHandle != null)
                {
                    stencilColorHandle.Dispose();
                }
                if (world != null)
                {
                    world.Dispose();
                }

                // Done
                base.Dispose();
            }
        }