| 6 | extern float scale_factor; |
| 7 | extern int width, height; |
| 8 | extern int y_offset_absolute; |
| 9 |
| 10 | typedef enum { |
| 11 | Default = 0, |
| 12 | EaseIn = 1, |
| 13 | EaseOut = 2, |
| 14 | EaseInEaseOut = 3, |
| 15 | Linear = 4, |
| 16 | Sin = 5, |
| 17 | EaseOutBounce, |
| 18 | TIMING_NUM |
| 19 | } timing_type; |
| 20 |
| 21 | typedef float vec2[2]; |
| 22 | typedef float vec4[4]; |
| 23 | typedef vec4 mat4x4[4]; |
| 24 |
| 25 | typedef enum {NORMAL, NORMAL_ONE, RED, BLUE, LIGHT_RED, LIGHT_BLUE} texture_program_type; |
| 26 |
| 27 | typedef struct { |
| 28 | float x; |
| 29 | float y; |
| 30 | } CPoint; |
| 31 |
| 32 | typedef struct { |
| 33 | float width; |
| 34 | float height; |
| 35 | } CSize; |
| 36 |
| 37 | typedef struct { |
| 38 | float x; |
| 39 | float y; |
| 40 | float z; |
| 41 | } xyz; |
| 42 |
| 43 | typedef struct { |
| 44 | GLuint program; |
| 45 | GLuint a_position_location; |
| 46 | GLuint a_texture_coordinates_location; |
| 47 | GLint u_mvp_matrix_location; |
| 48 | GLint u_texture_unit_location; |
| 49 | GLint u_alpha_loaction; |
| 50 | } TextureProgram; |
| 51 |
| 52 | typedef struct { |
| 53 | GLuint program; |
| 54 | GLuint a_position_location; |
| 55 | GLint u_mvp_matrix_location; |
| 56 | GLint u_color_location; |
| 57 | GLint u_alpha_loaction; |
| 58 | } ColorProgram; |
| 59 |
| 60 | typedef struct { |
| 61 | float side_length; |
| 62 | float start_angle; |
| 63 | float end_angle; |
| 64 | float angle; |
| 65 | CSize size; |
| 66 | float radius; |
| 67 | float width; |
| 68 | } VarParams; |
| 69 |
| 70 | typedef struct { |
| 71 | GLsizeiptr datasize; |
| 72 | int round_count; |
| 73 | GLenum triangle_mode; |
| 74 | int is_star; |
| 75 | } ConstParams; |
| 76 |
| 77 | typedef struct { |
| 78 | xyz anchor; |
| 79 | xyz position; |
| 80 | float rotation; |
| 81 | xyz scale; |
| 82 | } LayerParams; |
| 83 |
| 84 | typedef struct { |
| 85 | xyz anchor; |
| 86 | xyz position; |
| 87 | float rotation; |
| 88 | xyz scale; |
| 89 | float alpha; |
| 90 | VarParams var_params; |
| 91 | ConstParams const_params; |
| 92 | LayerParams layer_params; |
| 93 | } Params; |
| 94 |
| 95 | typedef struct { |
| 96 | vec4 color; |
| 97 | CPoint *data; |
| 98 | GLuint buffer; |
| 99 | int num_points; |
| 100 |
| 101 | Params params; |
| 102 | } Shape; |
| 103 |
| 104 | typedef struct { |
| 105 | GLuint texture; |
| 106 | CPoint *data; |
| 107 | GLuint buffer; |
| 108 | int num_points; |
| 109 |
| 110 | Params params; |
| 111 | } TexturedShape; |
| 112 |
| 113 | #endif |
| 114 |