mirror of
https://github.com/shadowfacts/lwjgl2-arm64.git
synced 2026-04-06 23:14:19 +00:00
Cursor animation support regardless of platform features
This commit is contained in:
parent
c219f3f7a2
commit
bb51e3dc23
12 changed files with 334 additions and 153 deletions
|
|
@ -169,6 +169,7 @@ public class Mouse {
|
|||
currentCursor = cursor;
|
||||
if (currentCursor != null) {
|
||||
nSetNativeCursor(currentCursor.getHandle());
|
||||
currentCursor.setTimeout();
|
||||
} else {
|
||||
nSetNativeCursor(0);
|
||||
}
|
||||
|
|
@ -511,4 +512,18 @@ public class Mouse {
|
|||
public static boolean hasWheel() {
|
||||
return hasWheel;
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the cursor, so that animation can be changed if needed.
|
||||
* This method is called automatically by the window on its update.
|
||||
*/
|
||||
public static void updateCursor() {
|
||||
if(currentCursor != null && currentCursor.hasTimedOut()) {
|
||||
currentCursor.nextCursor();
|
||||
try {
|
||||
setNativeCursor(currentCursor);
|
||||
} catch (Exception e) {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue