Opentk/Source/Utilities/Fonts/TextHandle.cs

60 lines
1.6 KiB
C#
Raw Normal View History

2007-11-08 15:54:58 +00:00
#region --- License ---
/* Copyright (c) 2006, 2007 Stefanos Apostolopoulos
* See license.txt for license info
*/
#endregion
using System;
2007-11-06 20:59:15 +00:00
using System.Collections.Generic;
using System.Text;
namespace OpenTK.Graphics
2007-11-06 20:59:15 +00:00
{
2007-11-08 15:54:58 +00:00
/// <summary>
/// Represents a handle to cached text.
/// </summary>
public class TextHandle : IDisposable
2007-11-06 20:59:15 +00:00
{
internal TextHandle(int handle)
{
Handle = handle;
}
2007-11-08 15:54:58 +00:00
/// <summary>
/// The handle of the cached text. Call the OpenTK.Graphics.ITextPrinter.Draw() method
2007-11-08 15:54:58 +00:00
/// to draw the text represented by this TextHandle.
/// </summary>
2007-11-06 20:59:15 +00:00
public readonly int Handle;
internal TextureFont font;
2007-11-08 15:54:58 +00:00
protected bool disposed;
#region public override string ToString()
2007-11-06 20:59:15 +00:00
2007-11-08 15:54:58 +00:00
/// <summary>
/// Returns a System.String that represents the current TextHandle.
/// </summary>
/// <returns>a System.String that descibes the current TextHandle.</returns>
2007-11-06 20:59:15 +00:00
public override string ToString()
{
return String.Format("TextHandle: {0}", Handle);
}
2007-11-08 15:54:58 +00:00
#endregion
#region --- IDisposable Members ---
/// <summary>
/// Frees the resource consumed by the TextHandle.
/// </summary>
2007-11-08 15:54:58 +00:00
public void Dispose()
{
this.Dispose(true);
GC.SuppressFinalize(this);
}
protected virtual void Dispose(bool manual) { }
~TextHandle() { this.Dispose(false); }
#endregion
2007-11-06 20:59:15 +00:00
}
}