Context

Struct Context 

Source
pub struct Context { /* private fields */ }

Implementations§

Source§

impl Context

Source

pub fn new(ctx: Context) -> Self

Source

pub fn enable(&mut self, feature: Feature)

Source

pub fn disable(&mut self, feature: Feature)

Source

pub fn new_debug_group(&self, message: &str) -> DebugGroup<'_>

Source

pub fn new_buffer( &mut self, size: usize, buffer_type: BufferType, usage: Usage, initial_data: Option<&[u8]>, ) -> Result<BufferKey, GraphicsError>

Source

pub fn destroy_buffer(&mut self, buffer: &Buffer)

Source

pub fn bind_buffer(&mut self, buffer_key: BufferKey, buffer_type: BufferType)

Source

pub fn buffer_static_draw(&self, buffer: &Buffer, data: &[u8], offset: usize)

Source

pub fn unmap_buffer(&mut self, map: &MappedBuffer)

Source

pub fn new_shader( &mut self, vertex_source: &str, fragment_source: &str, ) -> Result<ShaderKey, ShaderError>

Source

pub fn get_shader_attributes(&self, shader: ShaderKey) -> Vec<Attribute>

Source

pub fn get_shader_uniforms(&self, shader: ShaderKey) -> Vec<Uniform>

Source

pub fn destroy_shader(&mut self, shader: ShaderKey)

Source

pub fn use_shader<S: Shader + ?Sized>(&mut self, shader: Option<&S>)

Source

pub fn new_texture( &mut self, texture_type: TextureType, ) -> Result<TextureKey, GraphicsError>

Source

pub fn destroy_texture(&mut self, texture_key: TextureKey)

Source

pub fn bind_texture_to_unit( &mut self, texture_type: TextureType, texture_key: TextureKey, texture_unit: TextureUnit, )

Source

pub fn new_framebuffer(&mut self) -> Result<FramebufferKey, GraphicsError>

Source

pub fn destroy_framebuffer(&mut self, framebuffer_key: FramebufferKey)

Source

pub fn bind_framebuffer( &mut self, target: Target, framebuffer_key: Option<FramebufferKey>, )

Source

pub fn check_framebuffer_status(&self, target: Target) -> Status

Source

pub fn get_active_framebuffer(&self, target: Target) -> Option<FramebufferKey>

Source

pub fn framebuffer_texture( &mut self, target: Target, attachment: Attachment, texture_type: TextureType, texture_key: TextureKey, level: u32, )

Source

pub fn new_renderbuffer(&mut self) -> Result<RenderbufferKey, GraphicsError>

Source

pub fn bind_renderbuffer(&mut self, renderbuffer: Option<RenderbufferKey>)

Source

pub fn renderbuffer_storage( &mut self, format: PixelFormat, width: i32, height: i32, )

Source

pub fn framebuffer_renderbuffer( &mut self, attachment: Attachment, renderbuffer: Option<RenderbufferKey>, )

Source

pub fn destroy_renderbuffer(&mut self, renderbuffer_key: RenderbufferKey)

Source

pub fn set_vertex_attributes( &mut self, desired: u32, binding_info: &[Option<BindingInfo<'_>>], )

Source

pub fn set_uniform_by_location( &self, location: &UniformLocation, data: &RawUniformValue, )

Source

pub fn draw_arrays(&self, mode: DrawMode, first: i32, count: i32)

Source

pub fn draw_elements( &self, mode: DrawMode, count: i32, element_type: u32, offset: i32, )

Source

pub fn draw_arrays_instanced( &self, mode: DrawMode, first: i32, count: i32, instance_count: i32, )

Source

pub fn draw_elements_instanced( &self, mode: DrawMode, count: i32, element_type: u32, offset: i32, instance_count: i32, )

Source

pub fn set_viewport(&mut self, x: i32, y: i32, width: i32, height: i32)

Source

pub fn viewport(&self) -> Viewport<i32>

Source

pub fn set_scissor(&mut self, region: Option<Viewport<i32>>)

Source

pub fn clear_color(&self, red: f32, green: f32, blue: f32, alpha: f32)

Source

pub fn clear(&self)

Source

pub fn read_pixels( &self, x: i32, y: i32, width: i32, height: i32, format: PixelFormat, data: &mut [u8], )

Source

pub fn debug_message_callback<F>(&self, callback: F)

Trait Implementations§

Source§

impl Drop for Context

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl Renderer for Context

Source§

fn clear(&mut self, settings: ClearSettings<'_>)

Source§

fn draw<S, M>( &mut self, shader: &S, geometry: &Geometry<M>, settings: PipelineSettings<'_>, )
where S: Shader + ?Sized, M: Mesh,

Source§

impl TextureUpdate for Context

Source§

fn set_texture_sub_data( &mut self, texture_key: TextureKey, texture: TextureInfo, texture_type: TextureType, data: &[u8], x_offset: u32, y_offset: u32, )

Source§

fn set_texture_data( &mut self, texture_key: TextureKey, texture: TextureInfo, texture_type: TextureType, data: Option<&[u8]>, )

Source§

fn set_texture_wrap( &mut self, texture_key: TextureKey, texture_type: TextureType, wrap: Wrap, )

Source§

fn set_texture_filter( &mut self, texture_key: TextureKey, texture_type: TextureType, filter: Filter, )

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.