Esempio n. 1
0
 private void LoadMeshCallback(IntPtr h, IntPtr r)
 {
     Debug.Assert(h == Handle);
     if (EventLoadMesh != null)
     {
         Mesh m = new Mesh();
         m.Load(r);
         BrowserInterop.vtsSetResourceMemoryCost(r, 0, (uint)(m.vertices == null ? 0 : m.vertices.Length) + (uint)(m.indices == null ? 0 : m.indices.Length) * 2);
         Util.CheckError();
         GCHandle hnd = GCHandle.Alloc(EventLoadMesh.Invoke(m));
         BrowserInterop.vtsSetResourceUserData(r, GCHandle.ToIntPtr(hnd), UnloadResourceDelegate);
         Util.CheckError();
     }
 }
Esempio n. 2
0
        private void LoadMeshCallback(IntPtr h, IntPtr r)
        {
            Map m = GetMap(h);

            if (m.EventLoadMesh != null)
            {
                Mesh msh = new Mesh();
                msh.Load(r);
                BrowserInterop.vtsResourceSetMemoryCost(r, 0, (uint)(msh.vertices == null ? 0 : msh.vertices.Length) + (uint)(msh.indices == null ? 0 : msh.indices.Length) * 2);
                Util.CheckInterop();
                GCHandle hnd = GCHandle.Alloc(m.EventLoadMesh.Invoke(msh));
                BrowserInterop.vtsResourceSetUserData(r, GCHandle.ToIntPtr(hnd), m.UnloadResourceDelegate);
                Util.CheckInterop();
            }
        }