Fixed Crashing
This commit is contained in:
parent
195f7abbe0
commit
58be5709a3
@ -14,7 +14,7 @@ extern GameObject *g_SelectedObject; // Pointer to the currently selected object
|
||||
extern std::shared_ptr<CameraComponent> g_RuntimeCameraObject;
|
||||
|
||||
#include "Engine/AssetManager.h"
|
||||
extern AssetManager *g_AssetManager;
|
||||
extern AssetManager g_AssetManager;
|
||||
extern LoggerWindow *g_LoggerWindow;
|
||||
|
||||
void InspectorWindow::Show()
|
||||
@ -428,7 +428,7 @@ void InspectorWindow::Show()
|
||||
mesh->MeshPath = buffer;
|
||||
}
|
||||
if (ImGui::Button("Reload Mesh")) {
|
||||
std::shared_ptr<Model> model = g_AssetManager->loadAsset<Model>(AssetType::MODEL, mesh->MeshPath.c_str());
|
||||
std::shared_ptr<Model> model = g_AssetManager.loadAsset<Model>(AssetType::MODEL, mesh->MeshPath.c_str());
|
||||
|
||||
}
|
||||
|
||||
|
@ -94,11 +94,6 @@ bool PlayPauseButton(const char *label, bool *isPlaying, ImVec2 Size)
|
||||
return false; // No toggle occurred
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void RenderWindow::Show(bool *GameRunning)
|
||||
{
|
||||
ImGui::Begin(ICON_FA_GAMEPAD " Editor##EditorWindow");
|
||||
@ -153,11 +148,6 @@ void RenderWindow::Show(bool *GameRunning)
|
||||
ImGui::End();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void RenderWindow::InitGLResources()
|
||||
{
|
||||
// ----------------------------------------------------
|
||||
@ -175,7 +165,6 @@ void RenderWindow::InitGLResources()
|
||||
m_ShaderPtr = shaderAsset.get();
|
||||
}
|
||||
|
||||
|
||||
// ----------------------------------------------------
|
||||
// 3) Load TEXTURE from the asset manager
|
||||
// ----------------------------------------------------
|
||||
@ -223,6 +212,11 @@ void RenderWindow::RenderSceneToFBO(bool *GameRunning)
|
||||
m_FBO.Bind();
|
||||
glViewport(0, 0, m_LastWidth, m_LastHeight);
|
||||
|
||||
#if TRANSPERANCY
|
||||
glEnable(GL_BLEND);
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
#endif
|
||||
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
|
||||
glClearColor(0.f, 0.f, 0.f, 1.f);
|
||||
@ -351,6 +345,10 @@ void RenderWindow::RenderSceneToFBO(bool *GameRunning)
|
||||
}
|
||||
|
||||
// Cleanup: Unbind the shader program
|
||||
#if TRANSPERANCY
|
||||
|
||||
glDisable(GL_BLEND);
|
||||
#endif
|
||||
glUseProgram(0);
|
||||
|
||||
// Unbind the FBO
|
||||
|
Loading…
Reference in New Issue
Block a user