mirror of
https://github.com/Noratrieb/game-wip-dontplay.git
synced 2026-01-16 12:25:02 +01:00
Add basic lighting
This commit is contained in:
parent
45acd4c1ac
commit
d1df7cd472
4 changed files with 58 additions and 17 deletions
11
src/res.rs
11
src/res.rs
|
|
@ -1,9 +1,14 @@
|
|||
use sfml::{audio::Music, graphics::Texture, SfBox};
|
||||
use sfml::{
|
||||
audio::Music,
|
||||
graphics::{Shader, ShaderType, Texture},
|
||||
SfBox,
|
||||
};
|
||||
|
||||
pub struct Res {
|
||||
pub tile_atlas: SfBox<Texture>,
|
||||
pub surf_music: Music<'static>,
|
||||
pub und_music: Music<'static>,
|
||||
pub lighting_shader: Shader<'static>,
|
||||
}
|
||||
|
||||
impl Res {
|
||||
|
|
@ -12,6 +17,10 @@ impl Res {
|
|||
tile_atlas: Texture::from_file("res/tiles.png")?,
|
||||
surf_music: Music::from_file("res/music.ogg").unwrap(),
|
||||
und_music: Music::from_file("res/cave2.ogg").unwrap(),
|
||||
lighting_shader: Shader::from_memory(
|
||||
include_str!("../shaders/lighting.glsl"),
|
||||
ShaderType::Fragment,
|
||||
)?,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue