Add simple API version fetch function.

* Plugins/apps that build against the header (and so get the
  RENDERDOC_API_VERSION macro) can call this to verify that they're running
  against compatible API functions. If the versions don't match, the app
  should immediately quit.
This commit is contained in:
baldurk
2014-09-02 00:54:43 +01:00
parent 546a1fbb31
commit d04aba48f7
2 changed files with 11 additions and 0 deletions
+6
View File
@@ -84,6 +84,12 @@ extern "C" RENDERDOC_API void RENDERDOC_CC Maths_CameraFPSLook(const FloatVector
right->z = r.z;
}
extern "C" RENDERDOC_API
int RENDERDOC_CC RENDERDOC_GetAPIVersion()
{
return RENDERDOC_API_VERSION;
}
extern "C" RENDERDOC_API
void RENDERDOC_CC RENDERDOC_LogText(const wchar_t *text)
{
+5
View File
@@ -210,6 +210,11 @@ typedef ReplayCreateStatus (RENDERDOC_CC *pRENDERDOC_CreateReplayRenderer)(const
// Takes the filename of the log. Returns NULL in the case of any error.
//////////////////////////////////////////////////////////////////////////
#define RENDERDOC_API_VERSION 1
extern "C" RENDERDOC_API int RENDERDOC_CC RENDERDOC_GetAPIVersion();
typedef int (RENDERDOC_CC *pRENDERDOC_GetAPIVersion)();
extern "C" RENDERDOC_API void RENDERDOC_CC RENDERDOC_SetLogFile(const wchar_t *logfile);
typedef void (RENDERDOC_CC *pRENDERDOC_SetLogFile)(const wchar_t *logfile);