Fix Windows build

This commit is contained in:
Luke Street 2021-05-24 22:02:57 -04:00
parent 32f9bafff1
commit 657a3f48ba
3 changed files with 15 additions and 6 deletions

View File

@ -1,5 +1,6 @@
#include <string> #include <string>
#include <string_view> #include <string_view>
#include <numeric>
#include <hecl/Pipeline.hpp> #include <hecl/Pipeline.hpp>
#include "boo/boo.hpp" #include "boo/boo.hpp"
@ -222,6 +223,7 @@ private:
Limiter m_limiter{}; Limiter m_limiter{};
std::atomic_bool m_running = {true}; std::atomic_bool m_running = {true};
bool m_noShaderWarmup = false; bool m_noShaderWarmup = false;
bool m_imGuiInitialized = false;
bool m_firstFrame = true; bool m_firstFrame = true;
using delta_clock = std::chrono::high_resolution_clock; using delta_clock = std::chrono::high_resolution_clock;
@ -286,13 +288,16 @@ public:
onAppIdle(); onAppIdle();
} }
ImGuiEngine::Shutdown(); if (m_imGuiInitialized) {
ImGuiEngine::Shutdown();
}
if (g_mainMP1) {
g_mainMP1->Shutdown();
}
g_mainMP1.reset();
if (m_window) { if (m_window) {
m_window->getCommandQueue()->stopRenderer(); m_window->getCommandQueue()->stopRenderer();
} }
if (g_mainMP1)
g_mainMP1->Shutdown();
g_mainMP1.reset();
m_voiceEngine.reset(); m_voiceEngine.reset();
m_amuseAllocWrapper.reset(); m_amuseAllocWrapper.reset();
CDvdFile::Shutdown(); CDvdFile::Shutdown();
@ -369,6 +374,7 @@ public:
g_mainMP1->WarmupShaders(); g_mainMP1->WarmupShaders();
} }
ImGuiEngine::Initialize(gfxF, m_window->getWindowFrame(), scale); ImGuiEngine::Initialize(gfxF, m_window->getWindowFrame(), scale);
m_imGuiInitialized = true;
} }
float dt = 1 / 60.f; float dt = 1 / 60.f;
@ -556,6 +562,8 @@ using namespace Windows::ApplicationModel::Core;
} }
#elif _WIN32 #elif _WIN32
#include <shellapi.h>
int APIENTRY wWinMain(HINSTANCE hInstance, HINSTANCE, LPWSTR lpCmdLine, int) { int APIENTRY wWinMain(HINSTANCE hInstance, HINSTANCE, LPWSTR lpCmdLine, int) {
int argc = 0; int argc = 0;
const boo::SystemChar** argv; const boo::SystemChar** argv;
@ -568,7 +576,7 @@ int APIENTRY wWinMain(HINSTANCE hInstance, HINSTANCE, LPWSTR lpCmdLine, int) {
for (int i = 0; i < argc; ++i) for (int i = 0; i < argc; ++i)
booArgv[i + 1] = argv[i]; booArgv[i + 1] = argv[i];
const DWORD outType = GetFileType(GetStdHandle(STD_OUTPUT_HANDLE)); const DWORD outType = GetFileType(GetStdHandle(STD_ERROR_HANDLE));
if (IsClientLoggingEnabled(argc + 1, booArgv) && outType == FILE_TYPE_UNKNOWN) if (IsClientLoggingEnabled(argc + 1, booArgv) && outType == FILE_TYPE_UNKNOWN)
logvisor::CreateWin32Console(); logvisor::CreateWin32Console();
return wmain(argc + 1, booArgv); return wmain(argc + 1, booArgv);

View File

@ -74,6 +74,7 @@ void ImGuiEngine::Initialize(boo::IGraphicsDataFactory* factory, const boo::SWin
void ImGuiEngine::Shutdown() { void ImGuiEngine::Shutdown() {
ImGui::DestroyContext(); ImGui::DestroyContext();
ShaderDataBinding.reset();
ShaderPipeline.reset(); ShaderPipeline.reset();
} }

View File

@ -68,7 +68,7 @@ struct VertToFrag
float4 col : COLOR0; float4 col : COLOR0;
}; };
VertToFrag main(in VS_INPUT v) VertToFrag main(in VertData v)
{ {
VertToFrag vtf; VertToFrag vtf;
vtf.pos = mul(xf, float4(v.pos.xy, 0.f, 1.f)); vtf.pos = mul(xf, float4(v.pos.xy, 0.f, 1.f));