diff options
Diffstat (limited to 'src/common/client/assets.rs')
| -rw-r--r-- | src/common/client/assets.rs | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/common/client/assets.rs b/src/common/client/assets.rs new file mode 100644 index 0000000..742f9ea --- /dev/null +++ b/src/common/client/assets.rs @@ -0,0 +1,23 @@ +use teleia::*; + +pub struct Assets { + pub font: font::Bitmap, + pub shader_flat: shader::Shader, + pub mesh_square: mesh::Mesh, + pub texture_test: texture::Texture, +} + +impl Assets { + pub fn new(ctx: &context::Context) -> Self { + Self { + font: font::Bitmap::new(ctx), + shader_flat: shader::Shader::new( + ctx, + include_str!("assets/shaders/flat/vert.glsl"), + include_str!("assets/shaders/flat/frag.glsl"), + ), + mesh_square: mesh::Mesh::from_obj(ctx, include_bytes!("assets/meshes/square.obj")), + texture_test: texture::Texture::new(ctx, include_bytes!("assets/textures/test.png")), + } + } +} |
