本文整理匯總了Java中org.lwjgl.opengl.DisplayMode.isFullscreenCapable方法的典型用法代碼示例。如果您正苦於以下問題:Java DisplayMode.isFullscreenCapable方法的具體用法?Java DisplayMode.isFullscreenCapable怎麽用?Java DisplayMode.isFullscreenCapable使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.lwjgl.opengl.DisplayMode
的用法示例。
在下文中一共展示了DisplayMode.isFullscreenCapable方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: findBestDisplayMode
import org.lwjgl.opengl.DisplayMode; //導入方法依賴的package包/類
public static DisplayMode findBestDisplayMode(int width, int height) {
DisplayMode desktopMode = Display.getDesktopDisplayMode();
if (width == desktopMode.getWidth() && height == desktopMode.getHeight()) {
return desktopMode;
}
DisplayMode bestMode = null;
try {
for (DisplayMode m : Display.getAvailableDisplayModes()) {
if (width == m.getWidth() && height == m.getHeight()) {
if (null == bestMode
|| (m.isFullscreenCapable() && !bestMode.isFullscreenCapable())
|| (m.getBitsPerPixel() > bestMode.getBitsPerPixel())
|| m.getFrequency() > bestMode.getFrequency()) {
bestMode = m;
}
}
}
if (null != bestMode) {
return bestMode;
}
} catch (LWJGLException ex) {
Logger.getLogger(LwjglHelper.class.getName()).log(Level.SEVERE, null, ex);
}
return new DisplayMode(width, height);
}
示例2: isDisplayModeBetter
import org.lwjgl.opengl.DisplayMode; //導入方法依賴的package包/類
public static boolean isDisplayModeBetter(DisplayMode current, DisplayMode isBetter){
//Formatted weirdly to quickly see what the preferred settings are
if(
isBetter.getWidth() >= current.getWidth() &&
isBetter.getHeight() >= current.getHeight() &&
isBetter.getFrequency() >= current.getFrequency() &&
isBetter.getBitsPerPixel() >= current.getBitsPerPixel() &&
isBetter.isFullscreenCapable()
){
return true;
}
return false;
}
示例3: createBestDisplay
import org.lwjgl.opengl.DisplayMode; //導入方法依賴的package包/類
public static void createBestDisplay() throws LWJGLException{
DisplayMode displayMode = DisplayUtility.getPreferredDisplay();
//Output the displaymode
OutputUtility.outputLine("-Chosen Display Mode-");
OutputUtility.increment();
OutputUtility.outputLine("Width: " + displayMode.getWidth());
OutputUtility.outputLine("Height: " + displayMode.getHeight());
OutputUtility.outputLine("Frequency: " + displayMode.getFrequency());
OutputUtility.outputLine("Color range: " + displayMode.getBitsPerPixel());
OutputUtility.outputLine("Fullscreen Capable: " + displayMode.isFullscreenCapable());
OutputUtility.deincrement();
if (displayMode.isFullscreenCapable()) {
Display.setFullscreen(true);
}
Display.setDisplayMode(displayMode);
}
示例4: setResolution
import org.lwjgl.opengl.DisplayMode; //導入方法依賴的package包/類
public void setResolution(DisplayMode resolution, boolean fullscreen) {
try {
Display.setDisplayMode(resolution);
this.resolution = resolution;
if (fullscreen && resolution.isFullscreenCapable()) {
Display.setFullscreen(true);
this.fullScreen = fullscreen;
}
} catch (LWJGLException e) {
e.printStackTrace();
}
}
示例5: setResolution
import org.lwjgl.opengl.DisplayMode; //導入方法依賴的package包/類
public void setResolution(DisplayMode resolution, boolean fullscreen) {
try {
Display.setDisplayMode(resolution);
this.resolution = resolution;
if (fullscreen && resolution.isFullscreenCapable()) {
Display.setFullscreen(true);
this.fullScreen = fullscreen;
}
} catch (LWJGLException e) {
e.printStackTrace();
}
}
示例6: main
import org.lwjgl.opengl.DisplayMode; //導入方法依賴的package包/類
public static void main(String[] args) {
boolean launchedProperly = true;
try {
// verify libraries are present and LWJGL is in path
for (DisplayMode mode : Display.getAvailableDisplayModes()) {
if (mode.getWidth() == Display.getDesktopDisplayMode().getWidth() &&
mode.getHeight() == Display.getDesktopDisplayMode()
.getHeight() && mode.isFullscreenCapable()) {
Display.setDisplayMode(mode);
break;
}
}
Display.destroy();
} catch (Exception ex) {
ex.printStackTrace();
launchedProperly = false;
}
if (!launchedProperly) {
new DummyMain();
return;
}
Thread t = new Thread(new GraphicsHandler());
t.start();
InputManager.initialize();
Mob.initialize();
SoundManager.initialize();
while (!closed) {
Timing.calculateDelta();
Scheduler.checkTasks();
InputManager.manage();
if (world != null && player != null) {
Player.calculateLight();
TickManager.checkForTick();
for (Entity e : player.getLevel().getEntities()) {
e.manageMovement();
}
Block.updateSelectedBlock();
}
Timing.throttleCpu();
}
SoundManager.soundSystem.cleanup();
if (world != null) {
SaveManager.writeWorldToDisk(world);
}
}