mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-29 13:20:54 +00:00
Change dllexport'd RENDERDOC_GetAPI to a function pointer typedef
* Apps don't link against renderdoc so a dllexport is meaningless, they need a typedef to declare the function pointer they will GetProcAddress().
This commit is contained in:
@@ -29,29 +29,11 @@
|
||||
#endif
|
||||
|
||||
#if defined(WIN32)
|
||||
|
||||
#if defined(RENDERDOC_EXPORTS)
|
||||
#define RENDERDOC_API __declspec(dllexport)
|
||||
#else
|
||||
#define RENDERDOC_API __declspec(dllimport)
|
||||
#endif
|
||||
|
||||
#define RENDERDOC_CC __cdecl
|
||||
|
||||
#define RENDERDOC_CC __cdecl
|
||||
#elif defined(__linux__)
|
||||
|
||||
#ifdef RENDERDOC_EXPORTS
|
||||
#define RENDERDOC_API __attribute__ ((visibility ("default")))
|
||||
#define RENDERDOC_CC
|
||||
#else
|
||||
#define RENDERDOC_API
|
||||
#endif
|
||||
|
||||
#define RENDERDOC_CC
|
||||
|
||||
#else
|
||||
|
||||
#error "Unknown platform"
|
||||
|
||||
#error "Unknown platform"
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
@@ -508,6 +490,8 @@ typedef struct
|
||||
// RenderDoc API entry point
|
||||
//
|
||||
// This entry point can be obtained via GetProcAddress/dlsym if RenderDoc is available.
|
||||
//
|
||||
// The name is the same as the typedef - "RENDERDOC_GetAPI"
|
||||
//
|
||||
// This function is not thread safe, and should not be called on multiple threads at once.
|
||||
// Ideally, call this once as early as possible in your application's startup, before doing
|
||||
@@ -524,7 +508,7 @@ typedef struct
|
||||
// 1 - if the outAPIPointers has been filled with a pointer to the API struct requested
|
||||
// 0 - if the requested version is not supported or the arguments are invalid.
|
||||
//
|
||||
RENDERDOC_API int RENDERDOC_CC RENDERDOC_GetAPI(RENDERDOC_Version version, void **outAPIPointers);
|
||||
typedef int (RENDERDOC_CC *pRENDERDOC_GetAPI)(RENDERDOC_Version version, void **outAPIPointers);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
#include "core/core.h"
|
||||
#include "hooks/hooks.h"
|
||||
#include "api/app/renderdoc_app.h"
|
||||
#include "api/replay/renderdoc_replay.h" // for RENDERDOC_API to export the RENDERDOC_GetAPI function
|
||||
|
||||
static void SetFocusToggleKeys(RENDERDOC_InputButton *keys, int num)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user