1use miniquad::*;
2use quad_gl::*;
3
4struct Stage {
5 gl: QuadGl,
6}
7impl EventHandler for Stage {
8 fn update(&mut self, _ctx: &mut Context) {}
9
10 fn draw(&mut self, ctx: &mut Context) {
11 ctx.clear(Some((0., 1., 0., 1.)), None, None);
12
13 self.gl.geometry(
14 &[
15 Vertex::new(0., -0.5, 0., 0., 0., BLUE),
16 Vertex::new(0.5, 0.5, 0., 0., 0., RED),
17 Vertex::new(-0.5, 0.5, 0., 0., 0., GREEN),
18 ],
19 &[0, 1, 2],
20 );
21 self.gl.draw(ctx);
22 }
23}
24
25fn main() {
26 miniquad::start(conf::Conf::default(), |mut ctx| {
27 UserData::owning(
28 Stage {
29 gl: QuadGl::new(&mut ctx),
30 },
31 ctx,
32 )
33 });
34}