I'm still new to this kind of extending (though I've a good background in C++ and python)
what I wanted is to use ctypes module to pass data to a C++ function example that worked so far for me:
test.dll file
#define DLLEXPORT extern "C" __declspec(dllexport)
DLLEXPORT int sum(int a, int b) {
return a + b;
}
sum_test.py file:
from ctypes import cdll
mydll = cdll.LoadLibrary('test.dll')
mydll.sum(5, 3)
result is 8 which works well...
note: I'm using this to develop an Addon(plugin) for blender, the data which I will pass to the C++ function is a huge array (Tuple or whatever type of array), this data will be passed to GPU to process it with OpenCL
mainly the workflow in C++ is passing a pointer (which will copy the whole array data to the GPU)
so the question is: the best way (fastest too) to get that tuple pointer inside C++ (hopefully with explaining what happens in python and in C++)