Bugfix/merge fixes (#11)
This commit is contained in:
parent
a3e89b4e8f
commit
1297af3db1
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -8,4 +8,6 @@ riderModule.iml
|
||||||
test-results
|
test-results
|
||||||
cmake-build-vs-debug/
|
cmake-build-vs-debug/
|
||||||
cmake-build-debug/
|
cmake-build-debug/
|
||||||
|
cmake-build-debug-msvc/
|
||||||
|
cmake-build-debug-msvc-vs/
|
||||||
/.idea/
|
/.idea/
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
|
|
||||||
#include "SHObject.h"
|
#include "SHObject.h"
|
||||||
#include "SDL_events.h"
|
#include "SDL_events.h"
|
||||||
|
#include <memory>
|
||||||
#include "vlkx/vulkan/abstraction/Commands.h"
|
#include "vlkx/vulkan/abstraction/Commands.h"
|
||||||
|
|
||||||
namespace ShadowEngine {
|
namespace ShadowEngine {
|
||||||
|
|
|
@ -33,7 +33,6 @@ namespace ShadowEngine {
|
||||||
|
|
||||||
Module &GetModule(const std::string& name);
|
Module &GetModule(const std::string& name);
|
||||||
|
|
||||||
/*
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
T *GetModuleByType() {
|
T *GetModuleByType() {
|
||||||
for (auto &module: modules) {
|
for (auto &module: modules) {
|
||||||
|
@ -42,7 +41,7 @@ namespace ShadowEngine {
|
||||||
}
|
}
|
||||||
//SH_CORE_ERROR("Can't find the module {0}", T::Type());
|
//SH_CORE_ERROR("Can't find the module {0}", T::Type());
|
||||||
return nullptr;
|
return nullptr;
|
||||||
} */
|
}
|
||||||
|
|
||||||
void Init();
|
void Init();
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
#include <glm/glm.hpp>
|
#include <glm/glm.hpp>
|
||||||
#include <glm/gtc/matrix_transform.hpp>
|
#include <glm/gtc/matrix_transform.hpp>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
namespace vlkx {
|
namespace vlkx {
|
||||||
class Camera {
|
class Camera {
|
||||||
|
|
|
@ -174,7 +174,7 @@ void VulkanModule::Init() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void VulkanModule::BeginRenderPass(const std::unique_ptr<vlkx::RenderCommand>& commands) {
|
void VulkanModule::BeginRenderPass(const std::unique_ptr<vlkx::RenderCommand>& 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,
|
const auto res = commands->execute(commands->getFrame(), swapchain->swapChain, update,
|
||||||
[this](const VkCommandBuffer& buffer, int frame) {
|
[this](const VkCommandBuffer& buffer, int frame) {
|
||||||
|
@ -194,9 +194,13 @@ void VulkanModule::BeginRenderPass(const std::unique_ptr<vlkx::RenderCommand>& c
|
||||||
ImGui_ImplSDL2_NewFrame();
|
ImGui_ImplSDL2_NewFrame();
|
||||||
ImGui::NewFrame();
|
ImGui::NewFrame();
|
||||||
|
|
||||||
if (editorEnabled)
|
if (editorEnabled) {
|
||||||
ImGui::Image(editorRenderPlanes[0], { 640, 480 });
|
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();
|
ShadowEngine::ModuleManager::instance->OverlayRender();
|
||||||
|
|
||||||
ImGui::Render();
|
ImGui::Render();
|
||||||
|
|
|
@ -13,5 +13,5 @@ target_link_libraries(test-game PUBLIC shadow-engine)
|
||||||
|
|
||||||
add_custom_command(TARGET test-game
|
add_custom_command(TARGET test-game
|
||||||
POST_BUILD
|
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
|
||||||
)
|
)
|
Loading…
Reference in New Issue
Block a user