⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 common.cpp

📁 3D游戏展示程序
💻 CPP
字号:
//--------------------------------------------------
//  Desc: Common process
//  Author: artsylee/2006.8.6
//--------------------------------------------------
#include "ase/ASEngine.h"
#include "ModelManager.h"

stInputInfo g_stInputInfo;					// 有效期: Application(MainLoop)
GFont g_Font;								// 有效期: Application(Init-?)
LPDIRECT3DDEVICE9 g_pD3DDevice = NULL;		// 有效期: Application(Init-Destory)
CTextureManager* g_pTextureManager = NULL;	// 有效期: Application(Init-Destory)
CFrameManager*g_pFrameManager = NULL;		// 有效期: Application(Init-Destory)
CGraphics* g_pGraphics = NULL;				// 有效期: Application(Init-Destory)
GUIManager* g_pGUIManager = NULL;			// 有效期: Application(Init-Destory)
CGameApp* g_pGameApp = NULL;				// 有效期: Application(构造-析构)
CMessageManager* g_pMessageManager = NULL;
CModelManager* g_pModelManager = NULL;		// 有效期: Application(构造-析构)

// 高精记时优化
CHTimer g_Htimer;
double g_HDelay;

// 全局时间
unsigned long g_GlobalTime = 0;
unsigned long g_LastUpdateTime = 0;
unsigned long g_ElapsedTime = 0;

// 鼠标偏移
long g_CursorOffsetX = 0;
long g_CursorOffsetY = 0;
long g_CursorOffsetZ = 0;

CWindow* GetGUI(DWORD id)
{
	return (g_pGUIManager->GetElement(id));
}

void GUIShow(DWORD id, bool bShow /* = true */)
{
	CWindow *pElement = g_pGUIManager->GetElement(id);
	if(pElement)
	{
		pElement->Show(bShow);
	}
}

bool IsGUIVisual(DWORD id)
{
	CWindow *pElement = g_pGUIManager->GetElement(id);
	if(pElement)
	{
		return pElement->IsShow();
	}
	return false;
}

void GUIEnable(DWORD id, bool bEnable /* = true */)
{
	CWindow *pElement = g_pGUIManager->GetElement(id);
	if(pElement)
	{
		if(bEnable) pElement->Enable();
		else		pElement->Disable();
	}
}

bool IsGUIEnable(DWORD id)
{
	CWindow *pElement = g_pGUIManager->GetElement(id);
	if(pElement)
	{
		return pElement->IsEnable();
	}
	return false;
}


⌨️ 快捷键说明

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