-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathmod.rs
More file actions
62 lines (54 loc) · 1.38 KB
/
mod.rs
File metadata and controls
62 lines (54 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/*!
# CodeVR Graphics
CodeVR is powered by a data driven renderer. Actors in the engine add graphics objects
to the RenderState, which generate vulkan data structures that can be mutated by actors.
The renderer then traverses the render state, and generates command buffers that are
sent to Vulkan's rendering queue.
An actor accesses the `gfx` state from their EngineState struct, and calls
methods that return shared pointers to the resource that they can mutate.
```
// Add a camera
let cam = gfx.camera(
CameraProps {
...
}
);
let img = gfx.image("texture.png");
let tex = gfx.texture(img);
let text = gfx.text("Hello World");
```
*/
mod camera;
mod mesh;
mod text;
use vulkano_win::{Window};
use std::sync::Arc;
use config::Config;
pub use self::camera::*;
/// Centralized Graphics Store
pub struct GraphicsState {
pub buffers: Vec<u32>,
pub buffer_views: Vec<u32>,
pub images: Vec<u32>,
pub textures: Vec<u32>,
pub shaders: Vec<u32>,
pub pipelines: Vec<u32>,
pub cameras: Vec<Arc<Camera>>,
pub nodes: Vec<u32>,
pub meshes: Vec<u32>,
}
impl GraphicsState {
pub fn new() -> GraphicsState {
GraphicsState {
buffers: Vec::new(),
buffer_views: Vec::new(),
images: Vec::new(),
textures: Vec::new(),
shaders: Vec::new(),
pipelines: Vec::new(),
cameras: Vec::new(),
nodes: Vec::new(),
meshes: Vec::new(),
}
}
}