Beispiel #1
0
 private void LoadTextureCallback(IntPtr h, IntPtr r)
 {
     Debug.Assert(h == Handle);
     if (EventLoadTexture != null)
     {
         Texture t = new Texture();
         t.Load(r);
         BrowserInterop.vtsSetResourceMemoryCost(r, 0, (uint)t.data.Length);
         Util.CheckError();
         GCHandle hnd = GCHandle.Alloc(EventLoadTexture.Invoke(t));
         BrowserInterop.vtsSetResourceUserData(r, GCHandle.ToIntPtr(hnd), UnloadResourceDelegate);
         Util.CheckError();
     }
 }
Beispiel #2
0
        private void LoadTextureCallback(IntPtr h, IntPtr r)
        {
            Map m = GetMap(h);

            if (m.EventLoadTexture != null)
            {
                Texture t = new Texture();
                t.Load(r);
                BrowserInterop.vtsResourceSetMemoryCost(r, 0, (uint)t.data.Length);
                Util.CheckInterop();
                GCHandle hnd = GCHandle.Alloc(m.EventLoadTexture.Invoke(t));
                BrowserInterop.vtsResourceSetUserData(r, GCHandle.ToIntPtr(hnd), m.UnloadResourceDelegate);
                Util.CheckInterop();
            }
        }