public override void DebugReadbackImage(out int w, out int h, out NativeArray <byte> pixels) { var displayInfo = GetSingleton <DisplayInfo>(); pixels = new NativeArray <byte>(displayInfo.framebufferWidth * displayInfo.framebufferHeight * 4, Allocator.Persistent); unsafe { HTMLNativeCalls.debugReadback(displayInfo.framebufferWidth, displayInfo.framebufferHeight, pixels.GetUnsafePtr()); } w = displayInfo.framebufferWidth; h = displayInfo.framebufferHeight; }
public override void DebugReadbackImage(out int w, out int h, out NativeArray <byte> pixels) { var env = World.TinyEnvironment(); var config = env.GetConfigData <DisplayInfo>(); pixels = new NativeArray <byte>(config.framebufferWidth * config.framebufferHeight * 4, Allocator.Persistent); unsafe { HTMLNativeCalls.debugReadback(config.framebufferWidth, config.framebufferHeight, pixels.GetUnsafePtr()); } w = config.framebufferWidth; h = config.framebufferHeight; }