当前位置: 首页>>代码示例>>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;未经允许,请勿转载。