1 ///////////////////////////////////////////////////////////////////////////////
2 // $Source: x:/prj/tech/libsrc/dispdev/RCS/wdispdd.h $
4 // $Date: 1998/02/02 12:46:29 $
7 // @TBD (toml 05-16-96): Must do a flippable DD mode op
14 ///////////////////////////////////////////////////////////////////////////////
16 class cDDCritMsgHandler
;
19 ///////////////////////////////////////////////////////////////////////////////
25 const char * WhatDDError(HRESULT error
);
28 #define DebugMsgIfErr(msg, err) { if (result != DD_OK) { mprintf("%s, result == \"%s\"\n", msg, WhatDDError(err)); } }
29 #define DebugDumpModeInfo(t, p) DebugMsgTrue5(t, "Mode info is (%d, %d, %d, 0x%lx, 0x%lx)", p->w, p->h, p->rowBytes, p->vbase, p->vbase2)
30 #define DebugMsgDesc(d) \
32 DebugMsg2("Surface Descriptor " #d ": dwSize is %u, dwFlags is 0x%x,", d.dwSize, d.dwFlags); \
33 DebugMsg4(" h is %u, w is %u, p is %d, ddsCaps is 0x%x", d.dwHeight, d.dwWidth, d.lPitch, d.ddsCaps); \
36 #define DebugMsgIfErr(msg, err)
37 #define DebugDumpModeInfo(t, p)
38 #define DebugMsgDesc(fPrimaryDesc)
41 ///////////////////////////////////////////////////////////////////////////////
45 // Implements DirectDraw based version of modeless display device operations
48 class cDDProvider
: public cWinDisplayProvider
51 cDDProvider(cWinDisplayDevice
* pDisplayDevice
);
52 virtual ~cDDProvider();
56 kDDFullScreenCoopFlags
= (DDSCL_FULLSCREEN
| DDSCL_EXCLUSIVE
| DDSCL_ALLOWMODEX
),
57 kDDWindowedCoopFlags
= DDSCL_NORMAL
60 ///////////////////////////////////
62 HRESULT
SetCooperativeLevel(DWORD
);
66 ///////////////////////////////////
68 // Hooks from cWinDisplayProvider
71 virtual BOOL
DoProcessMessage(UINT msg
, WPARAM wParam
, LPARAM lParam
, long * pRetVal
);
72 virtual void DoGetInfo(sGrDeviceInfo
*, sGrModeInfo
*);
73 virtual BOOL
DoOpen(sGrModeCap
*, int flags
);
74 virtual BOOL
DoClose();
75 virtual cWinDisplayModeOperations
* DoSetMode(const sGrModeInfo
&, int flags
, sGrModeCap
* pReturnModeInfo
);
76 virtual BOOL
DoGetDirectDraw(IDirectDraw
**);
77 virtual BOOL
DoGetBitmapSurface(sGrBitmap
*, IDirectDrawSurface
**);
79 ///////////////////////////////////
81 friend class cDDModeOpsBase
;
82 cDDModeOpsBase
* m_pModeOps
;
84 ///////////////////////////////////
86 LPDIRECTDRAW m_pDD
; // DirectDraw object
90 DDSCAPS m_SurfaceCaps
;
91 long m_lTotalVideoMemory
;
92 long m_NormalWindowStyle
;
93 long m_NormalWindowExStyle
;
102 static HRESULT CALLBACK
EnumDisplayModesCallback(LPDDSURFACEDESC pddsd
, LPVOID Context
);
103 friend class cDDCritMsgHandler
;
106 ///////////////////////////////////////////////////////////////////////////////
108 #endif /* !__WDISPDD_H */