From 5d1eda9289e8fb00bd2d8d513cf38ab42411af13 Mon Sep 17 00:00:00 2001 From: the_fiddler Date: Tue, 25 Nov 2008 17:25:10 +0000 Subject: [PATCH] Implemented GetHashCode and ToString. --- Source/Utilities/Graphics/Texture2D.cs | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/Source/Utilities/Graphics/Texture2D.cs b/Source/Utilities/Graphics/Texture2D.cs index 6e487425..9be42a3d 100644 --- a/Source/Utilities/Graphics/Texture2D.cs +++ b/Source/Utilities/Graphics/Texture2D.cs @@ -177,10 +177,27 @@ namespace OpenTK.Graphics #endregion - //public override int GetHashCode() - //{ - // return (this as IGraphicsResource).Id; - //} + #region public override int GetHashCode() + + public override int GetHashCode() + { + return (this as IGraphicsResource).Id; + } + + #endregion + + #region public overrid string ToString() + + public override string ToString() + { + return String.Format("Texture2D #{0} ({1}x{2}, {3})", + (this as IGraphicsResource).Id.ToString(), + Width.ToString(), + Height.ToString(), + InternalFormat.ToString()); + } + + #endregion #endregion