本文整理汇总了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);
}
}