Finished debug logger for now; Started work on the main window and fullscreen functionality

This commit is contained in:
grayson committed 2021-08-14 15:48:52 -05:00
1 parent 41d043726c
commit 5777478858
8 files changed
+141 -17

No files matched your search

+15
View File
@@ -8,7 +8,22 @@ namespace nf {
Application(Config& conf);
Application() = delete;
Application(Application& other) = delete;
Config& getConfig();
void showWindow(bool show);
~Application();
private:
void registerWindowClass();
void toggleFullscreen();
RECT getWindowRect();
static LRESULT CALLBACK WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
Config m_currentConfig;
HINSTANCE m_hInst;
LPCWSTR m_wclassName;
HWND m_window;
WINDOWPLACEMENT m_wndPlacement;
};
}
+4 -3
View File
@@ -3,8 +3,9 @@
namespace nf {
struct Config {
public:
int m_width;
int m_height;
bool m_fullscreen;
int width;
int height;
bool fullscreen;
const char* title;
};
}
+8 -7
View File
@@ -1,28 +1,29 @@
#pragma once
#include <chrono>
#include <iostream>
#include <string>
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 Log(x) Debug::LogImp(x)
#define Error(x) Debug::ErrorImp(x,__FILENAME__, __LINE__);\
DebugBreak();
class Debug {
private:
static std::chrono::steady_clock::time_point m_initTime;
static std::chrono::duration<float> getCurrentTime();
public:
static void LogImp(char* in);
static void LogImp(std::string& in);
static void ErrorImp(char* in, char* filename, int line);
static void LogImp(const char* in);
static void LogImp(const std::string& in);
static void ErrorImp(const char* in, const char* filename, int line);
};
#else
#define DEBUGINIT
#define Log(x)
#define Error(x)
#endif
const wchar_t* toWide(const char* in);
}