From ad1eb12636f3f7822db733da7e813ded5c89ce79 Mon Sep 17 00:00:00 2001 From: jracek Date: Tue, 11 Mar 2025 12:36:34 +0100 Subject: [PATCH] Fixed bug upon opening a fresh vram view window --- Editor/VramEditorWindow.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Editor/VramEditorWindow.cs b/Editor/VramEditorWindow.cs index 74119bb..20c375e 100644 --- a/Editor/VramEditorWindow.cs +++ b/Editor/VramEditorWindow.cs @@ -44,6 +44,14 @@ public class VRAMEditorWindow : EditorWindow GetWindow("VRAM Editor"); } + private void OnEnable() + { + vramImage = new Texture2D(VramWidth, VramHeight); + NativeArray blackPixels = new NativeArray(VramWidth * VramHeight, Allocator.Temp); + vramImage.SetPixelData(blackPixels, 0); + vramImage.Apply(); + blackPixels.Dispose(); + } public static void PasteTexture(Texture2D baseTexture, Texture2D overlayTexture, int posX, int posY) {