Example usage for com.badlogic.gdx.utils GdxNativesLoader disableNativesLoading

List of usage examples for com.badlogic.gdx.utils GdxNativesLoader disableNativesLoading

Introduction

In this page you can find the example usage for com.badlogic.gdx.utils GdxNativesLoader disableNativesLoading.

Prototype

boolean disableNativesLoading

To view the source code for com.badlogic.gdx.utils GdxNativesLoader disableNativesLoading.

Click Source Link

Usage

From source file:phasereditor.audio.core.AudioCore.java

License:Open Source License

private static void initGdxAudio() {
    GdxNativesLoader.disableNativesLoading = true;
    _musicsToUpdate = new ArrayList<>();
    _musicActionsToUpdate = new ArrayList<>();

    // music loop

    Thread th = new Thread("Phaser Editor music loop") {
        @Override/*w w w. j a  va  2s. c  o  m*/
        public void run() {
            while (true) {
                try {
                    sleep(100);
                } catch (InterruptedException e) {
                    // nothing
                }
                synchronized (_musicsToUpdate) {
                    for (OpenALMusic music : _musicsToUpdate) {
                        synchronized (music) {
                            if (music.isPlaying()) {
                                music.update();
                            }
                        }
                    }
                }

                synchronized (_musicActionsToUpdate) {
                    for (Runnable action : _musicActionsToUpdate) {
                        try {
                            action.run();
                        } catch (Exception e) {
                            e.printStackTrace();
                        }
                    }
                }
            }
        }
    };
    th.setDaemon(true);
    th.start();
}