#region --- License ---
/* Copyright (c) 2006, 2007 Stefanos Apostolopoulos
* See license.txt for license info
*/
#endregion
using System;
using System.Collections.Generic;
using System.Text;
namespace OpenTK.Graphics
{
///
/// Represents a handle to cached text.
///
public abstract class TextHandle : IDisposable
{
///
/// Constructs a new TextHandle,
///
///
public TextHandle(int handle)
{
Handle = handle;
}
private int handle;
protected TextureFont font;
protected bool disposed;
///
/// Gets the handle of the cached text run. Call the OpenTK.Graphics.ITextPrinter.Draw() method
/// to draw the text represented by this TextHandle.
///
public int Handle
{
get { return handle; }
protected set { handle = value; }
}
///
/// Gets the TextureFont used for this text run.
///
public TextureFont Font
{
get { return font; }
internal set { font = value; }
}
#region public override string ToString()
///
/// Returns a System.String that represents the current TextHandle.
///
/// a System.String that descibes the current TextHandle.
public override string ToString()
{
return String.Format("TextHandle: {0}", Handle);
}
#endregion
#region --- IDisposable Members ---
///
/// Frees the resource consumed by the TextHandle.
///
public void Dispose()
{
this.Dispose(true);
GC.SuppressFinalize(this);
}
protected virtual void Dispose(bool manual) { }
~TextHandle() { this.Dispose(false); }
#endregion
}
}