summaryrefslogtreecommitdiff
path: root/crates/renderer/src/assets.rs
blob: 4eb681a16f9c5f6e8e05d9141320e4475771ebda (plain)
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
use teleia::*;

pub struct Assets {
    pub font: font::Bitmap,
    pub shader_flat: shader::Shader,
    pub shader_flat_noflip: shader::Shader,
    pub shader_acs: shader::Shader,
    pub shader_scene: shader::Shader,
    pub shader_color: shader::Shader,
    pub shader_tcg: shader::Shader,
    pub shader_tcg_screen: shader::Shader,
    pub shader_tcg_base: shader::Shader,
    pub shader_tcg_effect: shader::Shader,
    pub texture_adblock: texture::Texture,
    pub texture_mod: texture::Texture,
    pub texture_operatop: texture::Texture,
    pub texture_operabottom: texture::Texture,
    pub texture_clippyborder: texture::Texture,
}

impl Assets {
    pub fn new(ctx: &context::Context) -> Self {
        Self {
            font: font::Bitmap::default(ctx),
            shader_flat: shader::Shader::new(
                ctx,
                include_str!("assets/shaders/flat/vert.glsl"),
                include_str!("assets/shaders/flat/frag.glsl"),
            ),
            shader_flat_noflip: shader::Shader::new(
                ctx,
                include_str!("assets/shaders/flat_noflip/vert.glsl"),
                include_str!("assets/shaders/flat_noflip/frag.glsl"),
            ),
            shader_acs: shader::Shader::new(
                ctx,
                include_str!("assets/shaders/acs/vert.glsl"),
                include_str!("assets/shaders/acs/frag.glsl"),
            ),
            shader_scene: shader::Shader::new(
                ctx,
                include_str!("assets/shaders/scene/vert.glsl"),
                include_str!("assets/shaders/scene/frag.glsl")
            ),
            shader_color: shader::Shader::new(
                ctx,
                include_str!("assets/shaders/color/vert.glsl"),
                include_str!("assets/shaders/color/frag.glsl")
            ),
            shader_tcg: shader::Shader::new(
                ctx,
                include_str!("assets/shaders/tcg/vert.glsl"),
                include_str!("assets/shaders/tcg/frag.glsl")
            ),
            shader_tcg_screen: shader::Shader::new(
                ctx,
                include_str!("assets/shaders/tcg_screen/vert.glsl"),
                include_str!("assets/shaders/tcg_screen/frag.glsl")
            ),
            shader_tcg_base: shader::Shader::new(
                ctx,
                include_str!("assets/shaders/tcg_base/vert.glsl"),
                include_str!("assets/shaders/tcg_base/frag.glsl")
            ),
            shader_tcg_effect: shader::Shader::new(
                ctx,
                include_str!("assets/shaders/tcg_effect/vert.glsl"),
                include_str!("assets/shaders/tcg_effect/frag.glsl")
            ),
            texture_adblock: texture::Texture::new(ctx, include_bytes!("assets/textures/adblock.png")),
            texture_mod: texture::Texture::new(ctx, include_bytes!("assets/textures/mod.png")),
            texture_operatop: texture::Texture::new(ctx, include_bytes!("assets/textures/operatop.png")),
            texture_operabottom: texture::Texture::new(ctx, include_bytes!("assets/textures/operabottom.png")),
            texture_clippyborder: texture::Texture::new(ctx, include_bytes!("assets/textures/clippyborder.png")),
        }
    }
}