logo
pub struct Framebuffer { /* private fields */ }

Implementations

set_window_size: @window: A #Stage @width: A width, in pixels @height: A height, in pixels

Sets the size of the window, taking into account any window border. This corresponds to the window’s available area for its child, minus the area occupied by the window’s toolbar, if it’s enabled.

Setting the window size may involve a request to the underlying windowing system, and may not immediately be reflected.

Trait Implementations

Converts this type into a shared reference of the (usually inferred) input type.

Converts this type into a shared reference of the (usually inferred) input type.

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Calls the provided callback when all previously-submitted commands have been executed by the GPU. Read more

Explicitly allocates a configured Framebuffer allowing developers to check and handle any errors that might arise from an unsupported configuration so that fallback configurations may be tried. Read more

Removes a fence previously submitted with Framebuffer::add_fence_callback; the callback will not be called. Read more

Clears all the auxiliary buffers identified in the buffers mask, and if that includes the color buffer then the specified color is used. Read more

Clears all the auxiliary buffers identified in the buffers mask, and if that includes the color buffer then the specified color is used. Read more

Declares that the specified buffers no longer need to be referenced by any further rendering commands. This can be an important optimization to avoid subsequent frames of rendering depending on the results of a previous frame. Read more

Draws a textured rectangle to self with the given pipeline state with the top left corner positioned at (x_1, y_1) and the bottom right corner positioned at (x_2, y_2). As a pipeline may contain multiple texture layers this interface lets you supply texture coordinates for each layer of the pipeline. Read more

Draws a rectangle to self with the given pipeline state and with the top left corner positioned at (x_1, y_1) and the bottom right corner positioned at (x_2, y_2). Read more

Draws a textured rectangle to self using the given pipeline state with the top left corner positioned at (x_1, y_1) and the bottom right corner positioned at (x_2, y_2). The top left corner will have texture coordinates of (s_1, t_1) and the bottom right corner will have texture coordinates of (s_2, t_2). Read more

This blocks the CPU until all pending rendering associated with the specified framebuffer has completed. It’s very rare that developers should ever need this level of synchronization with the GPU and should never be used unless you clearly understand why you need to explicitly force synchronization. Read more

Replaces the current projection matrix with a perspective matrix for a given viewing frustum defined by 4 side clip planes that all cross through the origin and 2 near and far clip planes. Read more

Retrieves the number of alpha bits of self Read more

Retrieves the number of blue bits of self Read more

Gets the current ColorMask of which channels would be written to the current framebuffer. Each bit set in the mask means that the corresponding color would be written. Read more

Can be used to query the Context a given self was instantiated within. This is the Context that was passed to Onscreen::new for example. Read more

Retrieves the number of depth bits of self Read more

Retrieves the depth buffer of self as a Texture. You need to call framebuffer_get_depth_texture(fb, true); before using this function. Read more

Queries whether texture based depth buffer has been enabled via Framebuffer::set_depth_texture_enabled. Read more

Queries whether depth buffer writing is enabled for self. This can be controlled via Framebuffer::set_depth_write_enabled. Read more

Returns whether dithering has been requested for the given self. See Framebuffer::set_dither_enabled for more details about dithering. Read more

Retrieves the number of green bits of self Read more

Queries the current height of the given self. Read more

Stores the current model-view matrix in matrix. Read more

Stores the current projection matrix in matrix. Read more

Retrieves the number of red bits of self Read more

Gets the number of points that are sampled per-pixel when rasterizing geometry. Usually by default this will return 0 which means that single-sample not multisample rendering has been chosen. When using a GPU supporting multisample rendering it’s possible to increase the number of samples per pixel using Framebuffer::set_samples_per_pixel. Read more

Gets the current StereoMode, which defines which stereo buffers should be drawn to. See Framebuffer::set_stereo_mode. Read more

Queries the height of the viewport as set using Framebuffer::set_viewport or the default value which is the height of the framebuffer. Read more

Queries the width of the viewport as set using Framebuffer::set_viewport or the default value which is the width of the framebuffer. Read more

Queries the x coordinate of the viewport origin as set using Framebuffer::set_viewport or the default value which is 0. Read more

Queries the y coordinate of the viewport origin as set using Framebuffer::set_viewport or the default value which is 0. Read more

Queries the current width of the given self. Read more

Resets the current model-view matrix to the identity matrix.

Replaces the current projection matrix with an orthographic projection matrix. Read more

Replaces the current projection matrix with a perspective matrix based on the provided values. Read more

Reverts the clipping region to the state before the last call to Framebuffer::push_scissor_clip, Framebuffer::push_rectangle_clip framebuffer_push_path_clip, or Framebuffer::push_primitive_clip. Read more

Restores the model-view matrix on the top of the matrix stack.

Copies the current model-view matrix onto the matrix stack. The matrix can later be restored with Framebuffer::pop_matrix. Read more

Sets a new clipping area using a 2D shaped described with a Primitive. The shape must not contain self overlapping geometry and must lie on a single 2D plane. A bounding box of the 2D shape in local coordinates (the same coordinates used to describe the shape) must be given. It is acceptable for the bounds to be larger than the true bounds but behaviour is undefined if the bounds are smaller than the true bounds. Read more

Specifies a modelview transformed rectangular clipping area for all subsequent drawing operations. Any drawing commands that extend outside the rectangle will be clipped so that only the portion inside the rectangle will be displayed. The rectangle dimensions are transformed by the current model-view matrix. Read more

Specifies a rectangular clipping area for all subsequent drawing operations. Any drawing commands that extend outside the rectangle will be clipped so that only the portion inside the rectangle will be displayed. The rectangle dimensions are not transformed by the current model-view matrix. Read more

This is a convenience wrapper around Framebuffer::read_pixels_into_bitmap which allocates a temporary Bitmap to read pixel data directly into the given buffer. The rowstride of the buffer is assumed to be the width of the region times the bytes per pixel of the format. The source for the data is always taken from the color buffer. If you want to use any other rowstride or source, please use the Framebuffer::read_pixels_into_bitmap fn directly. Read more

This reads a rectangle of pixels from the given framebuffer where position (0, 0) is the top left. The pixel at (x, y) is the first read, and a rectangle of pixels with the same size as the bitmap is read right and downwards from that point. Read more

When point sample rendering (also known as multisample rendering) has been enabled via Framebuffer::set_samples_per_pixel then you can optionally call this fn (or Framebuffer::resolve_samples_region) to explicitly resolve the point samples into values for the final color buffer. Read more

When point sample rendering (also known as multisample rendering) has been enabled via Framebuffer::set_samples_per_pixel then you can optionally call this fn (or Framebuffer::resolve_samples) to explicitly resolve the point samples into values for the final color buffer. Read more

Multiplies the current model-view matrix by one that rotates the model around the axis-vector specified by x, y and z. The rotation follows the right-hand thumb rule so for example rotating by 10 degrees about the axis-vector (0, 0, 1) causes a small counter-clockwise rotation. Read more

Multiplies the current model-view matrix by one that rotates according to the rotation described by euler. Read more

Multiplies the current model-view matrix by one that rotates according to the rotation described by quaternion. Read more

Multiplies the current model-view matrix by one that scales the x, y and z axes by the given values. Read more

Defines a bit mask of which color channels should be written to the given self. If a bit is set in color_mask that means that color will be written. Read more

If enabled is true, the depth buffer used when rendering to self is available as a texture. You can retrieve the texture with Framebuffer::get_depth_texture. Read more

Enables or disables depth buffer writing when rendering to self. If depth writing is enabled for both the framebuffer and the rendering pipeline, and the framebuffer has an associated depth buffer, depth information will be written to this buffer during rendering. Read more

Enables or disabled dithering if supported by the hardware. Read more

Sets matrix as the new model-view matrix. Read more

Sets matrix as the new projection matrix. Read more

Requires that when rendering to self then n point samples should be made per pixel which will all contribute to the final resolved color for that pixel. The idea is that the hardware aims to get quality similar to what you would get if you rendered everything twice as big (for 4 samples per pixel) and then scaled that image back down with filtering. It can effectively remove the jagged edges of polygons and should be more efficient than if you were to manually render at a higher resolution and downscale because the hardware is often able to take some shortcuts. For example the GPU may only calculate a single texture sample for all points of a single pixel, and for tile based architectures all the extra sample data (such as depth and stencil samples) may be handled on-chip and so avoid increased demand on system memory bandwidth. Read more

Sets which stereo buffers should be drawn to. The default is StereoMode::Both, which means that both the left and right buffers will be affected by drawing. For this to have an effect, the display system must support stereo drawables, and the framebuffer must have been created with stereo enabled. (See OnscreenTemplate::set_stereo_enabled, Framebuffer::get_is_stereo.) Read more

Defines a scale and offset for everything rendered relative to the top-left of the destination framebuffer. Read more

Multiplies the current model-view matrix by the given matrix. Read more

Multiplies the current model-view matrix by one that translates the model along all three axes according to the given values. Read more

Returns the argument unchanged.

Typed getter

Inspect the context.

Inspect the context.

Inspect the context.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Convert into color

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

Sets value as a parameter of self.

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.