diff --git a/.idea/.idea.KhaoticEngineReborn/.idea/projectSettingsUpdater.xml b/.idea/.idea.KhaoticEngineReborn/.idea/projectSettingsUpdater.xml
index 64af657..4bb9f4d 100644
--- a/.idea/.idea.KhaoticEngineReborn/.idea/projectSettingsUpdater.xml
+++ b/.idea/.idea.KhaoticEngineReborn/.idea/projectSettingsUpdater.xml
@@ -1,7 +1,6 @@
-
-
+
\ No newline at end of file
diff --git a/.idea/.idea.KhaoticEngineReborn/.idea/workspace.xml b/.idea/.idea.KhaoticEngineReborn/.idea/workspace.xml
index 9ecad4e..52d2bca 100644
--- a/.idea/.idea.KhaoticEngineReborn/.idea/workspace.xml
+++ b/.idea/.idea.KhaoticEngineReborn/.idea/workspace.xml
@@ -5,14 +5,11 @@
+
-
-
-
-
-
+
@@ -62,7 +59,7 @@
-
+
@@ -77,30 +74,38 @@
- {
+ "keyToString": {
+ "ASKED_SHARE_PROJECT_CONFIGURATION_FILES": "true",
+ "C++ Project.enginecustom.executor": "Run",
+ "C/C++ Project.enginecustom.executor": "Run",
+ "RunOnceActivity.ShowReadmeOnStart": "true",
+ "RunOnceActivity.git.unshallow": "true",
+ "SHARE_PROJECT_CONFIGURATION_FILES": "true",
+ "git-widget-placeholder": "main",
+ "ignore.virus.scanning.warn.message": "true",
+ "node.js.detected.package.eslint": "true",
+ "node.js.detected.package.tslint": "true",
+ "node.js.selected.package.eslint": "(autodetect)",
+ "node.js.selected.package.tslint": "(autodetect)",
+ "nodejs_package_manager_path": "npm",
+ "settings.editor.selected.configurable": "preferences.keymap",
+ "vue.rearranger.settings.migration": "true"
+ },
+ "keyToStringList": {
+ "rider.external.source.directories": [
+ "C:\\Users\\arivas\\AppData\\Roaming\\JetBrains\\Rider2024.1\\resharper-host\\DecompilerCache",
+ "C:\\Users\\arivas\\AppData\\Roaming\\JetBrains\\Rider2024.1\\resharper-host\\SourcesCache",
+ "C:\\Users\\arivas\\AppData\\Local\\Symbols\\src"
+ ]
}
-}]]>
-
+}
+
-
+
+
@@ -108,19 +113,18 @@
-
-
-
+
+
@@ -128,10 +132,8 @@
-
-
@@ -161,6 +163,8 @@
+
+
diff --git a/enginecustom/imgui.ini b/enginecustom/imgui.ini
index e2e8eae..811270e 100644
--- a/enginecustom/imgui.ini
+++ b/enginecustom/imgui.ini
@@ -11,21 +11,21 @@ DockId=0x00000005,0
[Window][Objects]
Pos=8,27
-Size=290,826
+Size=289,974
Collapsed=0
-DockId=0x0000000A,0
+DockId=0x00000009,0
[Window][Terrain]
Pos=8,27
-Size=290,866
+Size=250,826
Collapsed=0
-DockId=0x00000009,0
+DockId=0x00000007,0
[Window][Light]
Pos=8,27
Size=290,866
Collapsed=0
-DockId=0x00000009,1
+DockId=0x00000007,1
[Window][Shader Manager]
Pos=8,27
@@ -34,10 +34,10 @@ Collapsed=0
DockId=0x00000001,2
[Window][Engine Settings]
-Pos=1187,27
-Size=389,826
+Pos=8,27
+Size=1223,826
Collapsed=0
-DockId=0x00000008,1
+DockId=0x00000009,1
[Window][DockSpace Demo]
Size=1584,861
@@ -45,9 +45,9 @@ Collapsed=0
[Window][Render Window]
Pos=8,27
-Size=1223,826
+Size=1559,974
Collapsed=0
-DockId=0x00000008,0
+DockId=0x00000009,0
[Window][DockSpace]
Pos=0,0
@@ -76,14 +76,14 @@ 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=0x00000002 Parent=0xCCBD8CF7 SizeRef=1223,826 Split=Y
- DockNode ID=0x00000004 Parent=0x00000002 SizeRef=2032,866 Split=Y
- DockNode ID=0x0000000B Parent=0x00000004 SizeRef=1568,637 Split=X
- DockNode ID=0x00000007 Parent=0x0000000B SizeRef=290,826 Split=Y Selected=0x393905AB
- DockNode ID=0x00000009 Parent=0x00000007 SizeRef=395,413 Selected=0x321620B2
- DockNode ID=0x0000000A Parent=0x00000007 SizeRef=395,411 Selected=0x031DC75C
- DockNode ID=0x00000008 Parent=0x0000000B SizeRef=1276,826 CentralNode=1 Selected=0x9204953B
- DockNode ID=0x0000000C Parent=0x00000004 SizeRef=1568,335 Selected=0x139FDA3F
- DockNode ID=0x00000006 Parent=0x00000002 SizeRef=2032,226 Selected=0xAB74BEE9
- DockNode ID=0x00000005 Parent=0xCCBD8CF7 SizeRef=343,826 Selected=0x9F035453
+ DockNode ID=0x00000009 Parent=0xCCBD8CF7 SizeRef=289,974 Selected=0x031DC75C
+ DockNode ID=0x0000000D Parent=0xCCBD8CF7 SizeRef=1613,974 Split=X
+ DockNode ID=0x00000002 Parent=0x0000000D SizeRef=1268,826 Split=Y
+ DockNode ID=0x00000004 Parent=0x00000002 SizeRef=2032,866 Split=Y
+ DockNode ID=0x0000000B Parent=0x00000004 SizeRef=1568,637 Split=X
+ DockNode ID=0x00000007 Parent=0x0000000B SizeRef=250,826 Selected=0x393905AB
+ DockNode ID=0x00000008 Parent=0x0000000B SizeRef=971,826 CentralNode=1 Selected=0x031DC75C
+ DockNode ID=0x0000000C Parent=0x00000004 SizeRef=1568,335 Selected=0x139FDA3F
+ DockNode ID=0x00000006 Parent=0x00000002 SizeRef=2032,226 Selected=0xAB74BEE9
+ DockNode ID=0x00000005 Parent=0x0000000D SizeRef=343,826 Selected=0x9F035453
diff --git a/enginecustom/src/inc/system/imguiManager.h b/enginecustom/src/inc/system/imguiManager.h
index cc3e7f0..41a23f9 100644
--- a/enginecustom/src/inc/system/imguiManager.h
+++ b/enginecustom/src/inc/system/imguiManager.h
@@ -61,7 +61,7 @@ private:
bool showObjectWindow;
bool showTerrainWindow;
bool showLightWindow;
- bool showShaderWindow;
+ bool showOldSceneWindow;
bool showEngineSettingsWindow;
bool showLogWindow;
diff --git a/enginecustom/src/inc/system/systemclass.h b/enginecustom/src/inc/system/systemclass.h
index 6ad1879..ee627e8 100644
--- a/enginecustom/src/inc/system/systemclass.h
+++ b/enginecustom/src/inc/system/systemclass.h
@@ -27,7 +27,7 @@ public:
void SendPath(wchar_t* path, std::filesystem::path WFolder);
-private:
+protected:
bool Frame();
void InitializeWindows(int&, int&);
void ShutdownWindows();
@@ -54,6 +54,7 @@ private:
// FUNCTION PROTOTYPES //
/////////////////////////
static LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
+static LRESULT CALLBACK SecondaryWndProc(HWND, UINT, WPARAM, LPARAM);
/////////////
diff --git a/enginecustom/src/src/system/Systemclass.cpp b/enginecustom/src/src/system/Systemclass.cpp
index 60b519f..cd2c3a6 100644
--- a/enginecustom/src/src/system/Systemclass.cpp
+++ b/enginecustom/src/src/system/Systemclass.cpp
@@ -468,3 +468,15 @@ void SystemClass::SendPath(wchar_t* path, std::filesystem::path WFolder)
m_Application->SetWFolder(WFolder);
}
+LRESULT CALLBACK SecondaryWndProc(HWND hwnd, UINT umessage, WPARAM wparam, LPARAM lparam)
+{
+ switch (umessage)
+ {
+ case WM_DESTROY:
+ case WM_CLOSE:
+ PostQuitMessage(0);
+ return 0;
+ default:
+ return DefWindowProc(hwnd, umessage, wparam, lparam);
+ }
+}
\ No newline at end of file
diff --git a/enginecustom/src/src/system/applicationclass.cpp b/enginecustom/src/src/system/applicationclass.cpp
index 46166e4..15b7c7d 100644
--- a/enginecustom/src/src/system/applicationclass.cpp
+++ b/enginecustom/src/src/system/applicationclass.cpp
@@ -995,8 +995,15 @@ bool ApplicationClass::Render(float rotation, float x, float y, float z, float t
m_SceneTexture->Initialize(m_Direct3D->GetDevice(), (int)windowSize.x, (int)windowSize.y, SCREEN_DEPTH, SCREEN_NEAR, 1);
}
- m_SceneTexture->SetRenderTarget(m_Direct3D->GetDeviceContext());
- m_SceneTexture->ClearRenderTarget(m_Direct3D->GetDeviceContext(), 0.0f, 0.0f, 0.0f, 1.0f);
+ m_Direct3D->SetBackBufferRenderTarget();
+ m_Direct3D->ResetViewport();
+
+
+ /// CPT ALED C'EST ICI QUE CA SE PASSE ///
+
+
+ //m_SceneTexture->SetRenderTarget(m_Direct3D->GetDeviceContext());
+ //m_SceneTexture->ClearRenderTarget(m_Direct3D->GetDeviceContext(), 0.0f, 0.0f, 0.0f, 0.0f);
scaleMatrix = XMMatrixScaling(0.5f, 0.5f, 0.5f); // Build the scaling matrix.
rotateMatrix = XMMatrixRotationY(rotation); // Build the rotation matrix.
@@ -1186,7 +1193,7 @@ bool ApplicationClass::Render(float rotation, float x, float y, float z, float t
Logger::Get().Log("Could not render the model using the alpha map shader", __FILE__, __LINE__, Logger::LogLevel::Error);
return false;
}
-
+
// Setup matrices.
rotateMatrix = XMMatrixRotationY(rotation);
translateMatrix = XMMatrixTranslation(-5.0f, -5.0f, -20.0f);
diff --git a/enginecustom/src/src/system/imguiManager.cpp b/enginecustom/src/src/system/imguiManager.cpp
index bc84c7d..eaa3700 100644
--- a/enginecustom/src/src/system/imguiManager.cpp
+++ b/enginecustom/src/src/system/imguiManager.cpp
@@ -29,6 +29,11 @@ bool imguiManager::Initialize(HWND hwnd, ID3D11Device* device, ID3D11DeviceConte
// Setup style
ImGui::StyleColorsDark();
+ // Set the window background color to be a transparent black/gray
+ ImGui::GetStyle().Colors[ImGuiCol_WindowBg] = ImVec4(0, 0, 0, 0.5f);
+ // Set the menu bar background color to be a transparent black/gray
+ ImGui::GetStyle().Colors[ImGuiCol_MenuBarBg] = ImVec4(0, 0, 0, 0.5f);
+
Logger::Get().Log("imgui initialized", __FILE__, __LINE__, Logger::LogLevel::Initialize);
@@ -48,13 +53,13 @@ void imguiManager::Render(ApplicationClass* app)
{
ImGui::Render();
- app->GetDirect3D()->TurnZBufferOff();
- app->GetDirect3D()->EnableAlphaBlending();
+ //app->GetDirect3D()->TurnZBufferOff();
+ //app->GetDirect3D()->EnableAlphaBlending();
ImGui_ImplDX11_RenderDrawData(ImGui::GetDrawData());
- app->GetDirect3D()->DisableAlphaBlending();
- app->GetDirect3D()->TurnZBufferOn();
+ //app->GetDirect3D()->DisableAlphaBlending();
+ //app->GetDirect3D()->TurnZBufferOn();
}
void imguiManager::NewFrame()
@@ -75,15 +80,19 @@ void imguiManager::SetupDockspace() {
window_flags |= ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove;
window_flags |= ImGuiWindowFlags_NoBringToFrontOnFocus | ImGuiWindowFlags_NoNavFocus;
+ ImGui::PushStyleColor(ImGuiCol_WindowBg, ImVec4(0, 0, 0, 0));
+
ImGui::Begin("DockSpace", nullptr, window_flags);
ImGui::PopStyleVar(2);
+ ImGui::PopStyleColor();
+
if (ImGui::BeginMenuBar()) {
if (ImGui::BeginMenu("Windows")) {
ImGui::MenuItem("Object Window", NULL, &showObjectWindow);
ImGui::MenuItem("Terrain Window", NULL, &showTerrainWindow);
ImGui::MenuItem("Light Window", NULL, &showLightWindow);
- ImGui::MenuItem("Shader Window", NULL, &showShaderWindow);
+ ImGui::MenuItem("Old Scene Window", NULL, &showOldSceneWindow);
ImGui::MenuItem("Engine Settings Window", NULL, &showEngineSettingsWindow);
ImGui::MenuItem("Log Window", NULL, &showLogWindow);
ImGui::EndMenu();
@@ -405,7 +414,11 @@ bool imguiManager::ImGuiWidgetRenderer(ApplicationClass* app)
WidgetLogWindow(app);
}
- WidgetRenderWindow(app, ImVec2(800, 600));
+ if (showOldSceneWindow)
+ {
+ WidgetRenderWindow(app, ImVec2(800, 600));
+ }
+
//render imgui
Render(app);
@@ -611,7 +624,6 @@ void imguiManager::WidgetLogWindow(ApplicationClass* app)
void imguiManager::WidgetRenderWindow(ApplicationClass* app, ImVec2 availableSize)
{
-
ImGui::Begin("Render Window");
ImVec2 oldWindowSize = windowSize;
@@ -640,7 +652,12 @@ void imguiManager::WidgetRenderWindow(ApplicationClass* app, ImVec2 availableSiz
if (texture)
{
- // Affichez la texture dans une fenêtre ImGui
+ // Affichez la scenne projeté sur texture dans une fenêtre ImGui
+ // alpha blend is not enable to render the texture
+
+ app->GetDirect3D()->TurnZBufferOff();
+ app->GetDirect3D()->EnableAlphaBlending();
+
ImGui::Image((ImTextureID)texture, windowSize, ImVec2(0, 0), ImVec2(1, 1), ImVec4(1, 1, 1, 1));
}
else