pub struct GLSLBackend {
pub version: GLSLVersion,
}Expand description
Code generation backend that emits GLSL source text.
Fields§
§version: GLSLVersionTarget GLSL version.
Implementations§
Source§impl GLSLBackend
impl GLSLBackend
Sourcepub fn new(version: GLSLVersion) -> Self
pub fn new(version: GLSLVersion) -> Self
Create a new backend targeting the specified GLSL version.
Sourcepub fn emit_shader(&self, shader: &GLSLShader) -> String
pub fn emit_shader(&self, shader: &GLSLShader) -> String
Emit a complete GLSL shader as a source string.
Sourcepub fn vertex_shader_template(&self) -> String
pub fn vertex_shader_template(&self) -> String
Build a minimal vertex shader template that passes a position through.
Sourcepub fn fragment_shader_template(&self) -> String
pub fn fragment_shader_template(&self) -> String
Build a minimal fragment (pixel) shader template that samples a texture.
Sourcepub fn phong_vertex_template(&self) -> String
pub fn phong_vertex_template(&self) -> String
Build a Phong lighting vertex shader template.
Sourcepub fn phong_fragment_template(&self) -> String
pub fn phong_fragment_template(&self) -> String
Build a Phong lighting fragment shader template.
Auto Trait Implementations§
impl Freeze for GLSLBackend
impl RefUnwindSafe for GLSLBackend
impl Send for GLSLBackend
impl Sync for GLSLBackend
impl Unpin for GLSLBackend
impl UnsafeUnpin for GLSLBackend
impl UnwindSafe for GLSLBackend
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more