From ee4a93b47b0afb7d5f05dd53102ccc0749dc4b9f Mon Sep 17 00:00:00 2001 From: jp9000 Date: Sun, 27 Jul 2014 09:43:32 -0700 Subject: [PATCH] Add function to get current core version The version macro that modules use to compile versus the actual core version that may be in use may be different, so this is a way to compare them to check for compatibility issues later on. --- libobs/obs.c | 5 +++++ libobs/obs.h | 3 +++ 2 files changed, 8 insertions(+) diff --git a/libobs/obs.c b/libobs/obs.c index 95850542d..0d7acd105 100644 --- a/libobs/obs.c +++ b/libobs/obs.c @@ -596,6 +596,11 @@ bool obs_initialized(void) return obs != NULL; } +uint32_t obs_get_version(void) +{ + return LIBOBS_API_VER; +} + void obs_set_locale(const char *locale) { if (!obs) diff --git a/libobs/obs.h b/libobs/obs.h index 7753a6c7e..f36e2c5eb 100644 --- a/libobs/obs.h +++ b/libobs/obs.h @@ -211,6 +211,9 @@ EXPORT void obs_shutdown(void); /** @return true if the main OBS context has been initialized */ EXPORT bool obs_initialized(void); +/** @return The current core version */ +EXPORT uint32_t obs_get_version(void); + /** * Sets a new locale to use for modules. This will call obs_module_set_locale * for each module with the new locale.