aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.cpp
diff options
context:
space:
mode:
authorladevieq <ladevie.quentin@gmail.com>2021-01-13 22:20:01 +0100
committerladevieq <ladevie.quentin@gmail.com>2021-01-13 22:20:01 +0100
commit4c7e4ae43566d08f1d7d91bffff4646ce287a68a (patch)
treeda9576fc4978f3ce7da1a97c7986dc5103061f9e /src/main.cpp
parent0b68d510069ec524daa3e10e598587c62ab713ff (diff)
Compile on windows
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp15
1 files changed, 11 insertions, 4 deletions
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 <cstring>
#include <cstdio>
#include <cassert>
-#include <unistd.h>
-#include <dlfcn.h>
#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
//-------------------------