@sdltype("SDL_RWFromConstMem", [ctypes.c_void_p, ctypes.c_int],
ctypes.POINTER(SDL_RWops))
def rw_from_const_mem(mem, size):
"""Creates a SDL_RWops from a contiguous memory region.
size denotes the size of the memory region in bytes.
"""
ptr = ctypes.c_void_p(mem)
retval = dll.SDL_RWFromMem(ptr, size)
if retval is None or not bool(retval):
raise SDLError()
return retval.contents
should be
@sdltype("SDL_RWFromConstMem", [ctypes.c_void_p, ctypes.c_int],
ctypes.POINTER(SDL_RWops))
def rw_from_const_mem(mem, size):
"""Creates a SDL_RWops from a contiguous memory region.
It assumes the memory area is not writable.
size denotes the size of the memory region in bytes.
"""
ptr = ctypes.c_void_p(mem)
retval = dll.SDL_RWFromConstMem(ptr, size)
if retval is None or not bool(retval):
raise SDLError()
return retval.contents
Sorry, can't attach a patch right now.
Original issue reported on code.google.com by llxxn...@gmail.com on 19 Nov 2012 at 8:55
Original issue reported on code.google.com by
llxxn...@gmail.com
on 19 Nov 2012 at 8:55