Exemplo n.º 1
0
 public void Init()
 {
     Format        = EPixelFormat.PXF_D24_UNORM_S8_UINT;
     mCanBeSampled = vBOOL.FromBoolean(true);
     mUseStencil   = vBOOL.FromBoolean(false);
     mTexture2D    = CTexture2D.GetEmptyNativePointer();
     CPUAccess     = 0;
 }
Exemplo n.º 2
0
        public CSwapChain(NativePointer self)
        {
            mCoreObject = self;
            var tex = SDK_ISwapChain_GetTexture2D(CoreObject);

            mTexture2D = new CTexture2D(tex);
            if (tex.Pointer != IntPtr.Zero)
            {
                SDK_VIUnknown_AddRef(mTexture2D.CoreObject.Pointer);
            }
        }
Exemplo n.º 3
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);
            }
        }
Exemplo n.º 4
0
 public void CreateReadableTexture2D(ref CTexture2D pTexture, CShaderResourceView src, CFrameBuffer pFrameBuffers)
 {
     unsafe
     {
         CTexture2D.NativePointer oldPtr = CTexture2D.GetEmptyNativePointer();
         if (pTexture != null)
         {
             oldPtr = pTexture.CoreObject;
         }
         SDK_ICommandList_CreateReadableTexture2D(CoreObject, &oldPtr, src.CoreObject, pFrameBuffers.CoreObject);
         if (pTexture != null)
         {
             pTexture.UnsafeSetNativePointer(oldPtr);
         }
         else
         {
             pTexture = new CTexture2D(oldPtr);
         }
     }
 }
Exemplo n.º 5
0
 public void Init()
 {
     mCanBeSampled = vBOOL.FromBoolean(true);
     Format        = EPixelFormat.PXF_R8G8B8A8_UNORM;
     mTexture2D    = CTexture2D.GetEmptyNativePointer();
 }
Exemplo n.º 6
0
 public void Init()
 {
     mFormat    = EPixelFormat.PXF_R8G8B8A8_UNORM;
     mTexture2D = CTexture2D.GetEmptyNativePointer();
 }