Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide bindings for dxgi1_5.h #322

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions lib/dxguid/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -928,13 +928,15 @@ DEFINE_GUID!{IID_IDXGIDecodeSwapChain, 0x2633066b, 0x4514, 0x4c7a, 0x8f, 0xd8, 0
DEFINE_GUID!{IID_IDXGIDevice1, 0x77db970f, 0x6276, 0x48ba, 0xba, 0x28, 0x07, 0x01, 0x43, 0xb4, 0x39, 0x2c}
DEFINE_GUID!{IID_IDXGIDevice2, 0x05008617, 0xfbfd, 0x4051, 0xa7, 0x90, 0x14, 0x48, 0x84, 0xb4, 0xf6, 0xa9}
DEFINE_GUID!{IID_IDXGIDevice3, 0x6007896c, 0x3244, 0x4afd, 0xbf, 0x18, 0xa6, 0xd3, 0xbe, 0xda, 0x50, 0x23}
DEFINE_GUID!{IID_IDXGIDevice4, 0x95b4f95f, 0xd8da, 0x4ca4, 0x9e, 0xe6, 0x3b, 0x76, 0xd5, 0x96, 0x8a, 0x10}
DEFINE_GUID!{IID_IDXGIDevice, 0x54ec77fa, 0x1377, 0x44e6, 0x8c, 0x32, 0x88, 0xfd, 0x5f, 0x44, 0xc8, 0x4c}
DEFINE_GUID!{IID_IDXGIDeviceSubObject, 0x3d3e0379, 0xf9de, 0x4d58, 0xbb, 0x6c, 0x18, 0xd6, 0x29, 0x92, 0xf1, 0xa6}
DEFINE_GUID!{IID_IDXGIDisplayControl, 0xea9dbf1a, 0xc88e, 0x4486, 0x85, 0x4a, 0x98, 0xaa, 0x01, 0x38, 0xf3, 0x0c}
DEFINE_GUID!{IID_IDXGIFactory1, 0x770aae78, 0xf26f, 0x4dba, 0xa8, 0x29, 0x25, 0x3c, 0x83, 0xd1, 0xb3, 0x87}
DEFINE_GUID!{IID_IDXGIFactory2, 0x50c83a1c, 0xe072, 0x4c48, 0x87, 0xb0, 0x36, 0x30, 0xfa, 0x36, 0xa6, 0xd0}
DEFINE_GUID!{IID_IDXGIFactory3, 0x25483823, 0xcd46, 0x4c7d, 0x86, 0xca, 0x47, 0xaa, 0x95, 0xb8, 0x37, 0xbd}
DEFINE_GUID!{IID_IDXGIFactory4, 0x1bc6ea02, 0xef36, 0x464f, 0xbf, 0x0c, 0x21, 0xca, 0x39, 0xe5, 0x16, 0x8a}
DEFINE_GUID!{IID_IDXGIFactory5, 0x7632e1f5, 0xee65, 0x4dca, 0x87, 0xfd, 0x84, 0xcd, 0x75, 0xf8, 0x83, 0x8d}
DEFINE_GUID!{IID_IDXGIFactory, 0x7b7166ec, 0x21c7, 0x44ae, 0xb2, 0x1a, 0xc9, 0xae, 0x32, 0x1a, 0xe3, 0x69}
DEFINE_GUID!{IID_IDXGIFactoryMedia, 0x41e7d1f2, 0xa591, 0x4f7b, 0xa2, 0xe5, 0xfa, 0x9c, 0x84, 0x3e, 0x1c, 0x12}
DEFINE_GUID!{IID_IDXGIInfoQueue, 0xd67441c7, 0x672a, 0x476f, 0x9e, 0x82, 0xcd, 0x55, 0xb4, 0x49, 0x49, 0xce}
Expand All @@ -955,6 +957,7 @@ DEFINE_GUID!{IID_IDXGISurface, 0xcafcb56c, 0x6ac3, 0x4889, 0xbf, 0x47, 0x9e, 0x2
DEFINE_GUID!{IID_IDXGISwapChain1, 0x790a45f7, 0x0d42, 0x4876, 0x98, 0x3a, 0x0a, 0x55, 0xcf, 0xe6, 0xf4, 0xaa}
DEFINE_GUID!{IID_IDXGISwapChain2, 0xa8be2ac4, 0x199f, 0x4946, 0xb3, 0x31, 0x79, 0x59, 0x9f, 0xb9, 0x8d, 0xe7}
DEFINE_GUID!{IID_IDXGISwapChain3, 0x94d99bdb, 0xf1f8, 0x4ab0, 0xb2, 0x36, 0x7d, 0xa0, 0x17, 0x0e, 0xda, 0xb1}
DEFINE_GUID!{IID_IDXGISwapChain4, 0x3d585d5a, 0xbd4a, 0x489e, 0xb1, 0xf4, 0x3d, 0xbc, 0xb6, 0x45, 0x2f, 0xfb}
DEFINE_GUID!{IID_IDXGISwapChain, 0x310d36a0, 0xd2e7, 0x4c0a, 0xaa, 0x04, 0x6a, 0x9d, 0x23, 0xb8, 0x88, 0x6a}
DEFINE_GUID!{IID_IDXGISwapChainMedia, 0xdd95b90b, 0xf05f, 0x4f6a, 0xbd, 0x65, 0x25, 0xbf, 0xb2, 0x64, 0xbd, 0x84}
DEFINE_GUID!{IID_IDirect3D2, 0x6aae1ec1, 0x662a, 0x11d0, 0x88, 0x9d, 0x00, 0xaa, 0x00, 0xbb, 0xb7, 0x6a}
Expand Down
72 changes: 72 additions & 0 deletions src/dxgi1_5.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
// Copyright © 2015; Dmitry Roschin
// Licensed under the MIT License <LICENSE.md>
//! Mappings for the contents of dxgi1_5.h

ENUM!{ enum DXGI_HDR_METADATA_TYPE {
DXGI_HDR_METADATA_TYPE_NONE = 0,
DXGI_HDR_METADATA_TYPE_HDR10 = 1,
}}

ENUM!{ enum DXGI_FEATURE {
DXGI_FEATURE_ALLOW_TEARING = 0,
}}

ENUM!{ enum DXGI_OFFER_RESOURCE_FLAGS {
DXGI_OFFER_RESOURCE_FLAG_ALLOW_DECOMMIT = 0x1,
}}

ENUM!{ enum DXGI_RECLAIM_RESOURCE_RESULTS {
DXGI_RECLAIM_RESOURCE_RESULT_OK = 0,
DXGI_RECLAIM_RESOURCE_RESULT_DISCARDED = 1,
DXGI_RECLAIM_RESOURCE_RESULT_NOT_COMMITTED = 2,
}}

STRUCT!{struct DXGI_HDR_METADATA_HDR10 {
RedPrimary: [::UINT16; 2],
GreenPrimary: [::UINT16; 2],
BluePrimary: [::UINT16; 2],
WhitePoint: [::UINT16; 2],
MaxMasteringLuminance: ::UINT,
MinMasteringLuminance: ::UINT,
MaxContentLightLevel: ::UINT16,
MaxFrameAverageLightLevel: ::UINT16,
}}

RIDL!(
interface IDXGIDevice4(IDXGIDevice4Vtbl): IDXGIDevice3(IDXGIDevice3Vtbl) {
fn OfferResources1(
&mut self, NumResources: ::UINT,
ppResources: *const *mut ::IDXGIResource,
Priority: ::DXGI_OFFER_RESOURCE_PRIORITY, Flags: ::UINT
) -> ::HRESULT,
fn ReclaimResources1(
&mut self, NumResources: ::UINT,
ppResources: *const *mut ::IDXGIResource,
pResults: *mut ::DXGI_RECLAIM_RESOURCE_RESULTS
) -> ::HRESULT
});

RIDL!(
interface IDXGIFactory5(IDXGIFactory5Vtbl): IDXGIFactory4(IDXGIFactory4Vtbl) {
fn CheckFeatureSupport(
&mut self, Feature: ::DXGI_FEATURE, pFeatureSupportData: *mut ::c_void,
FeatureSupportDataSize: ::UINT
) -> ::HRESULT
});

RIDL!(
interface IDXGIOutput5(IDXGIOutput5Vtbl): IDXGIOutput4(IDXGIOutput4Vtbl) {
fn DuplicateOutput1(
&mut self, pDevice: *mut ::IUnknown, Flags: ::UINT,
SupportedFormatsCount: ::UINT, pSupportedFormats: *const ::DXGI_FORMAT,
ppOutputDuplication: *mut *mut ::IDXGIOutputDuplication
) -> ::HRESULT
});

RIDL!(
interface IDXGISwapChain4(IDXGISwapChain4Vtbl): IDXGISwapChain3(IDXGISwapChain3Vtbl) {
fn SetHDRMetaData(
&mut self, Type: ::DXGI_HDR_METADATA_TYPE, Size: ::UINT,
pMetaData: *mut ::c_void
) -> ::HRESULT
});
2 changes: 2 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ pub use dxgi::*;
pub use dxgi1_2::*;
pub use dxgi1_3::*;
pub use dxgi1_4::*;
pub use dxgi1_5::*;
pub use dxgiformat::*;
pub use dxgitype::*;
pub use errhandlingapi::*;
Expand Down Expand Up @@ -227,6 +228,7 @@ pub mod dxgi;
pub mod dxgi1_2;
pub mod dxgi1_3;
pub mod dxgi1_4;
pub mod dxgi1_5;
pub mod dxgiformat;
pub mod dxgitype;
pub mod errhandlingapi;
Expand Down