[][src]Struct miniquad::graphics::Context

pub struct Context { /* fields omitted */ }

Implementations

impl Context[src]

pub fn new() -> Context[src]

pub fn screen_size(&self) -> (f32, f32)[src]

The current framebuffer size in pixels NOTE: High DPI Rendering

pub fn dpi_scale(&self) -> f32[src]

The dpi scaling factor (window pixels to framebuffer pixels) NOTE: High DPI Rendering

pub fn high_dpi(&self) -> bool[src]

True when high_dpi was requested and actually running in a high-dpi scenario NOTE: High DPI Rendering

pub fn apply_pipeline(&mut self, pipeline: &Pipeline)[src]

pub fn set_cull_face(&mut self, cull_face: CullFace)[src]

pub fn set_color_write(&mut self, color_write: (bool, bool, bool, bool))[src]

pub fn set_blend(
    &mut self,
    color_blend: Option<BlendState>,
    alpha_blend: Option<BlendState>
)
[src]

pub fn set_stencil(&mut self, stencil_test: Option<StencilState>)[src]

pub fn apply_viewport(&mut self, x: i32, y: i32, w: i32, h: i32)[src]

Set a new viewport rectangle. Should be applied after begin_pass.

pub fn apply_scissor_rect(&mut self, x: i32, y: i32, w: i32, h: i32)[src]

Set a new scissor rectangle. Should be applied after begin_pass.

pub fn apply_bindings(&mut self, bindings: &Bindings)[src]

pub fn apply_uniforms<U>(&mut self, uniforms: &U)[src]

pub fn clear(
    &self,
    color: Option<(f32, f32, f32, f32)>,
    depth: Option<f32>,
    stencil: Option<i32>
)
[src]

pub fn begin_default_pass(&mut self, action: PassAction)[src]

start rendering to the default frame buffer

pub fn begin_pass(
    &mut self,
    pass: impl Into<Option<RenderPass>>,
    action: PassAction
)
[src]

start rendering to an offscreen framebuffer

pub fn end_render_pass(&mut self)[src]

pub fn commit_frame(&mut self)[src]

pub fn draw(&self, base_element: i32, num_elements: i32, num_instances: i32)[src]

Draw elements using currently applied bindings and pipeline.

  • base_element specifies starting offset in index_buffer.
  • num_elements specifies length of the slice of index_buffer to draw.
  • num_instances specifies how many instances should be rendered.

impl Context[src]

pub fn quit(&self)[src]

This function simply quits the application without giving the user a chance to intervene. Usually this might be called when the user clicks the 'Ok' button in a 'Really Quit?' dialog box

pub fn request_quit(&self)[src]

Calling request_quit() will trigger "quit_requested_event" event , giving the user code a chance to intervene and cancel the pending quit process (for instance to show a 'Really Quit?' dialog box). If the event handler callback does nothing, the application will be quit as usual. To prevent this, call the function "cancel_quit()"" from inside the event handler.

pub fn cancel_quit(&self)[src]

Cancels a pending quit request, either initiated by the user clicking the window close button, or programmatically by calling "request_quit()". The only place where calling this function makes sense is from inside the event handler callback when the "quit_requested_event" event has been received

pub fn set_cursor_grab(&self, grab: bool)[src]

Capture mouse cursor to the current window On WASM this will automatically hide cursor On desktop this will bound cursor to windows border NOTICE: on desktop cursor will not be automatically released after window lost focus so set_cursor_grab(false) on window's focus lost is recommended. TODO: implement window focus events

pub fn show_mouse(&self, shown: bool)[src]

Show or hide the mouse cursor

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.