當前位置: 首頁>>代碼示例>>Java>>正文


Java Display.getAvailableDisplayModes方法代碼示例

本文整理匯總了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;
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:17,代碼來源:Config.java

示例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);
		}
	}
}
 
開發者ID:TheThinMatrix,項目名稱:LowPolyWater,代碼行數:10,代碼來源:Window.java

示例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};
    }
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:37,代碼來源:Config.java

示例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;
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:35,代碼來源:Config.java

示例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);
        }
    }
}
 
開發者ID:GryPLOfficial,項目名稱:EcoSystem-Official,代碼行數:10,代碼來源:Window.java


注:本文中的org.lwjgl.opengl.Display.getAvailableDisplayModes方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。