mem.h

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

H
34 行
字号
#ifndef _MEM_H_
#define _MEM_H_

#include "../global.h"

class GcMem
{
public:

	// Allocate a pool of memory
	bool Init(uint size, bool vidMem = true);

	// "Allocate" a amount of memory from the pool
	void *Allocate(uint size);

	// "Free" the memory back to the pool
	//void Free(void *pointer);

	// using video memory or not?
	bool VideoMemory() const { return videoMem; }

	// De-allocate the pool
	void ShutDown(); 

private:

	byte		*memPool;		// The memory pool
	uint		poolSize;		// The size of the pool
	uint		usedSize;		// The amount of memory used
	bool		videoMem;		// Is memory on the gfx card?

};

#endif

⌨️ 快捷键说明

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