GLFW
This commit is contained in:
+1
-1
Submodule common updated: 48494cd857...b2f381a0d6
@@ -0,0 +1,18 @@
|
||||
package org.saturnclient.impl.provider;
|
||||
|
||||
import org.lwjgl.glfw.GLFW;
|
||||
import org.saturnclient.common.provider.GLFWProvider;
|
||||
import org.saturnclient.saturnclient.SaturnClient;
|
||||
|
||||
public class GLFWProviderImpl implements GLFWProvider {
|
||||
@Override
|
||||
public boolean isKeyPressed(int key) {
|
||||
return GLFW.glfwGetKey(SaturnClient.client.getWindow().getHandle(), key) == GLFW.GLFW_PRESS
|
||||
&& SaturnClient.client.currentScreen == null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getKeyName(int key) {
|
||||
return GLFW.glfwGetKeyName(key, GLFW.glfwGetKeyScancode(key));
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,6 @@ package org.saturnclient.impl.provider;
|
||||
|
||||
import java.awt.image.BufferedImage;
|
||||
|
||||
import org.lwjgl.glfw.GLFW;
|
||||
import org.saturnclient.common.provider.SaturnProvider;
|
||||
import org.saturnclient.common.ref.asset.IdentifierRef;
|
||||
import org.saturnclient.common.ref.game.MinecraftClientRef;
|
||||
@@ -17,22 +16,11 @@ public class SaturnProviderImpl implements SaturnProvider {
|
||||
return (MinecraftClientRef) SaturnClient.client;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isKeyPressed(int key) {
|
||||
return GLFW.glfwGetKey(SaturnClient.client.getWindow().getHandle(), key) == GLFW.GLFW_PRESS
|
||||
&& SaturnClient.client.currentScreen == null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerBufferedImageTexture(IdentifierRef i, BufferedImage bi) {
|
||||
IdentifierUtils.registerBufferedImageTextureFast((Identifier) (Object) i, bi);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getKeyName(int key) {
|
||||
return GLFW.glfwGetKeyName(key, GLFW.glfwGetKeyScancode(key));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stop() {
|
||||
SaturnClient.client.scheduleStop();
|
||||
|
||||
@@ -12,6 +12,7 @@ import org.saturnclient.cosmetics.cloak.Cloaks;
|
||||
import org.saturnclient.common.bindings.SaturnClientBindings;
|
||||
import org.saturnclient.common.provider.Providers;
|
||||
import org.saturnclient.impl.provider.FabricModuleProvider;
|
||||
import org.saturnclient.impl.provider.GLFWProviderImpl;
|
||||
import org.saturnclient.impl.provider.RefConstructorImpl;
|
||||
import org.saturnclient.impl.provider.SaturnProviderImpl;
|
||||
import org.saturnclient.modules.ModManager;
|
||||
@@ -44,6 +45,7 @@ public class SaturnClient implements ModInitializer {
|
||||
|
||||
Providers.saturn = new SaturnProviderImpl();
|
||||
Providers.refConstructor = new RefConstructorImpl();
|
||||
Providers.GLFW = new GLFWProviderImpl();
|
||||
|
||||
ElementRenderer.INSTANCE = new ElementRendererImpl();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user