Cursor animation support regardless of platform features

This commit is contained in:
Brian Matzon 2004-03-21 21:54:57 +00:00
parent c219f3f7a2
commit bb51e3dc23
12 changed files with 334 additions and 153 deletions

View file

@ -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) {
}
}
}
}