Created
January 25, 2017 08:46
-
-
Save autosquid/3aa5fbcca8d0a587ca57197d358c15a6 to your computer and use it in GitHub Desktop.
swig pitfalls
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%typemap(argout) std::vector<tex::TextureView>* { | |
/* { the last parameter is "whether python own the object behind the pointer" */ | |
/* in this case: $1 is points to `temp`, managed by vector, so python does not own it */ | |
/* to return something python own, we need to `new` a object */ | |
/* so instead of the following */ | |
/* $result = swig::from_ptr($1, 1); */ | |
/* we use: }*/ | |
$result = swig::from(*$1); | |
} | |
/* %include "tex/generate_texture_views.h" ---- we do not need this for namespace tangling difficulty for swig*/ | |
void generate_texture_views(std::string const & , std::vector<tex::TextureView> *); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment