Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
de16b97f8e | |||
f5331444cb |
93
.idea/.idea.KhaoticEngineReborn/.idea/workspace.xml
generated
93
.idea/.idea.KhaoticEngineReborn/.idea/workspace.xml
generated
@@ -6,8 +6,15 @@
|
|||||||
<component name="ChangeListManager">
|
<component name="ChangeListManager">
|
||||||
<list default="true" id="e81d6e08-efc7-40a0-909d-ec4943d948e9" name="Changes" comment="">
|
<list default="true" id="e81d6e08-efc7-40a0-909d-ec4943d948e9" name="Changes" comment="">
|
||||||
<change beforePath="$PROJECT_DIR$/.idea/.idea.KhaoticEngineReborn/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/.idea.KhaoticEngineReborn/.idea/workspace.xml" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/.idea/.idea.KhaoticEngineReborn/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/.idea.KhaoticEngineReborn/.idea/workspace.xml" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/enginecustom/enginecustom.vcxproj" beforeDir="false" afterPath="$PROJECT_DIR$/enginecustom/enginecustom.vcxproj" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/enginecustom/imgui.ini" beforeDir="false" afterPath="$PROJECT_DIR$/enginecustom/imgui.ini" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/enginecustom/imgui.ini" beforeDir="false" afterPath="$PROJECT_DIR$/enginecustom/imgui.ini" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/enginecustom/src/inc/system/Skybox.h" beforeDir="false" afterPath="$PROJECT_DIR$/enginecustom/src/inc/system/Skybox.h" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/enginecustom/src/inc/system/application_class.h" beforeDir="false" afterPath="$PROJECT_DIR$/enginecustom/src/inc/system/application_class.h" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/enginecustom/src/inc/system/object.h" beforeDir="false" afterPath="$PROJECT_DIR$/enginecustom/src/inc/system/object.h" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/enginecustom/src/inc/system/stats.h" beforeDir="false" afterPath="$PROJECT_DIR$/enginecustom/src/inc/system/stats.h" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/enginecustom/src/src/system/Skybox.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/enginecustom/src/src/system/Skybox.cpp" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/enginecustom/src/src/system/application_class.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/enginecustom/src/src/system/application_class.cpp" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/enginecustom/src/src/system/object.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/enginecustom/src/src/system/object.cpp" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/enginecustom/src/src/system/stats.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/enginecustom/src/src/system/stats.cpp" afterDir="false" />
|
||||||
</list>
|
</list>
|
||||||
<option name="SHOW_DIALOG" value="false" />
|
<option name="SHOW_DIALOG" value="false" />
|
||||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||||
@@ -27,9 +34,83 @@
|
|||||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||||
<setting file="cidr-memory-view://4" root0="FORCE_HIGHLIGHTING" />
|
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||||
|
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||||
|
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||||
|
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||||
|
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||||
|
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||||
|
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||||
|
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||||
|
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||||
|
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||||
|
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||||
|
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||||
|
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||||
|
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||||
|
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||||
|
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||||
|
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||||
|
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||||
|
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||||
|
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||||
|
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||||
|
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||||
|
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||||
|
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||||
|
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||||
|
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||||
|
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||||
|
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||||
|
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||||
|
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||||
|
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||||
|
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||||
|
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||||
|
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||||
|
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||||
|
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||||
|
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||||
|
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||||
|
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||||
|
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||||
|
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||||
|
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||||
|
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||||
|
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||||
|
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||||
|
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||||
|
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||||
|
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||||
|
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||||
|
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||||
|
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||||
|
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||||
|
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||||
|
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||||
|
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||||
|
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||||
|
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||||
|
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||||
|
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||||
|
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||||
|
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||||
|
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||||
|
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||||
|
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||||
|
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||||
|
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||||
|
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||||
|
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||||
|
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||||
|
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||||
|
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||||
|
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||||
|
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||||
|
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||||
<setting file="file://C:/Program Files (x86)/Windows Kits/10/Include/10.0.26100.0/um/d3d11.h" root0="SKIP_HIGHLIGHTING" />
|
<setting file="file://C:/Program Files (x86)/Windows Kits/10/Include/10.0.26100.0/um/d3d11.h" root0="SKIP_HIGHLIGHTING" />
|
||||||
<setting file="file://C:/Program Files (x86)/Windows Kits/10/Include/10.0.26100.0/um/dinput.h" root0="SKIP_HIGHLIGHTING" />
|
<setting file="file://C:/Program Files (x86)/Windows Kits/10/Include/10.0.26100.0/um/dinput.h" root0="SKIP_HIGHLIGHTING" />
|
||||||
|
<setting file="file://C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.44.35207/include/memory" root0="SKIP_HIGHLIGHTING" />
|
||||||
<setting file="file://$PROJECT_DIR$/enginecustom/include/Inc/VertexTypes.h" root0="SKIP_HIGHLIGHTING" />
|
<setting file="file://$PROJECT_DIR$/enginecustom/include/Inc/VertexTypes.h" root0="SKIP_HIGHLIGHTING" />
|
||||||
<setting file="file://$PROJECT_DIR$/enginecustom/include/Vulkan/Include/vulkan/vulkan_core.h" root0="SKIP_HIGHLIGHTING" />
|
<setting file="file://$PROJECT_DIR$/enginecustom/include/Vulkan/Include/vulkan/vulkan_core.h" root0="SKIP_HIGHLIGHTING" />
|
||||||
<setting file="file://$PROJECT_DIR$/../../IDE_VS/VC/Tools/MSVC/14.38.33130/include/type_traits" root0="SKIP_HIGHLIGHTING" />
|
<setting file="file://$PROJECT_DIR$/../../IDE_VS/VC/Tools/MSVC/14.38.33130/include/type_traits" root0="SKIP_HIGHLIGHTING" />
|
||||||
@@ -58,7 +139,7 @@
|
|||||||
"ASKED_SHARE_PROJECT_CONFIGURATION_FILES": "true",
|
"ASKED_SHARE_PROJECT_CONFIGURATION_FILES": "true",
|
||||||
"C++ Project.enginecustom.executor": "Run",
|
"C++ Project.enginecustom.executor": "Run",
|
||||||
"C/C++ Project.KhaoticDemo.executor": "Run",
|
"C/C++ Project.KhaoticDemo.executor": "Run",
|
||||||
"C/C++ Project.enginecustom.executor": "Run",
|
"C/C++ Project.enginecustom.executor": "Debug",
|
||||||
"RunOnceActivity.ShowReadmeOnStart": "true",
|
"RunOnceActivity.ShowReadmeOnStart": "true",
|
||||||
"RunOnceActivity.git.unshallow": "true",
|
"RunOnceActivity.git.unshallow": "true",
|
||||||
"SHARE_PROJECT_CONFIGURATION_FILES": "true",
|
"SHARE_PROJECT_CONFIGURATION_FILES": "true",
|
||||||
@@ -213,6 +294,12 @@
|
|||||||
<workItem from="1748869642637" duration="3049000" />
|
<workItem from="1748869642637" duration="3049000" />
|
||||||
<workItem from="1748954607174" duration="14202000" />
|
<workItem from="1748954607174" duration="14202000" />
|
||||||
<workItem from="1748969487337" duration="402000" />
|
<workItem from="1748969487337" duration="402000" />
|
||||||
|
<workItem from="1750187491423" duration="4397000" />
|
||||||
|
<workItem from="1750191969842" duration="162000" />
|
||||||
|
<workItem from="1750248915365" duration="442000" />
|
||||||
|
<workItem from="1750335650897" duration="2051000" />
|
||||||
|
<workItem from="1750344288223" duration="1751000" />
|
||||||
|
<workItem from="1750351735497" duration="9648000" />
|
||||||
</task>
|
</task>
|
||||||
<task id="LOCAL-00001" summary="Minor update - viewport window tweak">
|
<task id="LOCAL-00001" summary="Minor update - viewport window tweak">
|
||||||
<option name="closed" value="true" />
|
<option name="closed" value="true" />
|
||||||
|
@@ -1,106 +0,0 @@
|
|||||||
[Window][Debug##Default]
|
|
||||||
Pos=60,60
|
|
||||||
Size=400,400
|
|
||||||
Collapsed=0
|
|
||||||
|
|
||||||
[Window][Khaotic Engine]
|
|
||||||
Pos=1281,19
|
|
||||||
Size=303,842
|
|
||||||
Collapsed=0
|
|
||||||
DockId=0x0000000F,0
|
|
||||||
|
|
||||||
[Window][Objects]
|
|
||||||
Pos=0,19
|
|
||||||
Size=281,842
|
|
||||||
Collapsed=0
|
|
||||||
DockId=0x00000011,0
|
|
||||||
|
|
||||||
[Window][Terrain]
|
|
||||||
Pos=0,19
|
|
||||||
Size=280,842
|
|
||||||
Collapsed=0
|
|
||||||
DockId=0x00000007,0
|
|
||||||
|
|
||||||
[Window][Light]
|
|
||||||
Pos=0,19
|
|
||||||
Size=281,842
|
|
||||||
Collapsed=0
|
|
||||||
DockId=0x00000012,0
|
|
||||||
|
|
||||||
[Window][Shader Manager]
|
|
||||||
Pos=8,27
|
|
||||||
Size=330,487
|
|
||||||
Collapsed=0
|
|
||||||
DockId=0x00000001,2
|
|
||||||
|
|
||||||
[Window][Engine Settings]
|
|
||||||
Pos=1281,527
|
|
||||||
Size=303,334
|
|
||||||
Collapsed=0
|
|
||||||
DockId=0x00000010,0
|
|
||||||
|
|
||||||
[Window][DockSpace Demo]
|
|
||||||
Size=1584,861
|
|
||||||
Collapsed=0
|
|
||||||
|
|
||||||
[Window][Render Window]
|
|
||||||
Pos=8,27
|
|
||||||
Size=1559,974
|
|
||||||
Collapsed=0
|
|
||||||
DockId=0x00000011,0
|
|
||||||
|
|
||||||
[Window][DockSpace]
|
|
||||||
Pos=0,0
|
|
||||||
Size=1584,861
|
|
||||||
Collapsed=0
|
|
||||||
|
|
||||||
[Window][Add Object]
|
|
||||||
Pos=1188,0
|
|
||||||
Size=396,430
|
|
||||||
Collapsed=0
|
|
||||||
|
|
||||||
[Window][Log]
|
|
||||||
Pos=8,518
|
|
||||||
Size=1568,335
|
|
||||||
Collapsed=0
|
|
||||||
DockId=0x0000000C,0
|
|
||||||
|
|
||||||
[Window][Log Window]
|
|
||||||
Pos=0,636
|
|
||||||
Size=1279,225
|
|
||||||
Collapsed=0
|
|
||||||
DockId=0x00000006,0
|
|
||||||
|
|
||||||
[Window][Render Stats]
|
|
||||||
Pos=0,636
|
|
||||||
Size=1279,225
|
|
||||||
Collapsed=0
|
|
||||||
DockId=0x00000004,0
|
|
||||||
|
|
||||||
[Window][render Window]
|
|
||||||
Pos=16,718
|
|
||||||
Size=997,758
|
|
||||||
Collapsed=1
|
|
||||||
|
|
||||||
[Docking][Data]
|
|
||||||
DockSpace ID=0xC0DFADC4 Pos=8,27 Size=1568,826 Split=X
|
|
||||||
DockNode ID=0x00000001 Parent=0xC0DFADC4 SizeRef=330,1094 Selected=0x393905AB
|
|
||||||
DockNode ID=0x00000003 Parent=0xC0DFADC4 SizeRef=1700,1094 CentralNode=1
|
|
||||||
DockSpace ID=0xCCBD8CF7 Window=0x3DA2F1DE Pos=0,19 Size=1584,842 Split=X
|
|
||||||
DockNode ID=0x00000002 Parent=0xCCBD8CF7 SizeRef=1743,826 Split=Y
|
|
||||||
DockNode ID=0x0000000A Parent=0x00000002 SizeRef=1568,599 Split=X
|
|
||||||
DockNode ID=0x00000009 Parent=0x0000000A SizeRef=281,974 Split=Y Selected=0x031DC75C
|
|
||||||
DockNode ID=0x00000011 Parent=0x00000009 SizeRef=281,441 Selected=0x031DC75C
|
|
||||||
DockNode ID=0x00000012 Parent=0x00000009 SizeRef=281,440 Selected=0x321620B2
|
|
||||||
DockNode ID=0x0000000D Parent=0x0000000A SizeRef=1460,974 Split=Y
|
|
||||||
DockNode ID=0x0000000B Parent=0x0000000D SizeRef=1568,637 Split=X Selected=0x321620B2
|
|
||||||
DockNode ID=0x00000007 Parent=0x0000000B SizeRef=280,883 Selected=0x393905AB
|
|
||||||
DockNode ID=0x00000008 Parent=0x0000000B SizeRef=1178,883 CentralNode=1 Selected=0x4FC83240
|
|
||||||
DockNode ID=0x0000000C Parent=0x0000000D SizeRef=1568,335 Selected=0x139FDA3F
|
|
||||||
DockNode ID=0x0000000E Parent=0x00000002 SizeRef=1568,225 Split=X Selected=0xD99DEA49
|
|
||||||
DockNode ID=0x00000004 Parent=0x0000000E SizeRef=871,225 Selected=0xD99DEA49
|
|
||||||
DockNode ID=0x00000006 Parent=0x0000000E SizeRef=870,225 Selected=0xAB74BEE9
|
|
||||||
DockNode ID=0x00000005 Parent=0xCCBD8CF7 SizeRef=303,826 Split=Y Selected=0x9F035453
|
|
||||||
DockNode ID=0x0000000F Parent=0x00000005 SizeRef=303,667 Selected=0x9F035453
|
|
||||||
DockNode ID=0x00000010 Parent=0x00000005 SizeRef=303,441 Selected=0x0B098C4B
|
|
||||||
|
|
@@ -1,89 +0,0 @@
|
|||||||
[Window][Debug##Default]
|
|
||||||
Pos=60,60
|
|
||||||
Size=400,400
|
|
||||||
Collapsed=0
|
|
||||||
|
|
||||||
[Window][Khaotic Engine]
|
|
||||||
Pos=1233,27
|
|
||||||
Size=343,826
|
|
||||||
Collapsed=0
|
|
||||||
DockId=0x00000005,0
|
|
||||||
|
|
||||||
[Window][Objects]
|
|
||||||
Pos=8,27
|
|
||||||
Size=289,413
|
|
||||||
Collapsed=0
|
|
||||||
DockId=0x00000007,0
|
|
||||||
|
|
||||||
[Window][Terrain]
|
|
||||||
Pos=8,442
|
|
||||||
Size=289,411
|
|
||||||
Collapsed=0
|
|
||||||
DockId=0x00000008,0
|
|
||||||
|
|
||||||
[Window][Light]
|
|
||||||
Pos=8,27
|
|
||||||
Size=290,866
|
|
||||||
Collapsed=0
|
|
||||||
DockId=0x00000004,1
|
|
||||||
|
|
||||||
[Window][Shader Manager]
|
|
||||||
Pos=8,27
|
|
||||||
Size=330,487
|
|
||||||
Collapsed=0
|
|
||||||
DockId=0x00000001,2
|
|
||||||
|
|
||||||
[Window][Engine Settings]
|
|
||||||
Pos=1233,27
|
|
||||||
Size=343,826
|
|
||||||
Collapsed=0
|
|
||||||
DockId=0x00000005,1
|
|
||||||
|
|
||||||
[Window][DockSpace Demo]
|
|
||||||
Size=1584,861
|
|
||||||
Collapsed=0
|
|
||||||
|
|
||||||
[Window][Render Window]
|
|
||||||
Pos=8,27
|
|
||||||
Size=1559,974
|
|
||||||
Collapsed=0
|
|
||||||
DockId=0x00000007,0
|
|
||||||
|
|
||||||
[Window][DockSpace]
|
|
||||||
Pos=0,0
|
|
||||||
Size=1584,861
|
|
||||||
Collapsed=0
|
|
||||||
|
|
||||||
[Window][Add Object]
|
|
||||||
Pos=1188,0
|
|
||||||
Size=396,430
|
|
||||||
Collapsed=0
|
|
||||||
|
|
||||||
[Window][Log]
|
|
||||||
Pos=8,518
|
|
||||||
Size=1568,335
|
|
||||||
Collapsed=0
|
|
||||||
DockId=0x0000000C,0
|
|
||||||
|
|
||||||
[Window][Log Window]
|
|
||||||
Pos=299,627
|
|
||||||
Size=932,226
|
|
||||||
Collapsed=0
|
|
||||||
DockId=0x00000006,0
|
|
||||||
|
|
||||||
[Docking][Data]
|
|
||||||
DockSpace ID=0xC0DFADC4 Pos=8,27 Size=1568,826 Split=X
|
|
||||||
DockNode ID=0x00000001 Parent=0xC0DFADC4 SizeRef=330,1094 Selected=0x393905AB
|
|
||||||
DockNode ID=0x00000003 Parent=0xC0DFADC4 SizeRef=1700,1094 CentralNode=1
|
|
||||||
DockSpace ID=0xCCBD8CF7 Window=0x3DA2F1DE Pos=8,27 Size=1568,826 Split=X
|
|
||||||
DockNode ID=0x00000009 Parent=0xCCBD8CF7 SizeRef=289,974 Split=Y Selected=0x031DC75C
|
|
||||||
DockNode ID=0x00000007 Parent=0x00000009 SizeRef=289,299 Selected=0x031DC75C
|
|
||||||
DockNode ID=0x00000008 Parent=0x00000009 SizeRef=289,297 Selected=0x393905AB
|
|
||||||
DockNode ID=0x0000000D Parent=0xCCBD8CF7 SizeRef=1613,974 Split=X
|
|
||||||
DockNode ID=0x00000002 Parent=0x0000000D SizeRef=1268,826 Split=Y
|
|
||||||
DockNode ID=0x0000000B Parent=0x00000002 SizeRef=1568,637 Split=Y
|
|
||||||
DockNode ID=0x00000004 Parent=0x0000000B SizeRef=932,598 CentralNode=1
|
|
||||||
DockNode ID=0x00000006 Parent=0x0000000B SizeRef=932,226 Selected=0xAB74BEE9
|
|
||||||
DockNode ID=0x0000000C Parent=0x00000002 SizeRef=1568,335 Selected=0x139FDA3F
|
|
||||||
DockNode ID=0x00000005 Parent=0x0000000D SizeRef=343,826 Selected=0x0B098C4B
|
|
||||||
|
|
@@ -10,28 +10,50 @@ Collapsed=0
|
|||||||
|
|
||||||
[Window][Khaotic Engine]
|
[Window][Khaotic Engine]
|
||||||
Pos=1267,19
|
Pos=1267,19
|
||||||
Size=317,842
|
Size=317,609
|
||||||
Collapsed=0
|
Collapsed=0
|
||||||
DockId=0x00000002,0
|
DockId=0x00000002,0
|
||||||
|
|
||||||
[Window][render Stats]
|
[Window][render Stats]
|
||||||
Pos=275,630
|
Pos=0,630
|
||||||
Size=1309,231
|
Size=1584,231
|
||||||
Collapsed=0
|
Collapsed=0
|
||||||
DockId=0x00000004,0
|
DockId=0x00000009,0
|
||||||
|
|
||||||
[Window][Objects]
|
[Window][Objects]
|
||||||
Pos=0,19
|
Pos=0,19
|
||||||
Size=273,842
|
Size=238,609
|
||||||
Collapsed=0
|
Collapsed=0
|
||||||
DockId=0x00000005,0
|
DockId=0x0000000B,0
|
||||||
|
|
||||||
|
[Window][Terrain]
|
||||||
|
Pos=0,19
|
||||||
|
Size=266,609
|
||||||
|
Collapsed=0
|
||||||
|
DockId=0x00000007,0
|
||||||
|
|
||||||
|
[Window][Log Window]
|
||||||
|
Pos=794,630
|
||||||
|
Size=790,231
|
||||||
|
Collapsed=0
|
||||||
|
DockId=0x0000000A,0
|
||||||
|
|
||||||
|
[Window][Light]
|
||||||
|
Pos=0,19
|
||||||
|
Size=238,609
|
||||||
|
Collapsed=0
|
||||||
|
DockId=0x0000000B,1
|
||||||
|
|
||||||
[Docking][Data]
|
[Docking][Data]
|
||||||
DockSpace ID=0xCCBD8CF7 Window=0x3DA2F1DE Pos=0,19 Size=1584,842 Split=X
|
DockSpace ID=0xCCBD8CF7 Window=0x3DA2F1DE Pos=0,19 Size=1584,842 Split=Y
|
||||||
DockNode ID=0x00000005 Parent=0xCCBD8CF7 SizeRef=273,842 Selected=0x031DC75C
|
DockNode ID=0x00000003 Parent=0xCCBD8CF7 SizeRef=1584,609 Split=X
|
||||||
DockNode ID=0x00000006 Parent=0xCCBD8CF7 SizeRef=1309,842 Split=Y
|
DockNode ID=0x0000000B Parent=0x00000003 SizeRef=238,842 Selected=0x031DC75C
|
||||||
DockNode ID=0x00000003 Parent=0x00000006 SizeRef=1584,609 Split=X
|
DockNode ID=0x0000000C Parent=0x00000003 SizeRef=1344,842 Split=X
|
||||||
DockNode ID=0x00000001 Parent=0x00000003 SizeRef=990,842 CentralNode=1
|
DockNode ID=0x00000007 Parent=0x0000000C SizeRef=266,842 Selected=0x393905AB
|
||||||
DockNode ID=0x00000002 Parent=0x00000003 SizeRef=317,842 Selected=0x9F035453
|
DockNode ID=0x00000008 Parent=0x0000000C SizeRef=1316,842 Split=X
|
||||||
DockNode ID=0x00000004 Parent=0x00000006 SizeRef=1584,231 Selected=0xF5D1BB37
|
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
|
||||||
|
|
||||||
|
@@ -13,7 +13,7 @@ public:
|
|||||||
|
|
||||||
void Initialize(d_3d_class* d3dClassRef); // Get all the required references
|
void Initialize(d_3d_class* d3dClassRef); // Get all the required references
|
||||||
|
|
||||||
object* ConstructSkybox();
|
object* ConstructSkybox(application_class* app);
|
||||||
|
|
||||||
|
|
||||||
// Variables
|
// Variables
|
||||||
|
@@ -42,6 +42,7 @@
|
|||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <DirectXMath.h>
|
#include <DirectXMath.h>
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
#include "shadow_map.h"
|
#include "shadow_map.h"
|
||||||
#include "stats.h"
|
#include "stats.h"
|
||||||
@@ -54,6 +55,8 @@ constexpr bool full_screen = false;
|
|||||||
constexpr float screen_depth = 1000.0f;
|
constexpr float screen_depth = 1000.0f;
|
||||||
constexpr float screen_near = 0.3f;
|
constexpr float screen_near = 0.3f;
|
||||||
|
|
||||||
|
static std::map<std::string, std::shared_ptr<model_class>> g_model_cache;
|
||||||
|
|
||||||
struct input
|
struct input
|
||||||
{
|
{
|
||||||
bool key_left = false;
|
bool key_left = false;
|
||||||
@@ -78,8 +81,7 @@ public:
|
|||||||
render_texture_class* get_refraction_texture() const { return refraction_texture_; };
|
render_texture_class* get_refraction_texture() const { return refraction_texture_; };
|
||||||
render_texture_class* get_reflection_texture() const { return reflection_texture_; };
|
render_texture_class* get_reflection_texture() const { return reflection_texture_; };
|
||||||
|
|
||||||
void create_big_cube(int side_count);
|
bool create_big_cube(int side_count);
|
||||||
void process_terrain_generation();
|
|
||||||
virtual bool initialize(int, int, HWND, bool is_vulkan);
|
virtual bool initialize(int, int, HWND, bool is_vulkan);
|
||||||
void shutdown();
|
void shutdown();
|
||||||
virtual bool frame(input_class*);
|
virtual bool frame(input_class*);
|
||||||
|
@@ -57,7 +57,7 @@ public:
|
|||||||
ImVec2 GetWindowSize() const { return windowSize; }
|
ImVec2 GetWindowSize() const { return windowSize; }
|
||||||
|
|
||||||
// Getters
|
// Getters
|
||||||
void SetApp(application_class* app) { app_ = app; }
|
void SetApp(std::shared_ptr<application_class> app) { app_ = app; }
|
||||||
|
|
||||||
// Shader toggles
|
// Shader toggles
|
||||||
|
|
||||||
@@ -75,7 +75,7 @@ private:
|
|||||||
|
|
||||||
std::vector<widget_entry> widgets_;
|
std::vector<widget_entry> widgets_;
|
||||||
|
|
||||||
application_class* app_;
|
std::shared_ptr<application_class> app_;
|
||||||
scene_manager* scene_manager_;
|
scene_manager* scene_manager_;
|
||||||
stats* stats_;
|
stats* stats_;
|
||||||
|
|
||||||
|
@@ -26,15 +26,23 @@ enum class ShaderType
|
|||||||
ALPHA_MAPPING
|
ALPHA_MAPPING
|
||||||
};
|
};
|
||||||
|
|
||||||
class object : public model_class
|
class object
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
object(application_class& app);
|
||||||
object();
|
object();
|
||||||
~object();
|
~object();
|
||||||
|
|
||||||
object(const object&) = delete;
|
object(const object&) = delete;
|
||||||
object& operator=(const object&) = delete;
|
object& operator=(const object&) = delete;
|
||||||
|
|
||||||
|
bool Initialize(
|
||||||
|
ID3D11Device* device,
|
||||||
|
ID3D11DeviceContext* deviceContext,
|
||||||
|
char* modelFilename,
|
||||||
|
TextureContainer& texturesContainer
|
||||||
|
);
|
||||||
|
|
||||||
void SetScaleMatrix(XMMATRIX scaleMatrix);
|
void SetScaleMatrix(XMMATRIX scaleMatrix);
|
||||||
void SetRotateMatrix(XMMATRIX rotateMatrix);
|
void SetRotateMatrix(XMMATRIX rotateMatrix);
|
||||||
void SetTranslateMatrix(XMMATRIX translateMatrix);
|
void SetTranslateMatrix(XMMATRIX translateMatrix);
|
||||||
@@ -119,6 +127,9 @@ public:
|
|||||||
bool IsGravityEnabled() const { return m_gravityEnabled; }
|
bool IsGravityEnabled() const { return m_gravityEnabled; }
|
||||||
void SetGravityEnabled(bool state) { m_gravityEnabled = state; }
|
void SetGravityEnabled(bool state) { m_gravityEnabled = state; }
|
||||||
|
|
||||||
|
std::shared_ptr<model_class> get_model() const { return m_model_; }
|
||||||
|
void SetModel(std::shared_ptr<model_class> model) { m_model_ = model; }
|
||||||
|
|
||||||
public :
|
public :
|
||||||
bool m_demoSpinning = false;
|
bool m_demoSpinning = false;
|
||||||
XMVECTOR m_previousPosition;
|
XMVECTOR m_previousPosition;
|
||||||
@@ -127,6 +138,9 @@ public :
|
|||||||
bool m_gravityEnabled = true;
|
bool m_gravityEnabled = true;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
application_class& m_Application;
|
||||||
|
|
||||||
XMMATRIX m_scaleMatrix;
|
XMMATRIX m_scaleMatrix;
|
||||||
XMMATRIX m_rotateMatrix;
|
XMMATRIX m_rotateMatrix;
|
||||||
XMMATRIX m_translateMatrix;
|
XMMATRIX m_translateMatrix;
|
||||||
@@ -150,4 +164,6 @@ private:
|
|||||||
float m_initialStretch = 0.0f;
|
float m_initialStretch = 0.0f;
|
||||||
float m_springConstant = 10.0f;
|
float m_springConstant = 10.0f;
|
||||||
|
|
||||||
|
std::shared_ptr<model_class> m_model_;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@@ -6,6 +6,7 @@
|
|||||||
#include "object.h"
|
#include "object.h"
|
||||||
#include <intrin.h> // Pour __cpuid
|
#include <intrin.h> // Pour __cpuid
|
||||||
#include <dxgi.h> // Pour DXGI
|
#include <dxgi.h> // Pour DXGI
|
||||||
|
#include <mutex>
|
||||||
#pragma comment(lib, "dxgi.lib")
|
#pragma comment(lib, "dxgi.lib")
|
||||||
|
|
||||||
class stats
|
class stats
|
||||||
@@ -36,7 +37,6 @@ public:
|
|||||||
std::string get_gpu_driver_version(ID3D11Device* device);
|
std::string get_gpu_driver_version(ID3D11Device* device);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::thread update_geometric_thread_;
|
|
||||||
std::thread update_display_thread_;
|
std::thread update_display_thread_;
|
||||||
|
|
||||||
fps_class* fps_;
|
fps_class* fps_;
|
||||||
|
@@ -32,20 +32,12 @@ public:
|
|||||||
|
|
||||||
void send_path(wchar_t* path, std::filesystem::path w_folder);
|
void send_path(wchar_t* path, std::filesystem::path w_folder);
|
||||||
|
|
||||||
application_class* get_application_class() const { return application_; }
|
std::shared_ptr<application_class> get_application_class() const { return application_; }
|
||||||
void set_application_class(application_class* application) {
|
void set_application_class(std::shared_ptr<application_class> application) { application_ = std::move(application); }
|
||||||
if (application_) {
|
|
||||||
delete application_;
|
std::shared_ptr<input_class> get_input_class() const { return input_; }
|
||||||
}
|
void set_input(std::shared_ptr<input_class> input) { input_ = std::move(input); }
|
||||||
application_ = application;
|
|
||||||
}
|
|
||||||
input_class* get_input_class() const { return input_; }
|
|
||||||
void set_input(input_class* input) {
|
|
||||||
if (input_) {
|
|
||||||
delete input_;
|
|
||||||
}
|
|
||||||
input_ = input;
|
|
||||||
}
|
|
||||||
HWND get_hwnd() const { return hwnd_; }
|
HWND get_hwnd() const { return hwnd_; }
|
||||||
|
|
||||||
void set_d_3D_mock(d_3d_class* mock) {application_->set_direct_3d(mock);}
|
void set_d_3D_mock(d_3d_class* mock) {application_->set_direct_3d(mock);}
|
||||||
@@ -61,9 +53,9 @@ private:
|
|||||||
HINSTANCE hinstance_;
|
HINSTANCE hinstance_;
|
||||||
HWND hwnd_;
|
HWND hwnd_;
|
||||||
|
|
||||||
input_class* input_;
|
std::shared_ptr<input_class> input_;
|
||||||
application_class* application_;
|
std::shared_ptr<application_class> application_;
|
||||||
imguiManager* imgui_manager_;
|
std::shared_ptr<imguiManager> imgui_manager_;
|
||||||
|
|
||||||
int initial_window_width_;
|
int initial_window_width_;
|
||||||
int initial_window_height_;
|
int initial_window_height_;
|
||||||
|
@@ -23,7 +23,7 @@ void Skybox::Initialize(d_3d_class* d3dClassRef)
|
|||||||
m_d3dClassRef = d3dClassRef;
|
m_d3dClassRef = d3dClassRef;
|
||||||
}
|
}
|
||||||
|
|
||||||
object* Skybox::ConstructSkybox()
|
object* Skybox::ConstructSkybox(application_class* app)
|
||||||
{
|
{
|
||||||
Logger::Get().Log("Construct skybox", __FILE__, __LINE__, Logger::LogLevel::Initialize);
|
Logger::Get().Log("Construct skybox", __FILE__, __LINE__, Logger::LogLevel::Initialize);
|
||||||
|
|
||||||
@@ -51,7 +51,7 @@ object* Skybox::ConstructSkybox()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Create the model object
|
// Create the model object
|
||||||
m_Skybox = new object();
|
m_Skybox = new object(*app);
|
||||||
HRESULT result = m_Skybox->Initialize(m_d3dClassRef->get_device(), m_d3dClassRef->get_device_context(), modelFilename, SkyboxTextures);
|
HRESULT result = m_Skybox->Initialize(m_d3dClassRef->get_device(), m_d3dClassRef->get_device_context(), modelFilename, SkyboxTextures);
|
||||||
if (!result)
|
if (!result)
|
||||||
{
|
{
|
||||||
|
@@ -505,7 +505,7 @@ bool application_class::initialize(int screenWidth, int screenHeight, HWND hwnd,
|
|||||||
//ConstructSkyboxWithPlanes();
|
//ConstructSkyboxWithPlanes();
|
||||||
Skybox* skybox = new Skybox;
|
Skybox* skybox = new Skybox;
|
||||||
skybox->Initialize(direct_3d_);
|
skybox->Initialize(direct_3d_);
|
||||||
skybox_.push_back(skybox->ConstructSkybox());
|
skybox_.push_back(skybox->ConstructSkybox(this));
|
||||||
|
|
||||||
culling_active_ = true;
|
culling_active_ = true;
|
||||||
culling_thread_ = std::thread(&application_class::culling_thread_function, this);
|
culling_thread_ = std::thread(&application_class::culling_thread_function, this);
|
||||||
@@ -765,8 +765,6 @@ void application_class::shutdown()
|
|||||||
|
|
||||||
bool application_class::frame(input_class* Input)
|
bool application_class::frame(input_class* Input)
|
||||||
{
|
{
|
||||||
|
|
||||||
process_terrain_generation();
|
|
||||||
stats_->reset_draw_call_count();
|
stats_->reset_draw_call_count();
|
||||||
|
|
||||||
int mouseX, mouseY, currentMouseX, currentMouseY;
|
int mouseX, mouseY, currentMouseX, currentMouseY;
|
||||||
@@ -1157,6 +1155,7 @@ bool application_class::render(float rotation, float x, float y, float z, float
|
|||||||
// return false;
|
// return false;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
stats_->update_geometric_stats();
|
||||||
|
|
||||||
// Update the render count text.
|
// Update the render count text.
|
||||||
result = update_render_count_string(get_render_count());
|
result = update_render_count_string(get_render_count());
|
||||||
@@ -1301,15 +1300,6 @@ void application_class::generate_terrain()
|
|||||||
{
|
{
|
||||||
Logger::Get().Log("G<EFBFBD>n<EFBFBD>ration du terrain avec instanciation", __FILE__, __LINE__, Logger::LogLevel::Info);
|
Logger::Get().Log("G<EFBFBD>n<EFBFBD>ration du terrain avec instanciation", __FILE__, __LINE__, Logger::LogLevel::Info);
|
||||||
|
|
||||||
// Nettoyer les objets terrain existants pour <20>viter les fuites
|
|
||||||
for (auto* chunk : terrain_chunk_)
|
|
||||||
{
|
|
||||||
if (chunk)
|
|
||||||
{
|
|
||||||
chunk->Shutdown();
|
|
||||||
delete chunk;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
terrain_chunk_.clear();
|
terrain_chunk_.clear();
|
||||||
|
|
||||||
// Dimensions du terrain
|
// Dimensions du terrain
|
||||||
@@ -1338,7 +1328,7 @@ void application_class::generate_terrain()
|
|||||||
for (int j = 0; j < gridSizeZ; j++)
|
for (int j = 0; j < gridSizeZ; j++)
|
||||||
{
|
{
|
||||||
// Cr<43>er un nouvel objet de terrain
|
// Cr<43>er un nouvel objet de terrain
|
||||||
object* terrain = new object();
|
object* terrain = new object(*this);
|
||||||
|
|
||||||
// Initialiser avec le mod<6F>le et les textures_ pr<70>charg<72>es
|
// Initialiser avec le mod<6F>le et les textures_ pr<70>charg<72>es
|
||||||
if (!terrain->Initialize(direct_3d_->get_device(), direct_3d_->get_device_context(), modelFilename, textureContainer))
|
if (!terrain->Initialize(direct_3d_->get_device(), direct_3d_->get_device_context(), modelFilename, textureContainer))
|
||||||
@@ -1371,6 +1361,7 @@ void application_class::generate_terrain()
|
|||||||
|
|
||||||
void application_class::add_kobject(std::wstring& filepath)
|
void application_class::add_kobject(std::wstring& filepath)
|
||||||
{
|
{
|
||||||
|
std::lock_guard<std::mutex> lock(objects_mutex_);
|
||||||
Logger::Get().Log("Adding object", __FILE__, __LINE__);
|
Logger::Get().Log("Adding object", __FILE__, __LINE__);
|
||||||
|
|
||||||
char modelFilename[128];
|
char modelFilename[128];
|
||||||
@@ -1391,7 +1382,7 @@ void application_class::add_kobject(std::wstring& filepath)
|
|||||||
L"assets/Texture/BricksGLOSS2K.png"
|
L"assets/Texture/BricksGLOSS2K.png"
|
||||||
};
|
};
|
||||||
|
|
||||||
object* newObject = new object();
|
object* newObject = new object(*this);
|
||||||
newObject->LoadTexturesFromPath(kobjTexture,KobjectsTextures, direct_3d_); // Load textures_ from the path
|
newObject->LoadTexturesFromPath(kobjTexture,KobjectsTextures, direct_3d_); // Load textures_ from the path
|
||||||
newObject->Initialize(direct_3d_->get_device(), direct_3d_->get_device_context(), modelFilename, KobjectsTextures);
|
newObject->Initialize(direct_3d_->get_device(), direct_3d_->get_device_context(), modelFilename, KobjectsTextures);
|
||||||
newObject->SetMass(1.0f);
|
newObject->SetMass(1.0f);
|
||||||
@@ -1405,7 +1396,7 @@ void application_class::add_kobject(std::wstring& filepath)
|
|||||||
object_.push_back(newObject);
|
object_.push_back(newObject);
|
||||||
|
|
||||||
// V<>rifiez que l'objet a bien re<72>u les textures_
|
// V<>rifiez que l'objet a bien re<72>u les textures_
|
||||||
if (newObject->GetTexture(TextureType::Diffuse,0) == nullptr)
|
if (newObject->get_model()->GetTexture(TextureType::Diffuse,0) == nullptr)
|
||||||
{
|
{
|
||||||
Logger::Get().Log("object texture is null after initialization", __FILE__, __LINE__, Logger::LogLevel::Error);
|
Logger::Get().Log("object texture is null after initialization", __FILE__, __LINE__, Logger::LogLevel::Error);
|
||||||
}
|
}
|
||||||
@@ -1413,6 +1404,7 @@ void application_class::add_kobject(std::wstring& filepath)
|
|||||||
|
|
||||||
void application_class::add_cube()
|
void application_class::add_cube()
|
||||||
{
|
{
|
||||||
|
std::lock_guard<std::mutex> lock(objects_mutex_);
|
||||||
Logger::Get().Log("Adding cube", __FILE__, __LINE__);
|
Logger::Get().Log("Adding cube", __FILE__, __LINE__);
|
||||||
|
|
||||||
char modelFilename[128];
|
char modelFilename[128];
|
||||||
@@ -1427,7 +1419,7 @@ void application_class::add_cube()
|
|||||||
|
|
||||||
static int cubeCount = 0;
|
static int cubeCount = 0;
|
||||||
float position = cubeCount * 2.0f;
|
float position = cubeCount * 2.0f;
|
||||||
object* newCube = new object();
|
object* newCube = new object(*this);
|
||||||
newCube->LoadTexturesFromPath(cubeTexture, CubeTexture, direct_3d_); // Load textures_ from the path
|
newCube->LoadTexturesFromPath(cubeTexture, CubeTexture, direct_3d_); // Load textures_ from the path
|
||||||
newCube->Initialize(direct_3d_->get_device(), direct_3d_->get_device_context(), modelFilename, CubeTexture);
|
newCube->Initialize(direct_3d_->get_device(), direct_3d_->get_device_context(), modelFilename, CubeTexture);
|
||||||
newCube->SetTranslateMatrix(XMMatrixTranslation(position, 0.0f, 0.0f));
|
newCube->SetTranslateMatrix(XMMatrixTranslation(position, 0.0f, 0.0f));
|
||||||
@@ -1438,25 +1430,19 @@ void application_class::add_cube()
|
|||||||
|
|
||||||
void application_class::delete_kobject(int index)
|
void application_class::delete_kobject(int index)
|
||||||
{
|
{
|
||||||
|
std::lock_guard<std::mutex> lock(objects_mutex_);
|
||||||
Logger::Get().Log("Deleting object", __FILE__, __LINE__);
|
Logger::Get().Log("Deleting object", __FILE__, __LINE__);
|
||||||
|
|
||||||
if (index < object_.size())
|
if (index < object_.size())
|
||||||
{
|
{
|
||||||
object_[index]->Shutdown();
|
|
||||||
delete object_[index];
|
|
||||||
object_.erase(object_.begin() + index);
|
object_.erase(object_.begin() + index);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void application_class::delete_terrain()
|
void application_class::delete_terrain()
|
||||||
{
|
{
|
||||||
|
std::lock_guard<std::mutex> lock(objects_mutex_);
|
||||||
Logger::Get().Log("Deleting terrain", __FILE__, __LINE__);
|
Logger::Get().Log("Deleting terrain", __FILE__, __LINE__);
|
||||||
|
|
||||||
for (auto cube : terrain_chunk_)
|
|
||||||
{
|
|
||||||
cube->Shutdown();
|
|
||||||
delete cube;
|
|
||||||
}
|
|
||||||
terrain_chunk_.clear();
|
terrain_chunk_.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1819,17 +1805,17 @@ bool application_class::render_pass(const std::vector<std::reference_wrapper<std
|
|||||||
translateMatrix
|
translateMatrix
|
||||||
);
|
);
|
||||||
|
|
||||||
object->Render(direct_3d_->get_device_context());
|
object->get_model()->Render(direct_3d_->get_device_context());
|
||||||
|
|
||||||
if (active_camera_ == sun_camera_)
|
if (active_camera_ == sun_camera_)
|
||||||
{
|
{
|
||||||
result = shader_manager_->render_depth_shader(
|
result = shader_manager_->render_depth_shader(
|
||||||
direct_3d_->get_device_context(),
|
direct_3d_->get_device_context(),
|
||||||
object->GetIndexCount(),
|
object->get_model()->GetIndexCount(),
|
||||||
worldMatrix,
|
worldMatrix,
|
||||||
view,
|
view,
|
||||||
projection,
|
projection,
|
||||||
object->GetTexture(TextureType::Diffuse,0)
|
object->get_model()->GetTexture(TextureType::Diffuse,0)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1844,13 +1830,13 @@ bool application_class::render_pass(const std::vector<std::reference_wrapper<std
|
|||||||
|
|
||||||
result = shader_manager_->render_alpha_map_shader(
|
result = shader_manager_->render_alpha_map_shader(
|
||||||
direct_3d_->get_device_context(),
|
direct_3d_->get_device_context(),
|
||||||
object->GetIndexCount(),
|
object->get_model()->GetIndexCount(),
|
||||||
worldMatrix,
|
worldMatrix,
|
||||||
view,
|
view,
|
||||||
projection,
|
projection,
|
||||||
object->GetTexture(TextureType::Diffuse,0),
|
object->get_model()->GetTexture(TextureType::Diffuse,0),
|
||||||
object->GetTexture(TextureType::Diffuse,1),
|
object->get_model()->GetTexture(TextureType::Diffuse,1),
|
||||||
object->GetTexture(TextureType::Alpha,0)
|
object->get_model()->GetTexture(TextureType::Alpha,0)
|
||||||
);
|
);
|
||||||
if (!result)
|
if (!result)
|
||||||
{
|
{
|
||||||
@@ -1864,11 +1850,11 @@ bool application_class::render_pass(const std::vector<std::reference_wrapper<std
|
|||||||
case ShaderType::CEL_SHADING:
|
case ShaderType::CEL_SHADING:
|
||||||
result = shader_manager_->render_cel_shading_shader(
|
result = shader_manager_->render_cel_shading_shader(
|
||||||
direct_3d_->get_device_context(),
|
direct_3d_->get_device_context(),
|
||||||
object->GetIndexCount(),
|
object->get_model()->GetIndexCount(),
|
||||||
worldMatrix,
|
worldMatrix,
|
||||||
view,
|
view,
|
||||||
projection,
|
projection,
|
||||||
object->GetTexture(TextureType::Diffuse,0),
|
object->get_model()->GetTexture(TextureType::Diffuse,0),
|
||||||
sun_light_->GetDiffuseColor(),
|
sun_light_->GetDiffuseColor(),
|
||||||
sun_light_->GetAmbientColor(),
|
sun_light_->GetAmbientColor(),
|
||||||
sun_light_->GetDirection(),
|
sun_light_->GetDirection(),
|
||||||
@@ -1884,12 +1870,12 @@ bool application_class::render_pass(const std::vector<std::reference_wrapper<std
|
|||||||
case ShaderType::NORMAL_MAPPING:
|
case ShaderType::NORMAL_MAPPING:
|
||||||
result = shader_manager_->render_normal_map_shader(
|
result = shader_manager_->render_normal_map_shader(
|
||||||
direct_3d_->get_device_context(),
|
direct_3d_->get_device_context(),
|
||||||
object->GetIndexCount(),
|
object->get_model()->GetIndexCount(),
|
||||||
worldMatrix,
|
worldMatrix,
|
||||||
view,
|
view,
|
||||||
projection,
|
projection,
|
||||||
object->GetTexture(TextureType::Diffuse,0),
|
object->get_model()->GetTexture(TextureType::Diffuse,0),
|
||||||
object->GetTexture(TextureType::Normal,0),
|
object->get_model()->GetTexture(TextureType::Normal,0),
|
||||||
lights_[0]->GetDirection(),
|
lights_[0]->GetDirection(),
|
||||||
lights_[0]->GetDiffuseColor()
|
lights_[0]->GetDiffuseColor()
|
||||||
);
|
);
|
||||||
@@ -1903,13 +1889,13 @@ bool application_class::render_pass(const std::vector<std::reference_wrapper<std
|
|||||||
case ShaderType::SPECULAR_MAPPING:
|
case ShaderType::SPECULAR_MAPPING:
|
||||||
result = shader_manager_->render_spec_map_shader(
|
result = shader_manager_->render_spec_map_shader(
|
||||||
direct_3d_->get_device_context(),
|
direct_3d_->get_device_context(),
|
||||||
object->GetIndexCount(),
|
object->get_model()->GetIndexCount(),
|
||||||
worldMatrix,
|
worldMatrix,
|
||||||
view,
|
view,
|
||||||
projection,
|
projection,
|
||||||
object->GetTexture(TextureType::Diffuse,0),
|
object->get_model()->GetTexture(TextureType::Diffuse,0),
|
||||||
object->GetTexture(TextureType::Normal,0),
|
object->get_model()->GetTexture(TextureType::Normal,0),
|
||||||
object->GetTexture(TextureType::Specular,0),
|
object->get_model()->GetTexture(TextureType::Specular,0),
|
||||||
lights_[0]->GetDirection(),
|
lights_[0]->GetDirection(),
|
||||||
lights_[0]->GetDiffuseColor(),
|
lights_[0]->GetDiffuseColor(),
|
||||||
camera_->get_position(),
|
camera_->get_position(),
|
||||||
@@ -1926,11 +1912,11 @@ bool application_class::render_pass(const std::vector<std::reference_wrapper<std
|
|||||||
case ShaderType::TEXTURE:
|
case ShaderType::TEXTURE:
|
||||||
result = shader_manager_->render_texture_shader(
|
result = shader_manager_->render_texture_shader(
|
||||||
direct_3d_->get_device_context(),
|
direct_3d_->get_device_context(),
|
||||||
object->GetIndexCount(),
|
object->get_model()->GetIndexCount(),
|
||||||
worldMatrix,
|
worldMatrix,
|
||||||
view,
|
view,
|
||||||
projection,
|
projection,
|
||||||
object->GetTexture(TextureType::Diffuse,0)
|
object->get_model()->GetTexture(TextureType::Diffuse,0)
|
||||||
);
|
);
|
||||||
if (!result)
|
if (!result)
|
||||||
{
|
{
|
||||||
@@ -1942,11 +1928,11 @@ bool application_class::render_pass(const std::vector<std::reference_wrapper<std
|
|||||||
case ShaderType::LIGHTING:
|
case ShaderType::LIGHTING:
|
||||||
result = shader_manager_->renderlight_shader(
|
result = shader_manager_->renderlight_shader(
|
||||||
direct_3d_->get_device_context(),
|
direct_3d_->get_device_context(),
|
||||||
object->GetIndexCount(),
|
object->get_model()->GetIndexCount(),
|
||||||
worldMatrix,
|
worldMatrix,
|
||||||
view,
|
view,
|
||||||
projection,
|
projection,
|
||||||
object->GetTexture(TextureType::Diffuse,0),
|
object->get_model()->GetTexture(TextureType::Diffuse,0),
|
||||||
diffuse,
|
diffuse,
|
||||||
position,
|
position,
|
||||||
ambient
|
ambient
|
||||||
@@ -1961,11 +1947,11 @@ bool application_class::render_pass(const std::vector<std::reference_wrapper<std
|
|||||||
case ShaderType::SKYBOX:
|
case ShaderType::SKYBOX:
|
||||||
result = shader_manager_->render_skybox_shader(
|
result = shader_manager_->render_skybox_shader(
|
||||||
direct_3d_->get_device_context(),
|
direct_3d_->get_device_context(),
|
||||||
object->GetIndexCount(),
|
object->get_model()->GetIndexCount(),
|
||||||
worldMatrix,
|
worldMatrix,
|
||||||
view,
|
view,
|
||||||
projection,
|
projection,
|
||||||
object->GetTexture(TextureType::Diffuse,0),
|
object->get_model()->GetTexture(TextureType::Diffuse,0),
|
||||||
sun_light_->GetDiffuseColor(),
|
sun_light_->GetDiffuseColor(),
|
||||||
sun_light_->GetAmbientColor(),
|
sun_light_->GetAmbientColor(),
|
||||||
sun_light_->GetDirection(),
|
sun_light_->GetDirection(),
|
||||||
@@ -1981,11 +1967,11 @@ bool application_class::render_pass(const std::vector<std::reference_wrapper<std
|
|||||||
case ShaderType::SUNLIGHT:
|
case ShaderType::SUNLIGHT:
|
||||||
result = shader_manager_->render_sunlight_shader(
|
result = shader_manager_->render_sunlight_shader(
|
||||||
direct_3d_->get_device_context(),
|
direct_3d_->get_device_context(),
|
||||||
object->GetIndexCount(),
|
object->get_model()->GetIndexCount(),
|
||||||
worldMatrix,
|
worldMatrix,
|
||||||
view,
|
view,
|
||||||
projection,
|
projection,
|
||||||
object->GetTexture(TextureType::Diffuse,0),
|
object->get_model()->GetTexture(TextureType::Diffuse,0),
|
||||||
sun_light_->GetDiffuseColor(),
|
sun_light_->GetDiffuseColor(),
|
||||||
sun_light_->GetAmbientColor(),
|
sun_light_->GetAmbientColor(),
|
||||||
sun_light_->GetDirection(),
|
sun_light_->GetDirection(),
|
||||||
@@ -2001,11 +1987,11 @@ bool application_class::render_pass(const std::vector<std::reference_wrapper<std
|
|||||||
default:
|
default:
|
||||||
result = shader_manager_->renderlight_shader(
|
result = shader_manager_->renderlight_shader(
|
||||||
direct_3d_->get_device_context(),
|
direct_3d_->get_device_context(),
|
||||||
object->GetIndexCount(),
|
object->get_model()->GetIndexCount(),
|
||||||
worldMatrix,
|
worldMatrix,
|
||||||
view,
|
view,
|
||||||
projection,
|
projection,
|
||||||
object->GetTexture(TextureType::Diffuse,0),
|
object->get_model()->GetTexture(TextureType::Diffuse,0),
|
||||||
diffuse,
|
diffuse,
|
||||||
position,
|
position,
|
||||||
ambient
|
ambient
|
||||||
@@ -2168,134 +2154,56 @@ void application_class::physics_thread_function()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void application_class::create_big_cube(int side_count)
|
bool application_class::create_big_cube(int side_count)
|
||||||
{
|
{
|
||||||
Logger::Get().Log("Lancement de la g<>n<EFBFBD>ration du terrain dans un thread s<>par<61>", __FILE__, __LINE__, Logger::LogLevel::Info);
|
std::string modelName = "assets/Model/TXT/cube.txt";
|
||||||
|
std::shared_ptr<model_class> sharedModel;
|
||||||
|
|
||||||
// Cr<EFBFBD>er un thread qui ex<65>cutera la g<>n<EFBFBD>ration du terrain
|
// V<EFBFBD>rifier si le mod<6F>le existe d<>j<EFBFBD>
|
||||||
std::thread generationThread([this, side_count]() {
|
auto it = g_model_cache.find(modelName);
|
||||||
Logger::Get().Log("Thread de g<>n<EFBFBD>ration de terrain d<>marr<72>", __FILE__, __LINE__, Logger::LogLevel::Info);
|
if (it != g_model_cache.end()) {
|
||||||
|
sharedModel = it->second;
|
||||||
|
} else {
|
||||||
|
// copy le string en char*
|
||||||
|
char model_file[128];
|
||||||
|
size_t convertedChars = 0;
|
||||||
|
(void)wcstombs_s(&convertedChars, model_file, sizeof(model_file), std::wstring(modelName.begin(), modelName.end()).c_str(), _TRUNCATE);
|
||||||
|
|
||||||
// Stockage temporaire pour les nouveaux objets
|
// Cr<EFBFBD>er et initialiser le mod<6F>le si non trouv<75>
|
||||||
std::vector<object*> newTerrainChunks;
|
auto newModel = std::make_shared<model_class>();
|
||||||
|
TextureContainer textures;
|
||||||
|
textures.diffusePaths.push_back(L"assets/Texture/Bricks2K.png");
|
||||||
|
textures.normalPaths.push_back(L"assets/Texture/BricksNRM2K.png");
|
||||||
|
textures.specularPaths.push_back(L"assets/Texture/BricksGLOSS2K.png");
|
||||||
|
newModel->PreloadTextures(direct_3d_->get_device(), direct_3d_->get_device_context(), textures);
|
||||||
|
if (!newModel->Initialize(direct_3d_->get_device(), direct_3d_->get_device_context(),model_file, textures)) {
|
||||||
|
Logger::Get().Log("Impossible d'initialiser le mod<6F>le du gros cube", __FILE__, __LINE__, Logger::LogLevel::Error);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
g_model_cache[modelName] = newModel;
|
||||||
|
sharedModel = newModel;
|
||||||
|
}
|
||||||
|
|
||||||
// Dimensions du terrain
|
// Cr<EFBFBD>er temporairement les cubes dans un vecteur local
|
||||||
float scaleX = 1.0f;
|
std::vector<object*> tempCubes;
|
||||||
float scaleY = 1.0f;
|
tempCubes.reserve(side_count * side_count * side_count);
|
||||||
float scaleZ = 1.0f;
|
|
||||||
|
|
||||||
// Pr<EFBFBD>parer les donn<6E>es pour la cr<63>ation des cubes
|
// G<EFBFBD>n<EFBFBD>rer side_count<6E> cubes
|
||||||
std::vector<std::tuple<float, float, float, std::string, int>> cubeData;
|
for (int x = 0; x < side_count; x++)
|
||||||
int objectId = object_id_;
|
{
|
||||||
|
for (int y = 0; y < side_count; y++)
|
||||||
// G<>n<EFBFBD>rer les donn<6E>es des cubes
|
{
|
||||||
for (int i = 0; i < side_count; i++) {
|
for (int z = 0; z < side_count; z++)
|
||||||
for (int j = 0; j < side_count; j++) {
|
{
|
||||||
for (int k = 0; k < side_count; k++) {
|
object* cubePart = new object(*this);
|
||||||
// V<>rifier si nous devons arr<72>ter le thread
|
cubePart->SetModel(sharedModel);
|
||||||
if (should_quit_) {
|
cubePart->SetTranslateMatrix(XMMatrixTranslation(static_cast<float>(x),static_cast<float>(y),static_cast<float>(z)));
|
||||||
Logger::Get().Log("G<EFBFBD>n<EFBFBD>ration de terrain annul<75>e", __FILE__, __LINE__, Logger::LogLevel::Info);
|
tempCubes.push_back(cubePart);
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Position et nom du cube
|
|
||||||
float posX = i * scaleX;
|
|
||||||
float posY = k * scaleY;
|
|
||||||
float posZ = j * scaleZ;
|
|
||||||
std::string name = "TerrainTile_" + std::to_string(i) + "_" + std::to_string(j) + "_" + std::to_string(k);
|
|
||||||
|
|
||||||
// Stocker les donn<6E>es du cube
|
|
||||||
cubeData.push_back(std::make_tuple(posX, posY, posZ, name, objectId++));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
// Transf<73>rer les cubes du vecteur temporaire au vecteur membre
|
||||||
|
cubes_ = std::move(tempCubes);
|
||||||
|
|
||||||
// Synchroniser avec le thread principal pour cr<63>er les objets
|
return true;
|
||||||
// Cette partie doit <20>tre ex<65>cut<75>e dans le thread principal (via une file d'attente ou autre m<>canisme)
|
|
||||||
std::lock_guard<std::mutex> lock(terrain_mutex_);
|
|
||||||
terrain_generation_data_ = std::move(cubeData);
|
|
||||||
terrain_generation_ready_ = true;
|
|
||||||
next_terrain_object_id_ = objectId;
|
|
||||||
|
|
||||||
Logger::Get().Log("Donn<EFBFBD>es de g<>n<EFBFBD>ration de terrain pr<70>par<61>es (" + std::to_string(terrain_generation_data_.size()) + " cubes)", __FILE__, __LINE__, Logger::LogLevel::Info);
|
|
||||||
});
|
|
||||||
|
|
||||||
// D<>tacher le thread pour qu'il s'ex<65>cute en arri<72>re-plan
|
|
||||||
generationThread.detach();
|
|
||||||
}
|
|
||||||
|
|
||||||
void application_class::process_terrain_generation()
|
|
||||||
{
|
|
||||||
// V<>rifier si des donn<6E>es de terrain sont pr<70>tes <20> <20>tre trait<69>es
|
|
||||||
if (!terrain_generation_ready_) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Acqu<71>rir les donn<6E>es g<>n<EFBFBD>r<EFBFBD>es
|
|
||||||
std::vector<std::tuple<float, float, float, std::string, int>> cubeData;
|
|
||||||
{
|
|
||||||
std::lock_guard<std::mutex> lock(terrain_mutex_);
|
|
||||||
cubeData = std::move(terrain_generation_data_);
|
|
||||||
terrain_generation_data_.clear();
|
|
||||||
terrain_generation_ready_ = false;
|
|
||||||
object_id_ = next_terrain_object_id_;
|
|
||||||
}
|
|
||||||
|
|
||||||
Logger::Get().Log("Cr<EFBFBD>ation des objets terrain <20> partir des donn<6E>es pr<70>par<61>es", __FILE__, __LINE__, Logger::LogLevel::Info);
|
|
||||||
|
|
||||||
// Nettoyer les objets terrain existants
|
|
||||||
for (auto* chunk : terrain_chunk_)
|
|
||||||
{
|
|
||||||
if (chunk) {
|
|
||||||
chunk->Shutdown();
|
|
||||||
delete chunk;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
terrain_chunk_.clear();
|
|
||||||
|
|
||||||
// Cr<43>er un conteneur de textures_ partag<61>
|
|
||||||
TextureContainer textureContainer;
|
|
||||||
textureContainer.diffusePaths.push_back(L"assets/Texture/Bricks2K.png");
|
|
||||||
textureContainer.normalPaths.push_back(L"assets/Texture/BricksNRM2K.png");
|
|
||||||
textureContainer.specularPaths.push_back(L"assets/Texture/BricksGLOSS2K.png");
|
|
||||||
|
|
||||||
// Pr<50>charger les textures_ une seule fois
|
|
||||||
model_class* sharedModel = new model_class();
|
|
||||||
sharedModel->PreloadTextures(direct_3d_->get_device(), direct_3d_->get_device_context(), textureContainer);
|
|
||||||
|
|
||||||
char modelFilename[128];
|
|
||||||
strcpy_s(modelFilename, "assets/Model/TXT/cube.txt");
|
|
||||||
|
|
||||||
// Cr<43>er les objets <20> partir des donn<6E>es
|
|
||||||
for (const auto& [posX, posY, posZ, name, id] : cubeData)
|
|
||||||
{
|
|
||||||
// Cr<43>er un nouvel objet de terrain
|
|
||||||
object* terrain = new object();
|
|
||||||
|
|
||||||
// Initialiser avec le mod<6F>le et les textures_
|
|
||||||
if (!terrain->Initialize(direct_3d_->get_device(), direct_3d_->get_device_context(), modelFilename, textureContainer))
|
|
||||||
{
|
|
||||||
Logger::Get().Log("<EFBFBD>chec de l'initialisation d'une tuile de terrain", __FILE__, __LINE__, Logger::LogLevel::Error);
|
|
||||||
delete terrain;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Configurer l'objet
|
|
||||||
XMFLOAT3 position(posX, posY, posZ);
|
|
||||||
XMFLOAT3 scale(1.0f, 1.0f, 1.0f);
|
|
||||||
|
|
||||||
terrain->SetPosition(XMLoadFloat3(&position));
|
|
||||||
terrain->SetScale(XMLoadFloat3(&scale));
|
|
||||||
terrain->SetName(name);
|
|
||||||
terrain->SetType(ObjectType::Cube);
|
|
||||||
terrain->SetActiveShader(ShaderType::TEXTURE);
|
|
||||||
terrain->SetId(id);
|
|
||||||
|
|
||||||
// Ajouter <20> la liste des chunks de terrain
|
|
||||||
terrain_chunk_.push_back(terrain);
|
|
||||||
}
|
|
||||||
|
|
||||||
delete sharedModel;
|
|
||||||
|
|
||||||
Logger::Get().Log("G<EFBFBD>n<EFBFBD>ration du terrain termin<69>e avec " + std::to_string(terrain_chunk_.size()) + " cubes", __FILE__, __LINE__, Logger::LogLevel::Info);
|
|
||||||
}
|
}
|
@@ -165,7 +165,7 @@ bool imguiManager::Initialize(HWND hwnd, ID3D11Device* device, ID3D11DeviceConte
|
|||||||
|
|
||||||
// initialize the scene manager
|
// initialize the scene manager
|
||||||
scene_manager_ = new scene_manager;
|
scene_manager_ = new scene_manager;
|
||||||
if (!scene_manager_->initialize(app_)) {
|
if (!scene_manager_->initialize(app_.get())) {
|
||||||
Logger::Get().Log("Failed to initialize scene manager", __FILE__, __LINE__, Logger::LogLevel::Error);
|
Logger::Get().Log("Failed to initialize scene manager", __FILE__, __LINE__, Logger::LogLevel::Error);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -441,7 +441,7 @@ void imguiManager::WidgetObjectWindow()
|
|||||||
|
|
||||||
// Compter combien de textures_ de ce type existent
|
// Compter combien de textures_ de ce type existent
|
||||||
int textureCount = 0;
|
int textureCount = 0;
|
||||||
while (object->GetTexture(type, textureCount) != nullptr)
|
while (object->get_model()->GetTexture(type, textureCount) != nullptr)
|
||||||
{
|
{
|
||||||
textureCount++;
|
textureCount++;
|
||||||
}
|
}
|
||||||
@@ -450,7 +450,7 @@ void imguiManager::WidgetObjectWindow()
|
|||||||
ImGui::BeginGroup();
|
ImGui::BeginGroup();
|
||||||
for (int texIndex = 0; texIndex < textureCount; texIndex++)
|
for (int texIndex = 0; texIndex < textureCount; texIndex++)
|
||||||
{
|
{
|
||||||
ID3D11ShaderResourceView* texture = object->GetTexture(type, texIndex);
|
ID3D11ShaderResourceView* texture = object->get_model()->GetTexture(type, texIndex);
|
||||||
if (texture)
|
if (texture)
|
||||||
{
|
{
|
||||||
// ID unique pour chaque bouton de texture
|
// ID unique pour chaque bouton de texture
|
||||||
@@ -477,7 +477,7 @@ void imguiManager::WidgetObjectWindow()
|
|||||||
if (GetOpenFileName(&ofn))
|
if (GetOpenFileName(&ofn))
|
||||||
{
|
{
|
||||||
// Changer la texture existante
|
// Changer la texture existante
|
||||||
object->ChangeTexture(m_device, m_deviceContext, ofn.lpstrFile, type, texIndex);
|
object->get_model()->ChangeTexture(m_device, m_deviceContext, ofn.lpstrFile, type, texIndex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -515,7 +515,7 @@ void imguiManager::WidgetObjectWindow()
|
|||||||
if (GetOpenFileName(&ofn))
|
if (GetOpenFileName(&ofn))
|
||||||
{
|
{
|
||||||
// Ajouter une nouvelle texture
|
// Ajouter une nouvelle texture
|
||||||
object->AddTexture(m_device, m_deviceContext, ofn.lpstrFile, type);
|
object->get_model()->AddTexture(m_device, m_deviceContext, ofn.lpstrFile, type);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -2,9 +2,27 @@
|
|||||||
|
|
||||||
#include <comdef.h>
|
#include <comdef.h>
|
||||||
|
|
||||||
|
#include "application_class.h"
|
||||||
#include "d_3d_class.h"
|
#include "d_3d_class.h"
|
||||||
|
|
||||||
object::object()// initialize the reference here
|
object::object(application_class& app) : m_Application(app)// initialize the reference here
|
||||||
|
{
|
||||||
|
m_scaleMatrix = XMMatrixIdentity();
|
||||||
|
m_rotateMatrix = XMMatrixIdentity();
|
||||||
|
m_translateMatrix = XMMatrixIdentity();
|
||||||
|
m_srMatrix = XMMatrixIdentity();
|
||||||
|
m_worldMatrix = XMMatrixIdentity();
|
||||||
|
m_previousPosition = XMVectorZero();
|
||||||
|
m_velocity = XMVectorZero();
|
||||||
|
m_acceleration = XMVectorZero();
|
||||||
|
m_mass = NULL;
|
||||||
|
m_isGrounded = false;
|
||||||
|
m_id = NULL;
|
||||||
|
m_boundingRadius = 1.0f;
|
||||||
|
}
|
||||||
|
|
||||||
|
object::object()
|
||||||
|
: m_Application(*static_cast<application_class*>(nullptr)) // Remplacer suivant votre logique
|
||||||
{
|
{
|
||||||
m_scaleMatrix = XMMatrixIdentity();
|
m_scaleMatrix = XMMatrixIdentity();
|
||||||
m_rotateMatrix = XMMatrixIdentity();
|
m_rotateMatrix = XMMatrixIdentity();
|
||||||
@@ -24,6 +42,34 @@ object::~object()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool object::Initialize(
|
||||||
|
ID3D11Device* device,
|
||||||
|
ID3D11DeviceContext* deviceContext,
|
||||||
|
char* modelFilename,
|
||||||
|
TextureContainer& texturesContainer
|
||||||
|
)
|
||||||
|
{
|
||||||
|
|
||||||
|
std::string filename(modelFilename);
|
||||||
|
auto it = g_model_cache.find(filename);
|
||||||
|
if (it != g_model_cache.end())
|
||||||
|
{
|
||||||
|
m_model_ = it->second;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
auto new_model = std::make_shared<model_class>();
|
||||||
|
if (!new_model->Initialize(device, deviceContext, modelFilename, texturesContainer))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
g_model_cache[filename] = new_model;
|
||||||
|
m_model_ = new_model;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
void object::SetScaleMatrix(XMMATRIX scaleMatrix)
|
void object::SetScaleMatrix(XMMATRIX scaleMatrix)
|
||||||
{
|
{
|
||||||
m_scaleMatrix = scaleMatrix;
|
m_scaleMatrix = scaleMatrix;
|
||||||
|
@@ -85,13 +85,6 @@ bool scene_manager::load_scene() {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Nettoyer les objets existants
|
|
||||||
for (auto& obj : object_vec_) {
|
|
||||||
if (obj) {
|
|
||||||
obj->Shutdown();
|
|
||||||
delete obj;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
object_vec_.clear();
|
object_vec_.clear();
|
||||||
object_id_ = 0;
|
object_id_ = 0;
|
||||||
|
|
||||||
@@ -192,7 +185,7 @@ bool scene_manager::load_scene() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// preload texture
|
// preload texture
|
||||||
if (!newObject->PreloadTextures(direct_3d_->get_device(), direct_3d_->get_device_context(), objectTextures))
|
if (!newObject->get_model()->PreloadTextures(direct_3d_->get_device(), direct_3d_->get_device_context(), objectTextures))
|
||||||
{
|
{
|
||||||
// G<>rer l'erreur
|
// G<>rer l'erreur
|
||||||
return false;
|
return false;
|
||||||
@@ -281,28 +274,28 @@ bool scene_manager::save_scene() {
|
|||||||
// M<>me chose pour les autres types de textures_
|
// M<>me chose pour les autres types de textures_
|
||||||
|
|
||||||
// Textures diffuses
|
// Textures diffuses
|
||||||
const auto& diffusePaths = object->GetTextureContainer().GetPaths(TextureType::Diffuse);
|
const auto& diffusePaths = object->get_model()->GetTextureContainer().GetPaths(TextureType::Diffuse);
|
||||||
outFile << " " << diffusePaths.size();
|
outFile << " " << diffusePaths.size();
|
||||||
for (const auto& path : diffusePaths) {
|
for (const auto& path : diffusePaths) {
|
||||||
outFile << " " << convert_w_string_to_string(path);
|
outFile << " " << convert_w_string_to_string(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Textures normales
|
// Textures normales
|
||||||
const auto& normalPaths = object->GetTextureContainer().GetPaths(TextureType::Normal);
|
const auto& normalPaths = object->get_model()->GetTextureContainer().GetPaths(TextureType::Normal);
|
||||||
outFile << " " << normalPaths.size();
|
outFile << " " << normalPaths.size();
|
||||||
for (const auto& path : normalPaths) {
|
for (const auto& path : normalPaths) {
|
||||||
outFile << " " << convert_w_string_to_string(path);
|
outFile << " " << convert_w_string_to_string(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Textures sp<73>culaires
|
// Textures sp<73>culaires
|
||||||
const auto& specularPaths = object->GetTextureContainer().GetPaths(TextureType::Specular);
|
const auto& specularPaths = object->get_model()->GetTextureContainer().GetPaths(TextureType::Specular);
|
||||||
outFile << " " << specularPaths.size();
|
outFile << " " << specularPaths.size();
|
||||||
for (const auto& path : specularPaths) {
|
for (const auto& path : specularPaths) {
|
||||||
outFile << " " << convert_w_string_to_string(path);
|
outFile << " " << convert_w_string_to_string(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Textures alpha
|
// Textures alpha
|
||||||
const auto& alphaPaths = object->GetTextureContainer().GetPaths(TextureType::Alpha);
|
const auto& alphaPaths = object->get_model()->GetTextureContainer().GetPaths(TextureType::Alpha);
|
||||||
outFile << " " << alphaPaths.size();
|
outFile << " " << alphaPaths.size();
|
||||||
for (const auto& path : alphaPaths) {
|
for (const auto& path : alphaPaths) {
|
||||||
outFile << " " << convert_w_string_to_string(path);
|
outFile << " " << convert_w_string_to_string(path);
|
||||||
|
@@ -27,11 +27,6 @@ bool stats::initialize(application_class* app)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// call update() in a separate thread
|
|
||||||
std::thread update_geometric_thread(&stats::update_geometric_stats, this);
|
|
||||||
update_geometric_thread_ = std::move(update_geometric_thread); // Move the thread to the member variable
|
|
||||||
update_geometric_thread_.detach(); // Detach the thread to run independently
|
|
||||||
|
|
||||||
Logger::Get().Log("Stats initialized successfully", __FILE__, __LINE__, Logger::LogLevel::Initialize);
|
Logger::Get().Log("Stats initialized successfully", __FILE__, __LINE__, Logger::LogLevel::Initialize);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@@ -39,8 +34,7 @@ bool stats::initialize(application_class* app)
|
|||||||
|
|
||||||
void stats::update_geometric_stats()
|
void stats::update_geometric_stats()
|
||||||
{
|
{
|
||||||
while (true)
|
|
||||||
{
|
|
||||||
object_vec_ = app_->get_kobjects();
|
object_vec_ = app_->get_kobjects();
|
||||||
cubes_vec_ = app_->get_cubes();
|
cubes_vec_ = app_->get_cubes();
|
||||||
terrain_chunk_vec_ = app_->get_terrain_cubes();
|
terrain_chunk_vec_ = app_->get_terrain_cubes();
|
||||||
@@ -48,10 +42,6 @@ void stats::update_geometric_stats()
|
|||||||
total_vertex_count_ = get_total_vertex_count();
|
total_vertex_count_ = get_total_vertex_count();
|
||||||
total_triangle_count_ = get_total_triangle_count();
|
total_triangle_count_ = get_total_triangle_count();
|
||||||
visible_triangle_count_ = get_visible_triangle_count();
|
visible_triangle_count_ = get_visible_triangle_count();
|
||||||
|
|
||||||
// call update_stats() every second
|
|
||||||
std::this_thread::sleep_for(std::chrono::seconds(1));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void stats::update_display_stats()
|
void stats::update_display_stats()
|
||||||
@@ -71,7 +61,7 @@ int stats::get_total_vertex_count() const
|
|||||||
{
|
{
|
||||||
if (obj)
|
if (obj)
|
||||||
{
|
{
|
||||||
totalVertices += obj->GetVertexCount();
|
totalVertices += obj->get_model()->GetVertexCount();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Ajoutez le nombre de sommets pour les cubes
|
// Ajoutez le nombre de sommets pour les cubes
|
||||||
@@ -79,7 +69,7 @@ int stats::get_total_vertex_count() const
|
|||||||
{
|
{
|
||||||
if (cube)
|
if (cube)
|
||||||
{
|
{
|
||||||
totalVertices += cube->GetVertexCount();
|
totalVertices += cube->get_model()->GetVertexCount();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Ajoutez le nombre de sommets pour le terrain
|
// Ajoutez le nombre de sommets pour le terrain
|
||||||
@@ -87,7 +77,7 @@ int stats::get_total_vertex_count() const
|
|||||||
{
|
{
|
||||||
if (chunk)
|
if (chunk)
|
||||||
{
|
{
|
||||||
totalVertices += chunk->GetVertexCount();
|
totalVertices += chunk->get_model()->GetVertexCount();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return totalVertices;
|
return totalVertices;
|
||||||
@@ -101,7 +91,7 @@ int stats::get_total_triangle_count() const
|
|||||||
if (obj)
|
if (obj)
|
||||||
{
|
{
|
||||||
// Dans une topologie de liste de triangles, chaque triangle utilise 3 indices
|
// Dans une topologie de liste de triangles, chaque triangle utilise 3 indices
|
||||||
totalTriangles += obj->GetIndexCount() / 3;
|
totalTriangles += obj->get_model()->GetIndexCount() / 3;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Ajoutez le nombre de triangles pour les cubes
|
// Ajoutez le nombre de triangles pour les cubes
|
||||||
@@ -109,7 +99,7 @@ int stats::get_total_triangle_count() const
|
|||||||
{
|
{
|
||||||
if (cube)
|
if (cube)
|
||||||
{
|
{
|
||||||
totalTriangles += cube->GetIndexCount() / 3;
|
totalTriangles += cube->get_model()->GetIndexCount() / 3;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Ajoutez le nombre de triangles pour le terrain
|
// Ajoutez le nombre de triangles pour le terrain
|
||||||
@@ -117,7 +107,7 @@ int stats::get_total_triangle_count() const
|
|||||||
{
|
{
|
||||||
if (chunk)
|
if (chunk)
|
||||||
{
|
{
|
||||||
totalTriangles += chunk->GetIndexCount() / 3;
|
totalTriangles += chunk->get_model()->GetIndexCount() / 3;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return totalTriangles;
|
return totalTriangles;
|
||||||
@@ -130,7 +120,7 @@ int stats::get_visible_triangle_count() const
|
|||||||
{
|
{
|
||||||
if (obj && obj->IsVisible())
|
if (obj && obj->IsVisible())
|
||||||
{
|
{
|
||||||
visibleTriangles += obj->GetIndexCount() / 3;
|
visibleTriangles += obj->get_model()->GetIndexCount() / 3;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Ajoutez le nombre de triangles visibles pour les cubes
|
// Ajoutez le nombre de triangles visibles pour les cubes
|
||||||
@@ -138,7 +128,7 @@ int stats::get_visible_triangle_count() const
|
|||||||
{
|
{
|
||||||
if (cube && cube->IsVisible())
|
if (cube && cube->IsVisible())
|
||||||
{
|
{
|
||||||
visibleTriangles += cube->GetIndexCount() / 3;
|
visibleTriangles += cube->get_model()->GetIndexCount() / 3;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Ajoutez le nombre de triangles visibles pour le terrain
|
// Ajoutez le nombre de triangles visibles pour le terrain
|
||||||
@@ -146,7 +136,7 @@ int stats::get_visible_triangle_count() const
|
|||||||
{
|
{
|
||||||
if (chunk && chunk->IsVisible())
|
if (chunk && chunk->IsVisible())
|
||||||
{
|
{
|
||||||
visibleTriangles += chunk->GetIndexCount() / 3;
|
visibleTriangles += chunk->get_model()->GetIndexCount() / 3;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return visibleTriangles;
|
return visibleTriangles;
|
||||||
|
@@ -20,27 +20,6 @@ system_class::system_class()
|
|||||||
|
|
||||||
system_class::~system_class()
|
system_class::~system_class()
|
||||||
{
|
{
|
||||||
|
|
||||||
if (application_handle)
|
|
||||||
{
|
|
||||||
delete application_handle;
|
|
||||||
application_handle = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (input_)
|
|
||||||
{
|
|
||||||
delete input_;
|
|
||||||
input_ = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (imgui_manager_)
|
|
||||||
{
|
|
||||||
delete imgui_manager_;
|
|
||||||
imgui_manager_ = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool system_class::initialize()
|
bool system_class::initialize()
|
||||||
@@ -56,7 +35,7 @@ bool system_class::initialize()
|
|||||||
initialize_windows(screenWidth, screenHeight);
|
initialize_windows(screenWidth, screenHeight);
|
||||||
|
|
||||||
// Create and initialize the input object. This object will be used to handle reading the keyboard input from the user.
|
// Create and initialize the input object. This object will be used to handle reading the keyboard input from the user.
|
||||||
input_ = new input_class;
|
input_ = std::make_shared<input_class>();
|
||||||
|
|
||||||
result = input_->Initialize(hinstance_, hwnd_, screenWidth, screenHeight);
|
result = input_->Initialize(hinstance_, hwnd_, screenWidth, screenHeight);
|
||||||
if (!result)
|
if (!result)
|
||||||
@@ -66,7 +45,7 @@ bool system_class::initialize()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Create and initialize the application class object. This object will handle rendering all the graphics for this application.
|
// Create and initialize the application class object. This object will handle rendering all the graphics for this application.
|
||||||
application_ = new application_class;
|
application_ = std::make_shared<application_class>();
|
||||||
|
|
||||||
result = application_->initialize(screenWidth, screenHeight, hwnd_, false);
|
result = application_->initialize(screenWidth, screenHeight, hwnd_, false);
|
||||||
if (!result)
|
if (!result)
|
||||||
@@ -85,7 +64,7 @@ bool system_class::initialize()
|
|||||||
// initialize imgui
|
// initialize imgui
|
||||||
if(DEBUG_MODE)
|
if(DEBUG_MODE)
|
||||||
{
|
{
|
||||||
imgui_manager_ = new imguiManager;
|
imgui_manager_ = std::make_shared<imguiManager>();
|
||||||
imgui_manager_->SetApp(application_);
|
imgui_manager_->SetApp(application_);
|
||||||
result = imgui_manager_->Initialize(hwnd_, application_->get_direct_3d()->get_device(), application_->get_direct_3d()->get_device_context());
|
result = imgui_manager_->Initialize(hwnd_, application_->get_direct_3d()->get_device(), application_->get_direct_3d()->get_device_context());
|
||||||
if (!result)
|
if (!result)
|
||||||
@@ -112,49 +91,11 @@ void system_class::shutdown()
|
|||||||
|
|
||||||
std::lock_guard<std::mutex> guard(render_mutex_);
|
std::lock_guard<std::mutex> guard(render_mutex_);
|
||||||
|
|
||||||
// shutdown imgui
|
|
||||||
if (imgui_manager_)
|
|
||||||
{
|
|
||||||
Logger::Get().Log("Shutting down imgui manager", __FILE__, __LINE__, Logger::LogLevel::Shutdown);
|
|
||||||
|
|
||||||
imgui_manager_->Shutdown();
|
|
||||||
delete imgui_manager_;
|
|
||||||
imgui_manager_ = 0;
|
|
||||||
|
|
||||||
Logger::Get().Log("Imgui manager shut down", __FILE__, __LINE__, Logger::LogLevel::Shutdown);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Release the application class object.
|
|
||||||
if (application_)
|
|
||||||
{
|
|
||||||
Logger::Get().Log("Shutting down application", __FILE__, __LINE__, Logger::LogLevel::Shutdown);
|
|
||||||
|
|
||||||
application_->shutdown();
|
|
||||||
delete application_;
|
|
||||||
application_ = 0;
|
|
||||||
|
|
||||||
Logger::Get().Log("Application shut down", __FILE__, __LINE__, Logger::LogLevel::Shutdown);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Release the input object.
|
|
||||||
if (input_)
|
|
||||||
{
|
|
||||||
Logger::Get().Log("Shutting down input", __FILE__, __LINE__, Logger::LogLevel::Shutdown);
|
|
||||||
|
|
||||||
delete input_;
|
|
||||||
input_ = 0;
|
|
||||||
|
|
||||||
Logger::Get().Log("Input shut down", __FILE__, __LINE__, Logger::LogLevel::Shutdown);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// shutdown the window.
|
// shutdown the window.
|
||||||
shutdown_windows();
|
shutdown_windows();
|
||||||
|
|
||||||
Logger::Get().Log("System class shut down", __FILE__, __LINE__, Logger::LogLevel::Shutdown);
|
Logger::Get().Log("System class shut down", __FILE__, __LINE__, Logger::LogLevel::Shutdown);
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void system_class::run()
|
void system_class::run()
|
||||||
@@ -224,7 +165,7 @@ bool system_class::frame()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Do the frame processing for the application class object.
|
// Do the frame processing for the application class object.
|
||||||
result = application_->frame(input_);
|
result = application_->frame(input_.get());
|
||||||
if (!result)
|
if (!result)
|
||||||
{
|
{
|
||||||
Logger::Get().Log("Failed to process application frame", __FILE__, __LINE__, Logger::LogLevel::Error);
|
Logger::Get().Log("Failed to process application frame", __FILE__, __LINE__, Logger::LogLevel::Error);
|
||||||
|
Reference in New Issue
Block a user