equal
deleted
inserted
replaced
1 extern crate integral_geometry; |
1 extern crate integral_geometry; |
2 extern crate land2d; |
2 extern crate land2d; |
3 extern crate landgen; |
3 extern crate landgen; |
4 extern crate lfprng; |
4 extern crate lfprng; |
|
5 extern crate gfx; |
|
6 extern crate gfx_device_gl; |
5 |
7 |
6 mod world; |
8 mod world; |
7 mod engine_message; |
9 mod engine_message; |
8 mod command; |
10 mod command; |
9 |
11 |
10 #[repr(C)] |
12 #[repr(C)] |
11 pub struct EngineInstance { |
13 pub struct EngineInstance { |
12 world: world::World, |
14 world: world::World, |
|
15 } |
|
16 |
|
17 impl EngineInstance { |
|
18 pub fn new() -> Self { |
|
19 let world = world::World::new(); |
|
20 Self { world } |
|
21 } |
|
22 |
|
23 pub fn render<R, C>( |
|
24 &self, |
|
25 context: &mut gfx::Encoder<R, C>, |
|
26 target: &gfx::handle::RenderTargetView<R, gfx::format::Rgba8>) |
|
27 where R: gfx::Resources, |
|
28 C: gfx::CommandBuffer<R> |
|
29 { |
|
30 context.clear(target, [0.0, 0.5, 0.0, 1.0]); |
|
31 } |
13 } |
32 } |
14 |
33 |
15 #[repr(C)] |
34 #[repr(C)] |
16 #[derive(Copy, Clone)] |
35 #[derive(Copy, Clone)] |
17 pub struct PreviewInfo { |
36 pub struct PreviewInfo { |