📄 gtgame.h
字号:
#ifndef GTGAME_H_
#define GTGAME_H_
#include "EasyDraw.h"
#include "Surface.h"
#include "Building.h"
#include "Map.h"
#include "PictureGroup.h"
#include "RTimer.h"
class GtGame;
typedef int (GtGame::*WWndFunc)(DWORD,DWORD);
struct WMessageFunc {
DWORD id;
WWndFunc func;
};
#define MAP_MESSAGE_FUNC() \
public: \
virtual const WMessageFunc* GetMessageEntries() { return messageEntries; } \
static const WMessageFunc messageEntries[];
#define MAP_MESSAGE(id,func) {id,(WWndFunc)&func},
#define END_MAP_MESSAGE() {0,0}};
class GtGame
{
public:
GtGame(HINSTANCE hInstance,int nCmdShow);
~GtGame();
void Create();
int MainLoop();
private:
static LRESULT CALLBACK _ProcFn( HWND hwnd, UINT uMsg,WPARAM wParam, LPARAM lParam );
int OnLButtonDown(DWORD w,DWORD l); // 窗口关闭, 发一退出消息
int OnDestroy(DWORD w,DWORD l); // 窗口关闭, 发一退出消息
int OnKeyDown(DWORD w,DWORD l);
HWND GameHwnd;
ATOM MyRegisterClass();
HINSTANCE hInstance;
int nCmdShow;
Surface surface;
Surface surface1;
Building build;
PictureGroup hero;
Map map;
RTimer timer;
HFONT font;
MAP_MESSAGE_FUNC()
};
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -