[][src]Struct glium::backend::glutin::headless::Headless

pub struct Headless { /* fields omitted */ }

A headless glutin context.

Implementations

impl Headless[src]

pub fn new<T: ContextCurrentState>(
    context: Context<T>
) -> Result<Self, IncompatibleOpenGl>
[src]

Create a new glium Headless context.

Performs a compatibility check to make sure that all core elements of glium are supported by the implementation.

pub unsafe fn unchecked<T: ContextCurrentState>(
    context: Context<T>
) -> Result<Self, IncompatibleOpenGl>
[src]

Create a new glium Headless context.

This function does the same as build_glium, except that the resulting context will assume that the current OpenGL context will never change.

pub fn with_debug<T: ContextCurrentState>(
    context: Context<T>,
    debug: DebugCallbackBehavior
) -> Result<Self, IncompatibleOpenGl>
[src]

The same as the new constructor, but allows for specifying debug callback behaviour.

pub unsafe fn unchecked_with_debug<T: ContextCurrentState>(
    context: Context<T>,
    debug: DebugCallbackBehavior
) -> Result<Self, IncompatibleOpenGl>
[src]

The same as the unchecked constructor, but allows for specifying debug callback behaviour.

pub fn draw(&self) -> Frame[src]

Start drawing on the backbuffer.

This function returns a Frame, which can be used to draw on it. When the Frame is destroyed, the buffers are swapped.

Note that destroying a Frame is immediate, even if vsync is enabled.

If the framebuffer dimensions have changed since the last call to draw, the inner glutin context will be resized accordingly before returning the Frame.

Methods from Deref<Target = Context>

pub fn get_framebuffer_dimensions(&self) -> (u32, u32)[src]

Calls get_framebuffer_dimensions on the backend object stored by this context.

pub unsafe fn rebuild<B>(
    &self,
    new_backend: B
) -> Result<(), IncompatibleOpenGl> where
    B: Backend + 'static, 
[src]

Changes the OpenGL context associated with this context.

The new context must have lists shared with the old one.

pub fn swap_buffers(&self) -> Result<(), SwapBuffersError>[src]

Swaps the buffers in the backend.

pub fn get_version(&self) -> &Version[src]

👎 Deprecated:

use get_opengl_version instead.

Returns the OpenGL version

pub fn get_opengl_version(&self) -> &Version[src]

Returns the OpenGL version detected by this context.

pub fn get_supported_glsl_version(&self) -> Version[src]

Returns the GLSL version guaranteed to be supported.

pub fn is_glsl_version_supported(&self, version: &Version) -> bool[src]

Returns true if the given GLSL version is supported.

pub fn get_opengl_version_string(&self) -> &str[src]

Returns a string containing this GL version or release number used by this context.

Vendor-specific information may follow the version number.

pub fn get_opengl_vendor_string(&self) -> &str[src]

Returns a string containing the company responsible for this GL implementation.

pub fn get_opengl_renderer_string(&self) -> &str[src]

Returns a string containing the name of the GL renderer used by this context.

This name is typically specific to a particular configuration of a hardware platform.

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

Returns true if the context is in debug mode.

Debug mode may provide additional error and performance issue reporting functionality.

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

Returns true if the context is in "forward-compatible" mode.

Forward-compatible mode means that no deprecated functionality will be supported.

pub fn get_opengl_profile(&self) -> Option<Profile>[src]

Returns this context's OpenGL profile if available.

The context profile is available from OpenGL 3.2 onwards. Returns None if not supported.

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

Returns true if out-of-bound buffer access from the GPU side (inside a program) cannot result in a crash.

You should take extra care if is_robust returns false.

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

Returns true if a context loss is possible.

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

Returns true if the context has been lost and needs to be recreated.

Implementation

If it has been determined that the context has been lost before, then the function immediately returns true. Otherwise, calls glGetGraphicsResetStatus. If this function is not available, returns false.

pub fn get_release_behavior(&self) -> ReleaseBehavior[src]

Returns the behavior when the current OpenGL context is changed.

The most common value is Flush. In order to get None you must explicitly request it during creation.

pub fn get_max_anisotropy_support(&self) -> Option<u16>[src]

Returns the maximum value that can be used for anisotropic filtering, or None if the hardware doesn't support it.

pub fn get_max_viewport_dimensions(&self) -> (u32, u32)[src]

Returns the maximum dimensions of the viewport.

Glium will panic if you request a larger viewport than this when drawing.

pub fn release_shader_compiler(&self)[src]

Releases the shader compiler, indicating that no new programs will be created for a while.

This method is a no-op if it's not available in the implementation.

pub fn get_free_video_memory(&self) -> Option<usize>[src]

Returns an estimate of the amount of video memory available in bytes.

Returns None if no estimate is available.

pub fn read_front_buffer<T>(&self) -> Result<T, ReadError> where
    T: Texture2dDataSink<(u8, u8, u8, u8)>, 
[src]

Reads the content of the front buffer.

You will only see the data that has finished being drawn.

This function can return any type that implements Texture2dDataSink<(u8, u8, u8, u8)>.

Example

let pixels: Result<Vec<Vec<(u8, u8, u8, u8)>>, _> = display.read_front_buffer();

pub unsafe fn exec_in_context<'a, T, F>(&self, action: F) -> T where
    T: Send + 'static,
    F: FnOnce() -> T + 'a, 
[src]

Execute an arbitrary closure with the OpenGL context active. Useful if another component needs to directly manipulate OpenGL state.

If action manipulates any OpenGL state, it must be restored before action completes.

pub fn assert_no_error(&self, user_msg: Option<&str>)[src]

Asserts that there are no OpenGL errors pending.

This function should be used in tests.

pub fn synchronize(&self)[src]

DEPRECATED. Renamed finish.

pub fn finish(&self)[src]

Calls glFinish(). This waits until all the previously issued commands have finished being executed.

When you execute OpenGL functions, they are not executed immediately. Instead they are put in a queue. This function flushes this queue, then waits until all commands have finished being executed.

You normally don't need to call this function manually, except for debugging purposes.

pub fn flush(&self)[src]

Calls glFlush(). This starts executing the commands that you have issued if it is not yet the case.

When you execute OpenGL functions, they are not executed immediately. Instead they are put in a queue. This function flushes this queue so that commands start being executed.

You normally don't need to call this function manually. Swapping buffers automatically flushes the queue. This function can be useful if you want to benchmark the time it takes from your OpenGL driver to process commands.

pub fn insert_debug_marker(&self, marker: &str) -> Result<(), ()>[src]

Inserts a debugging string in the commands queue. If you use an OpenGL debugger, you will be able to see that string.

This is helpful to understand where you are when you have big applications.

Returns Err if the backend doesn't support this functionality. You can choose whether to call .unwrap() if you want to make sure that it works, or .ok() if you don't care.

pub fn debug_insert_debug_marker(&self, marker: &str) -> Result<(), ()>[src]

Same as insert_debug_marker, except that if you don't compile with debug_assertions it is a no-op and returns Ok.

Trait Implementations

impl Deref for Headless[src]

type Target = Context

The resulting type after dereferencing.

impl Facade for Headless[src]

Auto Trait Implementations

impl !RefUnwindSafe for Headless

impl !Send for Headless

impl !Sync for Headless

impl Unpin for Headless

impl !UnwindSafe for Headless

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> CapabilitiesSource for T where
    T: Facade + ?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.