mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
MaterialSystem: fix console not drawing in the 4:3/5:4 aspect ratio modes
DrawImGui should be called BEFORE ID3D11DeviceContext::ClearRenderTargetView() or ID3D11DeviceContext::End(). Moved drawing code to SpinPresent which is just before the clear/end calls are being made. Console now draws in the 4:3/5:4 aspect ratio video modes.
This commit is contained in:
parent
77a20f4d9e
commit
365448b8c7
@ -10,6 +10,7 @@
|
||||
#include "vpc/keyvalues.h"
|
||||
#include "rtech/rtech_utils.h"
|
||||
#include "engine/cmodel_bsp.h"
|
||||
#include "engine/sys_engine.h"
|
||||
#include "geforce/reflex.h"
|
||||
#ifndef MATERIALSYSTEM_NODX
|
||||
#include "windows/id3dx.h"
|
||||
@ -115,6 +116,20 @@ void* __fastcall DispatchDrawCall(int64_t a1, uint64_t a2, int a3, int a4, int64
|
||||
//---------------------------------------------------------------------------------
|
||||
ssize_t SpinPresent(void)
|
||||
{
|
||||
// TODO[ AMOS ]: move imgui code to a separate file.
|
||||
extern void DrawImGui();
|
||||
extern void ImGui_Init();
|
||||
|
||||
if (!g_bImGuiInitialized)
|
||||
{
|
||||
ImGui_Init();
|
||||
g_ThreadRenderThreadID = GetCurrentThreadId();
|
||||
g_bImGuiInitialized = true;
|
||||
}
|
||||
|
||||
if (g_pEngine->GetQuitting() == IEngine::QUIT_NOTQUITTING)
|
||||
DrawImGui();
|
||||
|
||||
const ssize_t val = v_SpinPresent();
|
||||
return val;
|
||||
}
|
||||
|
@ -10,7 +10,6 @@
|
||||
#include "gameui/IConsole.h"
|
||||
#include "gameui/IBrowser.h"
|
||||
#include "engine/framelimit.h"
|
||||
#include "engine/sys_engine.h"
|
||||
#include "engine/sys_mainwind.h"
|
||||
#include "inputsystem/inputsystem.h"
|
||||
#include "materialsystem/cmaterialsystem.h"
|
||||
@ -136,18 +135,8 @@ void DrawImGui()
|
||||
|
||||
HRESULT __stdcall Present(IDXGISwapChain* pSwapChain, UINT nSyncInterval, UINT nFlags)
|
||||
{
|
||||
if (!g_bImGuiInitialized)
|
||||
{
|
||||
ImGui_Init();
|
||||
g_ThreadRenderThreadID = GetCurrentThreadId();
|
||||
g_bImGuiInitialized = true;
|
||||
}
|
||||
|
||||
g_FrameLimiter.Run();
|
||||
|
||||
if (g_pEngine->GetQuitting() == IEngine::QUIT_NOTQUITTING)
|
||||
DrawImGui();
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// NOTE: -1 since we need to sync this with its corresponding frame, g_FrameNum
|
||||
// gets incremented in CMaterialSystem::SwapBuffers, which is after the markers
|
||||
|
Loading…
x
Reference in New Issue
Block a user