Khaotic Engine Reborn
Loading...
Searching...
No Matches
system_class.h
1#ifndef _SYSTEMCLASS_H_
2#define _SYSTEMCLASS_H_
3
4#define WIN32_LEAN_AND_MEAN
5
6static bool DEBUG_MODE = true;
7
8#include "Logger.h"
9
10#include "input_class.h"
11#include "application_class.h"
12#include "imguiManager.h"
13#include <mutex>
14#include <filesystem>
15#include <commdlg.h>
16
17#include "../resources.h"
18#include <chrono>
19
21{
22public:
26
27 bool initialize();
28 void shutdown();
29 void run();
30
31 LRESULT CALLBACK message_handler(HWND, UINT, WPARAM, LPARAM);
32
33 void send_path(wchar_t* path, std::filesystem::path w_folder);
34
35 std::shared_ptr<application_class> get_application_class() const { return application_; }
36 void set_application_class(std::shared_ptr<application_class> application) { application_ = std::move(application); }
37
38 std::shared_ptr<input_class> get_input_class() const { return input_; }
39 void set_input(std::shared_ptr<input_class> input) { input_ = std::move(input); }
40
41 HWND get_hwnd() const { return hwnd_; }
42
43 void set_d_3D_mock(d_3d_class* mock) {application_->set_direct_3d(mock);}
44
45
46protected:
47 bool frame();
48 void initialize_windows(int&, int&);
49 void shutdown_windows();
50
51private:
52 LPCWSTR application_name_;
53 HINSTANCE hinstance_;
54 HWND hwnd_;
55
56 std::shared_ptr<input_class> input_;
57 std::shared_ptr<application_class> application_;
58 std::shared_ptr<imguiManager> imgui_manager_;
59
60 int initial_window_width_;
61 int initial_window_height_;
62 bool is_direct_3d_initialized_;
63 bool is_resizing_ = false;
64 bool is_debug_key_pressed_ = false;
65
66 std::mutex render_mutex_;
67
68};
69
70
72// FUNCTION PROTOTYPES //
74static LRESULT CALLBACK wnd_proc(HWND, UINT, WPARAM, LPARAM);
75
76
78// GLOBALS //
80static system_class* application_handle = 0;
81
82
83#endif