diff --git a/.gitignore b/.gitignore index 6213c48..4768c35 100644 --- a/.gitignore +++ b/.gitignore @@ -8,4 +8,6 @@ riderModule.iml test-results cmake-build-vs-debug/ cmake-build-debug/ +cmake-build-debug-msvc/ +cmake-build-debug-msvc-vs/ /.idea/ diff --git a/projs/shadow/shadow-engine/core/inc/core/Module.h b/projs/shadow/shadow-engine/core/inc/core/Module.h index 1f80379..6ac8a8b 100644 --- a/projs/shadow/shadow-engine/core/inc/core/Module.h +++ b/projs/shadow/shadow-engine/core/inc/core/Module.h @@ -3,6 +3,7 @@ #include "SHObject.h" #include "SDL_events.h" +#include #include "vlkx/vulkan/abstraction/Commands.h" namespace ShadowEngine { diff --git a/projs/shadow/shadow-engine/core/inc/core/ModuleManager.h b/projs/shadow/shadow-engine/core/inc/core/ModuleManager.h index 261b6eb..f8820d0 100644 --- a/projs/shadow/shadow-engine/core/inc/core/ModuleManager.h +++ b/projs/shadow/shadow-engine/core/inc/core/ModuleManager.h @@ -33,7 +33,6 @@ namespace ShadowEngine { Module &GetModule(const std::string& name); - /* template T *GetModuleByType() { for (auto &module: modules) { @@ -42,7 +41,7 @@ namespace ShadowEngine { } //SH_CORE_ERROR("Can't find the module {0}", T::Type()); return nullptr; - } */ + } void Init(); diff --git a/projs/shadow/shadow-engine/shadow-renderer/inc/vlkx/render/Camera.h b/projs/shadow/shadow-engine/shadow-renderer/inc/vlkx/render/Camera.h index 9684718..dbc7f14 100644 --- a/projs/shadow/shadow-engine/shadow-renderer/inc/vlkx/render/Camera.h +++ b/projs/shadow/shadow-engine/shadow-renderer/inc/vlkx/render/Camera.h @@ -5,6 +5,7 @@ #include #include #include +#include namespace vlkx { class Camera { diff --git a/projs/shadow/shadow-engine/shadow-renderer/src/vulkan/VulkanModule.cpp b/projs/shadow/shadow-engine/shadow-renderer/src/vulkan/VulkanModule.cpp index 8f432ed..2ccb106 100644 --- a/projs/shadow/shadow-engine/shadow-renderer/src/vulkan/VulkanModule.cpp +++ b/projs/shadow/shadow-engine/shadow-renderer/src/vulkan/VulkanModule.cpp @@ -174,7 +174,7 @@ void VulkanModule::Init() { } void VulkanModule::BeginRenderPass(const std::unique_ptr& commands) { - const auto update = !editorEnabled ? [](const int frame) { ShadowEngine::ModuleManager::instance->Update(frame); } : nullptr; + const auto update = !editorEnabled ? [](const int frame) { ShadowEngine::ModuleManager::instance->Update(frame); } : [](const int frame) {}; const auto res = commands->execute(commands->getFrame(), swapchain->swapChain, update, [this](const VkCommandBuffer& buffer, int frame) { @@ -194,9 +194,13 @@ void VulkanModule::BeginRenderPass(const std::unique_ptr& c ImGui_ImplSDL2_NewFrame(); ImGui::NewFrame(); - if (editorEnabled) - ImGui::Image(editorRenderPlanes[0], { 640, 480 }); - + if (editorEnabled) { + static bool active = true; + if (ImGui::Begin("Game View", &active, ImGuiWindowFlags_None)) { + ImGui::Image((ImTextureID) editorRenderPlanes[0], {640, 480}); + } + ImGui::End(); + } ShadowEngine::ModuleManager::instance->OverlayRender(); ImGui::Render(); diff --git a/projs/test-game/CMakeLists.txt b/projs/test-game/CMakeLists.txt index c0a4ce6..27fab4a 100644 --- a/projs/test-game/CMakeLists.txt +++ b/projs/test-game/CMakeLists.txt @@ -13,5 +13,5 @@ target_link_libraries(test-game PUBLIC shadow-engine) add_custom_command(TARGET test-game POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/resources ${CMAKE_CURRENT_BINARY_DIR}/vlkx-resources + COMMAND ${CMAKE_COMMAND} -E copy_directory ${PROJECT_SOURCE_DIR}/resources ${CMAKE_CURRENT_BINARY_DIR}/resources ) \ No newline at end of file