本文整理汇总了Java中org.lwjgl.opengl.Display.getDisplayMode方法的典型用法代码示例。如果您正苦于以下问题:Java Display.getDisplayMode方法的具体用法?Java Display.getDisplayMode怎么用?Java Display.getDisplayMode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.lwjgl.opengl.Display
的用法示例。
在下文中一共展示了Display.getDisplayMode方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: run
import org.lwjgl.opengl.Display; //导入方法依赖的package包/类
public Object run() {
try {
Display.getDisplayMode();
} catch (Exception e) {
Log.error(e);
}
return null;
}
示例2: setInitialDisplayMode
import org.lwjgl.opengl.Display; //导入方法依赖的package包/类
private void setInitialDisplayMode() throws LWJGLException
{
if (this.fullscreen)
{
Display.setFullscreen(true);
DisplayMode displaymode = Display.getDisplayMode();
this.displayWidth = Math.max(1, displaymode.getWidth());
this.displayHeight = Math.max(1, displaymode.getHeight());
}
else
{
Display.setDisplayMode(new DisplayMode(this.displayWidth, this.displayHeight));
}
}
示例3: setInitialDisplayMode
import org.lwjgl.opengl.Display; //导入方法依赖的package包/类
private void setInitialDisplayMode() throws LWJGLException {
if (this.fullscreen) {
Display.setFullscreen(true);
DisplayMode displaymode = Display.getDisplayMode();
this.displayWidth = Math.max(1, displaymode.getWidth());
this.displayHeight = Math.max(1, displaymode.getHeight());
} else {
Display.setDisplayMode(new DisplayMode(this.displayWidth, this.displayHeight));
}
}
示例4: checkDisplaySettings
import org.lwjgl.opengl.Display; //导入方法依赖的package包/类
public static void checkDisplaySettings()
{
int i = getAntialiasingLevel();
if (i > 0)
{
DisplayMode displaymode = Display.getDisplayMode();
dbg("FSAA Samples: " + i);
try
{
Display.destroy();
Display.setDisplayMode(displaymode);
Display.create((new PixelFormat()).withDepthBits(24).withSamples(i));
Display.setResizable(false);
Display.setResizable(true);
}
catch (LWJGLException lwjglexception2)
{
warn("Error setting FSAA: " + i + "x");
lwjglexception2.printStackTrace();
try
{
Display.setDisplayMode(displaymode);
Display.create((new PixelFormat()).withDepthBits(24));
Display.setResizable(false);
Display.setResizable(true);
}
catch (LWJGLException lwjglexception1)
{
lwjglexception1.printStackTrace();
try
{
Display.setDisplayMode(displaymode);
Display.create();
Display.setResizable(false);
Display.setResizable(true);
}
catch (LWJGLException lwjglexception)
{
lwjglexception.printStackTrace();
}
}
}
if (!Minecraft.isRunningOnMac && getDefaultResourcePack() != null)
{
InputStream inputstream = null;
InputStream inputstream1 = null;
try
{
inputstream = getDefaultResourcePack().getInputStreamAssets(new ResourceLocation("icons/icon_16x16.png"));
inputstream1 = getDefaultResourcePack().getInputStreamAssets(new ResourceLocation("icons/icon_32x32.png"));
if (inputstream != null && inputstream1 != null)
{
Display.setIcon(new ByteBuffer[] {readIconImage(inputstream), readIconImage(inputstream1)});
}
}
catch (IOException ioexception)
{
warn("Error setting window icon: " + ioexception.getClass().getName() + ": " + ioexception.getMessage());
}
finally
{
IOUtils.closeQuietly(inputstream);
IOUtils.closeQuietly(inputstream1);
}
}
}
}
示例5: checkDisplaySettings
import org.lwjgl.opengl.Display; //导入方法依赖的package包/类
public static void checkDisplaySettings()
{
if (getAntialiasingLevel() > 0)
{
int i = getAntialiasingLevel();
DisplayMode displaymode = Display.getDisplayMode();
dbg("FSAA Samples: " + i);
try
{
Display.destroy();
Display.setDisplayMode(displaymode);
Display.create((new PixelFormat()).withDepthBits(24).withSamples(i));
Display.setResizable(false);
Display.setResizable(true);
}
catch (LWJGLException lwjglexception2)
{
warn("Error setting FSAA: " + i + "x");
lwjglexception2.printStackTrace();
try
{
Display.setDisplayMode(displaymode);
Display.create((new PixelFormat()).withDepthBits(24));
Display.setResizable(false);
Display.setResizable(true);
}
catch (LWJGLException lwjglexception1)
{
lwjglexception1.printStackTrace();
try
{
Display.setDisplayMode(displaymode);
Display.create();
Display.setResizable(false);
Display.setResizable(true);
}
catch (LWJGLException lwjglexception)
{
lwjglexception.printStackTrace();
}
}
}
}
}
示例6: checkDisplaySettings
import org.lwjgl.opengl.Display; //导入方法依赖的package包/类
public static void checkDisplaySettings()
{
int i = getAntialiasingLevel();
if (i > 0)
{
DisplayMode displaymode = Display.getDisplayMode();
dbg("FSAA Samples: " + i);
try
{
Display.destroy();
Display.setDisplayMode(displaymode);
Display.create((new PixelFormat()).withDepthBits(24).withSamples(i));
Display.setResizable(false);
Display.setResizable(true);
}
catch (LWJGLException lwjglexception2)
{
warn("Error setting FSAA: " + i + "x");
lwjglexception2.printStackTrace();
try
{
Display.setDisplayMode(displaymode);
Display.create((new PixelFormat()).withDepthBits(24));
Display.setResizable(false);
Display.setResizable(true);
}
catch (LWJGLException lwjglexception1)
{
lwjglexception1.printStackTrace();
try
{
Display.setDisplayMode(displaymode);
Display.create();
Display.setResizable(false);
Display.setResizable(true);
}
catch (LWJGLException lwjglexception)
{
lwjglexception.printStackTrace();
}
}
}
if (!Minecraft.IS_RUNNING_ON_MAC && getDefaultResourcePack() != null)
{
InputStream inputstream = null;
InputStream inputstream1 = null;
try
{
inputstream = getDefaultResourcePack().getInputStreamAssets(new ResourceLocation("icons/icon_16x16.png"));
inputstream1 = getDefaultResourcePack().getInputStreamAssets(new ResourceLocation("icons/icon_32x32.png"));
if (inputstream != null && inputstream1 != null)
{
Display.setIcon(new ByteBuffer[] {readIconImage(inputstream), readIconImage(inputstream1)});
}
}
catch (IOException ioexception)
{
warn("Error setting window icon: " + ioexception.getClass().getName() + ": " + ioexception.getMessage());
}
finally
{
IOUtils.closeQuietly(inputstream);
IOUtils.closeQuietly(inputstream1);
}
}
}
}
示例7: AppGameContainer
import org.lwjgl.opengl.Display; //导入方法依赖的package包/类
/**
* Create a new container wrapping a game
*
* @param game The game to be wrapped
* @param width The width of the display required
* @param height The height of the display required
* @param fullscreen True if we want fullscreen mode
* @throws SlickException Indicates a failure to initialise the display
*/
public AppGameContainer(Game game,int width,int height,boolean fullscreen) throws SlickException {
super(game);
originalDisplayMode = Display.getDisplayMode();
setDisplayMode(width,height,fullscreen);
}