diff --git a/SPOUTSDK/SpoutGL/SpoutUtils.cpp b/SPOUTSDK/SpoutGL/SpoutUtils.cpp index 3b397966..22e0fdd6 100644 --- a/SPOUTSDK/SpoutGL/SpoutUtils.cpp +++ b/SPOUTSDK/SpoutGL/SpoutUtils.cpp @@ -189,6 +189,11 @@ 19.03.24 - Add icon/button option for variable arguments 29.03.24 - Correct ReadPathFromRegistry definition for default size argument Correct EndTiming definition for microseconds argument + 14.06.24 - SpoutUtils.h - PR #114 + Correct conditional definition of EndTimimg in header file + Allow mingw to define USE_CHRONO if available + Include to fix mingw build + */ diff --git a/SPOUTSDK/SpoutGL/SpoutUtils.h b/SPOUTSDK/SpoutGL/SpoutUtils.h index 2906be77..f2ef4d1b 100644 --- a/SPOUTSDK/SpoutGL/SpoutUtils.h +++ b/SPOUTSDK/SpoutGL/SpoutUtils.h @@ -46,6 +46,7 @@ #include #include // for shellexecute #include // For TaskDialogIndirect +#include // for round // // C++11 timer is only available for MS Visual Studio 2015 and above. @@ -56,7 +57,9 @@ // If this is a problem, remove _MSC_VER_ and manually enable/disable the USE_CHRONO define. // // PR #84 Fixes for clang -#if _MSC_VER >= 1900 || (defined(__clang__) && __cplusplus >= 201103L) +// PR #114 Fixes for MingW +#if (defined(_MSC_VER) && (_MSC_VER >= 1900)) || (defined(__cplusplus) && (__cplusplus >= 201103L)) + #define USE_CHRONO #endif @@ -312,21 +315,23 @@ namespace spoututils { // Timing functions // + // Monitor refresh rate + double SPOUT_DLLEXP GetRefreshRate(); + // Start timing period void SPOUT_DLLEXP StartTiming(); - // Stop timing and return microseconds elapsed. +#ifdef USE_CHRONO + // Stop timing and return milliseconds or microseconds elapsed. + // (microseconds default). // Code console output can be enabled for quick timing tests. - // Default milliseconds double SPOUT_DLLEXP EndTiming(bool microseconds = false); - - // Monitor refresh rate - double SPOUT_DLLEXP GetRefreshRate(); - -#ifdef USE_CHRONO // Microseconds elapsed since epoch double SPOUT_DLLEXP ElapsedMicroseconds(); +#else + double SPOUT_DLLEXP EndTiming(); #endif + void SPOUT_DLLEXP StartCounter(); double SPOUT_DLLEXP GetCounter();