Search in sources :

Example 31 with LwjglApplication

use of com.badlogic.gdx.backends.lwjgl.LwjglApplication in project shattered-pixel-dungeon-gdx by 00-Evan.

the class DesktopLauncher method main.

public static void main(String[] arg) {
    String version = DesktopLauncher.class.getPackage().getSpecificationVersion();
    if (version == null) {
        version = "0.6.4";
    }
    int versionCode;
    try {
        versionCode = Integer.parseInt(DesktopLauncher.class.getPackage().getImplementationVersion());
    } catch (NumberFormatException e) {
        versionCode = 251;
    }
    LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
    if (SharedLibraryLoader.isMac) {
        config.preferencesDirectory = "Library/Application Support/Shattered Pixel Dungeon/";
    } else if (SharedLibraryLoader.isLinux) {
        config.preferencesDirectory = ".shatteredpixel/shattered-pixel-dungeon/";
    } else if (SharedLibraryLoader.isWindows) {
        String winVer = System.getProperties().getProperty("os.name");
        if (winVer.contains("XP")) {
            config.preferencesDirectory = "Application Data/.shatteredpixel/Shattered Pixel Dungeon/";
        } else {
            config.preferencesDirectory = "AppData/Roaming/.shatteredpixel/Shattered Pixel Dungeon/";
        }
    }
    // FIXME: This is a hack to get access to the preferences before we have an application setup
    com.badlogic.gdx.Preferences prefs = new LwjglPreferences(SPDSettings.FILE_NAME, config.preferencesDirectory);
    boolean isFullscreen = prefs.getBoolean(SPDSettings.KEY_WINDOW_FULLSCREEN, false);
    // config.fullscreen = isFullscreen;
    if (!isFullscreen) {
        config.width = prefs.getInteger(SPDSettings.KEY_WINDOW_WIDTH, SPDSettings.DEFAULT_WINDOW_WIDTH);
        config.height = prefs.getInteger(SPDSettings.KEY_WINDOW_HEIGHT, SPDSettings.DEFAULT_WINDOW_HEIGHT);
    }
    config.addIcon("ic_launcher_128.png", Files.FileType.Internal);
    config.addIcon("ic_launcher_32.png", Files.FileType.Internal);
    config.addIcon("ic_launcher_16.png", Files.FileType.Internal);
    // TODO: It have to be pulled from build.gradle, but I don't know how it can be done
    config.title = "Shattered Pixel Dungeon";
    new LwjglApplication(new ShatteredPixelDungeon(new DesktopSupport(version, versionCode, config.preferencesDirectory, new DesktopInputProcessor())), config);
}
Also used : LwjglApplicationConfiguration(com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration) LwjglApplication(com.badlogic.gdx.backends.lwjgl.LwjglApplication) LwjglPreferences(com.badlogic.gdx.backends.lwjgl.LwjglPreferences) ShatteredPixelDungeon(com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon)

Example 32 with LwjglApplication

use of com.badlogic.gdx.backends.lwjgl.LwjglApplication in project high-flyer by sangngh.

the class DesktopLauncher method main.

public static void main(String[] arg) {
    GameSettings settings = new GameSettings(AspectRatio.STANDARD.calculateWidth(600), 600);
    LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
    config.title = "High Flyer - Soars to the sky!";
    config.useGL30 = false;
    config.height = settings.getWindowHeight();
    config.width = settings.getWindowWidth();
    new LwjglApplication(new GameEngine(settings, new GameState(), ScreenManager.INSTANCE), config);
}
Also used : LwjglApplication(com.badlogic.gdx.backends.lwjgl.LwjglApplication) LwjglApplicationConfiguration(com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration) GameEngine(com.relic.highflyer.GameEngine) GameState(com.relic.highflyer.GameState) GameSettings(com.relic.highflyer.GameSettings)

Example 33 with LwjglApplication

use of com.badlogic.gdx.backends.lwjgl.LwjglApplication in project ultimate-java by pantinor.

the class SpriteAtlasTool method main.

public static void main(String[] args) {
    LwjglApplicationConfiguration cfg = new LwjglApplicationConfiguration();
    cfg.title = "Sprite Atlas Tool";
    cfg.width = screenWidth;
    cfg.height = screenHeight;
    new LwjglApplication(new SpriteAtlasTool(), cfg);
}
Also used : LwjglApplication(com.badlogic.gdx.backends.lwjgl.LwjglApplication) LwjglApplicationConfiguration(com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration)

Example 34 with LwjglApplication

use of com.badlogic.gdx.backends.lwjgl.LwjglApplication in project ultimate-java by pantinor.

the class WaterTest method main.

public static void main(String[] args) {
    LwjglApplicationConfiguration cfg = new LwjglApplicationConfiguration();
    cfg.title = "test";
    cfg.width = 800;
    cfg.height = 600;
    new LwjglApplication(new WaterTest(), cfg);
}
Also used : LwjglApplication(com.badlogic.gdx.backends.lwjgl.LwjglApplication) LwjglApplicationConfiguration(com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration)

Example 35 with LwjglApplication

use of com.badlogic.gdx.backends.lwjgl.LwjglApplication in project AnotherMonekyParadox by SantiagoMille.

the class DesktopLauncher method main.

public static void main(String[] arg) {
    LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
    config.width = 1280;
    config.height = 720;
    new LwjglApplication(new Main(), config);
}
Also used : LwjglApplication(com.badlogic.gdx.backends.lwjgl.LwjglApplication) LwjglApplicationConfiguration(com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration) Main(mx.itesm.another_monkey_paradox.Main)

Aggregations

LwjglApplication (com.badlogic.gdx.backends.lwjgl.LwjglApplication)41 LwjglApplicationConfiguration (com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration)37 GdxTest (com.badlogic.gdx.tests.utils.GdxTest)2 RubeLoaderTest (com.gushikustudios.rube.RubeLoaderTest)2 File (java.io.File)2 AmazingMazeGame (ca.hiphiparray.amazingmaze.AmazingMazeGame)1 GameMain (cn.s3bit.th902.GameMain)1 PlatformRelatedInterfaces (cn.s3bit.th902.PlatformRelatedInterfaces)1 IFont (cn.s3bit.th902.utils.IFont)1 ApplicationAdapter (com.badlogic.gdx.ApplicationAdapter)1 ApplicationListener (com.badlogic.gdx.ApplicationListener)1 Game (com.badlogic.gdx.Game)1 DisplayMode (com.badlogic.gdx.Graphics.DisplayMode)1 LwjglPreferences (com.badlogic.gdx.backends.lwjgl.LwjglPreferences)1 FileHandle (com.badlogic.gdx.files.FileHandle)1 Color (com.badlogic.gdx.graphics.Color)1 PixmapPacker (com.badlogic.gdx.graphics.g2d.PixmapPacker)1 FreeTypeFontGenerator (com.badlogic.gdx.graphics.g2d.freetype.FreeTypeFontGenerator)1 BitmapFontWriter (com.badlogic.gdx.tools.bmfont.BitmapFontWriter)1 Settings (com.badlogic.gdx.tools.texturepacker.TexturePacker.Settings)1