www.pudn.com > IntroductionTo3DGameEngineDesign.rar > hud.cs


using System; 
using System.Drawing; 
using Microsoft.DirectX; 
using Microsoft.DirectX.Direct3D; 
 
namespace GameEngine 
{ 
	///  
	/// Summary description for hud. 
	///  
	public class Hud : IDisposable 
	{ 
		///  
		/// Custom vertex type for the HudPoint 
		///  
		public struct HUDPOINTVERTEX 
		{ 
			public Vector3 p; 
			public float rhw; 
			public int color; 
 
			public const VertexFormats Fvf = VertexFormats.PositionW | VertexFormats.Diffuse; 
		}; 
 
		private CustomVertex.TransformedColored[]  m_Points;    
		private VertexBuffer m_VB = null;  // Vertex buffer 
		private int m_xSize; 
		private int m_ySize; 
		private int m_numPoints; 
 
		public Hud(int xSize, int ySize) 
		{ 
			m_xSize = xSize; 
			m_ySize = ySize; 
			m_numPoints = xSize * ySize; 
 
			m_Points = new CustomVertex.TransformedColored[m_numPoints]; 
 
			for ( int i=0; i