private static Window createWindow( int width, int height, String title, Monitor monitor, Window share) { setHints(); if (fullScreen) { if (monitor == null) monitor = Monitor.getPrimaryMonitor(); if (videoMode == null) videoMode = monitor.getVideoMode(); width = videoMode.getWidth(); height = videoMode.getHeight(); } Window window = new Window(width, height, title, monitor, share); window.makeCurrent(); setCallbacks(window); clearHints(); if (cursorHidden) window.setInputMode(GLFW_CURSOR, GLFW_CURSOR_HIDDEN); if (cursorGrabbed) window.setInputMode(GLFW_CURSOR, GLFW_CURSOR_DISABLED); if (!fullScreen) window.setPosition(posX, posY); if (cursor == null) defaultCursor = cursor = new Cursor(Cursor.Type.ARROW); window.setCursor(cursor); dirty = true; VertexArray.CURRENT = null; setVSync(vSync); return window; }
public static void grabCursor() { cursorHidden = cursorGrabbed = true; if (displayWindow == null) return; displayWindow.setInputMode(GLFW_CURSOR, GLFW_CURSOR_DISABLED); }
public static void showCursor() { cursorHidden = cursorGrabbed = false; if (displayWindow == null) return; displayWindow.setInputMode(GLFW_CURSOR, GLFW_CURSOR_NORMAL); }
public static void hideCursor() { cursorHidden = !(cursorGrabbed = false); if (displayWindow == null) return; displayWindow.setInputMode(GLFW_CURSOR, GLFW_CURSOR_HIDDEN); }