本文整理了Java中org.lwjgl.glfw.GLFWCursorPosCallback
类的一些代码示例,展示了GLFWCursorPosCallback
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。GLFWCursorPosCallback
类的具体详情如下:
包路径:org.lwjgl.glfw.GLFWCursorPosCallback
类名称:GLFWCursorPosCallback
[英]Instances of this class may be passed to the GLFW#glfwSetCursorPosCallback method.
void (*) (
GLFWwindow *window,
double xpos,
double ypos
)
[中]此类的实例可以传递给GLFW#glfwsetcursorpcallback方法。
####类型
void (*) (
GLFWwindow *window,
double xpos,
double ypos
)
代码示例来源:origin: libgdx/libgdx
@Override
public void dispose() {
keyCallback.free();
charCallback.free();
scrollCallback.free();
cursorPosCallback.free();
mouseButtonCallback.free();
}
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
@Override
public void destroy() {
if (!context.isRenderable()) {
return;
}
cursorPosCallback.close();
scrollCallback.close();
mouseButtonCallback.close();
currentCursor = null;
currentCursorDelays = null;
for (long[] glfwCursors : jmeToGlfwCursorMap.values()) {
for (long glfwCursor : glfwCursors) {
glfwDestroyCursor(glfwCursor);
}
}
jmeToGlfwCursorMap.clear();
logger.fine("Mouse destroyed.");
}
代码示例来源:origin: org.lwjgl.osgi/org.lwjgl.glfw
/** Like {@link #create(long) create}, but returns {@code null} if {@code functionPointer} is {@code NULL}. */
@Nullable
public static GLFWCursorPosCallback createSafe(long functionPointer) {
return functionPointer == NULL ? null : create(functionPointer);
}
代码示例来源:origin: org.jmonkeyengine/jme3-lwjgl3
@Override
public void callback(long args) {
super.callback(args);
}
});
代码示例来源:origin: org.lwjgl.osgi/org.lwjgl.glfw
/**
* Sets the cursor position callback of the specified window, which is called when the cursor is moved. The callback is provided with the position, in
* screen coordinates, relative to the upper-left corner of the client area of the window.
*
* <p>This function must only be called from the main thread.</p>
*
* @param window the window whose callback to set
* @param cbfun the new callback or {@code NULL} to remove the currently set callback
*
* @return the previously set callback, or {@code NULL} if no callback was set
*
* @since version 1.0
*/
@Nullable
@NativeType("GLFWcursorposfun")
public static GLFWCursorPosCallback glfwSetCursorPosCallback(@NativeType("GLFWwindow *") long window, @Nullable @NativeType("GLFWcursorposfun") GLFWCursorPosCallbackI cbfun) {
return GLFWCursorPosCallback.createSafe(nglfwSetCursorPosCallback(window, memAddressSafe(cbfun)));
}
代码示例来源:origin: FedUni/caliko
/** Destroy the window, finish up glfw and release all callback methods. */
public void cleanup()
{
glfwDestroyWindow(mWindowId);
glfwTerminate();
cursorPosCallback.release();
mouseButtonCallback.release();
windowSizeCallback.release();
keyCallback.release();
errorCallback.release();
}
代码示例来源:origin: sriharshachilakapati/SilenceEngine
cursorEnterCallback.invoke(registeredWindows.get(window), entered));
glfwCursorPosCallback = GLFWCursorPosCallback.create((win, xPos, yPos) ->
代码示例来源:origin: libgdx/libgdx
@Override
public void dispose() {
keyCallback.free();
charCallback.free();
scrollCallback.free();
cursorPosCallback.free();
mouseButtonCallback.free();
}
代码示例来源:origin: org.jmonkeyengine/jme3-lwjgl3
@Override
public void close() {
super.close();
}
代码示例来源:origin: FedUni/caliko
glfwSetCursorPosCallback(mWindowId, cursorPosCallback = GLFWCursorPosCallback.create( (long windowId, double mouseX, double mouseY) ->
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
@Override
public void destroy() {
if (!context.isRenderable()) {
return;
}
cursorPosCallback.free();
scrollCallback.free();
mouseButtonCallback.free();
for (long glfwCursor : jmeToGlfwCursorMap.values()) {
glfwDestroyCursor(glfwCursor);
}
logger.fine("Mouse destroyed.");
}
代码示例来源:origin: org.jmonkeyengine/jme3-lwjgl3
@Override
public void destroy() {
if (!context.isRenderable()) {
return;
}
cursorPosCallback.close();
scrollCallback.close();
mouseButtonCallback.close();
currentCursor = null;
currentCursorDelays = null;
for (long[] glfwCursors : jmeToGlfwCursorMap.values()) {
for (long glfwCursor : glfwCursors) {
glfwDestroyCursor(glfwCursor);
}
}
jmeToGlfwCursorMap.clear();
logger.fine("Mouse destroyed.");
}
代码示例来源:origin: com.badlogicgames.gdx/gdx-backend-lwjgl3
@Override
public void dispose() {
keyCallback.free();
charCallback.free();
scrollCallback.free();
cursorPosCallback.free();
mouseButtonCallback.free();
}
代码示例来源:origin: playn/playn
void shutdown() {
charCallback.close();
keyCallback.close();
mouseBtnCallback.close();
cursorPosCallback.close();
scrollCallback.close();
}
代码示例来源:origin: sriharshachilakapati/SilenceEngine
/**
* This method releases the native callbacks, preventing the occurrence of segmentation fault errors from the JNI
* code, which usually occurs due to the function address not being cleared from the native code. Releasing these
* callbacks erases the function address, so it can't be called again.
*/
private void releaseNativeCallbacks()
{
glfwCharCallback.free();
glfwCharModsCallback.free();
glfwCursorEnterCallback.free();
glfwCursorPosCallback.free();
glfwDropCallback.free();
glfwFramebufferSizeCallback.free();
glfwKeyCallback.free();
glfwMouseButtonCallback.free();
glfwScrollCallback.free();
glfwWindowCloseCallback.free();
glfwWindowFocusCallback.free();
glfwWindowIconifyCallback.free();
glfwWindowPosCallback.free();
glfwWindowRefreshCallback.free();
glfwWindowSizeCallback.free();
}
内容来源于网络,如有侵权,请联系作者删除!