示例#1
0
        public void Dispose()
        {
            DefaultShader.Dispose();
            DepthShader.Dispose();
            DepthCubeShader.Dispose();
            DefaultTexture.Dispose();
            FallbackTexture.Dispose();
            WhiteTexture.Dispose();
            BlackTexture.Dispose();
            DefaultMaterial.Dispose();
            DefaultTextureMaterial.Dispose();
            MissingTextureMaterial.Dispose();
            m_shaderRegistry.Dispose();

            foreach (CResource waitingResource in m_waitingResources)
            {
                waitingResource.Dispose();
            }

            m_waitingResources.Clear();

            foreach (var registeredResource in m_registeredResources)
            {
                registeredResource.Value.Dispose();
            }

            m_registeredResources.Clear();
        }
示例#2
0
        public void Dispose()
        {
            _graphicsDeviceManager.PreparingDeviceSettings -= OnPreparingDeviceChanged;

            SpriteBatch?.Dispose();
            WhiteTexture?.Dispose();
            BgRenderer.Dispose();
        }
示例#3
0
 protected override void Dispose(bool disposing)
 {
     base.Dispose(disposing);
     if (disposing)
     {
         In.Dispose();
         WhiteTexture.Dispose();
     }
 }
示例#4
0
 public override void DrawSelf(SpriteBatch sb)
 {
     base.DrawSelf(sb);
     if (SizeStyle == SizeStyle.Inline)
     {
         sb.Draw(Texture, Pivot * new Vector2(Width, Height), null, _color, TextureRotation, Pivot * Texture.Size(),
                 new Vector2(1, 1), SpriteEffects.None, 0f);
         if (IsMouseHover && WhiteTexture != null)
         {
             sb.Draw(WhiteTexture, Pivot * new Vector2(Width, Height), null, Color.White, TextureRotation, Pivot * WhiteTexture.Size(),
                     new Vector2(1, 1), SpriteEffects.None, 0f);
         }
     }
     else
     {
         sb.Draw(Texture, new Rectangle(0, 0, Width, Height), null, _color, TextureRotation, Pivot * Texture.Size(), SpriteEffects.None, 0f);
         if (IsMouseHover && WhiteTexture != null)
         {
             sb.Draw(WhiteTexture, new Rectangle(0, 0, Width, Height), null, Color.White, TextureRotation, Pivot * WhiteTexture.Size(), SpriteEffects.None, 0f);
         }
     }
 }
示例#5
0
        } = 1;                                                 // 0 is white texture

        public static void Dispose()
        {
            VertexArray?.Dispose();
            WhiteTexture?.Dispose();
            TextureShader?.Dispose();
        }