From 4c7e4ae43566d08f1d7d91bffff4646ce287a68a Mon Sep 17 00:00:00 2001 From: ladevieq Date: Wed, 13 Jan 2021 22:20:01 +0100 Subject: Compile on windows --- src/main.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index 5bd2f6e..5b321ff 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -4,8 +4,6 @@ #include #include #include -#include -#include #include "rt.hpp" #include "vk-renderer.hpp" @@ -70,6 +68,16 @@ void random_scene(sphere *world) { int main() { RENDERDOC_API_1_1_2 *rdoc_api = NULL; +#ifdef WINDOWS + // At init, on windows + if(HMODULE mod = GetModuleHandleA("renderdoc.dll")) + { + pRENDERDOC_GetAPI RENDERDOC_GetAPI = + (pRENDERDOC_GetAPI)GetProcAddress(mod, "RENDERDOC_GetAPI"); + int ret = RENDERDOC_GetAPI(eRENDERDOC_API_Version_1_1_2, (void **)&rdoc_api); + assert(ret == 1); + } +#elif LINUX // At init, on linux/android. // For android replace librenderdoc.so with libVkLayer_GLES_RenderDoc.so if(void *mod = dlopen("librenderdoc.so", RTLD_NOW | RTLD_NOLOAD)) @@ -78,6 +86,7 @@ int main() { int ret = RENDERDOC_GetAPI(eRENDERDOC_API_Version_1_1_2, (void **)&rdoc_api); assert(ret == 1); } +#endif // Image dimensions // const float aspect_ratio = 16.0 / 9.0; @@ -150,8 +159,6 @@ int main() { // stop the capture if(rdoc_api) rdoc_api->EndFrameCapture(NULL, NULL); - pause(); - //------------------------- // GPU path tracer //------------------------- -- cgit v1.3