Last active
February 25, 2020 08:52
-
-
Save btmxh/017cbf1c42c06d568bb55e632b6c21a3 to your computer and use it in GitHub Desktop.
Chain Callbacks for LWJGL 3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package lightningstrike.glfw.chaincb; | |
import java.util.*; | |
import org.lwjgl.glfw.*; | |
import org.lwjgl.system.CallbackI; | |
public abstract class ChainCallback<CB extends CallbackI.V> extends LinkedList<CB> implements CallbackI.V { | |
@Override | |
public void callback(long args) { | |
for (CB cb : this) { | |
cb.callback(args); | |
} | |
} | |
public static class Key extends ChainCallback<GLFWKeyCallbackI> implements GLFWKeyCallbackI { | |
@Override | |
public void invoke(long window, int key, int scancode, int action, int mods) { | |
//UNIMPLEMENTED | |
} | |
} | |
public static class WindowPos extends ChainCallback<GLFWWindowPosCallbackI> implements GLFWWindowPosCallbackI { | |
@Override | |
public void invoke(long window, int xpos, int ypos) { | |
//UNIMPLEMENTED | |
} | |
} | |
public static class WindowSize extends ChainCallback<GLFWWindowSizeCallbackI> implements GLFWWindowSizeCallbackI { | |
@Override | |
public void invoke(long window, int width, int height) { | |
//UNIMPLEMENTED | |
} | |
} | |
public static class WindowClose extends ChainCallback<GLFWWindowCloseCallbackI> implements GLFWWindowCloseCallbackI { | |
@Override | |
public void invoke(long window) { | |
//UNIMPLEMENTED | |
} | |
} | |
public static class WindowRefresh extends ChainCallback<GLFWWindowRefreshCallbackI> implements GLFWWindowRefreshCallbackI { | |
@Override | |
public void invoke(long window) { | |
//UNIMPLEMENTED | |
} | |
} | |
public static class WindowFocus extends ChainCallback<GLFWWindowFocusCallbackI> implements GLFWWindowFocusCallbackI { | |
@Override | |
public void invoke(long window, boolean focused) { | |
//UNIMPLEMENTED | |
} | |
} | |
public static class WindowIconify extends ChainCallback<GLFWWindowIconifyCallbackI> implements GLFWWindowIconifyCallbackI { | |
@Override | |
public void invoke(long window, boolean iconified) { | |
//UNIMPLEMENTED | |
} | |
} | |
public static class WindowMaximize extends ChainCallback<GLFWWindowMaximizeCallbackI> implements GLFWWindowMaximizeCallbackI { | |
@Override | |
public void invoke(long window, boolean maximized) { | |
//UNIMPLEMENTED | |
} | |
} | |
public static class FramebufferSize extends ChainCallback<GLFWFramebufferSizeCallbackI> implements GLFWFramebufferSizeCallbackI { | |
@Override | |
public void invoke(long window, int width, int height) { | |
//UNIMPLEMENTED | |
} | |
} | |
public static class Char extends ChainCallback<GLFWCharCallbackI> implements GLFWCharCallbackI { | |
@Override | |
public void invoke(long window, int codepoint) { | |
//UNIMPLEMENTED | |
} | |
} | |
public static class CharMods extends ChainCallback<GLFWCharModsCallbackI> implements GLFWCharModsCallbackI { | |
@Override | |
public void invoke(long window, int codepoint, int mods) { | |
//UNIMPLEMENTED | |
} | |
} | |
public static class MouseButton extends ChainCallback<GLFWMouseButtonCallbackI> implements GLFWMouseButtonCallbackI { | |
@Override | |
public void invoke(long window, int button, int action, int mods) { | |
//UNIMPLEMENTED | |
} | |
} | |
public static class CursorPos extends ChainCallback<GLFWCursorPosCallbackI> implements GLFWCursorPosCallbackI { | |
@Override | |
public void invoke(long window, double xpos, double ypos) { | |
//UNIMPLEMENTED | |
} | |
} | |
public static class CursorEnter extends ChainCallback<GLFWCursorEnterCallbackI> implements GLFWCursorEnterCallbackI { | |
@Override | |
public void invoke(long window, boolean entered) { | |
//UNIMPLEMENTED | |
} | |
} | |
public static class WindowContentScale extends ChainCallback<GLFWWindowContentScaleCallbackI> implements GLFWWindowContentScaleCallbackI { | |
@Override | |
public void invoke(long window, float xscale, float yscale) { | |
//UNIMPLEMENTED | |
} | |
} | |
public static class Scroll extends ChainCallback<GLFWScrollCallbackI> implements GLFWScrollCallbackI { | |
@Override | |
public void invoke(long window, double xoffset, double yoffset) { | |
//UNIMPLEMENTED | |
} | |
} | |
public static class Drop extends ChainCallback<GLFWDropCallbackI> implements GLFWDropCallbackI { | |
@Override | |
public void invoke(long window, int count, long names) { | |
//UNIMPLEMENTED | |
} | |
} | |
public static class Joystick extends ChainCallback<GLFWJoystickCallbackI> implements GLFWJoystickCallbackI { | |
@Override | |
public void invoke(int jid, int event) { | |
//UNIMPLEMENTED | |
} | |
} | |
public static class Error extends ChainCallback<GLFWErrorCallbackI> implements GLFWErrorCallbackI { | |
@Override | |
public void invoke(int error, long description) { | |
//UNIMPLEMENTED | |
} | |
} | |
public static class Monitor extends ChainCallback<GLFWMonitorCallbackI> implements GLFWMonitorCallbackI { | |
@Override | |
public void invoke(long monitor, int event) { | |
//UNIMPLEMENTED | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment