void UpdateString()
{
if (!m_texture.Initialized)
{
return;
}
int width = m_texture.Width;
int height = m_texture.Height;
Rectangle rect = new Rectangle(0, 0, width, height);
Bitmap bitmap = new Bitmap(width, height, System.Drawing.Imaging.PixelFormat.Format32bppArgb);
System.Drawing.Graphics graphics = System.Drawing.Graphics.FromImage(bitmap);
graphics.TextRenderingHint = TextRenderingHint.AntiAlias;
graphics.Clip = new Region(rect);
graphics.DrawString(m_text, m_font, m_brush, 0.0f, 0.0f);
graphics.Flush();
BitmapData data = bitmap.LockBits(rect,
ImageLockMode.ReadOnly,
System.Drawing.Imaging.PixelFormat.Format32bppArgb);
GraphicsCommand.UpdateTextureRGBA(m_texture, data.Scan0);
bitmap.UnlockBits(data);
m_updateString = false;
bitmap.Dispose();
graphics.Dispose();
}