projects
/
mandelwow.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
wasm: Enable backtraces in browser console
[mandelwow.git]
/
mandelwow.rs
diff --git
a/mandelwow.rs
b/mandelwow.rs
index 41f7e5d8cabf569f25e401253ae96f1b87e5e50d..bbb36712b6e08c2295ee24e820f8053b7d919cdc 100644
(file)
--- a/
mandelwow.rs
+++ b/
mandelwow.rs
@@
-3,10
+3,9
@@
use cube::Cube;
use glium;
use glium::index::PrimitiveType;
use cube::Cube;
use glium;
use glium::index::PrimitiveType;
-use glium::
Surface
;
+use glium::
{Display, Program, Surface}
;
use support;
use support;
-
/*
fn mand(cx: f32, cy: f32) -> [f32; 3] {
let maxiter = 64;
/*
fn mand(cx: f32, cy: f32) -> [f32; 3] {
let maxiter = 64;
@@
-28,7
+27,7
@@
fn mand(cx: f32, cy: f32) -> [f32; 3] {
}
*/
}
*/
-pub fn program(display: &
glium::Display) -> glium::
Program {
+pub fn program(display: &
Display) ->
Program {
Program::from_source(
display,
include_str!("shaders/mandelwow.vert"),
Program::from_source(
display,
include_str!("shaders/mandelwow.vert"),
@@
-36,9
+35,9
@@
pub fn program(display: &glium::Display) -> glium::Program {
.unwrap()
}
.unwrap()
}
-fn mandel<U>(display: &
glium::
Display,
+fn mandel<U>(display: &Display,
frame: &mut glium::Frame,
frame: &mut glium::Frame,
- program: &
glium::
Program,
+ program: &Program,
uniforms: &U,
bounds: &Cube,
z: [f32; 2]) where U: glium::uniforms::Uniforms {
uniforms: &U,
bounds: &Cube,
z: [f32; 2]) where U: glium::uniforms::Uniforms {
@@
-104,9
+103,9
@@
fn mandel<U>(display: &glium::Display,
frame.draw(&vb, &indices, program, uniforms, ¶ms).unwrap();
}
frame.draw(&vb, &indices, program, uniforms, ¶ms).unwrap();
}
-pub fn draw(display: &
glium::
Display,
+pub fn draw(display: &Display,
mut frame: &mut glium::Frame,
mut frame: &mut glium::Frame,
- program: &
glium::
Program,
+ program: &Program,
model: [[f32; 4]; 4],
camera: &support::camera::CameraState,
bounds: &Cube,
model: [[f32; 4]; 4],
camera: &support::camera::CameraState,
bounds: &Cube,