當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。