This commit is contained in:
CatChow0 2025-02-02 22:35:41 +01:00
parent af01f223c1
commit 5e68105fe1
10 changed files with 72 additions and 185 deletions

View File

@ -12,9 +12,9 @@
<change beforePath="$PROJECT_DIR$/enginecustom/src/hlsl/font.vs" beforeDir="false" afterPath="$PROJECT_DIR$/enginecustom/src/hlsl/font.vs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/enginecustom/src/inc/system/applicationclass.h" beforeDir="false" afterPath="$PROJECT_DIR$/enginecustom/src/inc/system/applicationclass.h" afterDir="false" />
<change beforePath="$PROJECT_DIR$/enginecustom/src/inc/system/imguiManager.h" beforeDir="false" afterPath="$PROJECT_DIR$/enginecustom/src/inc/system/imguiManager.h" afterDir="false" />
<change beforePath="$PROJECT_DIR$/enginecustom/src/inc/system/textclass.h" beforeDir="false" afterPath="$PROJECT_DIR$/enginecustom/src/inc/system/textclass.h" afterDir="false" />
<change beforePath="$PROJECT_DIR$/enginecustom/src/src/shader/fontshaderclass.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/enginecustom/src/src/shader/fontshaderclass.cpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/enginecustom/src/src/system/Systemclass.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/enginecustom/src/src/system/Systemclass.cpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/enginecustom/src/src/system/applicationclass.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/enginecustom/src/src/system/applicationclass.cpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/enginecustom/src/src/system/d3dclass.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/enginecustom/src/src/system/d3dclass.cpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/enginecustom/src/src/system/imguiManager.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/enginecustom/src/src/system/imguiManager.cpp" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
@ -61,90 +61,7 @@
<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="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="cidr-memory-view://5" root0="FORCE_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://$PROJECT_DIR$/enginecustom/src/src/shader/CelShadingShader.cpp" root0="FORCE_HIGHLIGHTING" />
</component>
@ -160,25 +77,25 @@
<option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" />
</component>
<component name="PropertiesComponent">{
&quot;keyToString&quot;: {
&quot;ASKED_SHARE_PROJECT_CONFIGURATION_FILES&quot;: &quot;true&quot;,
&quot;C++ Project.enginecustom.executor&quot;: &quot;Run&quot;,
&quot;C/C++ Project.enginecustom.executor&quot;: &quot;Run&quot;,
&quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;,
&quot;RunOnceActivity.git.unshallow&quot;: &quot;true&quot;,
&quot;SHARE_PROJECT_CONFIGURATION_FILES&quot;: &quot;true&quot;,
&quot;git-widget-placeholder&quot;: &quot;main&quot;,
&quot;ignore.virus.scanning.warn.message&quot;: &quot;true&quot;,
&quot;node.js.detected.package.eslint&quot;: &quot;true&quot;,
&quot;node.js.detected.package.tslint&quot;: &quot;true&quot;,
&quot;node.js.selected.package.eslint&quot;: &quot;(autodetect)&quot;,
&quot;node.js.selected.package.tslint&quot;: &quot;(autodetect)&quot;,
&quot;nodejs_package_manager_path&quot;: &quot;npm&quot;,
&quot;settings.editor.selected.configurable&quot;: &quot;preferences.keymap&quot;,
&quot;vue.rearranger.settings.migration&quot;: &quot;true&quot;
<component name="PropertiesComponent"><![CDATA[{
"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"
}
}</component>
}]]></component>
<component name="RunManager" selected="C/C++ Project.enginecustom">
<configuration name="KhaoticDemo" type="CppProject" factoryName="C++ Project">
<configuration_1 setup="1">
@ -243,6 +160,7 @@
<workItem from="1738358054789" duration="9000" />
<workItem from="1738358091089" duration="6675000" />
<workItem from="1738364887298" duration="2275000" />
<workItem from="1738515031789" duration="14018000" />
</task>
<task id="LOCAL-00001" summary="Minor update - viewport window tweak">
<option name="closed" value="true" />

View File

@ -4,8 +4,8 @@ Size=400,400
Collapsed=0
[Window][Khaotic Engine]
Pos=1187,27
Size=389,826
Pos=1233,27
Size=343,826
Collapsed=0
DockId=0x00000005,0
@ -37,7 +37,7 @@ DockId=0x00000001,2
Pos=1187,27
Size=389,826
Collapsed=0
DockId=0x00000005,1
DockId=0x00000008,1
[Window][DockSpace Demo]
Size=1584,861
@ -45,9 +45,9 @@ Collapsed=0
[Window][Render Window]
Pos=8,27
Size=1177,826
Size=1223,826
Collapsed=0
DockId=0x00000002,0
DockId=0x00000008,0
[Window][DockSpace]
Pos=0,0
@ -72,18 +72,18 @@ 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=Y
DockNode ID=0x00000004 Parent=0xCCBD8CF7 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 Split=X
DockNode ID=0x00000002 Parent=0x00000008 SizeRef=1177,826 CentralNode=1 Selected=0x9204953B
DockNode ID=0x00000005 Parent=0x00000008 SizeRef=389,826 Selected=0x9F035453
DockNode ID=0x0000000C Parent=0x00000004 SizeRef=1568,335 Selected=0x139FDA3F
DockNode ID=0x00000006 Parent=0xCCBD8CF7 SizeRef=2032,226 Selected=0xAB74BEE9
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

Binary file not shown.

View File

@ -31,8 +31,7 @@ float4 FontPixelShader(PixelInputType input) : SV_TARGET
// If the color is black on the texture then treat this pixel as transparent.
if (color.r == 0.0f && color.g == 0.0f && color.b == 0.0f)
{
color.a = 0.0f;
return color;
return color / color;
}
// If the color is other than black on the texture then this is a pixel in the font so draw it using the font pixel color.

View File

@ -64,7 +64,11 @@ public:
ApplicationClass();
~ApplicationClass();
D3DClass* GetDirect3D();
RenderTextureClass* GetRenderTexture() const { return m_SceneTexture; };
RenderTextureClass* GetSceneTexture() const { return m_SceneTexture; };
RenderTextureClass* GetRenderTexture() const { return m_RenderTexture; };
RenderTextureClass* GetRefractionTexture() const { return m_RefractionTexture; };
RenderTextureClass* GetReflectionTexture() const { return m_ReflectionTexture; };
bool Initialize(int, int, HWND);
void Shutdown();
@ -140,6 +144,8 @@ public:
bool GetCanFixedUpdate() const { return CanFixedUpdate; };
void SetCanFixedUpdate(bool canFixedUpdate) { CanFixedUpdate = canFixedUpdate; };
ID3D11ShaderResourceView* GetBackBufferSRV() const {return m_BackBufferSRV;};
private:
bool Render(float, float, float, float, float);
bool RenderPhysics(bool keyLeft, bool keyRight, bool keyUp, bool keyDown, float deltaTime);
@ -256,6 +262,9 @@ private :
bool CanFixedUpdate = false;
std::thread m_PhysicsThread;
ID3D11Texture2D* m_BackBufferTexture;
ID3D11ShaderResourceView* m_BackBufferSRV;
// ------------------------------------------------- //
// ------------------- Culling --------------------- //
// ------------------------------------------------- //

View File

@ -21,7 +21,7 @@ public:
bool Initialize(HWND hwnd, ID3D11Device* device, ID3D11DeviceContext* deviceContext);
void Shutdown();
void Render();
void Render(ApplicationClass* app);
void NewFrame();
void SetupDockspace();

View File

@ -178,6 +178,7 @@ bool FontShaderClass::InitializeShader(ID3D11Device* device, HWND hwnd, WCHAR* v
polygonLayout[1].AlignedByteOffset = D3D11_APPEND_ALIGNED_ELEMENT;
polygonLayout[1].InputSlotClass = D3D11_INPUT_PER_VERTEX_DATA;
polygonLayout[1].InstanceDataStepRate = 0;
// Get a count of the elements in the layout.
numElements = sizeof(polygonLayout) / sizeof(polygonLayout[0]);

View File

@ -213,7 +213,7 @@ bool SystemClass::Frame()
Logger::Get().Log("Failed to render ImGui widgets", __FILE__, __LINE__, Logger::LogLevel::Error);
return false;
}
m_Application->GetDirect3D()->EndScene();
return true;

View File

@ -994,7 +994,7 @@ bool ApplicationClass::Render(float rotation, float x, float y, float z, float t
m_SceneTexture->Shutdown();
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);
@ -1085,48 +1085,6 @@ bool ApplicationClass::Render(float rotation, float x, float y, float z, float t
return false;
}
// Setup matrices - Top display plane.
worldMatrix = XMMatrixTranslation(0.0f, 1.5f, 0.0f);
// Render the display plane using the texture shader and the render texture resource.
m_DisplayPlane->Render(m_Direct3D->GetDeviceContext());
result = m_ShaderManager->RenderTextureShader(m_Direct3D->GetDeviceContext(), m_DisplayPlane->GetIndexCount(), worldMatrix, viewMatrix, projectionMatrix,
m_RenderTexture->GetShaderResourceView());
if (!result)
{
Logger::Get().Log("Could not render the display plane using the texture shader", __FILE__, __LINE__, Logger::LogLevel::Error);
return false;
}
// Setup matrices - Bottom left display plane.
worldMatrix = XMMatrixTranslation(-1.5f, -1.5f, 0.0f);
// Render the display plane using the texture shader and the render texture resource.
m_DisplayPlane->Render(m_Direct3D->GetDeviceContext());
result = m_ShaderManager->RenderTextureShader(m_Direct3D->GetDeviceContext(), m_DisplayPlane->GetIndexCount(), worldMatrix, viewMatrix, projectionMatrix,
m_RenderTexture->GetShaderResourceView());
if (!result)
{
Logger::Get().Log("Could not render the display plane using the texture shader", __FILE__, __LINE__, Logger::LogLevel::Error);
return false;
}
// Setup matrices - Bottom right display plane.
worldMatrix = XMMatrixTranslation(1.5f, -1.5f, 0.0f);
// Render the display plane using the texture shader and the render texture resource.
m_DisplayPlane->Render(m_Direct3D->GetDeviceContext());
result = m_ShaderManager->RenderTextureShader(m_Direct3D->GetDeviceContext(), m_DisplayPlane->GetIndexCount(), worldMatrix, viewMatrix, projectionMatrix,
m_RenderTexture->GetShaderResourceView());
if (!result)
{
Logger::Get().Log("Could not render the display plane using the texture shader", __FILE__, __LINE__, Logger::LogLevel::Error);
return false;
}
// Disable the Z buffer and enable alpha blending for 2D rendering.
m_Direct3D->TurnZBufferOff();
m_Direct3D->EnableAlphaBlending();
@ -1361,6 +1319,8 @@ bool ApplicationClass::Render(float rotation, float x, float y, float z, float t
m_Direct3D->TurnZBufferOn();
m_Direct3D->DisableAlphaBlending();
return true;
}

View File

@ -29,8 +29,6 @@ bool imguiManager::Initialize(HWND hwnd, ID3D11Device* device, ID3D11DeviceConte
// Setup style
ImGui::StyleColorsDark();
ImGuiStyle& style = ImGui::GetStyle();
style.Colors[ImGuiCol_WindowBg] = ImVec4(1.0f, 0.1f, 0.1f, 1.0f);
Logger::Get().Log("imgui initialized", __FILE__, __LINE__, Logger::LogLevel::Initialize);
@ -46,10 +44,17 @@ void imguiManager::Shutdown()
Logger::Get().Log("imgui shutdown", __FILE__, __LINE__, Logger::LogLevel::Shutdown);
}
void imguiManager::Render()
void imguiManager::Render(ApplicationClass* app)
{
ImGui::Render();
app->GetDirect3D()->TurnZBufferOff();
app->GetDirect3D()->EnableAlphaBlending();
ImGui_ImplDX11_RenderDrawData(ImGui::GetDrawData());
app->GetDirect3D()->DisableAlphaBlending();
app->GetDirect3D()->TurnZBufferOn();
}
void imguiManager::NewFrame()
@ -403,7 +408,7 @@ bool imguiManager::ImGuiWidgetRenderer(ApplicationClass* app)
WidgetRenderWindow(app, ImVec2(800, 600));
//render imgui
Render();
Render(app);
return true;
}
@ -604,9 +609,9 @@ void imguiManager::WidgetLogWindow(ApplicationClass* app)
ImGui::End();
}
void imguiManager::WidgetRenderWindow(ApplicationClass* app, ImVec2 availableSize)
{
ImGui::Begin("Render Window");
ImVec2 oldWindowSize = windowSize;
@ -617,7 +622,6 @@ void imguiManager::WidgetRenderWindow(ApplicationClass* app, ImVec2 availableSiz
{
app->SetWindowSize(windowSize);
}
// Get the aspect ratio of the scene in app
@ -631,17 +635,13 @@ void imguiManager::WidgetRenderWindow(ApplicationClass* app, ImVec2 availableSiz
{
windowSize.y = windowSize.x / aspectRatio;
}
// Assurez-vous que la texture est valide
m_renderTexture = app->GetRenderTexture();
if (m_renderTexture)
ID3D11ShaderResourceView* texture = app->GetSceneTexture()->GetShaderResourceView();
if (texture)
{
// Obtenez la vue de la ressource shader de la texture rendue
ID3D11ShaderResourceView* texture = m_renderTexture->GetShaderResourceView();
// Affichez la texture dans une fenêtre ImGui
ImGui::Image((ImTextureID)texture, windowSize);
ImGui::Image((ImTextureID)texture, windowSize, ImVec2(0, 0), ImVec2(1, 1), ImVec4(1, 1, 1, 1));
}
else
{