/*
 * Copyright 2016 Steve Lhomme
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
 */

import "dxgi1_3.idl";

typedef enum DXGI_COLOR_SPACE_TYPE {
    DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709         = 0,
    DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709         = 1,
    DXGI_COLOR_SPACE_RGB_STUDIO_G22_NONE_P709       = 2,
    DXGI_COLOR_SPACE_RGB_STUDIO_G22_NONE_P2020      = 3,
    DXGI_COLOR_SPACE_RESERVED                       = 4,
    DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601  = 5,
    DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601     = 6,
    DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P601       = 7,
    DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709     = 8,
    DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P709       = 9,
    DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020    = 10,
    DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020      = 11,
    DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020      = 12,
    DXGI_COLOR_SPACE_YCBCR_STUDIO_G2084_LEFT_P2020  = 13,
    DXGI_COLOR_SPACE_RGB_STUDIO_G2084_NONE_P2020    = 14,
    DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_TOPLEFT_P2020 = 15,
    DXGI_COLOR_SPACE_YCBCR_STUDIO_G2084_TOPLEFT_P2020 = 16,
    DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P2020        = 17,
    DXGI_COLOR_SPACE_CUSTOM                         = 0xFFFFFFFF,
} DXGI_COLOR_SPACE_TYPE;

[
    object,
    local,
    uuid(94d99bdb-f1f8-4ab0-b236-7da0170edab1)
]
interface IDXGISwapChain3 : IDXGISwapChain2
{
    UINT GetCurrentBackBufferIndex();

    HRESULT CheckColorSpaceSupport(
        [in] DXGI_COLOR_SPACE_TYPE ColorSpace,
        [out] UINT* pColorSpaceSupport
    );

    HRESULT SetColorSpace1(
        [in] DXGI_COLOR_SPACE_TYPE ColorSpace
    );

    HRESULT ResizeBuffers1(
        [in] UINT BufferCount,
        [in] UINT Width,
        [in] UINT Height,
        [in] DXGI_FORMAT Format,
        [in] UINT SwapChainFlags,
        [in] const UINT* pCreationNodeMask,
        [in] IUnknown* const* ppPresentQueue
    );
};

typedef enum DXGI_SWAP_CHAIN_COLOR_SPACE_SUPPORT_FLAG
{
    DXGI_SWAP_CHAIN_COLOR_SPACE_SUPPORT_FLAG_PRESENT         = 0x01,
    DXGI_SWAP_CHAIN_COLOR_SPACE_SUPPORT_FLAG_OVERLAY_PRESENT = 0x02,
} DXGI_SWAP_CHAIN_COLOR_SPACE_SUPPORT_FLAG;

[
    object,
    local,
    uuid(1bc6ea02-ef36-464f-bf0c-21ca39e5168a)
]
interface IDXGIFactory4 : IDXGIFactory3
{
    HRESULT EnumAdapterByLuid(
        [in]  LUID     AdapterLuid,
        [in]  REFIID   riid,
        [out] void     **ppvAdapter
    );
    HRESULT EnumWarpAdapter(
        [in]  REFIID   riid,
        [out] void     **ppvAdapter
    );
}

[
    object,
    local,
    uuid(dc7dca35-2196-414d-9F53-617884032a60)
]
interface IDXGIOutput4 : IDXGIOutput3
{
    HRESULT CheckOverlayColorSpaceSupport(
        [in]  DXGI_FORMAT           Format,
        [in]  DXGI_COLOR_SPACE_TYPE ColorSpace,
        [in]  IUnknown              *pConcernedDevice,
        [out] UINT                  *pFlags
    );
}
