Module fermium::renderer[][src]

Expand description

SDL’s portable 2D rendering functions.

This API supports the following features:

  • single pixel points
  • single pixel lines
  • filled rectangles
  • texture images

The primitives may be drawn in opaque, blended, or additive modes.

The texture images may be drawn in opaque, blended, or additive modes. They can have an additional color tint or alpha modulation applied to them, and may also be stretched with linear interpolation.

This API is designed to accelerate simple 2D operations. You may want more functionality such as polygons and particle effects and in that case you should use SDL’s OpenGL/Direct3D support or one of the many good 3D engines.

These functions must be called from the main thread. See this bug for details: http://bugzilla.libsdl.org/show_bug.cgi?id=1995

Structs

An opaque structure representing rendering state.

Flags used when creating a rendering context

Information on the capabilities of a render driver or context.

The scaling mode for a texture.

An opaque, efficient, driver-specific representation of pixel data.

The access pattern allowed for a texture.

The texture channel modulation used in SDL_RenderCopy

Constants

flip horizontally

Do not flip

flip vertically

The renderer uses hardware acceleration

Present is synchronized with the refresh rate

The renderer is a software fallback

The renderer supports rendering to texture

anisotropic filtering

linear filtering

nearest pixel sampling

Changes rarely, not lockable.

Changes frequently, lockable.

Texture can be used as a render target.

srcA = srcA * alpha

srcC = srcC * color

Functions

Create a 2D rendering context for a window.

Create a 2D software rendering context for a surface.

Create a texture for a rendering context.

Create a texture from an existing surface.

Create a window and default renderer

Destroy the rendering context for a window and free associated textures.

Destroy the specified texture.

Bind the texture to the current OpenGL/ES/ES2 context for use with OpenGL instructions.

Unbind a texture from the current OpenGL/ES/ES2 context.

Get the number of 2D rendering drivers available for the current display.

Get the blend mode used for drawing operations.

Get the color used for drawing operations (Rect, Line and Clear).

Get information about a specific 2D rendering driver for the current display.

Get the current render target or NULL for the default render target.

Get the renderer associated with a window.

Get information about a rendering context.

Get the output size in pixels of a rendering context.

Get the additional alpha value used in render copy operations.

Get the blend mode used for texture copy operations.

Get the additional color value used in render copy operations.

Get the scale mode used for texture scale operations.

Lock a portion of the texture for write-only pixel access.

Lock a portion of the texture for write-only pixel access. Expose it as a SDL surface.

Query the attributes of a texture

Clear the current rendering target with the drawing color

Copy a portion of the texture to the current rendering target.

Copy a portion of the source texture to the current rendering target, rotating it by angle around the given center

Copy a portion of the source texture to the current rendering target, rotating it by angle around the given center

Copy a portion of the texture to the current rendering target.

Draw a line on the current rendering target.

Draw a line on the current rendering target.

Draw a series of connected lines on the current rendering target.

Draw a series of connected lines on the current rendering target.

Draw a point on the current rendering target.

Draw a point on the current rendering target.

Draw multiple points on the current rendering target.

Draw multiple points on the current rendering target.

Draw a rectangle on the current rendering target.

Draw a rectangle on the current rendering target.

Draw some number of rectangles on the current rendering target.

Draw some number of rectangles on the current rendering target.

Fill a rectangle on the current rendering target with the drawing color.

Fill a rectangle on the current rendering target with the drawing color.

Fill some number of rectangles on the current rendering target with the drawing color.

Fill some number of rectangles on the current rendering target with the drawing color.

Force the rendering context to flush any pending commands to the underlying rendering API.

Get the clip rectangle for the current target.

Get whether integer scales are forced for resolution-independent rendering

Get device independent resolution for rendering

Get the Metal command encoder for the current frame

Get the CAMetalLayer associated with the given Metal renderer

Get the drawing scale for the current target.

Get the drawing area for the current target.

Get whether clipping is enabled on the given renderer.

Update the screen with rendering performed.

Read pixels from the current rendering target.

Set the clip rectangle for the current target.

Set whether to force integer scales for resolution-independent rendering

Set device independent resolution for rendering

Set the drawing scale for rendering on the current target.

Set the drawing area for rendering on the current target.

Determines whether a window supports the use of render targets

Set the blend mode used for drawing operations (Fill and Line).

Set the color used for drawing operations (Rect, Line and Clear).

Set a texture as the current rendering target.

Set an additional alpha value used in render copy operations.

Set the blend mode used for texture copy operations.

Set an additional color value used in render copy operations.

Set the scale mode used for texture scale operations.

Unlock a texture, uploading the changes to video memory, if needed.

Update a rectangle within a planar NV12 or NV21 texture with new pixels.

Update the given texture rectangle with new pixel data.

Update a rectangle within a planar YV12 or IYUV texture with new pixel data.