org.lwjgl.glfw.GLFWCursorPosCallback Java Examples

The following examples show how to use org.lwjgl.glfw.GLFWCursorPosCallback. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ClientMouseDeltaFixer.java    From Cubes with MIT License 6 votes vote down vote up
static void setup() {
  // Log.debug("Setting up Client Mouse Delta Fixer");

  try {
    deltaXField = Lwjgl3Input.class.getDeclaredField("deltaX");
    deltaXField.setAccessible(true);
    deltaYField = Lwjgl3Input.class.getDeclaredField("deltaY");
    deltaYField.setAccessible(true);

    Field f = Lwjgl3Input.class.getDeclaredField("cursorPosCallback");
    f.setAccessible(true);
    libgdxCallback = (GLFWCursorPosCallback) f.get(Gdx.input);
  } catch (ReflectiveOperationException | ClassCastException e) {
    throw new CubesException("Failed to setup reflection to inject correct delta mouse values!", e);
  }

  GLFW.glfwSetCursorPosCallback(((Lwjgl3Graphics) Gdx.graphics).getWindow().getWindowHandle(), cursorPosCallback);
}
 
Example #2
Source File: Input.java    From mars-sim with GNU General Public License v3.0 4 votes vote down vote up
public GLFWCursorPosCallback getMouseMoveCallback() {
	return mouseMove;
}