示例#1
0
 public static FMOD_RESULT Memory_Initialize(
     ByteBuffer poolmem,
     int poollen,
     FMOD_MEMORY_ALLOCCALLBACK useralloc,
     FMOD_MEMORY_REALLOCCALLBACK userrealloc,
     FMOD_MEMORY_FREECALLBACK userfree,
     int memtypeflags) {
   if (poolmem != null && !poolmem.isDirect()) {
     throw new NonDirectBufferException();
   }
   if (useralloc != null && userrealloc != null && userfree != null) {
     CallbackManager.addCallback(25, useralloc, 0);
     CallbackManager.addCallback(27, userrealloc, 0);
     CallbackManager.addCallback(26, userfree, 0);
   } else {
     useralloc = null;
     userrealloc = null;
     userfree = null;
   }
   int javaResult =
       FmodExJNI.FmodEx_Memory_Initialize(
           poolmem,
           BufferUtils.getPositionInBytes(poolmem),
           poollen,
           useralloc == null ? false : true,
           userrealloc == null ? false : true,
           userfree == null ? false : true,
           memtypeflags);
   return FMOD_RESULT.get(javaResult);
 }