mirror of
https://github.com/MadeOfJelly/MushMachine.git
synced 2024-12-04 19:23:28 +01:00
allow changing particle buffer size
This commit is contained in:
parent
5cc6aa8c74
commit
5023a658e7
@ -304,6 +304,12 @@ void LiteParticles2D::render(Services::OpenGLRenderer& rs, Engine& engine) {
|
||||
renderParticles(rs, scene);
|
||||
}
|
||||
|
||||
void LiteParticles2D::setParticleBufferSize(uint32_t new_buffer_size) {
|
||||
_particle_buffer_size = new_buffer_size;
|
||||
|
||||
resetBuffers();
|
||||
}
|
||||
|
||||
void LiteParticles2D::resetBuffers(void) {
|
||||
const auto gl_buffer_type = GL_DYNAMIC_COPY;
|
||||
auto reset_buffer_0 = [this](size_t i) {
|
||||
|
@ -47,10 +47,8 @@ namespace MM::OpenGL::RenderTasks {
|
||||
float _time {0};
|
||||
|
||||
public:
|
||||
//glm::vec3 env_vec{0, 1, 0};
|
||||
//float env_force{0.3};
|
||||
//float noise_force{0.5};
|
||||
//float dampening{0.99};
|
||||
// TODO: impl some environment controlled force
|
||||
//glm::vec2 env_vec{0, 1};
|
||||
|
||||
LiteParticles2D(Engine& engine);
|
||||
~LiteParticles2D(void);
|
||||
@ -62,6 +60,7 @@ namespace MM::OpenGL::RenderTasks {
|
||||
void renderParticles(Services::OpenGLRenderer& rs, Scene& scene);
|
||||
void render(Services::OpenGLRenderer& rs, Engine& engine) override;
|
||||
|
||||
void setParticleBufferSize(uint32_t new_buffer_size = 10'000);
|
||||
void resetBuffers(void);
|
||||
void resetTypeBuffers(void);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user