summaryrefslogtreecommitdiff
path: root/src/common/client/assets.rs
blob: 742f9ea40cebc01c2dc8cdfbea7f5b0907900734 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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")),
        }
    }
}