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(); }
public void Dispose() { _graphicsDeviceManager.PreparingDeviceSettings -= OnPreparingDeviceChanged; SpriteBatch?.Dispose(); WhiteTexture?.Dispose(); BgRenderer.Dispose(); }
protected override void Dispose(bool disposing) { base.Dispose(disposing); if (disposing) { In.Dispose(); WhiteTexture.Dispose(); } }
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); } } }
} = 1; // 0 is white texture public static void Dispose() { VertexArray?.Dispose(); WhiteTexture?.Dispose(); TextureShader?.Dispose(); }