IntroRenderer.h 1.9 KB

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