Add DirectX manipulating lib

This commit is contained in:
2026-03-24 23:19:49 +01:00
parent 26e14b0c1b
commit 37c6a0aa3f
2 changed files with 30 additions and 0 deletions

12
includes/DirectX.h Normal file
View 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
View 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;
}