![]() |
Mali OpenGL ES SDK v2.4.4
Mali Developer Center
Use of the code snippets present within these pages are subject to these EULA terms
|
A sample which shows how to create and draw a particle system. More...
#include "ParticleSystem.h"#include "DiscEmitter.h"#include "Text.h"#include "Texture.h"#include "Shader.h"#include "Timer.h"#include "Matrix.h"#include <GLES2/gl2.h>#include <GLES2/gl2ext.h>#include "Platform.h"#include "EGLRuntime.h"#include <EGL/egl.h>Classes | |
| struct | UserData |
Macros | |
| #define | WINDOW_W 800 |
| #define | WINDOW_H 600 |
| #define | PARTICLE_DATA_SIZE 9 |
| #define | NUM_PARTICLES 2800 |
| #define | EMITTER_RADIUS 0.1f |
| #define | EMITTER_ANGLE 30.0f |
| #define | VELOCITY_FACTOR 0.5f |
| #define | LIFETIME_FACTOR 6.5f |
| #define | BASE_COLOUR_RED 0.5f |
| #define | BASE_COLOUR_GREEN 0.5f |
| #define | BASE_COLOUR_BLUE 0.7f |
| #define | GRAVITY_Z -0.06f |
| #define | TEXTURE_WIDTH 128 |
| #define | TEXTURE_HEIGHT 128 |
Functions | |
| void | initializeParticleDataArray () |
| void | updateParticleAge () |
| void | initialiseTextureFromRawGreyscaleAlphaFile (const string texturePath) |
| bool | setupGraphics (int width, int height) |
| void | renderFrame (void) |
| int | main (void) |
Variables | |
| string | resourceDirectory = "assets/" |
| string | vertexShaderFilename = "Particle_system.vert" |
| string | fragmentShaderFilename = "Particle_system.frag" |
| string | textureFilename = "smoke" |
| string | imageExtension = ".raw" |
| Text * | text |
| UserData * | userData = NULL |
A sample which shows how to create and draw a particle system.
Uses a shader to calculate particle trajectories, particle size and transparency.
| #define BASE_COLOUR_BLUE 0.7f |
| #define BASE_COLOUR_GREEN 0.5f |
| #define BASE_COLOUR_RED 0.5f |
| #define EMITTER_ANGLE 30.0f |
| #define EMITTER_RADIUS 0.1f |
| #define GRAVITY_Z -0.06f |
| #define LIFETIME_FACTOR 6.5f |
| #define NUM_PARTICLES 2800 |
| #define PARTICLE_DATA_SIZE 9 |
| #define TEXTURE_HEIGHT 128 |
| #define TEXTURE_WIDTH 128 |
| #define VELOCITY_FACTOR 0.5f |
| #define WINDOW_H 600 |
| #define WINDOW_W 800 |
| void initialiseTextureFromRawGreyscaleAlphaFile | ( | const string | texturePath | ) |
| void initializeParticleDataArray | ( | ) |
| int main | ( | void | ) |
| void renderFrame | ( | void | ) |
| void updateParticleAge | ( | ) |
| string fragmentShaderFilename = "Particle_system.frag" |
| string imageExtension = ".raw" |
| string resourceDirectory = "assets/" |
| Text* text |
| string textureFilename = "smoke" |
| UserData* userData = NULL |
| string vertexShaderFilename = "Particle_system.vert" |