#ifndef STARFIELD_H #define STARFIELD_H #include "LogoBox.h" #include "Mode.h" #include "GnomeScreensaver.h" #define NUM_STARS 500 #define MAX_STAR_DIST 1000 #define FLYBY_TICKS 3000 #define STAR_MAXX 500 #define STAR_MAXY 400 class Starfield : public Mode { public: Starfield(GnomeScreensaver & gs); ~Starfield(); bool expose (GnomeScreensaver & gs); bool configure (GnomeScreensaver & gs); bool update (GnomeScreensaver & gs); class Star { public: float axis[3]; uint64_t create_time; float x, y; float rot; }; protected: LogoBox m_logobox; uint64_t m_last_ticks; int m_star_idx; Star m_stars[NUM_STARS]; void getRandomAxis(float (*axis)[3]); void newStar(int idx, uint64_t ticks); }; #endif /* STARFIELD_H */