本文整理匯總了Java中com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration.getDesktopDisplayMode方法的典型用法代碼示例。如果您正苦於以下問題:Java LwjglApplicationConfiguration.getDesktopDisplayMode方法的具體用法?Java LwjglApplicationConfiguration.getDesktopDisplayMode怎麽用?Java LwjglApplicationConfiguration.getDesktopDisplayMode使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration
的用法示例。
在下文中一共展示了LwjglApplicationConfiguration.getDesktopDisplayMode方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: main
import com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration; //導入方法依賴的package包/類
public static void main (String[] arg) {
//Initialize log file
try {
File file = new File("log.txt");
if (file.exists()) {
file.delete();
}
PrintStream printStream = new PrintStream(file);
System.setOut(printStream);
System.setErr(printStream);
} catch (FileNotFoundException fileNotFoundException) {
System.out.println("Could not create log file.");
}
//Initialize application
Graphics.DisplayMode selectedDisplayMode = LwjglApplicationConfiguration.getDesktopDisplayMode();
if (selectedDisplayMode != null) {
GameModule gameModule = GameModuleProvider.provideGameModule();
LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
config.setFromDisplayMode(selectedDisplayMode);
config.vSyncEnabled = true;
if (gameModule.provideIconFileName() != null) {
config.addIcon(gameModule.provideIconFileName(), Files.FileType.Internal);
}
new LwjglApplication(new GGVmApplication(gameModule, PCMenu.class, KeyboardInputProcessor.class), config);
} else {
System.out.println("Sorry, this game requires a graphics card that can display 32 bpp!");
}
}
示例2: getDesktopDisplayMode
import com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration; //導入方法依賴的package包/類
public static Graphics.DisplayMode getDesktopDisplayMode() {
return LwjglApplicationConfiguration.getDesktopDisplayMode();
}