axle OS
x86_32 UNIX-like hobby OS
animator.h
1 #ifndef ANIMATOR_H
2 #define ANIMATOR_H
3 
4 #include <gfx/lib/window.h>
5 #include <gfx/lib/gfx.h>
6 
7 typedef enum animation_type {
8  ALPHA_ANIM = 0,
9  POS_ANIM,
10  COLOR_ANIM,
11 } animation_type;
12 
13 typedef struct ca_animation ca_animation;
14 typedef void (*animation_update)(Window* window, ca_animation* anim, float frame_time);
15 typedef struct ca_animation {
16  animation_type type;
17 
18  float alpha_to;
19  Point pos_to;
20  Color color_to;
21 
22  animation_update update;
23  event_handler finished_handler;
24 
25  float duration;
26  uint32_t end_date;
27 } ca_animation;
28 
29 ca_animation* create_animation(animation_type type, void* to, float duration);
30 void add_animation(Window* window, ca_animation* anim);
31 void finalize_animation(Window* window, ca_animation* anim);
32 void process_animations(Window* window, float frame_time);
33 void update_all_animations(Screen* screen, float frame_time);
34 
35 #endif
Definition: color.h:7
Definition: animator.h:15
Definition: point.h:4
Definition: window.h:16
Definition: gfx.h:22