本文整理匯總了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;
}
}
}
示例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;
}
示例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;
}
}
}
示例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;
}
}
}
示例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();
}
示例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");
}
}