예제 #1
0
 public bool OnRestore(ref CSwapChainDesc desc)
 {
     unsafe
     {
         fixed(CSwapChainDesc *p = &desc)
         {
             return((bool)SDK_ISwapChain_OnRestore(CoreObject, p));
         }
     }
 }
예제 #2
0
 public void GetDesc(ref CSwapChainDesc desc)
 {
     unsafe
     {
         fixed(CSwapChainDesc *p = &desc)
         {
             SDK_ISwapChain_GetDesc(CoreObject, p);
         }
     }
 }
예제 #3
0
 public CSwapChain CreateSwapChain(CSwapChainDesc desc)
 {
     unsafe
     {
         var sc = SDK_IRenderContext_CreateSwapChain(CoreObject, &desc);
         if (sc.Pointer == IntPtr.Zero)
         {
             return(null);
         }
         return(new CSwapChain(sc));
     }
 }
예제 #4
0
        public void OnResize(UInt32 width, UInt32 height)
        {
            CSwapChainDesc desc = new CSwapChainDesc();

            GetDesc(ref desc);
            OnLost();
            mTexture2D?.Cleanup();
            desc.Width  = width;
            desc.Height = height;
            OnRestore(ref desc);
            var tex = SDK_ISwapChain_GetTexture2D(CoreObject);

            mTexture2D = new CTexture2D(tex);
            if (tex.Pointer != IntPtr.Zero)
            {
                SDK_VIUnknown_AddRef(mTexture2D.CoreObject.Pointer);
            }
        }