A generic canvas independent of graphics backend. This type should
never need to be used directly; use
graphics::Canvas
instead.
A RGBA color in the sRGB
color space represented as f32
’s in the range [0.0-1.0]
A struct containing all the necessary info for drawing a
Drawable
.
A type for empty shader data for shaders that do not require any additional
data to be sent to the GPU
Parameters for the fill tessellator.
A handle referring to a loaded Truetype font.
The font cache of the engine.
A backend specification for OpenGL.
This is different from
Backend
because this needs to be its own struct to implement traits
upon, and because there may need to be a layer of translation
between what the user asks for in the config, and what the
graphics backend code actually gets from the driver.
Internal structure containing global shader state.
Object allowing glyph drawing, containing cache state. Manages glyph positioning cacheing,
glyph draw caching & efficient GPU texture cache updating.
Generic in-GPU-memory image data available to be drawn on the screen.
You probably just want to look at the Image
type.
Internal structure containing values that are different for each
drawable object. This is the per-object data that
gets fed into the shaders.
Mesh that will be rendered with hardware instancing.
Use this when you have a lot of similar geometry which does not move around often.
A builder for creating
Mesh
es.
An index of a particular instance in a MeshBatch
A ShaderGeneric
reprensents a handle user-defined shader that can be used
with a ggez graphics context that is generic over gfx::Resources
A lock for RAII shader regions. The shader automatically gets cleared once
the lock goes out of scope, restoring the previous shader (if any).
Parameters for the tessellator.
Drawable text object. Essentially a list of
TextFragment
’s
and some cached size information.
A piece of text with optional color, font and font scale information.
Drawing text generally involves one or more of these.
These options take precedence over any similar field/argument.
Implements From
for char
, &str
, String
and
(String, Font, PxScale)
.
Structure containing fundamental vertex data.
Describes horizontal alignment preference for positioning & bounds.
An enum for specifying default and custom blend modes
Specifies whether a mesh should be drawn
filled or as an outline.
The fill rule defines how to determine what is inside and what is outside of the shape.
Specifies what blending method to use when scaling up/down images.
The supported formats for saving an image.
Line cap as defined by the SVG specification.
Line join as defined by the SVG specification.
A struct that represents where to put a Drawable
.
Specifies how to wrap textures.
Specifies how texture coordinates outside the range [0, 1]
are handled.
A trait providing methods for working with a particular backend, such as OpenGL,
with associated gfx-rs types for that backend. As a user you probably
don’t need to touch this unless you want to write a new graphics backend
for ggez. (Trust me, you don’t.)
All types that can be drawn on the screen implement the Drawable
trait.
A trait that is used to create trait objects to abstract away the
gfx::Structure<ConstFormat>
type of the constant data for drawing
Clear the screen to the background color.
Deletes all cached font data.
Clears the the current shader for the Context
, restoring the default shader.
Get the default filter mode for new images.
Draws the given
Drawable
object to the screen by calling its
draw()
method.
Returns the size of the window’s underlying drawable in physical pixels as (width, height).
Returns zeros if window doesn’t exist.
Returns the screen color format used by the context
Gets the window position.
Returns raw gfx-rs
state objects, if you want to use gfx-rs
to write
your own graphics pipeline then this gets you the interfaces you need
to do so.
Premultiplies the given transformation matrix with the current projection matrix
Tells the graphics system to actually put everything on the screen.
Call this at the end of your
EventHandler
’s
draw()
method.
Gets a copy of the context’s raw projection matrix
Exposes glyph_brush
’s drawing API in case ggez
’s text drawing is insufficient.
It takes glyph_brush
’s VariedSection
and GlyphPositioner
, which give you lower-
level control over how text is drawn.
Returns a string that tells a little about the obtained rendering mode.
It is supposed to be human-readable and will change; do not try to parse
information out of it!
Returns a rectangle defining the coordinate system of the screen.
It will be Rect { x: left, y: top, w: width, h: height }
Take a screenshot by outputting the current render surface
(screen or selected canvas) to an Image
.
Sets the blend mode of the currently active shader program
Set the Canvas
to render to. Specifying Option::None
will cause all
rendering to be done directly to the screen.
Sets the default filter mode used to scale images.
Sets the window size (in physical pixels) / resolution to the specified width and height.
Sets the window to fullscreen or back.
Sets the window mode, such as the size and other properties.
Sets the raw projection matrix to the given homogeneous
transformation matrix. For an introduction to graphics matrices,
a good source is this:
http://ncase.me/matrix/Sets whether or not the window is resizable.
Sets the bounds of the screen viewport.
Set the current shader for the Context
to render with
Sets the window position.
Returns the size of the window in pixels as (width, height),
including borders, titlebar, etc.
Returns zeros if the window doesn’t exist.
Returns an iterator providing all resolutions supported by the current monitor.
Applies DrawParam
to Rect
.
Use a shader until the returned lock goes out of scope
Returns a reference to the Glutin window.
Ideally you should not need to use this because ggez
would provide all the functions you need without having
to dip into Glutin itself. But life isn’t always ideal.
Return raw window context