jGL
Loading...
Searching...
No Matches
particles.h
Go to the documentation of this file.
1#ifndef PARTICLES
2#define PARTICLES
3
4#include <jGL/primitive.h>
5#include <jGL/texture.h>
6
7#include <memory>
8#include <vector>
9#include <cstdint>
10
11namespace jGL
12{
14 {
15
16 public:
17
19 {
21 };
22
23 Particles(size_t sizeHint)
24 : points(std::vector<TexturedParticle>(sizeHint))
25 {}
26
27 Particles(std::vector<TexturedParticle> p)
28 : points(p)
29 {}
30
31 virtual ~Particles() = default;
32
33 virtual void update(UpdateInfo info) = 0;
34
35 virtual void draw(glm::mat4 proj) = 0;
36
37 virtual void setTexture(std::shared_ptr<Texture>) = 0;
38
39 std::vector<TexturedParticle> & getParticles(){ return points; }
40
42
43 protected:
44
45 float baseLineScalePixels = 1.0f;
46
47 std::vector<TexturedParticle> points;
48 std::shared_ptr<Texture> texture;
49
50 uint32_t uploaded = 0;
51 uint32_t drawing = 0;
52
53 };
54}
55
56#endif /* PARTICLES */
Definition particles.h:14
Particles(size_t sizeHint)
Definition particles.h:23
float baseLineScalePixels
Definition particles.h:45
std::shared_ptr< Texture > texture
Definition particles.h:48
Particles(std::vector< TexturedParticle > p)
Definition particles.h:27
virtual void draw(glm::mat4 proj)=0
void setBaseLineScale(float s)
Definition particles.h:41
virtual void setTexture(std::shared_ptr< Texture >)=0
uint32_t drawing
Definition particles.h:51
virtual ~Particles()=default
uint32_t uploaded
Definition particles.h:50
virtual void update(UpdateInfo info)=0
std::vector< TexturedParticle > points
Definition particles.h:47
std::vector< TexturedParticle > & getParticles()
Definition particles.h:39
A drawable graphic.
Definition id.h:10
Definition particles.h:19
bool texCoord
Definition particles.h:20
bool colour
Definition particles.h:20
bool position
Definition particles.h:20
Particle with a texture, with a position, orientation, and scale, colour, and texture region.
Definition primitive.h:27