In this recipe, we will learn how to apply a texture to all our particles using OpenGL point sprites and a GLSL Shader.
This method is optimized and allows for a large number of particles to be drawn at fast frame rates.
We will be using the particle system developed in the recipe Creating a particle system in 2D from Chapter 5, Building Particle Systems. So we will need to add the following files to your project:
Particle.h
ParticleSystem.h
We will also be loading an image to use as texture. The image's size must be a power of two, such as 256 x 256 or 512 x 512. Place the image inside the assets
folder and name it particle.png
.