r5sdk/r5dev/engine/sys_getmodes.cpp
Kawe Mazidjatari 0a319971dd Hook ResizeBuffers to obtain rect size during resize
Required as the initialization only sets it to the startup rect size. This will always be up-to-date during resizes.
2023-01-30 22:08:01 +01:00

29 lines
954 B
C++

//===========================================================================//
//
// Purpose:
//
//===========================================================================//
#include "core/stdafx.h"
#include "windows/id3dx.h"
#include "engine/sys_getmodes.h"
//-----------------------------------------------------------------------------
// Purpose: creates the game window, obtains the rect and plays the startup movie.
//-----------------------------------------------------------------------------
bool HCVideoMode_Common__CreateGameWindow(int* pnRect)
{
g_nWindowRect[0] = pnRect[0];
g_nWindowRect[1] = pnRect[1];
return CVideoMode_Common__CreateGameWindow(pnRect);
}
void HVideoMode_Common::Attach() const
{
DetourAttach(&CVideoMode_Common__CreateGameWindow, &HCVideoMode_Common__CreateGameWindow);
}
void HVideoMode_Common::Detach() const
{
DetourDetach(&CVideoMode_Common__CreateGameWindow, &HCVideoMode_Common__CreateGameWindow);
}