bdirectdraw.h

来自「用VC++及DirectX实现的SuperMario小游戏」· C头文件 代码 · 共 51 行

H
51
字号
/*
Author: Bear

This source is free to anybody.
If you have any problem with this or some advice to me, please:
    mailto: heyang22118952.student@sina.com
        or  yang45249.student@sina.com
or you can contact me through my QQ:     261570581

Welcome to discuss game programming techniques with me :)
And I like to play games!
*/
#pragma once

#include "BHeader.h"

class BDLL_API BDirectDraw
{
public:
	BDirectDraw(void);
	~BDirectDraw(void);
	bool Initialize(HWND hwnd, bool bFullScreen, int width, int height, int bpp);
	void UnInitialize(void);
	LPDIRECTDRAWSURFACE7 CreateOffScreenSurface(int width, int height, int memFlag, int colorKey = 0);
	LPDIRECTDRAWSURFACE7 GetPrimarySurface(void);
	LPDIRECTDRAWSURFACE7 GetBackSurface(void);
	LPDIRECTDRAWCLIPPER GetClipper(void);
	LPDIRECTDRAWPALETTE GetPalette(void);
	int GetBpp(void);
	void Restore(void);
	bool IsFullScreen(void);
	bool ResetDisplayMode(bool bFullScreen, int width, int height, int bpp);
private:
	LPDIRECTDRAW7 lpdd;
	LPDIRECTDRAWSURFACE7 lpddsPrimary;
	LPDIRECTDRAWSURFACE7 lpddsBack;
	LPDIRECTDRAWPALETTE lpddPal;
	LPDIRECTDRAWCLIPPER lpddc;
	LPDIRECTDRAWCLIPPER lpddcWindow;
	PALETTEENTRY palette[256];
	DDSURFACEDESC2 ddsd;
	DDBLTFX ddbltfx;
	DDSCAPS2 ddsCaps;
	HWND hwndMain;
	int screenWidth, screenHeight, screenBpp;
	bool isFullScreen;

	LPDIRECTDRAWCLIPPER AttachClipper(void);
	bool initialized;
};

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?