Example usage for com.badlogic.gdx.backends.lwjgl LwjglApplicationConfiguration disableAudio

List of usage examples for com.badlogic.gdx.backends.lwjgl LwjglApplicationConfiguration disableAudio

Introduction

In this page you can find the example usage for com.badlogic.gdx.backends.lwjgl LwjglApplicationConfiguration disableAudio.

Prototype

boolean disableAudio

To view the source code for com.badlogic.gdx.backends.lwjgl LwjglApplicationConfiguration disableAudio.

Click Source Link

Document

If true, OpenAL will not be used.

Usage

From source file:com.agateau.pixelwheels.tools.CommandLineApplication.java

License:Apache License

private static LwjglApplicationConfiguration createConfig(String title) {
    LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
    LwjglApplicationConfiguration.disableAudio = true;
    config.allowSoftwareMode = true;//from   w ww . j av a2 s  .co m
    config.forceExit = false;
    config.width = 100;
    config.height = 50;
    config.title = title;
    return config;
}

From source file:com.esotericsoftware.spine.SkeletonViewer.java

License:Open Source License

static public void main(String[] args) throws Exception {
    LwjglApplicationConfiguration.disableAudio = true;
    LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
    config.width = 800;/*from  w  w  w  . j av a 2s. co  m*/
    config.height = 600;
    config.title = "Skeleton Viewer";
    config.allowSoftwareMode = true;
    new LwjglApplication(new SkeletonViewer(), config);
}

From source file:me.scarlet.undertailor.audio.AudioManager.java

License:Open Source License

public AudioManager(Undertailor undertailor) {
    if (!AudioManager.audioReplaced) {
        log.info("Manager will now try to replace the audio system.");
        if (!LwjglApplicationConfiguration.disableAudio) {
            try {
                ((com.badlogic.gdx.backends.lwjgl.audio.OpenALAudio) Gdx.audio).dispose();

                LwjglApplicationConfiguration config = undertailor.getApplicationConfiguration();
                Gdx.audio = new OpenALAudio(config.audioDeviceSimultaneousSources,
                        config.audioDeviceBufferCount, config.audioDeviceBufferSize);

                AudioManager.audioReplaced = true;
                log.info("Success.");
            } catch (Throwable t) {
                log.error("Failed.", t);
            }//from w  w  w .j a v a  2 s . c o  m
        }
    }

    this.masterVolume = new BoundedFloat(0.0F, 1.0F, 1.0F);
    this.musicVolume = new BoundedFloat(0.0F, 1.0F, 1.0F);
    this.soundVolume = new BoundedFloat(0.0F, 1.0F, 1.0F);
    this.sounds = new ObjectMap<>();
    this.music = new ObjectMap<>();
}

From source file:org.interreg.docexplore.reader.ReaderApp.java

License:Open Source License

public static void main(String[] args) throws Exception {
    for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels())
        if ("Nimbus".equals(info.getName())) {
            UIManager.setLookAndFeel(info.getClassName());
            break;
        }//from   w  w  w .  j  a va2  s  . c om

    Startup startup = new Startup("Reader", null, false, false, true, true);

    ReaderApp.local = true;
    ReaderApp.localServer = new LocalServer();
    ReaderServer server = new ServerApp(startup).server;

    try {
        Thread.sleep(1000);
    } catch (Exception e) {
    }

    Vector<DisplayMode> displayModes = new Vector<DisplayMode>(
            Arrays.asList(LwjglApplicationConfiguration.getDisplayModes()));
    boolean fullscreen = false;
    DisplayMode mode = null;

    if (startup.winSize != null) {
        fullscreen = startup.fullscreen;
        for (DisplayMode dm : displayModes)
            if (dm.width == startup.winSize[0] && dm.height == startup.winSize[1]) {
                mode = dm;
                break;
            }
    }

    if (mode == null) {
        final JDialog modeDialog = new JDialog((Frame) null, "Mode", true);
        JPanel mainPanel = new JPanel(new BorderLayout(20, 20));
        mainPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
        JList modeList = new JList(displayModes);
        modeList.setSelectedIndex(0);
        mainPanel.add(new JScrollPane(modeList), BorderLayout.NORTH);
        JCheckBox fsBox = new JCheckBox("Fullscreen");
        mainPanel.add(fsBox, BorderLayout.CENTER);
        JButton okButton = new JButton("OK");
        JPanel buttonPanel = new JPanel(new FlowLayout());
        buttonPanel.add(okButton, BorderLayout.SOUTH);
        mainPanel.add(buttonPanel, BorderLayout.SOUTH);
        final boolean[] ok = { false };
        okButton.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                ok[0] = true;
                modeDialog.setVisible(false);
            }
        });
        modeDialog.add(mainPanel);
        modeDialog.pack();
        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
        GraphicsConfiguration gconf = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice()
                .getDefaultConfiguration();
        Insets screenInsets = Toolkit.getDefaultToolkit().getScreenInsets(gconf);
        modeDialog.setLocation(
                (screenSize.width - (screenInsets.left + screenInsets.right) - modeDialog.getWidth()) / 2,
                (screenSize.height - (screenInsets.bottom + screenInsets.top) - modeDialog.getHeight()) / 2);
        modeDialog.setVisible(true);
        if (!ok[0])
            return;
        mode = (DisplayMode) modeList.getSelectedValue();
        fullscreen = fsBox.isSelected();
    }

    //new ResourceMonitor().setVisible(true);

    LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
    config.stencil = 0;
    config.width = mode.width;
    config.height = mode.height;
    config.useGL20 = false;
    config.fullscreen = fullscreen;
    config.samples = 0;
    config.vSyncEnabled = true;
    config.title = "ReaderApp";
    LwjglApplicationConfiguration.disableAudio = true;
    new LwjglApplication(new ReaderApp(startup, server), config);
}

From source file:org.oscim.theme.comparator.vtm.VtmPanel.java

License:Open Source License

public VtmPanel(MapApplicationAdapter.MapReadyCallback callback) {
    this.setLayout(null);
    LwjglApplicationConfiguration.disableAudio = true;
    LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
    config.width = 300;// w  w  w.  jav a2  s .  c om
    config.height = 300;

    appListener = new MapApplicationAdapter(callback);

    new LwjglApplication(appListener, config, vtmCanvas);

    this.add(vtmCanvas);
    this.setSize(350, 350);
    this.setBorder(BorderFactory.createTitledBorder("VTM-Map"));

    this.addComponentListener(new ComponentAdapter() {
        @Override
        public void componentResized(ComponentEvent e) {
            super.componentResized(e);
            boundsChanged();
        }

        @Override
        public void componentMoved(ComponentEvent e) {
            super.componentMoved(e);
            boundsChanged();
        }

    });

    boundsChanged();

}

From source file:sink.core.Sink.java

License:Apache License

public static void main(String[] argc) {
    jsonValue = jsonReader.parse(Sink.class.getClassLoader().getResourceAsStream("config.json"));
    if (jsonValue.getBoolean("hasIcon"))
        cfg.addIcon("icon.png", FileType.Internal);
    cfg.width = jsonValue.getInt("screenWidth");
    cfg.height = jsonValue.getInt("screenHeight");
    cfg.x = jsonValue.getInt("x");
    cfg.y = jsonValue.getInt("y");
    cfg.resizable = jsonValue.getBoolean("resize");
    cfg.forceExit = jsonValue.getBoolean("forceExit");
    cfg.fullscreen = jsonValue.getBoolean("fullScreen");
    cfg.useGL20 = jsonValue.getBoolean("useGL20");
    cfg.vSyncEnabled = jsonValue.getBoolean("vSync");
    cfg.audioDeviceBufferCount = jsonValue.getInt("audioBufferCount");
    LwjglApplicationConfiguration.disableAudio = jsonValue.getBoolean("disableAudio");
    targetWidth = jsonValue.getInt("targetWidth");
    targetHeight = jsonValue.getInt("targetHeight");
    new LwjglApplication(new Sink(), cfg);
}