Verified Commit dfc16819 authored by insert's avatar insert

Fix multiwindow example.

parent 215a3d9e
#version 330 core
out vec4 FragColor;
out vec4 color;
void main() {
FragColor = vec4(1.0, 0.0, 0.0, 0.0);
color = vec4(1.0, 0.0, 0.0, 1.0);
}
......@@ -29,15 +29,21 @@ fn main() {
.vertex(vec![-0.5, 0.5, 0.0, 0.5, 0.5, 0.0, 0.0, -0.5, 0.0])
.create();
byol.run(move |event| match event {
byol.run(move |event, terminate| match event {
Event::Draw { window_id, .. } => {
if &window_id == win.id() {
win.clear();
shader.enable();
mesh.draw();
} else if &window_id == win2.id() {
win2.clear();
shader2.enable();
mesh2.draw();
}
}
Event::CloseRequested { .. } => {
terminate();
}
_ => {}
});
}
#version 330 core
layout (location = 0) in vec3 vPos;
uniform mat4 mvp;
void main() {
gl_Position = mvp * vec4(vPos, 1.0);
gl_Position = vec4(vPos, 1.0);
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment