diff --git a/.idea/.idea.KhaoticEngineReborn/.idea/workspace.xml b/.idea/.idea.KhaoticEngineReborn/.idea/workspace.xml
index 616a8ba..5cb53d8 100644
--- a/.idea/.idea.KhaoticEngineReborn/.idea/workspace.xml
+++ b/.idea/.idea.KhaoticEngineReborn/.idea/workspace.xml
@@ -7,13 +7,11 @@
-
-
+
-
-
+
@@ -68,46 +66,7 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
@@ -139,7 +98,7 @@
"ASKED_SHARE_PROJECT_CONFIGURATION_FILES": "true",
"C++ Project.enginecustom.executor": "Run",
"C/C++ Project.KhaoticDemo.executor": "Run",
- "C/C++ Project.enginecustom.executor": "Debug",
+ "C/C++ Project.enginecustom.executor": "Run",
"RunOnceActivity.ShowReadmeOnStart": "true",
"RunOnceActivity.git.unshallow": "true",
"SHARE_PROJECT_CONFIGURATION_FILES": "true",
@@ -150,7 +109,7 @@
"node.js.selected.package.eslint": "(autodetect)",
"node.js.selected.package.tslint": "(autodetect)",
"nodejs_package_manager_path": "npm",
- "settings.editor.selected.configurable": "preferences.pluginManager",
+ "settings.editor.selected.configurable": "preferences.environmentSetup",
"vue.rearranger.settings.migration": "true"
}
}]]>
@@ -300,6 +259,10 @@
+
+
+
+
diff --git a/enginecustom/imgui.ini b/enginecustom/imgui.ini
index bb12ee8..0bb0731 100644
--- a/enginecustom/imgui.ini
+++ b/enginecustom/imgui.ini
@@ -10,9 +10,9 @@ Collapsed=0
[Window][Khaotic Engine]
Pos=1267,19
-Size=317,609
+Size=317,441
Collapsed=0
-DockId=0x00000002,0
+DockId=0x00000005,0
[Window][render Stats]
Pos=0,630
@@ -22,7 +22,7 @@ DockId=0x00000009,0
[Window][Objects]
Pos=0,19
-Size=238,609
+Size=234,842
Collapsed=0
DockId=0x0000000B,0
@@ -33,27 +33,35 @@ Collapsed=0
DockId=0x00000007,0
[Window][Log Window]
-Pos=794,630
-Size=790,231
+Pos=0,630
+Size=1584,231
Collapsed=0
DockId=0x0000000A,0
[Window][Light]
Pos=0,19
-Size=238,609
+Size=234,609
Collapsed=0
-DockId=0x0000000B,1
+DockId=0x0000000B,0
+
+[Window][Engine Settings]
+Pos=1267,462
+Size=317,166
+Collapsed=0
+DockId=0x00000006,0
[Docking][Data]
-DockSpace ID=0xCCBD8CF7 Window=0x3DA2F1DE Pos=0,19 Size=1584,842 Split=Y
- DockNode ID=0x00000003 Parent=0xCCBD8CF7 SizeRef=1584,609 Split=X
- DockNode ID=0x0000000B Parent=0x00000003 SizeRef=238,842 Selected=0x031DC75C
- DockNode ID=0x0000000C Parent=0x00000003 SizeRef=1344,842 Split=X
- DockNode ID=0x00000007 Parent=0x0000000C SizeRef=266,842 Selected=0x393905AB
- DockNode ID=0x00000008 Parent=0x0000000C SizeRef=1316,842 Split=X
- DockNode ID=0x00000001 Parent=0x00000008 SizeRef=1025,842 CentralNode=1
- DockNode ID=0x00000002 Parent=0x00000008 SizeRef=317,842 Selected=0x9F035453
- DockNode ID=0x00000004 Parent=0xCCBD8CF7 SizeRef=1584,231 Split=X Selected=0xF5D1BB37
- DockNode ID=0x00000009 Parent=0x00000004 SizeRef=792,231 Selected=0xF5D1BB37
- DockNode ID=0x0000000A Parent=0x00000004 SizeRef=790,231 Selected=0xAB74BEE9
+DockSpace ID=0xCCBD8CF7 Window=0x3DA2F1DE Pos=0,19 Size=1584,842 Split=Y
+ DockNode ID=0x00000003 Parent=0xCCBD8CF7 SizeRef=1584,609 Split=X
+ DockNode ID=0x0000000B Parent=0x00000003 SizeRef=234,842 Selected=0x321620B2
+ DockNode ID=0x0000000C Parent=0x00000003 SizeRef=1348,842 Split=X
+ DockNode ID=0x00000007 Parent=0x0000000C SizeRef=266,842 Selected=0x393905AB
+ DockNode ID=0x00000008 Parent=0x0000000C SizeRef=1316,842 Split=X
+ DockNode ID=0x00000001 Parent=0x00000008 SizeRef=1265,842 CentralNode=1
+ DockNode ID=0x00000002 Parent=0x00000008 SizeRef=317,842 Split=Y Selected=0x9F035453
+ DockNode ID=0x00000005 Parent=0x00000002 SizeRef=317,441 Selected=0x9F035453
+ DockNode ID=0x00000006 Parent=0x00000002 SizeRef=317,166 Selected=0x0B098C4B
+ DockNode ID=0x00000004 Parent=0xCCBD8CF7 SizeRef=1584,231 Split=X Selected=0xF5D1BB37
+ DockNode ID=0x00000009 Parent=0x00000004 SizeRef=792,231 Selected=0xF5D1BB37
+ DockNode ID=0x0000000A Parent=0x00000004 SizeRef=790,231 Selected=0xAB74BEE9
diff --git a/enginecustom/src/inc/system/application_class.h b/enginecustom/src/inc/system/application_class.h
index de25173..e8d7d12 100644
--- a/enginecustom/src/inc/system/application_class.h
+++ b/enginecustom/src/inc/system/application_class.h
@@ -9,8 +9,6 @@
#include "camera_class.h"
#include "object.h"
#include "light_class.h"
-#include
-#include
#include "bitmap_class.h"
#include "sprite_class.h"
@@ -31,6 +29,8 @@
#include "physics.h"
#include "frustum.h"
#include "skybox.h"
+#include "shadow_map.h"
+#include "stats.h"
#include
@@ -43,9 +43,8 @@
#include
#include
#include
-
-#include "shadow_map.h"
-#include "stats.h"
+#include
+#include
/////////////
@@ -128,14 +127,20 @@ public:
void set_cel_shading(const bool enable) { enable_cel_shading_ = enable; };
- void set_vsync(bool vsync);
+ void set_vsync(bool vsync) {
+ vsync_enabled_ = vsync;
+ if (direct_3d_) {
+ direct_3d_->set_vsync(vsync);
+ Logger::Get().Log("Setting Vsync to " + std::to_string(vsync), __FILE__, __LINE__);
+ }
+ };
bool get_vsync() const { return vsync_enabled_; };
- HWND get_hwnd() const;
- void set_hwnd(HWND hwnd);
+ HWND get_hwnd() const { return hwnd_; };
+ void set_hwnd(HWND hwnd) { hwnd_ = hwnd; };
- bool is_windowed() const;
- void set_windowed(bool windowed);
+ bool is_windowed() const { return windowed_; };
+ void set_windowed(bool windowed) { windowed_ = windowed; };
void set_window_size(const ImVec2 size) { window_size_ = size; };
ImVec2 get_window_size() const { return window_size_; };
@@ -151,6 +156,7 @@ public:
void set_frustum(const frustum& frustum) { frustum_culling_ = frustum; };
void construct_frustum();
+
int get_render_count() const { return render_count_; };
void set_render_count(const int render_count) { render_count_ = render_count; };
float get_frustum_tolerance() const { return frustum_culling_tolerance_; };
@@ -176,6 +182,8 @@ private:
bool render_pass(const std::vector>>& RenderQueues, XMFLOAT4* diffuse, XMFLOAT4* position, XMFLOAT4* ambient, XMMATRIX view, XMMATRIX projection);
void update_skybox_position();
+ void culling_thread_function();
+ void update_stats_after_modification();
public :
std::vector textures;
@@ -186,9 +194,7 @@ private :
std::thread culling_thread_;
std::atomic culling_active_;
std::mutex objects_mutex_;
- void culling_thread_function();
-
-
+
std::mutex terrain_mutex_;
std::vector> terrain_generation_data_;
bool terrain_generation_ready_;
@@ -231,8 +237,9 @@ private :
object* selected_object_;
std::vector