From b691c43c44ff180d10e7d4a9afc83b98551ff586 Mon Sep 17 00:00:00 2001 From: daoge_cmd <3523206925@qq.com> Date: Sun, 1 Mar 2026 12:16:08 +0800 Subject: Initial commit --- Minecraft.Client/MemoryTracker.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 Minecraft.Client/MemoryTracker.h (limited to 'Minecraft.Client/MemoryTracker.h') diff --git a/Minecraft.Client/MemoryTracker.h b/Minecraft.Client/MemoryTracker.h new file mode 100644 index 00000000..9567fac9 --- /dev/null +++ b/Minecraft.Client/MemoryTracker.h @@ -0,0 +1,28 @@ +#pragma once +#include "MemoryTracker.h" +class ByteBuffer; +class IntBuffer; +class FloatBuffer; +using namespace std; + +/** Original comment + * This class is used so we can release all memory (allocated on the graphics card on shutdown) + */ +// 4J - all member functions in here were synchronized +class MemoryTracker +{ +private: + static unordered_map GL_LIST_IDS; + static vector TEXTURE_IDS; + +public: + static int genLists(int count); + static int genTextures(); + static void releaseLists(int id); + static void releaseTextures(); + static void release(); + // 4J - note - have removed buffer types from here that we aren't using + static ByteBuffer *createByteBuffer(int size); + static IntBuffer *createIntBuffer(int size); + static FloatBuffer *createFloatBuffer(int size); +}; -- cgit v1.2.3