home *** CD-ROM | disk | FTP | other *** search
/ Programming an RTS Game with Direct3D / Programming an RTS Game with Direct3D.iso / Examples / Chapter 4 / Example 4.1 / heightMap.h < prev    next >
Encoding:
C/C++ Source or Header  |  2006-07-01  |  783 b   |  35 lines

  1. #include <d3dx9.h>
  2. #include "intpoint.h"
  3.  
  4. struct PARTICLE{
  5.     D3DXVECTOR3 position;
  6.     D3DCOLOR color;
  7.     static const DWORD FVF;
  8. };
  9.  
  10. struct HEIGHTMAP
  11. {
  12.     //Functions
  13.     HEIGHTMAP(IDirect3DDevice9* Dev, INTPOINT _size);
  14.     ~HEIGHTMAP();
  15.     void Release();
  16.     HRESULT LoadFromFile(char fileName[]);
  17.     HRESULT CreateParticles();
  18.     void Render();
  19.     D3DXVECTOR2 GetCentre(){return D3DXVECTOR2(m_size.x / 2.0f, m_size.y / 2.0f);}
  20.  
  21.     //variables
  22.     INTPOINT m_size;        //Size of heightmap
  23.     float m_maxHeight;        //The height of the highest peak
  24.     float *m_pHeightMap;    //Array with height values
  25.  
  26.     //Vertex buffer for points
  27.     IDirect3DVertexBuffer9 *m_pVb;
  28.  
  29.     //Our device
  30.     IDirect3DDevice9* m_pDevice; 
  31.  
  32.     //Sprite
  33.     ID3DXSprite *m_pSprite;
  34.     IDirect3DTexture9 *m_pHeightMapTexture;
  35. };