ActivityView.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. //
  2. // ActivityView.h
  3. // Wxl
  4. //
  5. // Created by wxl on 11-10-9.
  6. // Copyright 2011 hna. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. #import <OpenGLES/EAGL.h>
  10. #import <OpenGLES/ES1/gl.h>
  11. #import <OpenGLES/ES1/glext.h>
  12. #import <QuartzCore/QuartzCore.h>
  13. #import <OpenGLES/EAGLDrawable.h>
  14. /*
  15. 这里可以自定义的各种配置
  16. */
  17. #define sizeRate 2.0
  18. //大小
  19. #define mySize CGSizeMake(37* sizeRate, 37* sizeRate)
  20. //内半径
  21. #define INRADIUS 8.0* sizeRate
  22. //外半径
  23. #define OUTRADIUS 17.0* sizeRate
  24. //线宽
  25. #define LINEWIDTH 2.5
  26. //转动动画颜色 0.9 0.6 0.3
  27. #define BeginR 0.9
  28. #define BeginG 0.6
  29. #define BeginB 0.3
  30. //背景动画颜色 1.0 1.0 1.0
  31. #define EndR 0.9
  32. #define EndG 0.9
  33. #define EndB 0.9
  34. /*------------------------------------------------*/
  35. @interface ActivityView : UIView
  36. {
  37. @private
  38. // The pixel dimensions of the backbuffer
  39. GLint backingWidth;
  40. GLint backingHeight;
  41. EAGLContext *context;
  42. // OpenGL names for the renderbuffer and framebuffers used to render to this view
  43. GLuint viewRenderbuffer, viewFramebuffer;
  44. // OpenGL name for the depth buffer that is attached to viewFramebuffer, if it exists (0 if it does not exist)
  45. GLuint depthRenderbuffer;
  46. CADisplayLink * displayLink;
  47. NSInteger animationFrameInterval;
  48. GLfloat * allLineVertexs;
  49. GLfloat * allLineColors;
  50. BOOL isAnimationRunning;
  51. BOOL hidesWhenStopped;
  52. }
  53. @property BOOL hidesWhenStopped;
  54. -(void)startAnimating;
  55. -(void)stopAnimating;
  56. -(BOOL)isAnimating;
  57. @end