ddrawce.h
上传用户:wstnjxml
上传日期:2014-04-03
资源大小:7248k
文件大小:10k
源码类别:

Windows CE

开发平台:

C/C++

  1. #define DD_OK 0
  2. typedef struct IDirectDraw *LPDIRECTDRAW;
  3. typedef struct IDirectDrawSurface *LPDIRECTDRAWSURFACE;
  4. typedef struct IDirectDrawClipper *LPDIRECTDRAWCLIPPER;
  5. typedef struct IDirectDrawPalette *LPDIRECTDRAWPALETTE;
  6. static const guid IID_IDirectDraw = { 0x9c59509a, 0x39bd, 0x11d1, { 0x8C,0x4A,0x00,0xC0,0x4F,0xD9,0x30,0xC5 }};
  7. typedef struct DDSCAPS
  8. {
  9.     DWORD dwCaps;
  10. } DDSCAPS;
  11. typedef DDSCAPS *LPDDSCAPS;
  12. typedef struct DDCAPS
  13. {
  14. DWORD dwSize;
  15.     DWORD dwVidMemTotal;
  16.     DWORD dwVidMemFree;
  17.     DWORD dwVidMemStride;
  18.     DDSCAPS ddsCaps;
  19.     DWORD dwNumFourCCCodes;
  20.     DWORD dwPalCaps;
  21.     DWORD dwBltCaps;
  22.     DWORD dwCKeyCaps;
  23.     DWORD dwAlphaCaps;
  24.     DWORD dwRops[8];
  25.     DWORD   dwOverlayCaps;
  26.     DWORD dwMaxVisibleOverlays;
  27.     DWORD dwCurrVisibleOverlays;
  28.     DWORD dwAlignBoundarySrc;
  29.     DWORD dwAlignSizeSrc;
  30.     DWORD dwAlignBoundaryDest;
  31.     DWORD dwAlignSizeDest;
  32.     DWORD dwMinOverlayStretch;
  33.     DWORD dwMaxOverlayStretch;
  34.     DWORD   dwMiscCaps;
  35. } DDCAPS;
  36. typedef DDCAPS *LPDDCAPS;
  37. typedef struct DDCOLORKEY
  38. {
  39.     DWORD dwColorSpaceLowValue;
  40.     DWORD dwColorSpaceHighValue;
  41. } DDCOLORKEY;
  42. typedef DDCOLORKEY *LPDDCOLORKEY;
  43. typedef struct DDOVERLAYFX
  44. {
  45.     DWORD dwSize;
  46.     DWORD dwAlphaConstBitDepth;
  47. DWORD dwAlphaConst;
  48.     DDCOLORKEY dckDestColorkey;
  49.     DDCOLORKEY dckSrcColorkey;
  50. } DDOVERLAYFX;
  51. typedef DDOVERLAYFX *LPDDOVERLAYFX;
  52. typedef struct DDPIXELFORMAT
  53. {
  54. DWORD dwSize;
  55. DWORD dwFlags;
  56. DWORD dwFourCC;
  57. DWORD dwRGBBitCount;
  58. DWORD dwRBitMask;
  59. DWORD dwGBitMask;
  60. DWORD dwBBitMask;
  61. DWORD dwRGBAlphaBitMask;
  62. } DDPIXELFORMAT;
  63. typedef DDPIXELFORMAT *LPDDPIXELFORMAT;
  64. typedef struct DDSURFACEDESC
  65. {
  66. DWORD dwSize;
  67. DWORD dwFlags;
  68. DWORD dwHeight;
  69. DWORD dwWidth;
  70. LONG lPitch;
  71.     LONG    lXPitch;
  72. DWORD dwBackBufferCount;
  73. DWORD dwRefreshRate;
  74. LPVOID lpSurface;
  75. DDCOLORKEY ddckCKDestOverlay;
  76. DDCOLORKEY ddckCKDestBlt;
  77. DDCOLORKEY ddckCKSrcOverlay;
  78. DDCOLORKEY ddckCKSrcBlt;
  79. DDPIXELFORMAT ddpfPixelFormat;
  80. DDSCAPS ddsCaps;
  81.     DWORD dwSurfaceSize;
  82. } DDSURFACEDESC;
  83. typedef DDSURFACEDESC *LPDDSURFACEDESC;
  84. #define DDPF_FOURCC 0x00000004
  85. #define DDPF_RGB 0x00000040
  86. #define DDPF_PALETTEINDEXED 0x00000020
  87. #define DDWAITVB_BLOCKBEGIN 0x00000001
  88. #define DDWAITVB_BLOCKEND 0x00000004
  89. #define DDSD_CAPS 0x00000001
  90. #define DDSD_HEIGHT 0x00000002
  91. #define DDSD_WIDTH 0x00000004
  92. #define DDSD_PITCH 0x00000008
  93. #define DDSD_XPITCH             0x00000010
  94. #define DDSD_BACKBUFFERCOUNT 0x00000020
  95. #define DDSD_PIXELFORMAT 0x00001000
  96. #define DDSCAPS_FLIP 0x00000004
  97. #define DDSCAPS_OVERLAY 0x00000010
  98. #define DDSCAPS_PRIMARYSURFACE 0x00000040
  99. #define DDSCAPS_VIDEOMEMORY 0x00000100
  100. #define DDFXCAPS_BLTARITHSTRETCHY 0x00000020
  101. #define DDFXCAPS_OVERLAYARITHSTRETCHY 0x00040000
  102. #define DDBLT_WAITNOTBUSY       0x01000000
  103. #define DDBLT_WAITVSYNC         0x00000001
  104. #define DDLOCK_WAITNOTBUSY 0x00000008
  105. #define DDBLTCAPS_FOURCCTORGB   0x00000004
  106. #define DDOVERLAYCAPS_CKEYDEST        0x00000200
  107. #define DDOVERLAYCAPS_MIRRORLEFTRIGHT 0x00000010
  108. #define DDOVERLAYCAPS_MIRRORUPDOWN    0x00000020
  109. #define DDOVERLAYCAPS_OVERLAYSUPPORT  0x80000000
  110. #define DDOVER_HIDE 0x00000020
  111. #define DDOVER_KEYDEST 0x00000040
  112. #define DDOVER_SHOW 0x00000400
  113. #define DDOVER_MIRRORLEFTRIGHT 0x00001000
  114. #define DDOVER_MIRRORUPDOWN 0x00002000
  115. #define DDCKEY_DESTOVERLAY 0x00000004
  116. #define DDSCL_NORMAL 0x00000000
  117. #define DDSCL_FULLSCREEN 0x00000001
  118. #define DDERR_SURFACELOST 0x887601C2
  119. #define DDFLIP_WAITNOTBUSY 0x00000008
  120. #define DDENUMRET_CANCEL 0
  121. #define DDENUMRET_OK 1
  122. typedef struct IDirectDrawVMT
  123. {
  124.     HRESULT (STDCALL* QueryInterface)(struct IDirectDraw*, const guid*, LPVOID*);
  125.     ULONG (STDCALL* AddRef)(struct IDirectDraw*);
  126.     ULONG (STDCALL* Release)(struct IDirectDraw*);
  127.     HRESULT (STDCALL* CreateClipper)(struct IDirectDraw*, DWORD, LPDIRECTDRAWCLIPPER*, void* );
  128.     HRESULT (STDCALL* CreatePalette)(struct IDirectDraw*, DWORD, LPPALETTEENTRY, LPDIRECTDRAWPALETTE*, void* );
  129.     HRESULT (STDCALL* CreateSurface)(struct IDirectDraw*,  LPDDSURFACEDESC, LPDIRECTDRAWSURFACE*, void*);
  130.     HRESULT (STDCALL* EnumDisplayModes)( struct IDirectDraw*, DWORD, LPDDSURFACEDESC, LPVOID, void* );
  131.     HRESULT (STDCALL* EnumSurfaces)(struct IDirectDraw*, DWORD, LPDDSURFACEDESC, LPVOID, void* );
  132.     HRESULT (STDCALL* FlipToGDISurface)(struct IDirectDraw*);
  133.     HRESULT (STDCALL* GetCaps)( struct IDirectDraw*, LPDDCAPS, LPDDCAPS);
  134.     HRESULT (STDCALL* GetDisplayMode)( struct IDirectDraw*, LPDDSURFACEDESC);
  135.     HRESULT (STDCALL* GetFourCCCodes)(struct IDirectDraw*,  LPDWORD, LPDWORD );
  136.     HRESULT (STDCALL* GetGDISurface)(struct IDirectDraw*, LPDIRECTDRAWSURFACE*);
  137.     HRESULT (STDCALL* GetMonitorFrequency)(struct IDirectDraw*, LPDWORD);
  138.     HRESULT (STDCALL* GetScanLine)(struct IDirectDraw*, LPDWORD);
  139.     HRESULT (STDCALL* GetVerticalBlankStatus)(struct IDirectDraw*, LPBOOL );
  140.     HRESULT (STDCALL* RestoreDisplayMode)(struct IDirectDraw*);
  141.     HRESULT (STDCALL* SetCooperativeLevel)(struct IDirectDraw*, HWND, DWORD);
  142.     HRESULT (STDCALL* SetDisplayMode)(struct IDirectDraw*, DWORD, DWORD,DWORD);
  143.     HRESULT (STDCALL* WaitForVerticalBlank)(struct IDirectDraw*, DWORD, HANDLE);
  144.     HRESULT (STDCALL* GetAvailableVidMem)(struct IDirectDraw*, LPDDSCAPS, LPDWORD, LPDWORD);
  145.     HRESULT (STDCALL* GetSurfaceFromDC)(struct IDirectDraw*, HDC, LPDIRECTDRAWSURFACE*);
  146.     HRESULT (STDCALL* RestoreAllSurfaces)(struct IDirectDraw*);
  147.     HRESULT (STDCALL* TestCooperativeLevel)(struct IDirectDraw*);
  148.     HRESULT (STDCALL* GetDeviceIdentifier)(struct IDirectDraw*,void*, DWORD );
  149. } IDirectDrawVMT;
  150. typedef struct IDirectDraw
  151. {
  152. IDirectDrawVMT *VMT;
  153. } IDirectDraw;
  154. #define IDirectDraw_QueryInterface(p,a,b) (p)->VMT->QueryInterface(p,a,b)
  155. #define IDirectDraw_Release(p) (p)->VMT->Release(p)
  156. #define IDirectDraw_CreateSurface(p,a,b,c) (p)->VMT->CreateSurface(p,a,b,c)
  157. #define IDirectDraw_GetDisplayMode(p,a)         (p)->VMT->GetDisplayMode(p,a)
  158. #define IDirectDraw_SetCooperativeLevel(p,a,b)  (p)->VMT->SetCooperativeLevel(p,a,b)
  159. #define IDirectDraw_GetCaps(p,a,b)              (p)->VMT->GetCaps(p,a,b)
  160. #define IDirectDraw_WaitForVerticalBlank(p,a,b) (p)->VMT->WaitForVerticalBlank(p,a,b)
  161. typedef HRESULT (FAR PASCAL *LPDDENUMSURFACESCALLBACK)(LPDIRECTDRAWSURFACE, LPDDSURFACEDESC, LPVOID);
  162. typedef struct IDirectDrawSurfaceVMT
  163. {
  164.     HRESULT (STDCALL* QueryInterface)(struct IDirectDrawSurface*, void*, LPVOID*);
  165.     ULONG (STDCALL* AddRef)(struct IDirectDrawSurface*);
  166.     ULONG (STDCALL* Release)(struct IDirectDrawSurface*);
  167.     HRESULT (STDCALL* AddOverlayDirtyRect)(struct IDirectDrawSurface*, LPRECT);
  168.     HRESULT (STDCALL* Blt)(struct IDirectDrawSurface*, LPRECT,LPDIRECTDRAWSURFACE, LPRECT,DWORD, void*);
  169.     HRESULT (STDCALL* EnumAttachedSurfaces)(struct IDirectDrawSurface*, LPVOID,LPDDENUMSURFACESCALLBACK);
  170.     HRESULT (STDCALL* EnumOverlayZOrders)(struct IDirectDrawSurface*, DWORD,LPVOID,void*);
  171.     HRESULT (STDCALL* Flip)(struct IDirectDrawSurface*, LPDIRECTDRAWSURFACE, DWORD);
  172.     HRESULT (STDCALL* GetBltStatus)(struct IDirectDrawSurface*, DWORD);
  173.     HRESULT (STDCALL* GetCaps)(struct IDirectDrawSurface*, LPDDSCAPS);
  174.     HRESULT (STDCALL* GetClipper)(struct IDirectDrawSurface*, LPDIRECTDRAWCLIPPER*);
  175.     HRESULT (STDCALL* GetColorKey)(struct IDirectDrawSurface*, DWORD, LPDDCOLORKEY);
  176.     HRESULT (STDCALL* GetDC)(struct IDirectDrawSurface*, HDC*);
  177.     HRESULT (STDCALL* GetFlipStatus)(struct IDirectDrawSurface*, DWORD);
  178.     HRESULT (STDCALL* GetOverlayPosition)(struct IDirectDrawSurface*, LPLONG, LPLONG );
  179.     HRESULT (STDCALL* GetPalette)(struct IDirectDrawSurface*, LPDIRECTDRAWPALETTE*);
  180.     HRESULT (STDCALL* GetPixelFormat)(struct IDirectDrawSurface*, LPDDPIXELFORMAT);
  181.     HRESULT (STDCALL* GetSurfaceDesc)(struct IDirectDrawSurface*, LPDDSURFACEDESC);
  182.     HRESULT (STDCALL* IsLost)(struct IDirectDrawSurface*);
  183.     HRESULT (STDCALL* Lock)(struct IDirectDrawSurface*, LPRECT,LPDDSURFACEDESC,DWORD,HANDLE);
  184.     HRESULT (STDCALL* ReleaseDC)(struct IDirectDrawSurface*, HDC);
  185.     HRESULT (STDCALL* Restore)(struct IDirectDrawSurface*);
  186.     HRESULT (STDCALL* SetClipper)(struct IDirectDrawSurface*, LPDIRECTDRAWCLIPPER);
  187.     HRESULT (STDCALL* SetColorKey)(struct IDirectDrawSurface*, DWORD, LPDDCOLORKEY);
  188.     HRESULT (STDCALL* SetOverlayPosition)(struct IDirectDrawSurface*, LONG, LONG );
  189.     HRESULT (STDCALL* SetPalette)(struct IDirectDrawSurface*, LPDIRECTDRAWPALETTE);
  190.     HRESULT (STDCALL* Unlock)(struct IDirectDrawSurface*, LPVOID);
  191.     HRESULT (STDCALL* UpdateOverlay)(struct IDirectDrawSurface*, LPRECT, LPDIRECTDRAWSURFACE,LPRECT,DWORD, LPDDOVERLAYFX);
  192.     HRESULT (STDCALL* UpdateOverlayZOrder)(struct IDirectDrawSurface*, DWORD, LPDIRECTDRAWSURFACE);
  193.     HRESULT (STDCALL* GetDDInterface)(struct IDirectDrawSurface*, LPDIRECTDRAW *);
  194.     HRESULT (STDCALL* AlphaBlt)(struct IDirectDrawSurface*, LPRECT, LPDIRECTDRAWSURFACE, LPRECT, DWORD, void*);
  195. } IDirectDrawSurfaceVMT;
  196. typedef struct IDirectDrawSurface
  197. {
  198. IDirectDrawSurfaceVMT *VMT;
  199. } IDirectDrawSurface;
  200. #define IDirectDrawSurface_Release(p) (p)->VMT->Release(p)
  201. #define IDirectDrawSurface_Blt(p,a,b,c,d,e) (p)->VMT->Blt(p,a,b,c,d,e)
  202. #define IDirectDrawSurface_GetSurfaceDesc(p,a) (p)->VMT->GetSurfaceDesc(p,a)
  203. #define IDirectDrawSurface_Lock(p,a,b,c,d) (p)->VMT->Lock(p,a,b,c,d)
  204. #define IDirectDrawSurface_Unlock(p,b) (p)->VMT->Unlock(p,b)
  205. #define IDirectDrawSurface_UpdateOverlay(p,a,b,c,d,e) (p)->VMT->UpdateOverlay(p,a,b,c,d,e)
  206. #define IDirectDrawSurface_SetColorKey(p,a,b)           (p)->VMT->SetColorKey(p,a,b)
  207. #define IDirectDrawSurface_Restore(p)                   (p)->VMT->Restore(p)
  208. #define IDirectDrawSurface_Flip(p,a,b) (p)->VMT->Flip(p,a,b)
  209. #define IDirectDrawSurface_EnumAttachedSurfaces(p,a,b) (p)->VMT->EnumAttachedSurfaces(p,a,b)