📄 application.h
字号:
//--------------------------------------------------
// Desc: application
// Date: 2006.12.18 /update
// Author: artsylee
//
// Copyright (C) 2006 artsylee
//
//--------------------------------------------------
#ifndef _APPLICATION_
#define _APPLICATION_
#include <Windows.h>
class CGraphics;
class ASE_DLL CGameApp
{
public:
CGameApp();
virtual ~CGameApp();
// state
void SetWindowWidth(int width) { m_ScreenWidth = width; }
void SetWindowHeight(int height) { m_ScreenHeight = height; }
void SetWindowDepth(int depth) { m_ScreenDepth = depth; }
int GetWindowWidth(void) { return m_ScreenWidth; }
int GetWindowHeight(void) { return m_ScreenHeight; }
int GetWindowDepth(void) { return m_ScreenDepth; }
void SetWindowMode(bool bwin) { m_bWindowed = bwin; }
bool GetWindowMode(void) { return m_bWindowed; }
void SetNotSuspend(bool bnotSus) { m_bNotSuspend = bnotSus; }
bool GetNotSuspend(void) { return m_bNotSuspend; }
void SetDLLFileLog(bool blog) { m_bDLLFileLog = blog; }
bool GetDLLFileLog(void) { return m_bDLLFileLog; }
void SetActive(bool bActive) { m_bActive = bActive; }
bool GetActive(void) { return m_bActive; }
void SetFPS(int fps);
int GetFPS(void) { return m_CurrentFPS; }
HWND GetWndHandle() { return m_hWnd; }
HINSTANCE GetInstance() { return m_hInst; }
virtual BOOL InitApplication(HINSTANCE hInstance, int nCmdShow, const char *szCaption = "Game Engine", const char *szIcon = IDI_APPLICATION);
virtual BOOL Destroy(void);
virtual void Run(void);
virtual void MainLoop(void) { }
protected:
HWND InitWindow(HINSTANCE hInstance, int nCmdShow, const char *szCaption = "Game Engine", const char *szIcon = IDI_APPLICATION);
protected:
bool m_bActive;
bool m_bNotSuspend;
bool m_bDLLFileLog;
HWND m_hWnd;
HINSTANCE m_hInst;
CGraphics* m_pGraphics;
// Timer & FPS
DWORD m_dwLastTime;
DWORD m_nFixedDelta;
DWORD m_dwOldTime;
int m_CurrentFPS;
int m_Frame;
//
int m_ScreenWidth;
int m_ScreenHeight;
int m_ScreenDepth;
bool m_bWindowed;
};
#endif // _APPLICATION_
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -