From 4860c458078f714df46e683944735645f9d73618 Mon Sep 17 00:00:00 2001 From: HampusM Date: Tue, 11 Aug 2026 12:30:58 +0200 Subject: feat(opengl-bindings): make more types derive Clone --- opengl-bindings/src/shader.rs | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'opengl-bindings/src/shader.rs') diff --git a/opengl-bindings/src/shader.rs b/opengl-bindings/src/shader.rs index 00fec58..511b00c 100644 --- a/opengl-bindings/src/shader.rs +++ b/opengl-bindings/src/shader.rs @@ -6,7 +6,7 @@ use safer_ffi::layout::ReprC; use crate::data_types::{Matrix, Vec3}; use crate::MaybeCurrentContextWithFns; -#[derive(Debug)] +#[derive(Debug, Clone)] pub struct Shader { shader: crate::sys::types::GLuint, @@ -128,7 +128,7 @@ pub enum Kind } /// Shader program -#[derive(Debug, PartialEq, Eq, Hash)] +#[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct Program { program: crate::sys::types::GLuint, @@ -144,11 +144,7 @@ impl Program Self { program } } - pub fn attach( - &self, - current_context: &MaybeCurrentContextWithFns, - shader: &Shader, - ) + pub fn attach(&self, current_context: &MaybeCurrentContextWithFns, shader: &Shader) { unsafe { current_context @@ -161,10 +157,8 @@ impl Program /// /// # Errors /// Returns `Err` if linking fails. - pub fn link( - &self, - current_context: &MaybeCurrentContextWithFns, - ) -> Result<(), Error> + pub fn link(&self, current_context: &MaybeCurrentContextWithFns) + -> Result<(), Error> { unsafe { current_context.fns().LinkProgram(self.program); @@ -358,7 +352,7 @@ impl UniformVariable for Matrix impl sealed::Sealed for Matrix {} -#[derive(Debug)] +#[derive(Debug, Clone)] pub struct UniformLocation(crate::sys::types::GLint); impl UniformLocation -- cgit v1.2.3-18-g5258