Struct luminance_glutin::GlutinSurface [−][src]
The Glutin surface.
You want to create such an object in order to use any luminance construct.
Fields
ctx: WindowedContext<PossiblyCurrent>
The windowed context.
Implementations
impl GlutinSurface
[src]
pub fn new_gl33_from_builders<'a, WB, CB>(
window_builder: WB,
ctx_builder: CB
) -> Result<(Self, EventLoop<()>), GlutinError> where
WB: FnOnce(&mut EventLoop<()>, WindowBuilder) -> WindowBuilder,
CB: FnOnce(&mut EventLoop<()>, ContextBuilder<'a, NotCurrent>) -> ContextBuilder<'a, NotCurrent>,
[src]
window_builder: WB,
ctx_builder: CB
) -> Result<(Self, EventLoop<()>), GlutinError> where
WB: FnOnce(&mut EventLoop<()>, WindowBuilder) -> WindowBuilder,
CB: FnOnce(&mut EventLoop<()>, ContextBuilder<'a, NotCurrent>) -> ContextBuilder<'a, NotCurrent>,
Create a new GlutinSurface
by consuming a [WindowBuilder
].
This is an alternative method to new_gl33
that is more flexible as you have access to the
whole glutin
types.
window_builder
is the default object when passed to your closure and ctx_builder
is
already initialized for the OpenGL context (you’re not supposed to change it!).
pub fn new_gl33(
window_builder: WindowBuilder,
samples: u16
) -> Result<(Self, EventLoop<()>), GlutinError>
[src]
window_builder: WindowBuilder,
samples: u16
) -> Result<(Self, EventLoop<()>), GlutinError>
Create a new GlutinSurface
from scratch.
pub fn size(&self) -> [u32; 2]
[src]
Get the underlying size (in physical pixels) of the surface.
This is equivalent to getting the inner size of the windowed context and converting it to a physical size by using the HiDPI factor of the windowed context.
pub fn back_buffer(
&mut self
) -> Result<Framebuffer<GL33, Dim2, (), ()>, FramebufferError>
[src]
&mut self
) -> Result<Framebuffer<GL33, Dim2, (), ()>, FramebufferError>
Get access to the back buffer.
pub fn swap_buffers(&mut self)
[src]
Swap the back and front buffers.
Trait Implementations
impl GraphicsContext for GlutinSurface
[src]
type Backend = GL33
Internal type used by the backend to cache, optimize and store data. This roughly represents the GPU data / context a backend implementation needs to work correctly. Read more
fn backend(&mut self) -> &mut Self::Backend
[src]
pub fn new_pipeline_gate(&mut self) -> PipelineGate<'_, Self::Backend>
[src]
pub fn new_buffer<T>(
&mut self,
len: usize
) -> Result<Buffer<Self::Backend, T>, BufferError> where
T: Copy + Default,
Self::Backend: Buffer<T>,
[src]
&mut self,
len: usize
) -> Result<Buffer<Self::Backend, T>, BufferError> where
T: Copy + Default,
Self::Backend: Buffer<T>,
pub fn new_buffer_from_vec<T, X>(
&mut self,
vec: X
) -> Result<Buffer<Self::Backend, T>, BufferError> where
T: Copy,
X: Into<Vec<T, Global>>,
Self::Backend: Buffer<T>,
[src]
&mut self,
vec: X
) -> Result<Buffer<Self::Backend, T>, BufferError> where
T: Copy,
X: Into<Vec<T, Global>>,
Self::Backend: Buffer<T>,
pub fn new_buffer_repeating<T>(
&mut self,
len: usize,
value: T
) -> Result<Buffer<Self::Backend, T>, BufferError> where
T: Copy,
Self::Backend: Buffer<T>,
[src]
&mut self,
len: usize,
value: T
) -> Result<Buffer<Self::Backend, T>, BufferError> where
T: Copy,
Self::Backend: Buffer<T>,
pub fn new_framebuffer<D, CS, DS>(
&mut self,
size: <D as Dimensionable>::Size,
mipmaps: usize,
sampler: Sampler
) -> Result<Framebuffer<Self::Backend, D, CS, DS>, FramebufferError> where
D: Dimensionable,
CS: ColorSlot<Self::Backend, D>,
DS: DepthSlot<Self::Backend, D>,
Self::Backend: Framebuffer<D>,
[src]
&mut self,
size: <D as Dimensionable>::Size,
mipmaps: usize,
sampler: Sampler
) -> Result<Framebuffer<Self::Backend, D, CS, DS>, FramebufferError> where
D: Dimensionable,
CS: ColorSlot<Self::Backend, D>,
DS: DepthSlot<Self::Backend, D>,
Self::Backend: Framebuffer<D>,
pub fn new_shader_stage<R>(
&mut self,
ty: StageType,
src: R
) -> Result<Stage<Self::Backend>, StageError> where
R: AsRef<str>,
Self::Backend: Shader,
[src]
&mut self,
ty: StageType,
src: R
) -> Result<Stage<Self::Backend>, StageError> where
R: AsRef<str>,
Self::Backend: Shader,
pub fn new_shader_program<Sem, Out, Uni>(
&mut self
) -> ProgramBuilder<'_, Self, Sem, Out, Uni> where
Sem: Semantics,
Self::Backend: Shader,
[src]
&mut self
) -> ProgramBuilder<'_, Self, Sem, Out, Uni> where
Sem: Semantics,
Self::Backend: Shader,
pub fn new_tess(
&mut self
) -> TessBuilder<'_, Self::Backend, (), (), (), Interleaved> where
Self::Backend: Tess<(), (), (), Interleaved>,
[src]
&mut self
) -> TessBuilder<'_, Self::Backend, (), (), (), Interleaved> where
Self::Backend: Tess<(), (), (), Interleaved>,
pub fn new_deinterleaved_tess<V, W>(
&mut self
) -> TessBuilder<'_, Self::Backend, V, (), W, Deinterleaved> where
W: TessVertexData<Deinterleaved>,
V: TessVertexData<Deinterleaved>,
Self::Backend: Tess<V, (), W, Deinterleaved>,
[src]
&mut self
) -> TessBuilder<'_, Self::Backend, V, (), W, Deinterleaved> where
W: TessVertexData<Deinterleaved>,
V: TessVertexData<Deinterleaved>,
Self::Backend: Tess<V, (), W, Deinterleaved>,
pub fn new_texture<D, P>(
&mut self,
size: <D as Dimensionable>::Size,
mipmaps: usize,
sampler: Sampler
) -> Result<Texture<Self::Backend, D, P>, TextureError> where
D: Dimensionable,
P: Pixel,
Self::Backend: Texture<D, P>,
[src]
&mut self,
size: <D as Dimensionable>::Size,
mipmaps: usize,
sampler: Sampler
) -> Result<Texture<Self::Backend, D, P>, TextureError> where
D: Dimensionable,
P: Pixel,
Self::Backend: Texture<D, P>,
Auto Trait Implementations
impl !RefUnwindSafe for GlutinSurface
[src]
impl !Send for GlutinSurface
[src]
impl !Sync for GlutinSurface
[src]
impl Unpin for GlutinSurface
[src]
impl !UnwindSafe for GlutinSurface
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,