DirectXTK/Inc/XboxDDSTextureLoader.h

68 строки
2.2 KiB
C
Исходник Обычный вид История

2017-02-15 02:51:26 +03:00
//--------------------------------------------------------------------------------------
// File: XboxDDSTextureLoader.h
//
// Functions for loading a DDS texture using the XBOX extended header and creating a
// Direct3D11.X runtime resource for it via the CreatePlacement APIs
//
// Note these functions will not load standard DDS files. Use the DDSTextureLoader
// module in the DirectXTex package or as part of the DirectXTK library to load
// these files which use standard Direct3D resource creation APIs.
//
2021-02-27 10:00:12 +03:00
// Copyright (c) Microsoft Corporation.
2018-02-23 22:49:48 +03:00
// Licensed under the MIT License.
2017-02-15 02:51:26 +03:00
//
// http://go.microsoft.com/fwlink/?LinkId=248926
// http://go.microsoft.com/fwlink/?LinkId=248929
//--------------------------------------------------------------------------------------
#pragma once
#if !defined(_XBOX_ONE) || !defined(_TITLE)
#error This module only supports Xbox One exclusive apps
#endif
#include <d3d11_x.h>
#include <cstddef>
2020-03-03 23:13:38 +03:00
#include <cstdint>
2017-02-15 02:51:26 +03:00
#ifndef DDS_ALPHA_MODE_DEFINED
#define DDS_ALPHA_MODE_DEFINED
namespace DirectX
2017-02-15 02:51:26 +03:00
{
2020-05-21 10:37:05 +03:00
enum DDS_ALPHA_MODE : uint32_t
2017-02-15 02:51:26 +03:00
{
DDS_ALPHA_MODE_UNKNOWN = 0,
DDS_ALPHA_MODE_STRAIGHT = 1,
2017-02-15 02:51:26 +03:00
DDS_ALPHA_MODE_PREMULTIPLIED = 2,
DDS_ALPHA_MODE_OPAQUE = 3,
DDS_ALPHA_MODE_CUSTOM = 4,
2017-02-15 02:51:26 +03:00
};
}
#endif
namespace Xbox
{
using DirectX::DDS_ALPHA_MODE;
2017-02-15 02:51:26 +03:00
HRESULT __cdecl CreateDDSTextureFromMemory(
_In_ ID3D11DeviceX* d3dDevice,
_In_reads_bytes_(ddsDataSize) const uint8_t* ddsData,
_In_ size_t ddsDataSize,
_Outptr_opt_ ID3D11Resource** texture,
_Outptr_opt_ ID3D11ShaderResourceView** textureView,
_Outptr_ void** grfxMemory,
_Out_opt_ DDS_ALPHA_MODE* alphaMode = nullptr,
_In_ bool forceSRGB = false) noexcept;
2017-02-15 02:51:26 +03:00
HRESULT __cdecl CreateDDSTextureFromFile( _In_ ID3D11DeviceX* d3dDevice,
_In_z_ const wchar_t* szFileName,
_Outptr_opt_ ID3D11Resource** texture,
_Outptr_opt_ ID3D11ShaderResourceView** textureView,
_Outptr_ void** grfxMemory,
_Out_opt_ DDS_ALPHA_MODE* alphaMode = nullptr,
_In_ bool forceSRGB = false) noexcept;
2017-02-15 02:51:26 +03:00
void FreeDDSTextureMemory( _In_opt_ void* grfxMemory ) noexcept;
}