2022-02-19 02:31:16 +01:00
|
|
|
#pragma once
|
|
|
|
#include "core/stdafx.h"
|
|
|
|
#include "mathlib/color.h"
|
|
|
|
|
|
|
|
struct LogMsg_t
|
|
|
|
{
|
2022-08-17 12:28:52 +02:00
|
|
|
LogMsg_t(const string svMessage, const int nTicks, const EGlobalContext_t type)
|
2022-02-19 02:31:16 +01:00
|
|
|
{
|
|
|
|
this->m_svMessage = svMessage;
|
|
|
|
this->m_nTicks = nTicks;
|
|
|
|
this->m_type = type;
|
|
|
|
}
|
2022-08-17 12:28:52 +02:00
|
|
|
string m_svMessage = "";
|
|
|
|
int m_nTicks = 1024;
|
|
|
|
EGlobalContext_t m_type = EGlobalContext_t::NONE;
|
2022-02-19 02:31:16 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
class CLogSystem
|
|
|
|
{
|
|
|
|
public:
|
2022-08-09 15:19:12 +02:00
|
|
|
CLogSystem()
|
|
|
|
{
|
|
|
|
m_nFontHeight = 16;
|
|
|
|
memset(m_pszCon_NPrintf_Buf, '\0', sizeof(m_pszCon_NPrintf_Buf));
|
|
|
|
}
|
|
|
|
|
2022-02-19 02:31:16 +01:00
|
|
|
void Update(void);
|
2022-08-17 12:28:52 +02:00
|
|
|
void AddLog(const EGlobalContext_t context, const string& svText);
|
2022-02-19 02:31:16 +01:00
|
|
|
void DrawLog(void);
|
2022-02-28 01:01:40 +01:00
|
|
|
void DrawHostStats(void) const;
|
2022-02-19 02:31:16 +01:00
|
|
|
void DrawSimStats(void) const;
|
|
|
|
void DrawGPUStats(void) const;
|
2022-07-01 22:33:48 +01:00
|
|
|
void DrawCrosshairMaterial(void) const;
|
2022-07-20 22:50:55 +01:00
|
|
|
void DrawStreamOverlay(void) const;
|
2022-02-19 02:31:16 +01:00
|
|
|
|
|
|
|
private:
|
2022-08-17 12:28:52 +02:00
|
|
|
Color GetLogColorForType(const EGlobalContext_t type) const;
|
2022-08-09 15:19:12 +02:00
|
|
|
vector<LogMsg_t> m_vLogs;
|
|
|
|
int m_nFontHeight;
|
2022-02-28 01:01:40 +01:00
|
|
|
|
|
|
|
public:
|
2022-08-09 15:19:12 +02:00
|
|
|
char m_pszCon_NPrintf_Buf[4096]{};
|
2022-02-19 02:31:16 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
void CEngineVGui_Attach();
|
|
|
|
void CEngineVGui_Detach();
|
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
extern CLogSystem g_pLogSystem;
|