aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.Client/MemoryTracker.h
diff options
context:
space:
mode:
authordaoge_cmd <3523206925@qq.com>2026-03-01 12:16:08 +0800
committerdaoge_cmd <3523206925@qq.com>2026-03-01 12:16:08 +0800
commitb691c43c44ff180d10e7d4a9afc83b98551ff586 (patch)
tree3e9849222cbc6ba49f2f1fc6e5fe7179632c7390 /Minecraft.Client/MemoryTracker.h
parentdef8cb415354ac390b7e89052a50605285f1aca9 (diff)
Initial commit
Diffstat (limited to 'Minecraft.Client/MemoryTracker.h')
-rw-r--r--Minecraft.Client/MemoryTracker.h28
1 files changed, 28 insertions, 0 deletions
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<int,int> GL_LIST_IDS;
+ static vector<int> 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);
+};