OpenGL ES SDK for Android ARM Developer Center
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
app.cpp File Reference
#include "app.h"
#include "timer.h"
#include "shader.h"
#include "primitives.h"
#include "noise.h"
#include "sort.h"
#include <math.h>

Go to the source code of this file.

Functions

bool load_app ()
 
void free_app ()
 
void init_shadowmap (int width, int height)
 
void init_particles ()
 
void init_app (int width, int height)
 
void sort_particles ()
 
void update_particles ()
 
void update_shadow_map ()
 
void update_app (float dt)
 
void render_geometry ()
 
void render_particles ()
 
void render_app (float dt)
 
void on_pointer_down (float x, float y)
 
void on_pointer_up (float x, float y)
 

Variables

const float TIMESTEP = 0.005f
 
const uint32 NUM_PARTICLES = NUM_KEYS
 
Shader shader_plane
 
Shader shader_sphere
 
Shader shader_update
 
Shader shader_spawn
 
Shader shader_draw_particle
 
Shader shader_shadow_map
 
Mesh quad
 
Mesh plane
 
Mesh sphere
 
mat4 mat_projection
 
mat4 mat_projection_light
 
mat4 mat_view
 
mat4 mat_view_light
 
vec2 camera_angle
 
vec2 camera_angle_vel
 
vec2 last_tap
 
vec3 light_pos
 
vec3 light_color
 
vec3 light_ambient
 
vec3 smoke_color
 
vec3 smoke_shadow
 
vec3 emitter_pos
 
vec3 sphere_pos
 
vec3 sphere_pos_target
 
vec3 sort_axis
 
float particle_lifetime
 
bool front_to_back
 
bool dragging
 
GLuint buffer_position
 
GLuint buffer_spawn
 
GLuint shadow_map_tex
 
GLuint shadow_map_fbo
 
int window_width
 
int window_height
 
int shadow_map_width
 
int shadow_map_height
 
Shader shader_count
 
int pass = 0
 

Function Documentation

void free_app ( )

Definition at line 113 of file app.cpp.

void init_app ( int  width,
int  height 
)

Definition at line 176 of file app.cpp.

void init_particles ( )

Definition at line 155 of file app.cpp.

void init_shadowmap ( int  width,
int  height 
)

Definition at line 135 of file app.cpp.

bool load_app ( )

Definition at line 88 of file app.cpp.

void on_pointer_down ( float  x,
float  y 
)

Definition at line 376 of file app.cpp.

void on_pointer_up ( float  x,
float  y 
)

Definition at line 412 of file app.cpp.

void render_app ( float  dt)

Definition at line 358 of file app.cpp.

void render_geometry ( )

Definition at line 307 of file app.cpp.

void render_particles ( )

Definition at line 337 of file app.cpp.

void sort_particles ( )

Definition at line 217 of file app.cpp.

void update_app ( float  dt)

Definition at line 283 of file app.cpp.

void update_particles ( )

Definition at line 232 of file app.cpp.

void update_shadow_map ( )

Definition at line 259 of file app.cpp.

Variable Documentation

GLuint buffer_position

Definition at line 74 of file app.cpp.

GLuint buffer_spawn

Definition at line 74 of file app.cpp.

vec2 camera_angle

Definition at line 51 of file app.cpp.

vec2 camera_angle_vel

Definition at line 51 of file app.cpp.

bool dragging

Definition at line 70 of file app.cpp.

vec3 emitter_pos

Definition at line 56 of file app.cpp.

bool front_to_back

Definition at line 70 of file app.cpp.

vec2 last_tap

Definition at line 51 of file app.cpp.

vec3 light_ambient

Definition at line 56 of file app.cpp.

vec3 light_color

Definition at line 56 of file app.cpp.

vec3 light_pos

Definition at line 56 of file app.cpp.

mat4 mat_projection

Definition at line 45 of file app.cpp.

mat4 mat_projection_light

Definition at line 45 of file app.cpp.

mat4 mat_view

Definition at line 45 of file app.cpp.

mat4 mat_view_light

Definition at line 45 of file app.cpp.

const uint32 NUM_PARTICLES = NUM_KEYS

Definition at line 29 of file app.cpp.

float particle_lifetime

Definition at line 67 of file app.cpp.

int pass = 0

Definition at line 216 of file app.cpp.

Mesh plane

Definition at line 40 of file app.cpp.

Mesh quad

Definition at line 40 of file app.cpp.

Shader shader_count

Definition at line 86 of file app.cpp.

Shader shader_draw_particle

Definition at line 32 of file app.cpp.

Shader shader_plane

Definition at line 32 of file app.cpp.

Shader shader_shadow_map

Definition at line 32 of file app.cpp.

Shader shader_spawn

Definition at line 32 of file app.cpp.

Shader shader_sphere

Definition at line 32 of file app.cpp.

Shader shader_update

Definition at line 32 of file app.cpp.

GLuint shadow_map_fbo

Definition at line 74 of file app.cpp.

int shadow_map_height

Definition at line 80 of file app.cpp.

GLuint shadow_map_tex

Definition at line 74 of file app.cpp.

int shadow_map_width

Definition at line 80 of file app.cpp.

vec3 smoke_color

Definition at line 56 of file app.cpp.

vec3 smoke_shadow

Definition at line 56 of file app.cpp.

vec3 sort_axis

Definition at line 56 of file app.cpp.

Mesh sphere

Definition at line 40 of file app.cpp.

vec3 sphere_pos

Definition at line 56 of file app.cpp.

vec3 sphere_pos_target

Definition at line 56 of file app.cpp.

const float TIMESTEP = 0.005f

Definition at line 28 of file app.cpp.

int window_height

Definition at line 80 of file app.cpp.

int window_width

Definition at line 80 of file app.cpp.