本文整理汇总了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");
}
}