Started work on the debug logger

This commit is contained in:
grayson committed 2021-08-13 15:15:58 -05:00
1 parent 9094f8c50c
commit 41d043726c
11 files changed
+91 -24

No files matched your search

+7 -1
View File
@@ -1,7 +1,13 @@
#include "Application.h"
#include "Utility.h"
#include <iostream>
namespace nf {
Application::Application(Config& config) {
DEBUGINIT;
Application::Application(Config& config) :
m_currentConfig(config)
{
std::cin.get();
}
}
View File
Whitespace-only changes.
+9
View File
@@ -0,0 +1,9 @@
//TODO: Debug logger
//TODO: Argument parser
//TODO: Resource pack reader
#include "Utility.h"
#include "Config.h"
namespace nf {
}
+5 -5
View File
@@ -1,14 +1,14 @@
#pragma once
#include "Config.h"
#include <Windows.h>
namespace nf {
class Application {
public:
Application(Config& conf) {
}
Application(Config& conf);
Application() = delete;
Application(Application& other) = delete;
private:
Config m_currentConfig;
};
}
+4 -6
View File
@@ -1,12 +1,10 @@
#pragma once
namespace nf {
class Config {
struct Config {
public:
Config() {
}
private:
int m_width;
int m_height;
bool m_fullscreen;
};
}
+5
View File
@@ -0,0 +1,5 @@
//Master engine include (Is this even useful?)
#include "Application.h"
#include "Config.h"
#include "Utility.h"
+28
View File
@@ -0,0 +1,28 @@
#pragma once
#include <chrono>
#include <iostream>
namespace nf {
#ifdef _DEBUG
#define __FILENAME__ strrchr(__FILE__, '\\') + 1
#define DEBUGINIT std::chrono::steady_clock::time_point Debug::m_initTime = std::chrono::high_resolution_clock::now();
#define Log(x) Debug::LogImp(x) s
#define Error(x) Debug::ErrorImp(x,__FILENAME__, __LINE__);\
DebugBreak();
class Debug {
private:
static std::chrono::steady_clock::time_point m_initTime;
public:
static void LogImp(char* in);
static void LogImp(std::string& in);
static void ErrorImp(char* in, char* filename, int line);
};
#else
#define DEBUGINIT
#define Log(x)
#define Error(x)
#endif
}