public bool OnRestore(ref CSwapChainDesc desc) { unsafe { fixed(CSwapChainDesc *p = &desc) { return((bool)SDK_ISwapChain_OnRestore(CoreObject, p)); } } }
public void GetDesc(ref CSwapChainDesc desc) { unsafe { fixed(CSwapChainDesc *p = &desc) { SDK_ISwapChain_GetDesc(CoreObject, p); } } }
public CSwapChain CreateSwapChain(CSwapChainDesc desc) { unsafe { var sc = SDK_IRenderContext_CreateSwapChain(CoreObject, &desc); if (sc.Pointer == IntPtr.Zero) { return(null); } return(new CSwapChain(sc)); } }
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); } }