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