Linux makefiles
[canaan.git] / prj / tech / libsrc / dispdev / wdispdd.h
blob8595eb696ff23f9f6c0a502b4eec3c8fc00f1925
1 ///////////////////////////////////////////////////////////////////////////////
2 // $Source: x:/prj/tech/libsrc/dispdev/RCS/wdispdd.h $
3 // $Author: KEVIN $
4 // $Date: 1998/02/02 12:46:29 $
5 // $Revision: 1.13 $
6 //
7 // @TBD (toml 05-16-96): Must do a flippable DD mode op
8 // implementation
9 //
11 #ifndef __WDISPDD_H
12 #define __WDISPDD_H
14 ///////////////////////////////////////////////////////////////////////////////
16 class cDDCritMsgHandler;
17 class cDDModeOpsBase;
19 ///////////////////////////////////////////////////////////////////////////////
21 #ifdef DEBUG
22 #include <mprintf.h>
23 #endif
25 const char * WhatDDError(HRESULT error);
27 #ifdef DEBUG
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) \
31 do { \
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); \
34 } while(0)
35 #else
36 #define DebugMsgIfErr(msg, err)
37 #define DebugDumpModeInfo(t, p)
38 #define DebugMsgDesc(fPrimaryDesc)
39 #endif
41 ///////////////////////////////////////////////////////////////////////////////
43 // CLASS: cDDProvider
45 // Implements DirectDraw based version of modeless display device operations
48 class cDDProvider : public cWinDisplayProvider
50 public:
51 cDDProvider(cWinDisplayDevice * pDisplayDevice);
52 virtual ~cDDProvider();
54 enum
56 kDDFullScreenCoopFlags = (DDSCL_FULLSCREEN | DDSCL_EXCLUSIVE | DDSCL_ALLOWMODEX),
57 kDDWindowedCoopFlags = DDSCL_NORMAL
60 ///////////////////////////////////
62 HRESULT SetCooperativeLevel(DWORD);
64 private:
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
88 DWORD m_DDCoopFlags;
89 DWORD m_PalFlags;
90 DDSCAPS m_SurfaceCaps;
91 long m_lTotalVideoMemory;
92 long m_NormalWindowStyle;
93 long m_NormalWindowExStyle;
95 enum eFlags
97 kAlwaysEmulate = 0x01
100 int m_Flags;
102 static HRESULT CALLBACK EnumDisplayModesCallback(LPDDSURFACEDESC pddsd, LPVOID Context);
103 friend class cDDCritMsgHandler;
106 ///////////////////////////////////////////////////////////////////////////////
108 #endif /* !__WDISPDD_H */