Struct rin::gl::vao::simple_vao::Builder [−][src]
pub struct Builder<'a>(_, _);
Implementations
impl<'a> Builder<'a>
[src]
impl<'a> Builder<'a>
[src]pub fn from_format<T, I>(
&self,
format: Format<T, I>
) -> Result<SimpleVao<T>, Error> where
T: 'static,
I: Into<Option<Buffer<u32>>>,
[src]
&self,
format: Format<T, I>
) -> Result<SimpleVao<T>, Error> where
T: 'static,
I: Into<Option<Buffer<u32>>>,
Create a SimpleVao
using a SimpleFormat
#[macro_use] extern crate glin; use std::mem; use glin::VertexFormat; #[derive(VertexFormat)] struct Vertex{ position: [f32;3] } fn main() { let vao = gl.new_simple_vao().from_format(glin::simple_vao::Format{ buffer: buffer, attribute_formats: Vertex::attributes_formats(&program), indices: None, mode: glin::gl::TRIANGLES, }).unwrap(); }
pub fn empty<T>(
&self,
attribute_formats: Vec<Format, Global>,
mode: u32
) -> Result<SimpleVao<T>, Error> where
T: 'static,
[src]
&self,
attribute_formats: Vec<Format, Global>,
mode: u32
) -> Result<SimpleVao<T>, Error> where
T: 'static,
Create an emoty SimpleVao
from it’s attribute formats and a draw mode
pub fn empty_from_bindings<T>(
&self,
bindings: &dyn Bindings,
mode: u32
) -> Result<SimpleVao<T>, Error> where
T: 'static + VertexFormat,
[src]
&self,
bindings: &dyn Bindings,
mode: u32
) -> Result<SimpleVao<T>, Error> where
T: 'static + VertexFormat,
Create an empty SimpleVao
from a bindings source, usually a glsl program and a draw mode
pub fn from_data_bindings<'data, T, D>(
&self,
data: D,
bindings: &dyn Bindings,
usage: u32
) -> Result<SimpleVao<T>, Error> where
T: 'static + VertexFormat,
D: Into<Data<'data, T>>,
[src]
&self,
data: D,
bindings: &dyn Bindings,
usage: u32
) -> Result<SimpleVao<T>, Error> where
T: 'static + VertexFormat,
D: Into<Data<'data, T>>,
Create a SimpleVao
from anything that implments Into and a usage mode
This is usually used with other libraries that provide Mesh types that implement Into and not directly
ⓘ
let mesh = ...; // mesh of type implementing Into<Data> let vao = glin::SimpleVao::from_data_bindings(mesh, &program, gl::STATIC_DRAW);
but it can be used directly as:
#[macro_use] extern crate glin; use std::mem; #[derive(VertexFormat)] struct Vertex{ position: [f32;4] } fn main() { let vertices: Vec<Vertex> = vec![]; let data = glin::simple_vao::Data{ vertices: &vertices, indices: &[], mode: glin::gl::TRIANGLES }; let vao = gl.new_simple_vao().from_data_bindings(data, &program, glin::gl::STATIC_DRAW); }
Auto Trait Implementations
impl<'a> !RefUnwindSafe for Builder<'a>
impl<'a> !Send for Builder<'a>
impl<'a> !Sync for Builder<'a>
impl<'a> Unpin for Builder<'a>
impl<'a> !UnwindSafe for Builder<'a>
Blanket Implementations
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
[src]
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
[src]pub fn to_subset(&self) -> Option<SS>
[src]
pub fn is_in_subset(&self) -> bool
[src]
pub fn to_subset_unchecked(&self) -> SS
[src]
pub fn from_subset(element: &SS) -> SP
[src]
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
[src]
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
[src]