A lot of those conversions are unnecessary and you should probably load the DLL "outside" of the function that's calling it. Another thing I noticed is this section:
Quote
16.16.1.8. Return types
By default functions are assumed to return the C int type. Other return types can be specified by setting the restype attribute of the function object.
Your function's return value is void so you need to set it as such.
Here's how I'd do it:
import ctypes as ct
# Load DLL and initialize all types once here
float3 = c_float * 3
mc_dll = ct.CDLL("mc_dll.dll")
mc_dll.get_normal.argtypes = [c_float, c_float, c_float, c_float, c_float, c_float, c_uint, c_uint, c_uint, float3]
mc_dll.get_normal.restype = None # returns void
def get_normal(x_grid_min, x_grid_max,
y_grid_min, y_grid_max,
z_grid_min, z_grid_max,
x_res, y_res, z_res):
output_arr = float3()
mc_dll.get_normal(x_grid_min, x_grid_max,
y_grid_min, y_grid_max,
z_grid_min, z_grid_max,
x_res, y_res, z_res,
output_arr)
return V3(output_arr[0], output_arr[1], output_arr[2])
Then, if you were to save this to "mc.py" you could use it as:
import mc
normal = mc.get_normal(...)
"I would try to find halo source code by bungie best fps engine ever created, u see why call of duty loses speed due to its detail." -- GettingNifty