From abf1e87a3677cc01543f295df588cfa5c54db4e4 Mon Sep 17 00:00:00 2001 From: Roz K Date: Tue, 20 Dec 2022 14:37:27 +0100 Subject: [PATCH] Cleanup more ctypes bindings. --- __init__.py | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/__init__.py b/__init__.py index 1eac005..5774c5c 100644 --- a/__init__.py +++ b/__init__.py @@ -101,10 +101,6 @@ def _ushortp(x): assert x.typecode == 'H' return x.buffer_info()[0] -def _uintp(x): - assert x.typecode == 'I' - return x.buffer_info()[0] - def _floatp(x): assert x.typecode == 'f' return x.buffer_info()[0] @@ -287,19 +283,14 @@ select_vertices = _lib.rk_select_vertices select_vertices.argtypes = ( ctypes.c_void_p,) # vertices -_draw_batch = _lib.rk_draw_batch -_draw_batch.argtypes = ( +draw_batch = _lib.rk_draw_batch +draw_batch.argtypes = ( ctypes.c_void_p, # batch ctypes.c_uint, # size - ctypes.c_void_p, # flags - ctypes.c_void_p, # meshes + ctypes.POINTER(ctypes.c_ubyte), # flags + ctypes.POINTER(ctypes.c_uint), # meshes ctypes.c_void_p) # params -def draw_batch(batch, flags, meshes, params): - size = len(flags) - assert len(meshes) == size - _draw_batch(batch, size, _ubytep(flags), _uintp(meshes), params) - unselect_vertices = _lib.rk_unselect_vertices unselect_vertices.argtypes = ( ctypes.c_void_p,) # vertices