librashader/librashader-runtime-gl/src/framebuffer.rs

23 lines
573 B
Rust
Raw Normal View History

use librashader_common::{GetSize, Size};
2022-11-30 01:38:05 -05:00
2023-01-13 03:19:58 -05:00
/// A handle to an OpenGL texture with format and size information.
///
/// Generally for use as shader resource inputs.
2022-11-21 02:56:03 -05:00
#[derive(Default, Debug, Copy, Clone)]
2022-11-30 00:39:42 -05:00
pub struct GLImage {
2023-01-13 03:19:58 -05:00
/// A GLuint to the texture.
2024-02-05 18:39:01 -05:00
pub handle: Option<glow::Texture>,
2023-01-13 03:19:58 -05:00
/// The format of the texture.
2024-02-05 18:39:01 -05:00
pub format: u32,
2023-01-13 03:19:58 -05:00
/// The size of the texture.
2022-11-21 03:01:26 -05:00
pub size: Size<u32>,
2022-11-21 02:56:03 -05:00
}
impl GetSize<u32> for GLImage {
type Error = std::convert::Infallible;
fn size(&self) -> Result<Size<u32>, Self::Error> {
Ok(self.size)
}
}