当前位置: 首页>>代码示例>>Java>>正文


Java Display.isActive方法代码示例

本文整理汇总了Java中org.lwjgl.opengl.Display.isActive方法的典型用法代码示例。如果您正苦于以下问题:Java Display.isActive方法的具体用法?Java Display.isActive怎么用?Java Display.isActive使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.lwjgl.opengl.Display的用法示例。


在下文中一共展示了Display.isActive方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setIngameFocus

import org.lwjgl.opengl.Display; //导入方法依赖的package包/类
/**
 * Will set the focus to ingame if the Minecraft window is the active with focus. Also clears any GUI screen
 * currently displayed
 */
public void setIngameFocus()
{
    if (Display.isActive())
    {
        if (!this.inGameHasFocus)
        {
            if (!IS_RUNNING_ON_MAC)
            {
                KeyBinding.updateKeyBindState();
            }

            this.inGameHasFocus = true;
            this.mouseHelper.grabMouseCursor();
            this.displayGuiScreen((GuiScreen)null);
            this.leftClickCounter = 10000;
        }
    }
}
 
开发者ID:NSExceptional,项目名称:Zombe-Modpack,代码行数:23,代码来源:Minecraft.java

示例2: getFrameRate

import org.lwjgl.opengl.Display; //导入方法依赖的package包/类
protected int getFrameRate() {
    int frameRate = Display.isActive() ? this.graphics.config.foregroundFPS : this.graphics.config.backgroundFPS;
    if (frameRate == -1) {
        frameRate = 10;
    }

    if (frameRate == 0) {
        frameRate = this.graphics.config.backgroundFPS;
    }

    if (frameRate == 0) {
        frameRate = 30;
    }

    return frameRate;
}
 
开发者ID:dmitrykolesnikovich,项目名称:featurea,代码行数:17,代码来源:MyLwjglCanvas.java

示例3: setIngameFocus

import org.lwjgl.opengl.Display; //导入方法依赖的package包/类
/**
 * Will set the focus to ingame if the Minecraft window is the active with focus. Also clears any GUI screen
 * currently displayed
 */
public void setIngameFocus()
{
    if (Display.isActive())
    {
        if (!this.inGameHasFocus)
        {
            this.inGameHasFocus = true;
            this.mouseHelper.grabMouseCursor();
            this.displayGuiScreen((GuiScreen)null);
            this.leftClickCounter = 10000;
        }
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:18,代码来源:Minecraft.java

示例4: setIngameFocus

import org.lwjgl.opengl.Display; //导入方法依赖的package包/类
/**
 * Will set the focus to ingame if the Minecraft window is the active with
 * focus. Also clears any GUI screen currently displayed
 */
public void setIngameFocus() {
	if (Display.isActive()) {
		if (!this.inGameHasFocus) {
			this.inGameHasFocus = true;
			this.mouseHelper.grabMouseCursor();
			this.displayGuiScreen((GuiScreen) null);
			this.leftClickCounter = 10000;
		}
	}
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:15,代码来源:Minecraft.java

示例5: hasFocus

import org.lwjgl.opengl.Display; //导入方法依赖的package包/类
/**
 * @see org.newdawn.slick.GameContainer#hasFocus()
 */
public boolean hasFocus() {
	// hmm, not really the right thing, talk to the LWJGL guys
	return Display.isActive();
}
 
开发者ID:j-dong,项目名称:trashjam2017,代码行数:8,代码来源:AppGameContainer.java

示例6: tick

import org.lwjgl.opengl.Display; //导入方法依赖的package包/类
public void tick() {

		if (!Display.isActive() && !inventory.isOpen()) inventory.open();

		ChunkSystem.removeDistantChunks();

		final int cameraChunkX = (int) (GameCamera.position.x / Chunk.H_SIZE);
		final int cameraChunkZ = (int) (GameCamera.position.z / Chunk.H_SIZE);

		ChunkSystem.addNewChunks(cameraChunkX, cameraChunkZ);

		player.tick(inventory.isOpen());

		if (!inventory.isOpen()) {

			if (MouseInput.isButtonJustPressed(0)) ChunkSystem.checkLeftClick(inventory);
			if (MouseInput.isButtonJustPressed(1)) ChunkSystem.checkRightClick(inventory);

		}

		ChunkModelQueue.queue();
		ChunkSaveQueue.queue();

		Time.updateTime(1200);

		final float time = Mathf.sinNormalized(Time.rawTime);

		sun.position.y = -time;
		sun.position.x = Mathf.cosNormalized(Time.rawTime) * .2f;
		sun.position.z = Mathf.cosNormalized(Time.rawTime);

		sun.brightness = Mathf.map(Mathf.max(time, -.4f), 1f, -.4f, 1f, 0f);

		Settings.CURRENT_SKY_COLOR = new Color(ImageBilinearFilter.getColor(AMBIENT, sun.brightness, 0));
		final Color sunColor = new Color(ImageBilinearFilter.getColor(AMBIENT, sun.brightness, 1));
		sun.color = new Vec3(sunColor.getRed(), sunColor.getGreen(), sunColor.getBlue());

		GameCamera.updateMatrix(Player.sprinting);

		if (autosaveTimer.isComplete()) {

			autosaveTimer.reset();

			for (final Chunk c : Chunk.CHUNKS)
				new ChunkSaveQueue(c);

			PlayerSave.save(player);
			inventory.save();

			System.out.println("Autosave");

		}

	}
 
开发者ID:ASasseCreations,项目名称:Voxel_Game,代码行数:55,代码来源:GameState.java


注:本文中的org.lwjgl.opengl.Display.isActive方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。