📄 dd.h
字号:
#ifndef _DD_H
#define _DD_H
#include <ddraw.h>
class CDD
{
public:
int m_nScreenHeight;//全屏幕的长宽;
int m_nScreenWidth;
public:
LPDIRECTDRAW m_lpDD; //DirectDraw object;
LPDIRECTDRAWSURFACE m_lpDDS_Primary;//DirectDraw primary surface.
LPDIRECTDRAWSURFACE m_lpDDS_Back; //Directdraw back surface.
LPDIRECTDRAWSURFACE m_lpDDS_Source;
LPCSTR m_szSourceBitmap;//资源位图;
public:
CDD();
~CDD();
CDD(HWND hwnd,
UINT uScreenWidth,
UINT uScreenHeight,
UINT uColorDepth,
LPCSTR szSourceBitmap,
COLORREF rgbTran,
COLORREF rgbBK);
public:
bool Initialize(HWND hwnd, //窗口句柄;
UINT uScreenWidth,UINT uScreenHeight,//屏幕尺寸;
UINT uColorDepth, //颜色深度;8、16 or 32?
LPCSTR szSourceBitmap, //源位图资源;
COLORREF rgbTran, //透明色;
COLORREF rgbBK); //背景色;
HRESULT RestoreSurface(void);
HRESULT ReLoadSourceBitmap(LPCSTR szSourceBitmap);
void FlipSurface(void);
void Destroy(void);
bool BlitSourceToBack(int x,int y,RECT rcRect,int style);
bool StretchBlitSourceToBack(RECT rcDest,RECT rcSrc,int style);
bool BlitBackToPrimary(int x,int y,RECT rcRect,int style);
bool SetBkColor(COLORREF rgb);
void ErrorCheck(HRESULT ddrval);
};
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -