debug.h

来自「小型的3D游戏引擎」· C头文件 代码 · 共 44 行

H
44
字号
#ifndef _DEBUG_H_
#define _DEBUG_H_

#include "compinfo.h"
#include <string>
#include "../singleton.h"
#include "dbgconsole.h"

class GcDebug : public Singleton<GcDebug>
{
public:
	
	
	// Constructor / Destructor
	GcDebug();
	~GcDebug();

	//enum MsgType { INFO, ERROR };

	void GetInfo();
	
	void Report( char * string, ... );
	//void Report( MsgType type, char * string, ... );
	bool Log( char * string, ... );		// Open, write and close log file
	

	static void Allocated()			{ numAllocated++; }
	static void Deallocated()		{ numDeallocated++; }
	static void Memory(int mem)		{ memoryUsed += mem; }
	static __int64 Memory()			{ return memoryUsed; }
	GcDebugConsole * Console()		{ return m_debugConsole; }

private:
	static __int64			memoryUsed;
	static unsigned int		numAllocated;
	static unsigned int		numDeallocated;

	char				fileName[255];
	GcCompchar			comp;
	GcDebugConsole *	m_debugConsole;
};


#endif

⌨️ 快捷键说明

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