Java Code Examples for org.lwjgl.glfw.GLFW#glfwSetCursorPosCallback()
The following examples show how to use
org.lwjgl.glfw.GLFW#glfwSetCursorPosCallback() .
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 |
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: Window.java From mars-sim with GNU General Public License v3.0 | 5 votes |
private void createCallbacks() { sizeCallback = new GLFWWindowSizeCallback() { public void invoke(long window, int w, int h) { width = w; height = h; isResized = true; } }; GLFW.glfwSetKeyCallback(window, input.getKeyboardCallback()); GLFW.glfwSetCursorPosCallback(window, input.getMouseMoveCallback()); GLFW.glfwSetMouseButtonCallback(window, input.getMouseButtonsCallback()); GLFW.glfwSetScrollCallback(window, input.getMouseScrollCallback()); GLFW.glfwSetWindowSizeCallback(window, sizeCallback); }
Example 3
Source File: GLFWContextCreator.java From settlers-remake with MIT License | 5 votes |
private void registerCallbacks() { GLFW.glfwSetKeyCallback(glfw_wnd, key_callback); GLFW.glfwSetMouseButtonCallback(glfw_wnd, mouse_callback); GLFW.glfwSetScrollCallback(glfw_wnd, scroll_callback); GLFW.glfwSetCursorEnterCallback(glfw_wnd, cursorenter_callback); GLFW.glfwSetCursorPosCallback(glfw_wnd, cursorpos_callback); GLFW.glfwSetWindowSizeCallback(glfw_wnd, size_callback); }
Example 4
Source File: Lwjgl3Mini2DxInput.java From mini2Dx with Apache License 2.0 | 5 votes |
public void windowHandleChanged(long windowHandle) { resetPollingStates(); GLFW.glfwSetKeyCallback(window.getWindowHandle(), keyCallback); GLFW.glfwSetCharCallback(window.getWindowHandle(), charCallback); GLFW.glfwSetScrollCallback(window.getWindowHandle(), scrollCallback); GLFW.glfwSetCursorPosCallback(window.getWindowHandle(), cursorPosCallback); GLFW.glfwSetMouseButtonCallback(window.getWindowHandle(), mouseButtonCallback); }