Compare commits

..

1 Commits

Author SHA1 Message Date
abf1e87a36 Cleanup more ctypes bindings. 2022-12-20 14:37:27 +01:00

View File

@ -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