Add DirectX manipulating lib
This commit is contained in:
12
includes/DirectX.h
Normal file
12
includes/DirectX.h
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <reshade.hpp>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Retrieves Display mode.
|
||||||
|
*
|
||||||
|
* This function should be calld on event `on_present`
|
||||||
|
*
|
||||||
|
* @param swapchain retrieved from on_present event
|
||||||
|
*/
|
||||||
|
bool IsExclusiveFullscreen(reshade::api::swapchain* swapchain);
|
||||||
18
libs/DirectX.cpp
Normal file
18
libs/DirectX.cpp
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
#include "DirectX.h"
|
||||||
|
#include <dxgi.h>
|
||||||
|
|
||||||
|
bool IsExclusiveFullscreen(reshade::api::swapchain* swapchain) {
|
||||||
|
if (!swapchain) return false;
|
||||||
|
|
||||||
|
auto native = swapchain->get_native(); // Retrieving native swapchain
|
||||||
|
IDXGISwapChain* dxgiSwap = reinterpret_cast<IDXGISwapChain*>(native);
|
||||||
|
if (!dxgiSwap) return false;
|
||||||
|
|
||||||
|
DXGI_SWAP_CHAIN_DESC desc = {};
|
||||||
|
bool exclusive = false;
|
||||||
|
|
||||||
|
if (SUCCEEDED(dxgiSwap->GetDesc(&desc)))
|
||||||
|
exclusive = (desc.Windowed == FALSE); // FALSE = exclusive fullscreen
|
||||||
|
|
||||||
|
return exclusive;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user