From: Alexis Laferrière Date: Mon, 1 Feb 2016 16:43:56 +0000 (-0500) Subject: lib/gamnit: intro static particles, the default most simple particle program X-Git-Url: http://nitlanguage.org lib/gamnit: intro static particles, the default most simple particle program Signed-off-by: Alexis Laferrière --- diff --git a/lib/gamnit/depth/depth.nit b/lib/gamnit/depth/depth.nit index b3cab23..9eed0e6 100644 --- a/lib/gamnit/depth/depth.nit +++ b/lib/gamnit/depth/depth.nit @@ -30,7 +30,7 @@ redef class App world_camera.near = 0.1 # Prepare programs - var programs = [versatile_program, normals_program, explosion_program, smoke_program: GamnitProgram] + var programs = [versatile_program, normals_program, explosion_program, smoke_program, static_program: GamnitProgram] for program in programs do program.compile_and_link var gamnit_error = program.error diff --git a/lib/gamnit/depth/particles.nit b/lib/gamnit/depth/particles.nit index e3be795..11b9aac 100644 --- a/lib/gamnit/depth/particles.nit +++ b/lib/gamnit/depth/particles.nit @@ -39,6 +39,9 @@ import depth_core redef class App + # Graphics program to display static non-moving particles + var static_program = new ParticleProgram + # Graphics program to display blowing up particles var explosion_program = new ExplosionProgram @@ -153,7 +156,7 @@ end # # This program should be subclassed to create custom particle effects. # Either `vertex_shader_source` and `vertex_shader_core` can be refined. -abstract class ParticleProgram +class ParticleProgram super GamnitProgramFromSource redef var vertex_shader_source = """