Struct nannou::window::Window [] [src]

pub struct Window { /* fields omitted */ }

An OpenGL window.

The Window acts as a wrapper around the glium::Display type, providing a more nannou-friendly API.

Methods

impl Window
[src]

[src]

Modifies the title of the window.

This is a no-op if the window has already been closed.

[src]

Shows the window if it was hidden.

Platform-specific

Has no effect on Android.

[src]

Hides the window if it was visible.

Platform-specific

Has no effect on Android.

[src]

The position of the top-left hand corner of the window relative to the top-left hand corner of the desktop.

Note that the top-left hand corner of the desktop is not necessarily the same as the screen. If the user uses a desktop with multiple monitors, the top-left hand corner of the desktop is the top-left hand corner of the monitor at the top-left of the desktop.

The coordinates can be negative if the top-left hand corner of the window is outside of the visible screen region.

[src]

Modifies the position of the window.

See get_position for more information about the returned coordinates.

[src]

The size in points of the client area of the window.

The client area is the content of the window, excluding the title bar and borders. To get the dimensions of the frame buffer when calling glViewport, multiply with hidpi factor.

This is the same as multiplying the result of inner_size_pixels() by hidpi_factor().

[src]

The size in pixels of the client area of the window.

The client area is the content of the window, excluding the title bar and borders. These are the dimensions of the frame buffer, and the dimensions that you should use when you call glViewport.

[src]

The size of the window in pixels.

These dimensions include title bar and borders. If you don't want these, you should use inner_size_pixels instead.

[src]

Modifies the inner size of the window.

See the inner_size methods for more informations about the values.

[src]

Modifies the mouse cursor of the window.

Platform-specific

Has no effect on Android.

[src]

The ratio between the backing framebuffer resolution and the window size in screen pixels.

This is typically 1.0 for a normal display, 2.0 for a retina display and higher on more modern displays.

[src]

Changes the position of the cursor in window coordinates.

[src]

Modifies the mouse cursor of the window.

Platform-specific

Has no effect on Android.

[src]

Sets the window to maximized or back.

[src]

Sets how winit handles the cursor.

See the documentation of CursorState for details.

Platform-specific

Has no effect on Android.

[src]

The current monitor that the window is on or the primary monitor if nothing matches.

[src]

A unique identifier associated with this window.

[src]

True if this context is the current one in this thread.

[src]

The address of an OpenGL function.

[src]

The OpenGL API being used.

[src]

The pixel format of the main framebuffer of the context.

[src]

Rebuilds the inner Display's GlWindow with the given window and context builders.

This method ensures that the new OpenGL context will share the display lists of the original.

[src]

The dimensions of the framebuffer - often equivalent to the inner dimensions of a window.

[src]

The OpenGL version detected by this context.

[src]

The GLSL version guaranteed to be supported.

[src]

Returns true if the given GLSL version is supported.

[src]

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

Vendor-specific information may follow the version number.

[src]

A string containing the company responsible for this GL implementation.

[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.

[src]

Returns true if the context is in debug mode.

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

[src]

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

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

[src]

This context's OpenGL profile if available.

The context profile is available from OpenGL 3.2 onwards.

Returns None if not supported.

[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.

[src]

Returns true if context loss is possible.

[src]

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

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.

[src]

The behaviour 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.

[src]

Returns the maximum value that can be used for anisotropic filtering.

Returns None if the hardware doesn't support it.

[src]

The maximum dimensions of the viewport.

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

[src]

Provides a hint to the OpenGL implementation that it may free internal resources associated with its shader compiler.

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

[src]

An estimate of the amount of video memory available in bytes.

None if no estimate is available.

[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)>.

[src]

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

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

[src]

Asserts that there are no OpenGL errors pending.

This function should be used in tests.

[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 functionnality. You can choose whether to call .unwrap() if you want to make sure that it works, or .ok() if you don't care.

[src]

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

[src]

Returns a reference to the inner glium::Display.

Note: using this method (or more spefically, some methods on Display) may break the nannou API. It should be avoided if possible, but is provided for flexibility in case it is needed or in case nannou's API does not suffice.

Trait Implementations

impl WinitWindow for Window
[src]

[src]

Return the inner size of the window.

[src]

Return the window's DPI factor so that we can convert from pixel values to scalar values.