WHSurface.h
上传用户:cydong117
上传日期:2009-11-10
资源大小:638k
文件大小:1k
源码类别:

模拟服务器

开发平台:

Visual C++

  1. #ifndef _WINDHORN_SURFACE
  2. #define _WINDHORN_SURFACE
  3. class CWHSurface
  4. {
  5. protected:
  6. LPDIRECTDRAWSURFACE7 m_pDDS;
  7. public:
  8. __inline CWHSurface() { m_pDDS = NULL; }
  9. __inline CWHSurface(LPDIRECTDRAW7 pDD, DWORD dwXSize, DWORD dwYSize) { CreateOffScreenSurface(pDD, dwXSize, dwYSize); }
  10. __inline ~CWHSurface() { ReleaseSurface(); }
  11. public:
  12. BOOL CreateOffScreenSurface(LPDIRECTDRAW7 pDD, DWORD dwXSize, DWORD dwYSize);
  13. BOOL CopyImageToSurface(DWORD dwSrcWidth, DWORD dwSrcHeight, WORD* pwSrc);
  14. BOOL ReleaseSurface();
  15. __inline LPDIRECTDRAWSURFACE7 GetSurface() { return m_pDDS; }
  16. __inline BOOL CopyImageToSurface(CWHImage* xImage) { return CopyImageToSurface(xImage->m_wWidth, xImage->m_wHeight, xImage->m_pwImage); }
  17. };
  18. #endif //_WINDHORN_SURFACE