Struct Model3DOpenGL

Source
pub struct Model3DOpenGL {}

Implementations§

Source§

impl Model3DOpenGL

Source

pub fn new() -> Self

Create a program from a list of compiled shaders

Trait Implementations§

Source§

impl Debug for Model3DOpenGL

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Model3DOpenGL

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Gl for Model3DOpenGL

Source§

fn use_program(&self, program: Option<&Self::Program>)

Use the program

Source§

fn program_use_texture( &mut self, program: &<Self as Gl>::Program, texture_id: TextureId, gl_texture: &<Self as Gl>::Texture, )

Requires the program to be ‘used’

Source§

type Program = Program

Source§

type Buffer = Buffer

Source§

type Vao = Vao

Source§

type Texture = Texture

Source§

type PipelineDesc<'a> = PipelineDesc

Source§

fn create_pipeline<F: Fn(&str) -> Result<String, String>>( &mut self, read_src: &F, pipeline_desc: Box<Self::PipelineDesc<'_>>, ) -> Result<Self::Program, String>

Source§

fn init_buffer_of_indices( &mut self, buffer: &mut <Self as Gl>::Buffer, view: &BufferIndexAccessor<'_, Self>, )

Create the OpenGL ELEMENT_ARRAY_BUFFER buffer using STATIC_DRAW - this copies the data in to OpenGL
Source§

fn vao_create_from_indices( &mut self, indices: &IndexBuffer<Self>, ) -> Result<Vao, ()>

Create a VAO, add the indices as its element array buffer, and leave it bound
Source§

fn buffer_bind_to_vao_attr( &mut self, buffer: &<Self as Gl>::Buffer, attr_id: &<Program as GlProgram>::GlAttrId, count: u32, ele_type: BufferElementType, byte_offset: u32, stride: u32, )

With the currently bound VAO add this view of the specified buffer as an attribute of the program, if the program has that attribute
Source§

fn program_set_uniform_mat4( &mut self, program: &Program, id: UniformId, mat4: &Mat4, )

Source§

fn program_set_uniform_floats_4( &mut self, program: &Self::Program, id: UniformId, floats: &[f32], )

Source§

fn program_bind_uniform_index( &mut self, program: &<Self as Gl>::Program, uniform_buffer_id: usize, gl_uindex: u32, ) -> Result<(), ()>

Source§

fn draw_primitive(&mut self, vaos: &[Vao], primitive: &Primitive)

Draw the specified primitive using its VAO index into the vaos slice
Source§

fn bind_vao(&mut self, vao: Option<&Self::Vao>)

Source§

fn uniform_buffer_create<F: Sized>( &mut self, data: &[F], is_dynamic: bool, ) -> Result<UniformBuffer<Self>, ()>

Create a uniform buffer (a GlBuffer in the GPU bound to GlUniformBuffer) Read more
Source§

fn uniform_buffer_update_data<F: Debug>( &mut self, uniform_buffer: &UniformBuffer<Self>, data: &[F], byte_offset: u32, )

Update (a portion) of a uniform GlBuffer
Source§

fn uniform_index_of_range( &mut self, uniform_buffer: &UniformBuffer<Self>, gl_uindex: u32, byte_offset: usize, byte_length: usize, )

Set the GPU’s UniformBlockMatrix index N to a range of a UniformBuffer
Source§

impl Renderable for Model3DOpenGL

Source§

fn init_buffer_desc_client( &mut self, _client: &mut Self::Descriptor, _buffer_desc: &BufferDescriptor<'_, Self>, )

Initialize a buffer descriptor client - it will have been created using default()

Source§

fn init_buffer_data_client( &mut self, client: &mut Self::Buffer, buffer_data: &BufferData<'_, Self>, )

Initialize a BufferData client

This may be called multiple times for the same [BufferData]; if the gl buffer is 0 then create, else it already exists with the same data

Source§

fn init_index_accessor_client( &mut self, client: &mut Self::IndexAccessor, buffer_view: &BufferIndexAccessor<'_, Self>, )

Initialize an accessor of indices

Source§

fn init_data_accessor_client( &mut self, client: &mut Self::DataAccessor, buffer_data_accessor: &BufferDataAccessor<'_, Self>, )

Initialize the client side of a BufferDataAccessor (for a particular vertex attr)

Source§

type Buffer = Buffer

The renderer’s type that reflects a BufferData Read more
Source§

type IndexAccessor = BufferView<Model3DOpenGL>

The renderer’s type that reflects a BufferIndexAccessor Read more
Source§

type DataAccessor = BufferView<Model3DOpenGL>

The renderer’s type that reflects a BufferDataAccessor Read more
Source§

type Texture = Texture

The renderer’s type that represents a texture; this is supplied to material creation, and hence is less a product of the renderer and more an input to the 3D model library
Source§

type Material = Material

The renderer’s type that reflects a Material; this is expected to be an extraction of the aspects of a material that the renderer pipelines can apply.
Source§

type Vertices = Vertices<Model3DOpenGL>

The renderer’s type that reflects a [BufferAccessor] of indices and the associated [BufferAccessor]s of attributes supported by a particular pipeline within the renderer
Source§

type Descriptor = Descriptor

The renderer’s type that reflects a BufferDescriptor Read more
Source§

fn create_vertices_client( &mut self, vertices: &Vertices<'_, Self>, ) -> Self::Vertices

Create a client
Source§

fn create_texture_client( &mut self, texture: &Texture<'_, Self>, ) -> Self::Texture

Create a client
Source§

fn create_material_client<M>( &mut self, object: &Object<'_, M, Self>, material: &M, ) -> Material
where M: Material,

Create a client
Source§

fn init_material_client<M: Material>( &mut self, _client: &mut Self::Material, _material: &M, )

Create a client for a reason - reason 0 is reserved Can we lose this?

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.