Skip to content

Commit

Permalink
Provide bindings for dxgi1_5.h
Browse files Browse the repository at this point in the history
  • Loading branch information
CtrlZvi committed Aug 20, 2016
1 parent 7758871 commit 0ad1b6b
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 0 deletions.
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 = 0
) -> ::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

0 comments on commit 0ad1b6b

Please sign in to comment.