fn upload(output: &mut glium::buffer::WriteMapping<[Vertex]>, iteration: u32) {
    const SPACING: f32 = 1.0;
    const W: f32 = 1.0;
    const H: f32 = 1.0;

    const MARCH_PIXELS_X: u32 = 24;
    const MARCH_PIXELS_Y: u32 = 128;

    let offset_x = (iteration % MARCH_PIXELS_X) as f32 * W;
    let offset_y = ((iteration / MARCH_PIXELS_X) % MARCH_PIXELS_Y) as f32 * H;

    let mut address = 0;

    for y_pos in (0 .. PARTICLE_COUNT_Y) {
        let y = SPACING as f32 + y_pos as f32 * (SPACING + H);

        for x_pos in (0 .. PARTICLE_COUNT_X) {
            let x = SPACING as f32 + x_pos as f32 * (SPACING + W);

            output.set(address + 0,
                       Vertex { position: (x + offset_x + 0.0, y + offset_y + 0.0) });
            output.set(address + 1,
                       Vertex { position: (x + offset_x + W, y + offset_y + 0.0) });
            output.set(address + 2,
                       Vertex { position: (x + offset_x + 0.0, y + offset_y + H) });
            output.set(address + 3,
                       Vertex { position: (x + offset_x + W, y + offset_y + 0.0) });
            output.set(address + 4,
                       Vertex { position: (x + offset_x + 0.0, y + offset_y + H) });
            output.set(address + 5,
                       Vertex { position: (x + offset_x + W, y + offset_y + H) });

            address += 6;
        }
    }
}
/// Writes the vertex data to the mapping.
Writes the vertex data to the mapping.
Writes the vertex data to the mapping .
fn upload(output: &mut glium::buffer::WriteMapping<[Vertex]>, iteration: u32) {
    const SPACING: f32 = 1.0;
    const W: f32 = 1.0;
    const H: f32 = 1.0;
    const MARCH_PIXELS_X: u32 = 24;
    const MARCH_PIXELS_Y: u32 = 128;
    let offset_x = (iteration % MARCH_PIXELS_X) as f32 * W;
    let offset_y = ((iteration / MARCH_PIXELS_X) % MARCH_PIXELS_Y) as f32 * H;
    let mut address = 0;
    for y_pos in (0 .. PARTICLE_COUNT_Y) {
        let y = SPACING as f32 + y_pos as f32 * (SPACING + H);
        for x_pos in (0 .. PARTICLE_COUNT_X) {
            let x = SPACING as f32 + x_pos as f32 * (SPACING + W);
            output.set(address + 0,
                       Vertex { position: (x + offset_x + 0.0, y + offset_y + 0.0) });
            output.set(address + 1,
                       Vertex { position: (x + offset_x + W, y + offset_y + 0.0) });
            output.set(address + 2,
                       Vertex { position: (x + offset_x + 0.0, y + offset_y + H) });
            output.set(address + 3,
                       Vertex { position: (x + offset_x + W, y + offset_y + 0.0) });
            output.set(address + 4,
                       Vertex { position: (x + offset_x + 0.0, y + offset_y + H) });
            output.set(address + 5,
                       Vertex { position: (x + offset_x + W, y + offset_y + H) });
            address += 6;
        }
    }
}
fn upload ( output : & mut glium :: buffer :: WriteMapping < [ Vertex ] > , iteration : u32 ) { const SPACING : f32 = 1.0 ; const W : f32 = 1.0 ; const H : f32 = 1.0 ; const MARCH_PIXELS_X : u32 = 24 ; const MARCH_PIXELS_Y : u32 = 128 ; let offset_x = ( iteration % MARCH_PIXELS_X ) as f32 * W ; let offset_y = ( ( iteration / MARCH_PIXELS_X ) % MARCH_PIXELS_Y ) as f32 * H ; let mut address = 0 ; for y_pos in ( 0 .. PARTICLE_COUNT_Y ) { let y = SPACING as f32 + y_pos as f32 * ( SPACING + H ) ; for x_pos in ( 0 .. PARTICLE_COUNT_X ) { let x = SPACING as f32 + x_pos as f32 * ( SPACING + W ) ; output . set ( address + 0 , Vertex { position : ( x + offset_x + 0.0 , y + offset_y + 0.0 ) } ) ; output . set ( address + 1 , Vertex { position : ( x + offset_x + W , y + offset_y + 0.0 ) } ) ; output . set ( address + 2 , Vertex { position : ( x + offset_x + 0.0 , y + offset_y + H ) } ) ; output . set ( address + 3 , Vertex { position : ( x + offset_x + W , y + offset_y + 0.0 ) } ) ; output . set ( address + 4 , Vertex { position : ( x + offset_x + 0.0 , y + offset_y + H ) } ) ; output . set ( address + 5 , Vertex { position : ( x + offset_x + W , y + offset_y + H ) } ) ; address += 6 ; } } }
Writes the vertex data to the mapping.
Writes the vertex data to the mapping .
output
&mut glium::buffer::WriteMapping<[Vertex]>
iteration
u32
output
&mut glium::buffer::WriteMapping<[Vertex]>
iteration
u32