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


Java DisplayMode.isFullscreenCapable方法代碼示例

本文整理匯總了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);
}
 
開發者ID:devnewton,項目名稱:jnuit,代碼行數:26,代碼來源:LwjglHelper.java

示例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;
    }
 
開發者ID:CryoGenesis,項目名稱:GGU,代碼行數:17,代碼來源:DisplayUtility.java

示例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);
    }
 
開發者ID:CryoGenesis,項目名稱:GGU,代碼行數:23,代碼來源:DisplayHandler.java

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

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

示例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);
        }

    }
 
開發者ID:caseif,項目名稱:Voxem,代碼行數:51,代碼來源:Main.java


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