57 lines
1022 B
C++
57 lines
1022 B
C++
#ifndef STARS_H
|
|
#define STARS_H
|
|
|
|
#include <cstdint>
|
|
#include <num/num.h>
|
|
#include <vector>
|
|
#include <array>
|
|
|
|
|
|
class Star
|
|
{
|
|
public:
|
|
Star();
|
|
~Star();
|
|
//void Update( float dt );
|
|
void Update( libnum::num dt );
|
|
|
|
|
|
libnum::num x;
|
|
libnum::num y;
|
|
libnum::num sx;
|
|
libnum::num sy;
|
|
uint8_t size;
|
|
uint16_t color;
|
|
};
|
|
|
|
class Pixel
|
|
{
|
|
public:
|
|
int x, y, c;
|
|
Pixel( int _x, int _y, int _c)
|
|
{
|
|
x = _x;
|
|
y = _y;
|
|
c = _c;
|
|
};
|
|
~Pixel() {};
|
|
};
|
|
|
|
class Starfield
|
|
{
|
|
public:
|
|
// the Star collection
|
|
std::vector<Star*> MyStars;
|
|
// list of all pixels to be rendered by Azur pixel shader fragment by fragment
|
|
std::array<std::vector<Pixel*>,14> PixelListPerFragment;
|
|
|
|
Starfield( );
|
|
~Starfield( );
|
|
void Update( float dt );
|
|
void Render( void );
|
|
|
|
private:
|
|
void AddPixel( int x, int y, int c );
|
|
};
|
|
|
|
#endif //STARS_H
|