mirror of
https://github.com/doukutsu-rs/doukutsu-rs
synced 2024-11-16 02:43:02 +00:00
40 lines
997 B
Rust
40 lines
997 B
Rust
use gfx::{self, *};
|
|
|
|
use crate::framework::context::Context;
|
|
use crate::framework::error::GameResult;
|
|
|
|
gfx_defines! {
|
|
constant WaterShaderParams {
|
|
resolution: [f32; 2] = "u_Resolution",
|
|
frame_pos: [f32; 2] = "u_FramePos",
|
|
t: f32 = "u_Tick",
|
|
}
|
|
}
|
|
|
|
pub struct Shaders {
|
|
//pub water_shader: Shader<WaterShaderParams>,
|
|
pub water_shader_params: WaterShaderParams,
|
|
}
|
|
|
|
impl Shaders {
|
|
pub fn new(ctx: &mut Context) -> GameResult<Shaders> {
|
|
let water_shader_params = WaterShaderParams {
|
|
t: 0.0,
|
|
resolution: [0.0, 0.0],
|
|
frame_pos: [0.0, 0.0],
|
|
};
|
|
|
|
Ok(Shaders {
|
|
/*water_shader: Shader::new(
|
|
ctx,
|
|
"/builtin/shaders/basic_es300.vert.glsl",
|
|
"/builtin/shaders/water_es300.frag.glsl",
|
|
water_shader_params,
|
|
"WaterShaderParams",
|
|
None,
|
|
)?,*/
|
|
water_shader_params,
|
|
})
|
|
}
|
|
}
|