コード例 #1
0
 private void Load(ref List <DrawTask> tasks, IntPtr group)
 {
     Util.CheckError();
     try
     {
         uint cnt = BrowserInterop.vtsDrawsCount(group);
         Util.CheckError();
         if (tasks == null)
         {
             tasks = new List <DrawTask>((int)cnt);
         }
         else
         {
             tasks.Clear();
         }
         for (uint i = 0; i < cnt; i++)
         {
             DrawTask t;
             IntPtr   pm, ptc, ptm;
             IntPtr   dataPtr = BrowserInterop.vtsDrawsAllInOne(group, i, out pm, out ptc, out ptm);
             Util.CheckError();
             t.data     = (DrawBase)Marshal.PtrToStructure(dataPtr, typeof(DrawBase));
             t.mesh     = Load(pm);
             t.texColor = Load(ptc);
             t.texMask  = Load(ptm);
             tasks.Add(t);
         }
     }
     finally
     {
         BrowserInterop.vtsDrawsDestroy(group);
         Util.CheckError();
     }
 }