本文整理汇总了Java中org.lwjgl.opengl.Display.getAvailableDisplayModes方法的典型用法代码示例。如果您正苦于以下问题:Java Display.getAvailableDisplayModes方法的具体用法?Java Display.getAvailableDisplayModes怎么用?Java Display.getAvailableDisplayModes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.lwjgl.opengl.Display
的用法示例。
在下文中一共展示了Display.getAvailableDisplayModes方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getDisplayMode
import org.lwjgl.opengl.Display; //导入方法依赖的package包/类
public static DisplayMode getDisplayMode(Dimension p_getDisplayMode_0_) throws LWJGLException
{
DisplayMode[] adisplaymode = Display.getAvailableDisplayModes();
for (int i = 0; i < adisplaymode.length; ++i)
{
DisplayMode displaymode = adisplaymode[i];
if (displaymode.getWidth() == p_getDisplayMode_0_.width && displaymode.getHeight() == p_getDisplayMode_0_.height && (desktopDisplayMode == null || displaymode.getBitsPerPixel() == desktopDisplayMode.getBitsPerPixel() && displaymode.getFrequency() == desktopDisplayMode.getFrequency()))
{
return displaymode;
}
}
return desktopDisplayMode;
}
示例2: getSuitableFullScreenModes
import org.lwjgl.opengl.Display; //导入方法依赖的package包/类
private void getSuitableFullScreenModes() throws LWJGLException {
DisplayMode[] resolutions = Display.getAvailableDisplayModes();
DisplayMode desktopResolution = Display.getDesktopDisplayMode();
for (DisplayMode resolution : resolutions) {
if (isSuitableFullScreenResolution(resolution, desktopResolution)) {
availableResolutions.add(resolution);
}
}
}
示例3: getFullscreenDisplayModes
import org.lwjgl.opengl.Display; //导入方法依赖的package包/类
public static DisplayMode[] getFullscreenDisplayModes()
{
try
{
DisplayMode[] adisplaymode = Display.getAvailableDisplayModes();
List list = new ArrayList();
for (int i = 0; i < adisplaymode.length; ++i)
{
DisplayMode displaymode = adisplaymode[i];
if (desktopDisplayMode == null || displaymode.getBitsPerPixel() == desktopDisplayMode.getBitsPerPixel() && displaymode.getFrequency() == desktopDisplayMode.getFrequency())
{
list.add(displaymode);
}
}
DisplayMode[] adisplaymode1 = (DisplayMode[])((DisplayMode[])list.toArray(new DisplayMode[list.size()]));
Comparator comparator = new Comparator()
{
public int compare(Object p_compare_1_, Object p_compare_2_)
{
DisplayMode displaymode1 = (DisplayMode)p_compare_1_;
DisplayMode displaymode2 = (DisplayMode)p_compare_2_;
return displaymode1.getWidth() != displaymode2.getWidth() ? displaymode2.getWidth() - displaymode1.getWidth() : (displaymode1.getHeight() != displaymode2.getHeight() ? displaymode2.getHeight() - displaymode1.getHeight() : 0);
}
};
Arrays.sort(adisplaymode1, comparator);
return adisplaymode1;
}
catch (Exception exception)
{
exception.printStackTrace();
return new DisplayMode[] {desktopDisplayMode};
}
}
示例4: getDisplayModes
import org.lwjgl.opengl.Display; //导入方法依赖的package包/类
public static DisplayMode[] getDisplayModes()
{
if (displayModes == null)
{
try
{
DisplayMode[] adisplaymode = Display.getAvailableDisplayModes();
Set<Dimension> set = getDisplayModeDimensions(adisplaymode);
List list = new ArrayList();
for (Dimension dimension : set)
{
DisplayMode[] adisplaymode1 = getDisplayModes(adisplaymode, dimension);
DisplayMode displaymode = getDisplayMode(adisplaymode1, desktopDisplayMode);
if (displaymode != null)
{
list.add(displaymode);
}
}
DisplayMode[] adisplaymode2 = (DisplayMode[])((DisplayMode[])list.toArray(new DisplayMode[list.size()]));
Arrays.sort(adisplaymode2, new DisplayModeComparator());
return adisplaymode2;
}
catch (Exception exception)
{
exception.printStackTrace();
displayModes = new DisplayMode[] {desktopDisplayMode};
}
}
return displayModes;
}
示例5: getSuitableFullScreenModes
import org.lwjgl.opengl.Display; //导入方法依赖的package包/类
private void getSuitableFullScreenModes() throws LWJGLException {
DisplayMode[] resolutions = Display.getAvailableDisplayModes();
DisplayMode desktopResolution = Display.getDesktopDisplayMode();
for (DisplayMode resolution : resolutions) {
if (isSuitableFullScreenResolution(resolution, desktopResolution)) {
availableResolutions.add(resolution);
}
}
}