DirectDraw.h
上传用户:wymy58
上传日期:2007-01-07
资源大小:2086k
文件大小:2k
源码类别:

DirextX编程

开发平台:

Visual C++

  1. // Copyright (C) 1998-1999 DXGuide.  All Rights Reserved.
  2. // File: DirectDraw.h
  3. #ifndef _DIRECTDRAW__H
  4. #define _DIRECTDRAW__H
  5. #if _MSC_VER >= 1000
  6. #pragma once
  7. #endif // _MSC_VER >= 1000
  8. #include <ddraw.h>
  9. #include <afxtempl.h>
  10. #include "DDDevice.h"
  11. class CDDModeInfoObject;
  12. class CD3DDeviceInfoObject;
  13. class CDirectDraw
  14. {
  15. friend class CDirectXApp;
  16. public:
  17. enum DIRECTDRAW_TYPE
  18. {
  19. DIRECTDRAW_DD,
  20. DIRECTDRAW_D3DIM,
  21. };
  22. protected:
  23. CDirectDraw(DIRECTDRAW_TYPE  DirectDrawType = DIRECTDRAW_DD);
  24. ~CDirectDraw();
  25. protected:
  26. bool Create(HWND  hWnd, DWORD  dwDDInitFlags);
  27. public:
  28. bool SelectDDDevice(int  nMonitorNo, int  nDeviceNo);
  29. bool SelectDDDevice(int  nDevicePos);
  30. bool SelectDDDevice(const LPGUID  lpGuid);
  31. public:
  32. int GetDDDeviceNumber(void) const;
  33. int GetMointorNumber(void) const;
  34. public:
  35. HRESULT Flip(void);
  36. HRESULT TestCooperativeLevel(void);
  37. protected:
  38. static BOOL WINAPI DDEnumCallbackEx(
  39. GUID FAR*  lpGUID, LPSTR  lpDriverDescription,
  40. LPSTR  lpDriverName, LPVOID  lpContext, HMONITOR  hm);
  41. static BOOL WINAPI DDEnumCallback(
  42. GUID FAR*  lpGUID, LPSTR  lpDriverDescription,
  43. LPSTR  lpDriverName, LPVOID  lpContext);
  44. protected:
  45. CTypedPtrArray<CObArray, CDDDevice*> m_ddDeviceInfoArray;
  46. int m_nCurrDevice;
  47. protected:
  48. bool LoadDDDeviceInfoArray(void);
  49. protected:
  50. int m_nMonitors;
  51. protected:
  52. static const CString m_strDisplayDriverName;
  53. public:
  54. int GetEnableDeviceNum(void) const;
  55. CDDDevice* GetFirstEnableDevice(void);
  56. CDDDevice* GetNextEnableDevice(void);
  57. protected:
  58. DIRECTDRAW_TYPE m_DirectDrawType;
  59. };
  60. #include "DirectDraw.inl"
  61. #endif // _DIRECTDRAW__H