private void LoadSimple(ref List <DrawSimpleTask> tasks, IntPtr group, uint cnt) { Util.CheckInterop(); if (tasks == null) { tasks = new List <DrawSimpleTask>((int)cnt); } else { tasks.Clear(); } for (uint i = 0; i < cnt; i++) { DrawSimpleTask t; IntPtr pm = IntPtr.Zero, ptc = IntPtr.Zero, pbs = IntPtr.Zero; BrowserInterop.vtsDrawsSimpleTask(group, i, ref pm, ref ptc, ref pbs); Util.CheckInterop(); if (pm == IntPtr.Zero) { continue; } t.data = (DrawSimpleBase)Marshal.PtrToStructure(pbs, typeof(DrawSimpleBase)); t.mesh = Load(pm); t.texColor = Load(ptc); tasks.Add(t); } }