summaryrefslogtreecommitdiff
path: root/src/win.rs
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2022-12-18 12:07:30 -0500
committerpommicket <pommicket@gmail.com>2022-12-18 12:07:30 -0500
commit53446631bf579c85786af1b4c8fcd54566c0d391 (patch)
tree0ebd2905473b4ff04a9242707ed2a8eeb18795b9 /src/win.rs
parent7192da0f823b069c593b5f03e170a30d7f63b639 (diff)
switch framebuffer texture to grayscale
Diffstat (limited to 'src/win.rs')
-rw-r--r--src/win.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/win.rs b/src/win.rs
index 1622b82..146ba54 100644
--- a/src/win.rs
+++ b/src/win.rs
@@ -492,6 +492,23 @@ unsafe impl Color for ColorF32 {
const GL_TYPE: GLenum = gl::FLOAT;
}
+#[repr(C)]
+#[derive(Clone, Copy, Default)]
+pub struct ColorGrayscaleF32 {
+ pub value: f32
+}
+
+impl ColorGrayscaleF32 {
+ pub const fn new(value: f32) -> Self {
+ Self { value }
+ }
+}
+
+unsafe impl Color for ColorGrayscaleF32 {
+ const GL_FORMAT: GLenum = gl::RED;
+ const GL_TYPE: GLenum = gl::FLOAT;
+}
+
pub struct Shader {
id: GLuint,
/// shaders should not be sent across threads because of the drop function.