vrcamillo / Sparkles

A particle system library written in C++ and OpenGL.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Sparkles!

A particle system demo written in C++ and OpenGL.

API

The API is documented in include/sparkles.h.

Here's a sample code:

#include "sparkles.h"
using namespace Sparkles;

// Initialization code
Sparkles::initialize();

// Create a particle system.
int particle_count = 100;
ParticleSystem* particle_system = particle_system_create(particle_count);

// Simulation code
for (int i = 0; i < particle_system->count; i += 1) {
  Particle* particle = particle_system->particles[i];
  
  // Spawn and simulate particles as you wish.
}

// Render code
RenderState my_render_state = /*...*/;
Mesh* my_mesh = /*...*/;
particle_system_upload_and_render(particle_system, my_mesh, &my_render_state);

Showcase

Open the example folder and run build_win32.bat to build our particle showcase.

You will to run the script from a developer console with Microsoft Build Tools installed. Check this link for reference.

(Right now, we only support Windows).

In order to see the simulation code, take a look at examples\code\sandbox.cpp. That's where most of the magic happens.

Examples

The following samples are located under examples\samples.

License

This project is released under the MIT license. See LICENSE for more information.

About

A particle system library written in C++ and OpenGL.

License:MIT License


Languages

Language:C++ 98.9%Language:Batchfile 1.1%