|
|
@ -195,6 +195,7 @@ int main(void) |
|
|
|
int i; |
|
|
|
int i; |
|
|
|
GLFWwindow* window; |
|
|
|
GLFWwindow* window; |
|
|
|
GLFWcursor* star_cursors[CURSOR_FRAME_COUNT]; |
|
|
|
GLFWcursor* star_cursors[CURSOR_FRAME_COUNT]; |
|
|
|
|
|
|
|
GLFWcursor* current_frame = NULL; |
|
|
|
|
|
|
|
|
|
|
|
glfwSetErrorCallback(error_callback); |
|
|
|
glfwSetErrorCallback(error_callback); |
|
|
|
|
|
|
|
|
|
|
@ -279,11 +280,22 @@ int main(void) |
|
|
|
if (animate_cursor) |
|
|
|
if (animate_cursor) |
|
|
|
{ |
|
|
|
{ |
|
|
|
const int i = (int) (glfwGetTime() * 30.0) % CURSOR_FRAME_COUNT; |
|
|
|
const int i = (int) (glfwGetTime() * 30.0) % CURSOR_FRAME_COUNT; |
|
|
|
|
|
|
|
if (current_frame != star_cursors[i]) |
|
|
|
|
|
|
|
{ |
|
|
|
glfwSetCursor(window, star_cursors[i]); |
|
|
|
glfwSetCursor(window, star_cursors[i]); |
|
|
|
|
|
|
|
current_frame = star_cursors[i]; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
current_frame = NULL; |
|
|
|
|
|
|
|
|
|
|
|
if (wait_events) |
|
|
|
if (wait_events) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (animate_cursor) |
|
|
|
|
|
|
|
glfwWaitEventsTimeout(1.0 / 30.0); |
|
|
|
|
|
|
|
else |
|
|
|
glfwWaitEvents(); |
|
|
|
glfwWaitEvents(); |
|
|
|
|
|
|
|
} |
|
|
|
else |
|
|
|
else |
|
|
|
glfwPollEvents(); |
|
|
|
glfwPollEvents(); |
|
|
|
|
|
|
|
|
|
|
|