[][src]Module fermium::renderer

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

Re-exports

pub use crate::stdinc::*;
pub use crate::video::*;

Structs

SDL_Renderer

An opaque structure representing rendering state.

SDL_RendererFlags

Flags used when creating a rendering context

SDL_RendererFlip

Flip values for SDL_RenderCopyEx

SDL_RendererInfo

Information on the capabilities of a render driver or context.

SDL_ScaleMode

The scaling mode for a texture.

SDL_Texture

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

SDL_TextureAccess

The access pattern allowed for a texture.

SDL_TextureModulate

The texture channel modulation used in SDL_RenderCopy

Constants

SDL_FLIP_HORIZONTAL

flip horizontally

SDL_FLIP_NONE

Do not flip

SDL_FLIP_VERTICAL

flip vertically

SDL_RENDERER_ACCELERATED

The renderer uses hardware acceleration

SDL_RENDERER_PRESENTVSYNC

Present is synchronized with the refresh rate

SDL_RENDERER_SOFTWARE

The renderer is a software fallback

SDL_RENDERER_TARGETTEXTURE

The renderer supports rendering to texture

SDL_ScaleModeBest

anisotropic filtering

SDL_ScaleModeLinear

linear filtering

SDL_ScaleModeNearest

nearest pixel sampling

SDL_TEXTUREACCESS_STATIC

Changes rarely, not lockable.

SDL_TEXTUREACCESS_STREAMING

Changes frequently, lockable.

SDL_TEXTUREACCESS_TARGET

Texture can be used as a render target.

SDL_TEXTUREMODULATE_ALPHA

srcA = srcA * alpha

SDL_TEXTUREMODULATE_COLOR

srcC = srcC * color

SDL_TEXTUREMODULATE_NONE

No modulation.

Functions

SDL_CreateRenderer

Create a 2D rendering context for a window.

SDL_CreateSoftwareRenderer

Create a 2D software rendering context for a surface.

SDL_CreateTexture

Create a texture for a rendering context.

SDL_CreateTextureFromSurface

Create a texture from an existing surface.

SDL_CreateWindowAndRenderer

Create a window and default renderer

SDL_DestroyRenderer

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

SDL_DestroyTexture

Destroy the specified texture.

SDL_GL_BindTexture

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

SDL_GL_UnbindTexture

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

SDL_GetNumRenderDrivers

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

SDL_GetRenderDrawBlendMode

Get the blend mode used for drawing operations.

SDL_GetRenderDrawColor

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

SDL_GetRenderDriverInfo

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

SDL_GetRenderTarget

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

SDL_GetRenderer

Get the renderer associated with a window.

SDL_GetRendererInfo

Get information about a rendering context.

SDL_GetRendererOutputSize

Get the output size in pixels of a rendering context.

SDL_GetTextureAlphaMod

Get the additional alpha value used in render copy operations.

SDL_GetTextureBlendMode

Get the blend mode used for texture copy operations.

SDL_GetTextureColorMod

Get the additional color value used in render copy operations.

SDL_GetTextureScaleMode

Get the scale mode used for texture scale operations.

SDL_LockTexture

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

SDL_LockTextureToSurface

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

SDL_QueryTexture

Query the attributes of a texture

SDL_RenderClear

Clear the current rendering target with the drawing color

SDL_RenderCopy

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

SDL_RenderCopyEx

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

SDL_RenderCopyExF

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

SDL_RenderCopyF

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

SDL_RenderDrawLine

Draw a line on the current rendering target.

SDL_RenderDrawLineF

Draw a line on the current rendering target.

SDL_RenderDrawLines

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

SDL_RenderDrawLinesF

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

SDL_RenderDrawPoint

Draw a point on the current rendering target.

SDL_RenderDrawPointF

Draw a point on the current rendering target.

SDL_RenderDrawPoints

Draw multiple points on the current rendering target.

SDL_RenderDrawPointsF

Draw multiple points on the current rendering target.

SDL_RenderDrawRect

Draw a rectangle on the current rendering target.

SDL_RenderDrawRectF

Draw a rectangle on the current rendering target.

SDL_RenderDrawRects

Draw some number of rectangles on the current rendering target.

SDL_RenderDrawRectsF

Draw some number of rectangles on the current rendering target.

SDL_RenderFillRect

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

SDL_RenderFillRectF

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

SDL_RenderFillRects

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

SDL_RenderFillRectsF

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

SDL_RenderFlush

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

SDL_RenderGetClipRect

Get the clip rectangle for the current target.

SDL_RenderGetIntegerScale

Get whether integer scales are forced for resolution-independent rendering

SDL_RenderGetLogicalSize

Get device independent resolution for rendering

SDL_RenderGetMetalCommandEncoder

Get the Metal command encoder for the current frame

SDL_RenderGetMetalLayer

Get the CAMetalLayer associated with the given Metal renderer

SDL_RenderGetScale

Get the drawing scale for the current target.

SDL_RenderGetViewport

Get the drawing area for the current target.

SDL_RenderIsClipEnabled

Get whether clipping is enabled on the given renderer.

SDL_RenderPresent

Update the screen with rendering performed.

SDL_RenderReadPixels

Read pixels from the current rendering target.

SDL_RenderSetClipRect

Set the clip rectangle for the current target.

SDL_RenderSetIntegerScale

Set whether to force integer scales for resolution-independent rendering

SDL_RenderSetLogicalSize

Set device independent resolution for rendering

SDL_RenderSetScale

Set the drawing scale for rendering on the current target.

SDL_RenderSetViewport

Set the drawing area for rendering on the current target.

SDL_RenderTargetSupported

Determines whether a window supports the use of render targets

SDL_SetRenderDrawBlendMode

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

SDL_SetRenderDrawColor

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

SDL_SetRenderTarget

Set a texture as the current rendering target.

SDL_SetTextureAlphaMod

Set an additional alpha value used in render copy operations.

SDL_SetTextureBlendMode

Set the blend mode used for texture copy operations.

SDL_SetTextureColorMod

Set an additional color value used in render copy operations.

SDL_SetTextureScaleMode

Set the scale mode used for texture scale operations.

SDL_UnlockTexture

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

SDL_UpdateTexture

Update the given texture rectangle with new pixel data.

SDL_UpdateYUVTexture

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

Type Definitions

c_char