VEX Engine
Retro looking game engine made in vulkan mostly because i wanted to understand it better.
Loading...
Searching...
No Matches
vex::DebugConsole Class Reference

Classes

struct  LogEntry

Public Types

using CommandFunc = std::function<void(const std::vector<std::string>&)>

Public Member Functions

void Init ()
 Initialize the debug console.
void Draw (bool *p_open, bool isEditorMode)
 Draw the debug console.
void RegisterCommand (const std::string &name, CommandFunc cmd)
 Register a command with the debug console.
void Execute (const std::string &commandLine)
 Execute a command with the given arguments.
void AddLog (LogLevel level, const char *msg)
 API for the callback.

Static Public Member Functions

static DebugConsole & Get ()

Private Attributes

std::vector< LogEntrym_logs
std::map< std::string, CommandFunc > m_commands
std::vector< std::string > m_history
int m_historyPos = -1
char m_inputBuf [256] = {0}
bool m_scrollToBottom = true
std::mutex m_mutex

Detailed Description

Definition at line 14 of file DebugConsole.hpp.

Member Typedef Documentation

◆ CommandFunc

using vex::DebugConsole::CommandFunc = std::function<void(const std::vector<std::string>&)>

Definition at line 37 of file DebugConsole.hpp.

Member Function Documentation

◆ AddLog()

void vex::DebugConsole::AddLog ( LogLevel level,
const char * msg )

API for the callback.

Parameters
levelThe log level.
msgThe log message.

Definition at line 55 of file DebugConsole.cpp.

◆ Draw()

void vex::DebugConsole::Draw ( bool * p_open,
bool isEditorMode )

Draw the debug console.

Parameters
p_openPointer to a boolean indicating whether the console is open.
isEditorModeIndicates whether the console is in editor mode.

Definition at line 93 of file DebugConsole.cpp.

◆ Execute()

void vex::DebugConsole::Execute ( const std::string & commandLine)

Execute a command with the given arguments.

Parameters
commandLineThe command line to execute.

Definition at line 37 of file DebugConsole.cpp.

◆ Get()

DebugConsole & vex::DebugConsole::Get ( )
inlinestatic

Definition at line 16 of file DebugConsole.hpp.

◆ Init()

void vex::DebugConsole::Init ( )

Initialize the debug console.

Definition at line 13 of file DebugConsole.cpp.

◆ RegisterCommand()

void vex::DebugConsole::RegisterCommand ( const std::string & name,
CommandFunc cmd )

Register a command with the debug console.

Parameters
nameThe name of the command.
cmdThe function to execute when the command is called.

Definition at line 33 of file DebugConsole.cpp.

Member Data Documentation

◆ m_commands

std::map<std::string, CommandFunc> vex::DebugConsole::m_commands
private

Definition at line 62 of file DebugConsole.hpp.

◆ m_history

std::vector<std::string> vex::DebugConsole::m_history
private

Definition at line 63 of file DebugConsole.hpp.

◆ m_historyPos

int vex::DebugConsole::m_historyPos = -1
private

Definition at line 64 of file DebugConsole.hpp.

◆ m_inputBuf

char vex::DebugConsole::m_inputBuf[256] = {0}
private

Definition at line 66 of file DebugConsole.hpp.

◆ m_logs

std::vector<LogEntry> vex::DebugConsole::m_logs
private

Definition at line 61 of file DebugConsole.hpp.

◆ m_mutex

std::mutex vex::DebugConsole::m_mutex
private

Definition at line 68 of file DebugConsole.hpp.

◆ m_scrollToBottom

bool vex::DebugConsole::m_scrollToBottom = true
private

Definition at line 67 of file DebugConsole.hpp.


The documentation for this class was generated from the following files: