Example usage for com.badlogic.gdx.backends.jglfw JglfwApplicationConfiguration JglfwApplicationConfiguration

List of usage examples for com.badlogic.gdx.backends.jglfw JglfwApplicationConfiguration JglfwApplicationConfiguration

Introduction

In this page you can find the example usage for com.badlogic.gdx.backends.jglfw JglfwApplicationConfiguration JglfwApplicationConfiguration.

Prototype

JglfwApplicationConfiguration

Source Link

Usage

From source file:com.badlogic.gdx.jglfw.tests.JglfwDebugStarter.java

License:Apache License

public static void main(String[] argv) {
    // this is only here for me to debug native code faster
    new SharedLibraryLoader("../../extensions/gdx-audio/libs/gdx-audio-natives.jar").load("gdx-audio");
    new SharedLibraryLoader("../../extensions/gdx-image/libs/gdx-image-natives.jar").load("gdx-image");
    new SharedLibraryLoader("../../extensions/gdx-freetype/libs/gdx-freetype-natives.jar").load("gdx-freetype");
    new SharedLibraryLoader(
            "../../extensions/gdx-controllers/gdx-controllers-desktop/libs/gdx-controllers-desktop-natives.jar")
                    .load("gdx-controllers-desktop");
    new SharedLibraryLoader("../../gdx/libs/gdx-natives.jar").load("gdx");

    GdxTest test = new SuperKoalio();
    JglfwApplicationConfiguration config = new JglfwApplicationConfiguration();
    config.vSync = true;//  w ww  .  ja v  a 2  s. co m
    new JglfwApplication(test, config);
}

From source file:com.badlogic.gdx.jglfw.tests.JglfwTestStarter.java

License:Apache License

/** Runs the {@link GdxTest} with the given name.
 * @param testName the name of a test class
 * @return {@code true} if the test was found and run, {@code false} otherwise */
public static JglfwApplication runTest(String testName) {
    final GdxTest test = GdxTests.newTest(testName);
    if (test == null)
        throw new GdxRuntimeException("Test not found: " + testName);

    final JglfwApplicationConfiguration config = new JglfwApplicationConfiguration();
    config.width = 640;/*from  ww w.  j a  v a2 s  .  c o  m*/
    config.height = 480;
    config.title = testName;
    config.forceExit = false;
    return new JglfwApplication(test, config);
}

From source file:com.o2d.pkayjava.editor.Main.java

License:Apache License

private void startLoadingEditor() {
    //first, kill off the splash
    if (!(SystemUtils.IS_OS_MAC_OSX || SystemUtils.IS_OS_MAC || SystemUtils.IS_OS_UNIX)) {
        splash.kill();/* w w w .j  a  v a  2  s .  c o m*/
    }

    Overlap2D overlap2D = new Overlap2D();
    Rectangle maximumWindowBounds = GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds();
    double width = maximumWindowBounds.getWidth();
    double height = maximumWindowBounds.getHeight();

    if (SystemUtils.IS_OS_MAC_OSX || SystemUtils.IS_OS_MAC) {
        System.setProperty("apple.laf.useScreenMenuBar", "true");
        System.setProperty("com.apple.mrj.application.apple.menu.about.name", "Overlap2D");
        JglfwApplicationConfiguration config = new JglfwApplicationConfiguration();
        config.width = (int) (width);
        config.height = (int) (height - height * .04);
        config.backgroundFPS = 0;
        config.title = "Overlap2D - Public Alpha v" + AppConfig.getInstance().version;
        new JglfwApplication(overlap2D, config);
    } else {
        LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
        config.title = "Overlap2D - Public Alpha v" + AppConfig.getInstance().version;
        config.fullscreen = true;
        config.resizable = false;
        config.width = (int) (width);
        config.height = (int) (height - height * .04);
        config.backgroundFPS = 0;
        mainFrame = new LwjglFrame(overlap2D, config);
        mainFrame.setExtendedState(mainFrame.getExtendedState() | JFrame.MAXIMIZED_BOTH);
        toggleVisible();

        // subscribe to file dropping notifications, currently windows only
        DropTarget dropTarget = new DropTarget(mainFrame, new FileDropListener());
    }

    if (!SystemUtils.IS_OS_UNIX) {
        // no aesthetics for linux users I guess..
        setIcon();
    }

}

From source file:net.mwplay.cocostudio.ui.junit.LibgdxRunner.java

License:Apache License

private void initApplication() {
    try {//from  ww w . jav  a  2s  .  c  om
        JglfwApplicationConfiguration cfg = new JglfwApplicationConfiguration();
        cfg.preferencesLocation = String.format("tmp/%d/.prefs/", random.nextLong());
        cfg.title = "Libgdx Runner";
        cfg.width = 2;
        cfg.height = 2;
        cfg.forceExit = true;
        new JglfwApplication(new TestApplicationListener(), cfg);
        ConditionWaiter.wait(new Condition() {
            @Override
            public Boolean check() {
                return Gdx.files != null;
            }
        }, "Jglfw init failed.", 10);
        prefs = new File(Gdx.files.getExternalStoragePath(), "tmp/");
        Runtime.getRuntime().addShutdownHook(new Thread(new Runnable() {
            @Override
            public void run() {
                LibgdxRunner.this.safeCleanDir();
                LibgdxRunner.this.closeGdxApplication();
            }
        }));
    } catch (Exception ex) {
        throw new LibgdxInitException(ex);
    }
}

From source file:org.oscim.gdx.GdxMapApp.java

License:Open Source License

static protected JglfwApplicationConfiguration getConfig() {
    JglfwApplicationConfiguration cfg = new JglfwApplicationConfiguration();
    cfg.title = "vtm-gdx";
    cfg.width = 800;// ww w .ja v  a  2 s . co  m
    cfg.height = 600;
    cfg.stencil = 8;
    //cfg.samples = 2;
    cfg.foregroundFPS = 30;
    cfg.backgroundFPS = 10;
    return cfg;
}