Struct solstice::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)where F: FnMut(DebugSource, DebugType, u32, DebugSeverity, &str),

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 Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

const: unstable · source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

const: unstable · 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 Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
source§

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

§

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

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.