base.h

来自「对游戏编程感兴趣的 朋友可以 下载下来看看 对DX讲解的很很详细」· C头文件 代码 · 共 50 行

H
50
字号
// Base.h: interface for the CBase class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_BASE_H__19BD59EB_1A65_420F_B8CC_09F798CE485C__INCLUDED_)
#define AFX_BASE_H__19BD59EB_1A65_420F_B8CC_09F798CE485C__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include <stdio.h>
#include <stdarg.h>
#include <d3dx8.h>
#include <tlhelp32.h>
#include <windows.h>

#define SafeRelease(pInterface) if(pInterface != NULL) {pInterface->Release(); pInterface=NULL;}
#define SafeDelete(pObject) if(pObject != NULL) {delete pObject; pObject=NULL;}

#define KEYDOWN(name, key) (name[key] & 0x80) 
#define MOUSEBUTTONDOWN(key) (key & 0x80)

//Mouse buttons
#define MOUSEBUTTON_LEFT 0
#define MOUSEBUTTON_RIGHT 1
#define MOUSEBUTTON_MIDDLE 2

class CBase  
{
private:
	static bool m_fEnableLogging;

public:
	CBase();
	virtual ~CBase();

	D3DXVECTOR3 GetTriangeNormal(D3DXVECTOR3* vVertex1, D3DXVECTOR3* vVertex2, D3DXVECTOR3* vVertex3);

	static void StartLogging();
	static void StopLogging();
	static void LogError(char *lpszText, ...);
	static void LogInfo(char *lpszText, ...);
	static void LogWarning(char *lpszText, ...);
	static DWORD GetMemoryUsage();
	static void LogMemoryUsage();
};

#endif // !defined(AFX_BASE_H__19BD59EB_1A65_420F_B8CC_09F798CE485C__INCLUDED_)

⌨️ 快捷键说明

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