This repository has been archived on 2024-10-22. You can view files and clone it, but cannot push or open issues or pull requests.
YimMenu/src/hooks/gui/swap_chain_resizebuffers.cpp
maybegreat48 1127e51a52
Optimizations (#2649)
* fix(Respawn): fix respawn in SP
* fix: re-enable bigobj
* fix: update creator's stack size
* fix: use BOOLs instead of bools
* fix(gitignore): hide .pyc files
2023-12-29 17:07:00 +01:00

26 lines
801 B
C++

#include "hooking/hooking.hpp"
#include "renderer.hpp"
#include "script.hpp"
namespace big
{
HRESULT hooks::swapchain_resizebuffers(IDXGISwapChain* this_, UINT buffer_count, UINT width, UINT height, DXGI_FORMAT new_format, UINT swapchain_flags)
{
if (g_running)
{
g_renderer->pre_reset();
const auto result = g_hooking->m_swapchain_hook.get_original<decltype(&swapchain_resizebuffers)>(swapchain_resizebuffers_index)(this_, buffer_count, width, height, new_format, swapchain_flags);
if (SUCCEEDED(result))
{
g_renderer->post_reset();
}
return result;
}
return g_hooking->m_swapchain_hook.get_original<decltype(&swapchain_resizebuffers)>(swapchain_resizebuffers_index)(this_, buffer_count, width, height, new_format, swapchain_flags);
}
}