home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ocl_ani1.zip / ocl_ani1.hpp < prev    next >
Text File  |  1997-06-19  |  1KB  |  55 lines

  1. /* Stéphane Charette, scharett@vansel.alcatel.com
  2.  * IBM Open Class Library Animation Sample
  3.  * (using Visual Age C++ v3.0 with OS/2 v4.0)
  4.  * 1997June19
  5.  */
  6.  
  7. #ifndef OCL_ANIM_HPP
  8. #define OCL_ANIM_HPP
  9.  
  10. /* IBM Open Class Library include */
  11. #include <iapp.hpp>
  12. #include <icolor.hpp>
  13. #include <idrawcv.hpp>
  14. #include <ievent.hpp>
  15. #include <ievtdata.hpp>
  16. #include <iframe.hpp>
  17. #include <igbitmap.hpp>
  18. #include <iglist.hpp>
  19. #include <igrafctx.hpp>
  20. #include <ipoint.hpp>
  21. #include <irect.hpp>
  22. #include <itimer.hpp>
  23.  
  24. /* general OS/2 include */
  25. #define INCL_WINWINDOWMGR
  26. #include <os2.h>
  27. #include <math.h>                      // needed for cos(), sin()
  28.  
  29. /* local include */
  30. #include "ocl_ani1.h"
  31.  
  32. /* macros */
  33. #define convertDegToRad( degree ) (degree * 180.0 / 3.141592654)
  34.  
  35. /* forward decleration of classes */
  36. class Ball;
  37.  
  38.  
  39.  
  40. class Ball : public IGBitmap
  41. {
  42.    public:
  43.       double speed;                    // speed of the object
  44.       double angle;                    // angle of the object (in degrees)
  45.       double x;                        // X coordinate of object
  46.       double y;                        // Y coordinate of object
  47.       double dx;                       // delta X to add every timer count
  48.       double dy;                       // delta Y to add every timer count
  49.       Ball( USHORT rcid );             // constructor derived from IGBitmap
  50.       void calcNextMove( void );       // function to call every timer count
  51. };
  52.  
  53. #endif
  54.  
  55.