Java Code Examples for com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration#addIcon()

The following examples show how to use com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration#addIcon() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: URacerDesktop.java    From uracer-kotd with Apache License 2.0 6 votes vote down vote up
private static LwjglApplicationConfiguration createLwjglConfig (BootConfig boot) {
	LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();

	// set to uracer defaults
	config.addIcon("data/base/icon.png", FileType.Internal);
	config.title = URacer.Name + " (" + URacer.versionInfo + ")";
	config.resizable = false;
	config.samples = 0;
	config.audioDeviceSimultaneousSources = 32;

	if (Config.Debug.PauseDisabled) {
		config.backgroundFPS = 0;
		config.foregroundFPS = 0;
	} else {
		config.backgroundFPS = 60;
		config.foregroundFPS = 60;
	}

	// apply boot config
	config.width = boot.getInt(BootConfigFlag.WIDTH);
	config.height = boot.getInt(BootConfigFlag.HEIGHT);
	config.vSyncEnabled = boot.getBoolean(BootConfigFlag.VSYNC);
	config.fullscreen = boot.getBoolean(BootConfigFlag.FULLSCREEN);

	return config;
}
 
Example 2
Source File: GLSurfaceLauncher.java    From gdx-texture-packer-gui with Apache License 2.0 6 votes vote down vote up
public static void start(Arguments arguments) {
	AppConstants.logFile = LoggerUtils.setupExternalFileOutput();

	final LwjglApplicationConfiguration configuration = new LwjglApplicationConfiguration();
	configuration.title = AppConstants.APP_TITLE;
	configuration.addIcon("icon128.png", Files.FileType.Classpath);
	configuration.addIcon("icon32.png", Files.FileType.Classpath);
	configuration.addIcon("icon16.png", Files.FileType.Classpath);
	configuration.preferencesDirectory = AppConstants.EXTERNAL_DIR;
	configuration.width = 1024;
	configuration.height = 600;
	configuration.allowSoftwareMode = arguments.softOpenGL;
	configuration.useHDPI = true;

	AppParams appParams = new AppParams();
	appParams.startupProject = arguments.project;
	appParams.debug = arguments.debug;

	App app = new App(new DesktopClassScanner(), appParams);
	new LwjglApplication(new WindowParamsPersistingApplicationWrapper(app, configuration), configuration);
}
 
Example 3
Source File: Main.java    From bladecoder-adventure-engine with Apache License 2.0 6 votes vote down vote up
public static void main(final String[] args) {
	LwjglApplicationConfiguration cfg = new LwjglApplicationConfiguration();

	cfg.title = "Adventure Editor v" + Versions.getVersion();

	cfg.resizable = true;
	cfg.vSyncEnabled = true;
	// cfg.samples = 2;
	// cfg.useGL30 = true;

	if (Main.class.getResource("/images/ic_app64.png") != null)
		cfg.addIcon("images/ic_app64.png", FileType.Internal);

	if (Main.class.getResource("/images/ic_app32.png") != null)
		cfg.addIcon("images/ic_app32.png", FileType.Internal);

	if (Main.class.getResource("/images/ic_app16.png") != null)
		cfg.addIcon("images/ic_app16.png", FileType.Internal);

	parseArgs(args);

	new Main(new Editor(), cfg);
}
 
Example 4
Source File: DesktopLauncher.java    From Klooni1010 with GNU General Public License v3.0 5 votes vote down vote up
public static void main(String[] arg) {
    LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
    config.title = "Klooni 1010!";
    config.width = Klooni.GAME_WIDTH;
    config.height = Klooni.GAME_HEIGHT;
    config.addIcon("ic_launcher/icon128.png", Files.FileType.Internal);
    config.addIcon("ic_launcher/icon32.png", Files.FileType.Internal);
    config.addIcon("ic_launcher/icon16.png", Files.FileType.Internal);
    new LwjglApplication(new Klooni(null), config);
}
 
Example 5
Source File: DesktopLauncher.java    From Unlucky with MIT License 5 votes vote down vote up
public static void main(String[] args) {
    LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
    config.width = Unlucky.V_WIDTH * Unlucky.V_SCALE;
    config.height = Unlucky.V_HEIGHT * Unlucky.V_SCALE;
    config.title = Unlucky.TITLE;
    config.resizable = false;
    config.vSyncEnabled = false;
    config.backgroundFPS = 10;
    config.foregroundFPS = 60;
    config.addIcon("desktop_icon128.png", Files.FileType.Internal);
    config.addIcon("desktop_icon32.png", Files.FileType.Internal);
    config.addIcon("desktop_icon16.png", Files.FileType.Internal);
    new LwjglApplication(new Unlucky(), config);
}
 
Example 6
Source File: DesktopLauncher.java    From libgdx-2d-tutorial with MIT License 5 votes vote down vote up
public static void main (String[] arg) {
	LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
	config.foregroundFPS = 60;
	config.width = SpaceGame.WIDTH;
	config.height = SpaceGame.HEIGHT;
	config.resizable = true;
	config.addIcon("icon_128.png", FileType.Internal);
	config.addIcon("icon_32.png", FileType.Internal);
	config.addIcon("icon_16.png", FileType.Internal);
	new LwjglApplication(new SpaceGame(), config);
}
 
Example 7
Source File: MPQViewer.java    From riiablo with Apache License 2.0 5 votes vote down vote up
public static void main(String[] args) {
  LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
  config.title = TITLE;
  config.addIcon(ASSETS + "ic_launcher_128.png", Files.FileType.Internal);
  config.addIcon(ASSETS + "ic_launcher_32.png",  Files.FileType.Internal);
  config.addIcon(ASSETS + "ic_launcher_16.png",  Files.FileType.Internal);
  config.resizable = true;
  config.width  = 1700;
  config.height = 960;
  config.foregroundFPS = config.backgroundFPS = 144;
  Client client = new Client();
  new LwjglApplication(client, config);
}
 
Example 8
Source File: DesktopLauncher.java    From shattered-pixel-dungeon-gdx with GNU General Public License v3.0 4 votes vote down vote up
public static void main (String[] arg) {
	String version = DesktopLauncher.class.getPackage().getSpecificationVersion();
	if (version == null) {
		version = "0.7.5f";
	}

	int versionCode;
	try {
		versionCode = Integer.parseInt(DesktopLauncher.class.getPackage().getImplementationVersion());
	} catch (NumberFormatException e) {
		versionCode = 383;
	}

	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);
}