2022-02-03 14:05:24 -05:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
namespace console
|
|
|
|
{
|
|
|
|
HWND get_window();
|
|
|
|
void set_title(std::string title);
|
|
|
|
void set_size(int width, int height);
|
|
|
|
|
|
|
|
enum console_type
|
|
|
|
{
|
|
|
|
con_type_error = 1,
|
2022-05-18 07:35:39 -04:00
|
|
|
con_type_dev = 2,
|
2022-02-03 14:05:24 -05:00
|
|
|
con_type_warning = 3,
|
|
|
|
con_type_info = 7
|
|
|
|
};
|
|
|
|
|
|
|
|
void print(int type, const char* fmt, ...);
|
|
|
|
|
|
|
|
template <typename... Args>
|
|
|
|
void error(const char* fmt, Args&&... args)
|
|
|
|
{
|
|
|
|
print(con_type_error, fmt, std::forward<Args>(args)...);
|
|
|
|
}
|
|
|
|
|
2022-05-18 07:35:39 -04:00
|
|
|
template <typename... Args>
|
|
|
|
void debug(const char* fmt, Args&&... args)
|
|
|
|
{
|
|
|
|
#ifdef DEBUG
|
|
|
|
print(2, fmt, std::forward<Args>(args)...);
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2022-02-03 14:05:24 -05:00
|
|
|
template <typename... Args>
|
|
|
|
void warn(const char* fmt, Args&&... args)
|
|
|
|
{
|
|
|
|
print(con_type_warning, fmt, std::forward<Args>(args)...);
|
|
|
|
}
|
|
|
|
|
|
|
|
template <typename... Args>
|
|
|
|
void info(const char* fmt, Args&&... args)
|
|
|
|
{
|
|
|
|
print(con_type_info, fmt, std::forward<Args>(args)...);
|
|
|
|
}
|
|
|
|
}
|