Struct shadiertoy::Window [−][src]
pub struct Window { /* fields omitted */ }
A window that you can draw on.
Methods
impl Window
[src]
impl Window
pub fn new(events: &EventsLoop) -> Self
[src]
pub fn new(events: &EventsLoop) -> Self
Make a new window that runs on the given event loop.
pub fn shader<I>(&mut self, init: I, shader: &[u8]) -> Result<Shader<I::Meta>> where
I: PipelineInit,
[src]
pub fn shader<I>(&mut self, init: I, shader: &[u8]) -> Result<Shader<I::Meta>> where
I: PipelineInit,
Compile a shader.
pub fn draw<'a, D, F>(&'a mut self, shader: &Shader<D::Meta>, data: F) where
D: PipelineData<R>,
F: FnOnce(&'a RenderTargetView, &'a DepthStencilView) -> D,
[src]
pub fn draw<'a, D, F>(&'a mut self, shader: &Shader<D::Meta>, data: F) where
D: PipelineData<R>,
F: FnOnce(&'a RenderTargetView, &'a DepthStencilView) -> D,
Pass the given data to the shader and draw!
pub fn flush(&mut self)
[src]
pub fn flush(&mut self)
Finish the frame.
pub fn resize(&mut self)
[src]
pub fn resize(&mut self)
Handle a resize event, resizing the buffers appropriately.
pub fn texture(&mut self, image: RgbaImage) -> Texture
[src]
pub fn texture(&mut self, image: RgbaImage) -> Texture
Load a texture, which can then be passed to the shader.
The corresponding link type is TextureSampler
.
pub fn size(&self) -> Option<(u32, u32)>
[src]
pub fn size(&self) -> Option<(u32, u32)>
Get the size of this window, in pixels.
This is the resolution you should pass to your shaders. The function
returns None
if the window has already been closed.
pub fn window(&self) -> &Window
[src]
pub fn window(&self) -> &Window
Get the raw window handle for this window.
This might be useful for locking the mouse or resizing the window.
pub fn encoder(&mut self) -> &mut Encoder<R, CommandBuffer>
[src]
pub fn encoder(&mut self) -> &mut Encoder<R, CommandBuffer>
Get the encoder for this window.
You probably don't need this.
pub fn factory(&mut self) -> &mut GlFactory
[src]
pub fn factory(&mut self) -> &mut GlFactory
Get the factory for this window.
You probably don't need this.