gdritter repos chenoska / 82d7182
Make printing less noisy and also fix UV Getty Ritter 6 years ago
1 changed file(s) with 7 addition(s) and 8 deletion(s). Collapse all Expand all
1414 use graphics::vertices::V2D;
1515
1616 static TILE_DATA: [V2D; 4] = [
17 V2D { x: 0.5, y: -0.5, u: 1.0, v: 0.0 },
18 V2D { x: -0.5, y: -0.5, u: 0.0, v: 0.0 },
19 V2D { x: 0.5, y: 0.5, u: 1.0, v: 1.0 },
20 V2D { x: -0.5, y: 0.5, u: 0.0, v: 1.0 },
17 V2D { x: 0.5, y: -0.5, u: 1.0, v: 1.0 },
18 V2D { x: -0.5, y: -0.5, u: 0.0, v: 1.0 },
19 V2D { x: 0.5, y: 0.5, u: 1.0, v: 0.0 },
20 V2D { x: -0.5, y: 0.5, u: 0.0, v: 0.0 },
2121 ];
2222
2323 // Shader sources
4343
4444 void main() {
4545 out_color = texture(tex, t_uv);
46 // out_color = vec4(1.0 - t_uv.x, 1.0 - t_uv.y, 1.0, 1.0);
4746 }";
4847
4948 pub fn main_loop() -> Result<(), pan::Error> {
5049 let mut f = std::fs::File::open("sample.png").unwrap();
5150 let texture: imagefmt::Image<u8> = imagefmt::png::read(&mut f, imagefmt::ColFmt::RGBA).unwrap();
52 println!("{:#?}", texture);
5351
5452 let window = pan::Window::create()?;
5553
8381 ..
8482 },
8583 ..
86 } => {
84 } if k.state == glutin::ElementState::Pressed => {
8785 match k.virtual_keycode {
8886 Some(VirtualKeyCode::Q) =>
8987 return ControlFlow::Break,
90 _ => println!("{:#?}", k),
88 Some(c) => println!("pressed {:#?}", c),
89 _ => (),
9190 }
9291 }
9392 _ => (),