可是我现在才起来
dx8 的源文件ddutil.cpp中有的
class CDisplay
{
protected:
LPDIRECTDRAW7 m_pDD;
LPDIRECTDRAWSURFACE7 m_pddsFrontBuffer;
LPDIRECTDRAWSURFACE7 m_pddsBackBuffer;
LPDIRECTDRAWSURFACE7 m_pddsBackBufferLeft; // For stereo modes
HWND m_hWnd;
RECT m_rcWindow;
BOOL m_bWindowed;
BOOL m_bStereo;
public:
CDisplay();
~CDisplay();
// Access functions
HWND GetHWnd() { return m_hWnd; }
LPDIRECTDRAW7 GetDirectDraw() { return m_pDD; }
LPDIRECTDRAWSURFACE7 GetFrontBuffer() { return m_pddsFrontBuffer; }
LPDIRECTDRAWSURFACE7 GetBackBuffer() { return m_pddsBackBuffer; }
LPDIRECTDRAWSURFACE7 GetBackBufferLEft() { return m_pddsBackBufferLeft; }
// Status functions
BOOL IsWindowed() { return m_bWindowed; }
BOOL IsStereo() { return m_bStereo; }
// Creation/destruction methods
HRESULT CreateFullScreenDisplay( HWND hWnd, DWORD dwWidth, DWORD dwHeight,
DWORD dwBPP );
HRESULT CreateWindowedDisplay( HWND hWnd, DWORD dwWidth, DWORD dwHeight );
HRESULT InitClipper();
HRESULT UpdateBounds();
virtual HRESULT DestroyObjects();
// Methods to create child objects
HRESULT CreateSurface( CSurface** ppSurface, DWORD dwWidth,
DWORD dwHeight );
HRESULT CreateSurfaceFromBitmap( CSurface** ppSurface, TCHAR* strBMP,
DWORD dwDesiredWidth,
DWORD dwDesiredHeight );
HRESULT CreateSurfaceFromText( CSurface** ppSurface, HFONT hFont,
TCHAR* strText,
COLORREF crBackground,
COLORREF crForeground );
HRESULT CreatePaletteFromBitmap( LPDIRECTDRAWPALETTE* ppPalette, const TCHAR* strBMP );
// Display methods
HRESULT Clear( DWORD dwColor = 0L );
HRESULT ColorKeyBlt( DWORD x, DWORD y, LPDIRECTDRAWSURFACE7 pdds,
RECT* prc = NULL );
HRESULT Blt( DWORD x, DWORD y, LPDIRECTDRAWSURFACE7 pdds,
RECT* prc=NULL, DWORD dwFlags=0 );
HRESULT Blt( DWORD x, DWORD y, CSurface* pSurface, RECT* prc = NULL );
HRESULT ShowBitmap( HBITMAP hbm, LPDIRECTDRAWPALETTE pPalette=NULL );
HRESULT SetPalette( LPDIRECTDRAWPALETTE pPalette );
HRESULT Present();
};