From 9bf00cb1a6d2ccea5bf7466dc1a4f3657da08ec4 Mon Sep 17 00:00:00 2001 From: baldurk Date: Tue, 18 Sep 2018 18:01:28 +0100 Subject: [PATCH] More natural python handling for GetDefaultCaptureOptions, return struct --- qrenderdoc/Code/pyrenderdoc/renderdoc.i | 6 ++++++ renderdoc/api/replay/renderdoc_replay.h | 7 ++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/qrenderdoc/Code/pyrenderdoc/renderdoc.i b/qrenderdoc/Code/pyrenderdoc/renderdoc.i index c70a4f190..2a46ab254 100644 --- a/qrenderdoc/Code/pyrenderdoc/renderdoc.i +++ b/qrenderdoc/Code/pyrenderdoc/renderdoc.i @@ -79,6 +79,12 @@ // completely ignore rdcdatetime, we custom convert to/from a native python datetime %ignore rdcdatetime; +// special handling for RENDERDOC_GetDefaultCaptureOptions to transform output parameter to a return value +%typemap(in, numinputs=0) CaptureOptions *defaultOpts { $1 = new CaptureOptions; } +%typemap(argout) CaptureOptions *defaultOpts { + $result = SWIG_NewPointerObj($1, $descriptor(struct CaptureOptions*), SWIG_POINTER_OWN); +} + // ignore some operators SWIG doesn't have to worry about %ignore SDType::operator=; %ignore StructuredObjectList::swap; diff --git a/renderdoc/api/replay/renderdoc_replay.h b/renderdoc/api/replay/renderdoc_replay.h index c8715bf2f..8be54103f 100644 --- a/renderdoc/api/replay/renderdoc_replay.h +++ b/renderdoc/api/replay/renderdoc_replay.h @@ -1999,10 +1999,11 @@ extern "C" RENDERDOC_API void RENDERDOC_CC RENDERDOC_BecomeRemoteServer( DOCUMENT(R"(Retrieve the default and recommended set of capture options. -:param CaptureOptions opts: A reference to a :class:`CaptureOptions` where the options will be - stored. +:return: The default capture options. +:rtype: CaptureOptions )"); -extern "C" RENDERDOC_API void RENDERDOC_CC RENDERDOC_GetDefaultCaptureOptions(CaptureOptions *opts); +extern "C" RENDERDOC_API void RENDERDOC_CC +RENDERDOC_GetDefaultCaptureOptions(CaptureOptions *defaultOpts); DOCUMENT(R"(Begin injecting speculatively into all new processes started on the system. Where supported by platform, configuration, and setup begin injecting speculatively into all new processes