36 lines
767 B
C++
36 lines
767 B
C++
|
|
#ifndef STARFIELD_H
|
|
#define STARFIELD_H
|
|
|
|
#include "LogoBox.h"
|
|
#include "Mode.h"
|
|
#include "GnomeScreensaver.h"
|
|
|
|
#define NUM_STARS 1000
|
|
#define MAX_STAR_DIST 1000
|
|
|
|
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;
|
|
};
|
|
protected:
|
|
LogoBox m_logobox;
|
|
uint64_t m_last_ticks;
|
|
Star m_stars[NUM_STARS];
|
|
void getRandomAxis(float (*axis)[3]);
|
|
void newStar(int idx, uint64_t ticks);
|
|
};
|
|
|
|
#endif /* STARFIELD_H */
|
|
|