summaryrefslogtreecommitdiff
path: root/opengl-bindings/src/shader.rs
diff options
context:
space:
mode:
Diffstat (limited to 'opengl-bindings/src/shader.rs')
-rw-r--r--opengl-bindings/src/shader.rs18
1 files changed, 6 insertions, 12 deletions
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<f32, 4, 4>
impl sealed::Sealed for Matrix<f32, 4, 4> {}
-#[derive(Debug)]
+#[derive(Debug, Clone)]
pub struct UniformLocation(crate::sys::types::GLint);
impl UniformLocation