Coder Social home page Coder Social logo

Comments (4)

Ali-RS avatar Ali-RS commented on August 28, 2024 1

What about using a system property? for example System.getProperty("com.jme3.alloc.librarypath")

NativeBinaryLoader can first check if the librarypath property is set and load it from there otherwise extract it automatically.

Edit:

Never mind, I think using NativeBinaryLoadr.setAutoLoad(false) is fine.

If you also cannot think of a good place to make a call for NativeBinaryLoadr.setAutoLoad(false), please let me know, too.

I think it should be in the class implementing JME BufferAllocator interface. (i.e. LwjglBufferAllocator).

    public class LwjglBufferAllocator implements BufferAllocator {

        static {
              NativeBinaryLoadr.setAutoLoad(false);
              NativeLibraryLoader.load(JmeAlloc);
        }

        @Override
        public void destroyDirectBuffer(Buffer toBeDestroyed) {
            NativeBufferAllocator.releaseDirectByteBuffer(toBeDestroyed);
        }

        @Override
        public ByteBuffer allocate(int size) {
            return NativeBufferAllocator.createDirectByteBuffer(size);
        }
    }

from jme-alloc.

pavly-gerges avatar pavly-gerges commented on August 28, 2024 1

@Ali-RS Feel free to review PR #50.

from jme-alloc.

pavly-gerges avatar pavly-gerges commented on August 28, 2024

This could be managed by creating a static Boolean flag NativeBinaryLoader.isAutoLoad() and it's setter method.

Notice, the flag should be true by default; because disabling the extraction process by default will break the test CI/CD workflow, so you will have to set this manually when implementing in jMonkeyEngine, before calling the NativeBufferAllocator.<cinit> (the static initializer).

If you agree on these modifications, please let me know, so I could prepare my schedule to solve this issue.

from jme-alloc.

pavly-gerges avatar pavly-gerges commented on August 28, 2024

If you also cannot think of a good place to make a call for NativeBinaryLoadr.setAutoLoad(false), please let me know, too.

from jme-alloc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.