Cleanup more ctypes bindings.
This commit is contained in:
parent
84ea17f1cc
commit
abf1e87a36
17
__init__.py
17
__init__.py
@ -101,10 +101,6 @@ def _ushortp(x):
|
|||||||
assert x.typecode == 'H'
|
assert x.typecode == 'H'
|
||||||
return x.buffer_info()[0]
|
return x.buffer_info()[0]
|
||||||
|
|
||||||
def _uintp(x):
|
|
||||||
assert x.typecode == 'I'
|
|
||||||
return x.buffer_info()[0]
|
|
||||||
|
|
||||||
def _floatp(x):
|
def _floatp(x):
|
||||||
assert x.typecode == 'f'
|
assert x.typecode == 'f'
|
||||||
return x.buffer_info()[0]
|
return x.buffer_info()[0]
|
||||||
@ -287,19 +283,14 @@ select_vertices = _lib.rk_select_vertices
|
|||||||
select_vertices.argtypes = (
|
select_vertices.argtypes = (
|
||||||
ctypes.c_void_p,) # vertices
|
ctypes.c_void_p,) # vertices
|
||||||
|
|
||||||
_draw_batch = _lib.rk_draw_batch
|
draw_batch = _lib.rk_draw_batch
|
||||||
_draw_batch.argtypes = (
|
draw_batch.argtypes = (
|
||||||
ctypes.c_void_p, # batch
|
ctypes.c_void_p, # batch
|
||||||
ctypes.c_uint, # size
|
ctypes.c_uint, # size
|
||||||
ctypes.c_void_p, # flags
|
ctypes.POINTER(ctypes.c_ubyte), # flags
|
||||||
ctypes.c_void_p, # meshes
|
ctypes.POINTER(ctypes.c_uint), # meshes
|
||||||
ctypes.c_void_p) # params
|
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 = _lib.rk_unselect_vertices
|
||||||
unselect_vertices.argtypes = (
|
unselect_vertices.argtypes = (
|
||||||
ctypes.c_void_p,) # vertices
|
ctypes.c_void_p,) # vertices
|
||||||
|
Loading…
Reference in New Issue
Block a user