예제 #1
0
        public unsafe Win7Output(GraphicsDevice device, IntPtr hwnd, OutputConfiguration desc) : base(device, desc)
        {
            _allocator      = device.CreateAllocator(ExecutionContext.Graphics);
            _presentContext = device.CreateList(ExecutionContext.Graphics, _allocator.Ptr, null).As <ID3D12GraphicsCommandList>();

            _presentFlags = desc.SyncInterval > 0 ? D3D12_DOWNLEVEL_PRESENT_FLAGS.D3D12_DOWNLEVEL_PRESENT_FLAG_WAIT_FOR_VBLANK : 0;
            _hwnd         = hwnd;
            _presentQueue = device.GraphicsQueue;

            if (!ComPtr.TryQueryInterface(_presentQueue.GetQueue(), out ID3D12CommandQueueDownlevel * pDownlevel))
            {
                ThrowHelper.ThrowPlatformNotSupportedException("Not on windows7");
            }

            _queue = new(pDownlevel);

            RECT window;

            _ = Windows.GetClientRect(hwnd, &window);

            InternalResize(new Size(width: window.right - window.left, height: window.bottom - window.top));
        }
예제 #2
0
 public int Present([NativeTypeName("ID3D12GraphicsCommandList *")] ID3D12GraphicsCommandList *pOpenCommandList, [NativeTypeName("ID3D12Resource *")] ID3D12Resource *pSourceTex2D, [NativeTypeName("HWND")] IntPtr hWindow, D3D12_DOWNLEVEL_PRESENT_FLAGS Flags)
 {
     return(((delegate * unmanaged <ID3D12CommandQueueDownlevel *, ID3D12GraphicsCommandList *, ID3D12Resource *, IntPtr, D3D12_DOWNLEVEL_PRESENT_FLAGS, int>)(lpVtbl[3]))((ID3D12CommandQueueDownlevel *)Unsafe.AsPointer(ref this), pOpenCommandList, pSourceTex2D, hWindow, Flags));
 }
예제 #3
0
 public HRESULT Present(ID3D12GraphicsCommandList *pOpenCommandList, ID3D12Resource *pSourceTex2D, HWND hWindow, D3D12_DOWNLEVEL_PRESENT_FLAGS Flags)
 {
     return(((delegate * unmanaged <ID3D12CommandQueueDownlevel *, ID3D12GraphicsCommandList *, ID3D12Resource *, HWND, D3D12_DOWNLEVEL_PRESENT_FLAGS, int>)(lpVtbl[3]))((ID3D12CommandQueueDownlevel *)Unsafe.AsPointer(ref this), pOpenCommandList, pSourceTex2D, hWindow, Flags));
 }