SDL
2.0
|
#include "../SDL_internal.h"
#include "SDL_assert.h"
#include "SDL_hints.h"
#include "SDL_log.h"
#include "SDL_render.h"
#include "SDL_sysrender.h"
#include "software/SDL_render_sw_c.h"
Go to the source code of this file.
Macros | |
#define | SDL_WINDOWRENDERDATA "_SDL_WindowRenderData" |
#define | CHECK_RENDERER_MAGIC(renderer, retval) |
#define | CHECK_TEXTURE_MAGIC(texture, retval) |
#define | SDL_COMPOSE_BLENDMODE(srcColorFactor, dstColorFactor, colorOperation, srcAlphaFactor, dstAlphaFactor, alphaOperation) |
#define | SDL_BLENDMODE_NONE_FULL |
#define | SDL_BLENDMODE_BLEND_FULL |
#define | SDL_BLENDMODE_ADD_FULL |
#define | SDL_BLENDMODE_MOD_FULL |
#define | SDL_BLENDMODE_MUL_FULL |
Functions | |
static SDL_INLINE void | DebugLogRenderCommands (const SDL_RenderCommand *cmd) |
static int | FlushRenderCommands (SDL_Renderer *renderer) |
static int | FlushRenderCommandsIfTextureNeeded (SDL_Texture *texture) |
static SDL_INLINE int | FlushRenderCommandsIfNotBatching (SDL_Renderer *renderer) |
int | SDL_RenderFlush (SDL_Renderer *renderer) |
Force the rendering context to flush any pending commands to the underlying rendering API. More... | |
void * | SDL_AllocateRenderVertices (SDL_Renderer *renderer, const size_t numbytes, const size_t alignment, size_t *offset) |
static SDL_RenderCommand * | AllocateRenderCommand (SDL_Renderer *renderer) |
static int | QueueCmdSetViewport (SDL_Renderer *renderer) |
static int | QueueCmdSetClipRect (SDL_Renderer *renderer) |
static int | QueueCmdSetDrawColor (SDL_Renderer *renderer, const Uint8 r, const Uint8 g, const Uint8 b, const Uint8 a) |
static int | QueueCmdClear (SDL_Renderer *renderer) |
static int | PrepQueueCmdDraw (SDL_Renderer *renderer, const Uint8 r, const Uint8 g, const Uint8 b, const Uint8 a) |
static SDL_RenderCommand * | PrepQueueCmdDrawSolid (SDL_Renderer *renderer, const SDL_RenderCommandType cmdtype) |
static int | QueueCmdDrawPoints (SDL_Renderer *renderer, const SDL_FPoint *points, const int count) |
static int | QueueCmdDrawLines (SDL_Renderer *renderer, const SDL_FPoint *points, const int count) |
static int | QueueCmdFillRects (SDL_Renderer *renderer, const SDL_FRect *rects, const int count) |
static SDL_RenderCommand * | PrepQueueCmdDrawTexture (SDL_Renderer *renderer, SDL_Texture *texture, const SDL_RenderCommandType cmdtype) |
static int | QueueCmdCopy (SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect *srcrect, const SDL_FRect *dstrect) |
static int | QueueCmdCopyEx (SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect *srcquad, const SDL_FRect *dstrect, const double angle, const SDL_FPoint *center, const SDL_RendererFlip flip) |
static int | UpdateLogicalSize (SDL_Renderer *renderer) |
int | SDL_GetNumRenderDrivers (void) |
Get the number of 2D rendering drivers available for the current display. More... | |
int | SDL_GetRenderDriverInfo (int index, SDL_RendererInfo *info) |
Get information about a specific 2D rendering driver for the current display. More... | |
static void | GetWindowViewportValues (SDL_Renderer *renderer, int *logical_w, int *logical_h, SDL_Rect *viewport, SDL_FPoint *scale) |
static int | SDL_RendererEventWatch (void *userdata, SDL_Event *event) |
int | SDL_CreateWindowAndRenderer (int width, int height, Uint32 window_flags, SDL_Window **window, SDL_Renderer **renderer) |
Create a window and default renderer. More... | |
static SDL_INLINE void | VerifyDrawQueueFunctions (const SDL_Renderer *renderer) |
SDL_Renderer * | SDL_CreateRenderer (SDL_Window *window, int index, Uint32 flags) |
Create a 2D rendering context for a window. More... | |
SDL_Renderer * | SDL_CreateSoftwareRenderer (SDL_Surface *surface) |
Create a 2D software rendering context for a surface. More... | |
SDL_Renderer * | SDL_GetRenderer (SDL_Window *window) |
Get the renderer associated with a window. More... | |
int | SDL_GetRendererInfo (SDL_Renderer *renderer, SDL_RendererInfo *info) |
Get information about a rendering context. More... | |
int | SDL_GetRendererOutputSize (SDL_Renderer *renderer, int *w, int *h) |
Get the output size in pixels of a rendering context. More... | |
static SDL_bool | IsSupportedBlendMode (SDL_Renderer *renderer, SDL_BlendMode blendMode) |
static SDL_bool | IsSupportedFormat (SDL_Renderer *renderer, Uint32 format) |
static Uint32 | GetClosestSupportedFormat (SDL_Renderer *renderer, Uint32 format) |
static SDL_ScaleMode | SDL_GetScaleMode (void) |
SDL_Texture * | SDL_CreateTexture (SDL_Renderer *renderer, Uint32 format, int access, int w, int h) |
Create a texture for a rendering context. More... | |
SDL_Texture * | SDL_CreateTextureFromSurface (SDL_Renderer *renderer, SDL_Surface *surface) |
Create a texture from an existing surface. More... | |
int | SDL_QueryTexture (SDL_Texture *texture, Uint32 *format, int *access, int *w, int *h) |
Query the attributes of a texture. More... | |
int | SDL_SetTextureColorMod (SDL_Texture *texture, Uint8 r, Uint8 g, Uint8 b) |
Set an additional color value used in render copy operations. More... | |
int | SDL_GetTextureColorMod (SDL_Texture *texture, Uint8 *r, Uint8 *g, Uint8 *b) |
Get the additional color value used in render copy operations. More... | |
int | SDL_SetTextureAlphaMod (SDL_Texture *texture, Uint8 alpha) |
Set an additional alpha value used in render copy operations. More... | |
int | SDL_GetTextureAlphaMod (SDL_Texture *texture, Uint8 *alpha) |
Get the additional alpha value used in render copy operations. More... | |
int | SDL_SetTextureBlendMode (SDL_Texture *texture, SDL_BlendMode blendMode) |
Set the blend mode used for texture copy operations. More... | |
int | SDL_GetTextureBlendMode (SDL_Texture *texture, SDL_BlendMode *blendMode) |
Get the blend mode used for texture copy operations. More... | |
int | SDL_SetTextureScaleMode (SDL_Texture *texture, SDL_ScaleMode scaleMode) |
Set the scale mode used for texture scale operations. More... | |
int | SDL_GetTextureScaleMode (SDL_Texture *texture, SDL_ScaleMode *scaleMode) |
Get the scale mode used for texture scale operations. More... | |
static int | SDL_UpdateTextureYUV (SDL_Texture *texture, const SDL_Rect *rect, const void *pixels, int pitch) |
static int | SDL_UpdateTextureNative (SDL_Texture *texture, const SDL_Rect *rect, const void *pixels, int pitch) |
int | SDL_UpdateTexture (SDL_Texture *texture, const SDL_Rect *rect, const void *pixels, int pitch) |
Update the given texture rectangle with new pixel data. More... | |
static int | SDL_UpdateTextureYUVPlanar (SDL_Texture *texture, const SDL_Rect *rect, const Uint8 *Yplane, int Ypitch, const Uint8 *Uplane, int Upitch, const Uint8 *Vplane, int Vpitch) |
int | SDL_UpdateYUVTexture (SDL_Texture *texture, const SDL_Rect *rect, const Uint8 *Yplane, int Ypitch, const Uint8 *Uplane, int Upitch, const Uint8 *Vplane, int Vpitch) |
Update a rectangle within a planar YV12 or IYUV texture with new pixel data. More... | |
static int | SDL_LockTextureYUV (SDL_Texture *texture, const SDL_Rect *rect, void **pixels, int *pitch) |
static int | SDL_LockTextureNative (SDL_Texture *texture, const SDL_Rect *rect, void **pixels, int *pitch) |
int | SDL_LockTexture (SDL_Texture *texture, const SDL_Rect *rect, void **pixels, int *pitch) |
Lock a portion of the texture for write-only pixel access. More... | |
int | SDL_LockTextureToSurface (SDL_Texture *texture, const SDL_Rect *rect, SDL_Surface **surface) |
Lock a portion of the texture for write-only pixel access. Expose it as a SDL surface. More... | |
static void | SDL_UnlockTextureYUV (SDL_Texture *texture) |
static void | SDL_UnlockTextureNative (SDL_Texture *texture) |
void | SDL_UnlockTexture (SDL_Texture *texture) |
Unlock a texture, uploading the changes to video memory, if needed. If SDL_LockTextureToSurface() was called for locking, the SDL surface is freed. More... | |
SDL_bool | SDL_RenderTargetSupported (SDL_Renderer *renderer) |
Determines whether a window supports the use of render targets. More... | |
int | SDL_SetRenderTarget (SDL_Renderer *renderer, SDL_Texture *texture) |
Set a texture as the current rendering target. More... | |
SDL_Texture * | SDL_GetRenderTarget (SDL_Renderer *renderer) |
Get the current render target or NULL for the default render target. More... | |
int | SDL_RenderSetLogicalSize (SDL_Renderer *renderer, int w, int h) |
Set device independent resolution for rendering. More... | |
void | SDL_RenderGetLogicalSize (SDL_Renderer *renderer, int *w, int *h) |
Get device independent resolution for rendering. More... | |
int | SDL_RenderSetIntegerScale (SDL_Renderer *renderer, SDL_bool enable) |
Set whether to force integer scales for resolution-independent rendering. More... | |
SDL_bool | SDL_RenderGetIntegerScale (SDL_Renderer *renderer) |
Get whether integer scales are forced for resolution-independent rendering. More... | |
int | SDL_RenderSetViewport (SDL_Renderer *renderer, const SDL_Rect *rect) |
Set the drawing area for rendering on the current target. More... | |
void | SDL_RenderGetViewport (SDL_Renderer *renderer, SDL_Rect *rect) |
Get the drawing area for the current target. More... | |
int | SDL_RenderSetClipRect (SDL_Renderer *renderer, const SDL_Rect *rect) |
Set the clip rectangle for the current target. More... | |
void | SDL_RenderGetClipRect (SDL_Renderer *renderer, SDL_Rect *rect) |
Get the clip rectangle for the current target. More... | |
SDL_bool | SDL_RenderIsClipEnabled (SDL_Renderer *renderer) |
Get whether clipping is enabled on the given renderer. More... | |
int | SDL_RenderSetScale (SDL_Renderer *renderer, float scaleX, float scaleY) |
Set the drawing scale for rendering on the current target. More... | |
void | SDL_RenderGetScale (SDL_Renderer *renderer, float *scaleX, float *scaleY) |
Get the drawing scale for the current target. More... | |
int | SDL_SetRenderDrawColor (SDL_Renderer *renderer, Uint8 r, Uint8 g, Uint8 b, Uint8 a) |
Set the color used for drawing operations (Rect, Line and Clear). More... | |
int | SDL_GetRenderDrawColor (SDL_Renderer *renderer, Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a) |
Get the color used for drawing operations (Rect, Line and Clear). More... | |
int | SDL_SetRenderDrawBlendMode (SDL_Renderer *renderer, SDL_BlendMode blendMode) |
Set the blend mode used for drawing operations (Fill and Line). More... | |
int | SDL_GetRenderDrawBlendMode (SDL_Renderer *renderer, SDL_BlendMode *blendMode) |
Get the blend mode used for drawing operations. More... | |
int | SDL_RenderClear (SDL_Renderer *renderer) |
Clear the current rendering target with the drawing color. More... | |
int | SDL_RenderDrawPoint (SDL_Renderer *renderer, int x, int y) |
Draw a point on the current rendering target. More... | |
int | SDL_RenderDrawPointF (SDL_Renderer *renderer, float x, float y) |
Draw a point on the current rendering target. More... | |
static int | RenderDrawPointsWithRects (SDL_Renderer *renderer, const SDL_Point *points, const int count) |
int | SDL_RenderDrawPoints (SDL_Renderer *renderer, const SDL_Point *points, int count) |
Draw multiple points on the current rendering target. More... | |
static int | RenderDrawPointsWithRectsF (SDL_Renderer *renderer, const SDL_FPoint *fpoints, const int count) |
int | SDL_RenderDrawPointsF (SDL_Renderer *renderer, const SDL_FPoint *points, int count) |
Draw multiple points on the current rendering target. More... | |
int | SDL_RenderDrawLine (SDL_Renderer *renderer, int x1, int y1, int x2, int y2) |
Draw a line on the current rendering target. More... | |
int | SDL_RenderDrawLineF (SDL_Renderer *renderer, float x1, float y1, float x2, float y2) |
Draw a line on the current rendering target. More... | |
static int | RenderDrawLinesWithRects (SDL_Renderer *renderer, const SDL_Point *points, const int count) |
static int | RenderDrawLinesWithRectsF (SDL_Renderer *renderer, const SDL_FPoint *points, const int count) |
int | SDL_RenderDrawLines (SDL_Renderer *renderer, const SDL_Point *points, int count) |
Draw a series of connected lines on the current rendering target. More... | |
int | SDL_RenderDrawLinesF (SDL_Renderer *renderer, const SDL_FPoint *points, int count) |
Draw a series of connected lines on the current rendering target. More... | |
int | SDL_RenderDrawRect (SDL_Renderer *renderer, const SDL_Rect *rect) |
Draw a rectangle on the current rendering target. More... | |
int | SDL_RenderDrawRectF (SDL_Renderer *renderer, const SDL_FRect *rect) |
Draw a rectangle on the current rendering target. More... | |
int | SDL_RenderDrawRects (SDL_Renderer *renderer, const SDL_Rect *rects, int count) |
Draw some number of rectangles on the current rendering target. More... | |
int | SDL_RenderDrawRectsF (SDL_Renderer *renderer, const SDL_FRect *rects, int count) |
Draw some number of rectangles on the current rendering target. More... | |
int | SDL_RenderFillRect (SDL_Renderer *renderer, const SDL_Rect *rect) |
Fill a rectangle on the current rendering target with the drawing color. More... | |
int | SDL_RenderFillRectF (SDL_Renderer *renderer, const SDL_FRect *rect) |
Fill a rectangle on the current rendering target with the drawing color. More... | |
int | SDL_RenderFillRects (SDL_Renderer *renderer, const SDL_Rect *rects, int count) |
Fill some number of rectangles on the current rendering target with the drawing color. More... | |
int | SDL_RenderFillRectsF (SDL_Renderer *renderer, const SDL_FRect *rects, int count) |
Fill some number of rectangles on the current rendering target with the drawing color. More... | |
SDL_FORCE_INLINE SDL_bool | SDL_FRectEmpty (const SDL_FRect *r) |
static SDL_bool | SDL_HasIntersectionF (const SDL_FRect *A, const SDL_FRect *B) |
int | SDL_RenderCopy (SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect *srcrect, const SDL_Rect *dstrect) |
Copy a portion of the texture to the current rendering target. More... | |
int | SDL_RenderCopyF (SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect *srcrect, const SDL_FRect *dstrect) |
Copy a portion of the texture to the current rendering target. More... | |
int | SDL_RenderCopyEx (SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect *srcrect, const SDL_Rect *dstrect, const double angle, const SDL_Point *center, const SDL_RendererFlip flip) |
Copy a portion of the source texture to the current rendering target, rotating it by angle around the given center. More... | |
int | SDL_RenderCopyExF (SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect *srcrect, const SDL_FRect *dstrect, const double angle, const SDL_FPoint *center, const SDL_RendererFlip flip) |
Copy a portion of the source texture to the current rendering target, rotating it by angle around the given center. More... | |
int | SDL_RenderReadPixels (SDL_Renderer *renderer, const SDL_Rect *rect, Uint32 format, void *pixels, int pitch) |
Read pixels from the current rendering target. More... | |
void | SDL_RenderPresent (SDL_Renderer *renderer) |
Update the screen with rendering performed. More... | |
void | SDL_DestroyTexture (SDL_Texture *texture) |
Destroy the specified texture. More... | |
void | SDL_DestroyRenderer (SDL_Renderer *renderer) |
Destroy the rendering context for a window and free associated textures. More... | |
int | SDL_GL_BindTexture (SDL_Texture *texture, float *texw, float *texh) |
Bind the texture to the current OpenGL/ES/ES2 context for use with OpenGL instructions. More... | |
int | SDL_GL_UnbindTexture (SDL_Texture *texture) |
Unbind a texture from the current OpenGL/ES/ES2 context. More... | |
void * | SDL_RenderGetMetalLayer (SDL_Renderer *renderer) |
Get the CAMetalLayer associated with the given Metal renderer. More... | |
void * | SDL_RenderGetMetalCommandEncoder (SDL_Renderer *renderer) |
Get the Metal command encoder for the current frame. More... | |
static SDL_BlendMode | SDL_GetShortBlendMode (SDL_BlendMode blendMode) |
static SDL_BlendMode | SDL_GetLongBlendMode (SDL_BlendMode blendMode) |
SDL_BlendMode | SDL_ComposeCustomBlendMode (SDL_BlendFactor srcColorFactor, SDL_BlendFactor dstColorFactor, SDL_BlendOperation colorOperation, SDL_BlendFactor srcAlphaFactor, SDL_BlendFactor dstAlphaFactor, SDL_BlendOperation alphaOperation) |
Create a custom blend mode, which may or may not be supported by a given renderer. More... | |
SDL_BlendFactor | SDL_GetBlendModeSrcColorFactor (SDL_BlendMode blendMode) |
SDL_BlendFactor | SDL_GetBlendModeDstColorFactor (SDL_BlendMode blendMode) |
SDL_BlendOperation | SDL_GetBlendModeColorOperation (SDL_BlendMode blendMode) |
SDL_BlendFactor | SDL_GetBlendModeSrcAlphaFactor (SDL_BlendMode blendMode) |
SDL_BlendFactor | SDL_GetBlendModeDstAlphaFactor (SDL_BlendMode blendMode) |
SDL_BlendOperation | SDL_GetBlendModeAlphaOperation (SDL_BlendMode blendMode) |
Variables | |
static const SDL_RenderDriver * | render_drivers [] |
static char | renderer_magic |
static char | texture_magic |
Definition at line 38 of file SDL_render.c.
Definition at line 45 of file SDL_render.c.
#define SDL_BLENDMODE_ADD_FULL |
Definition at line 70 of file SDL_render.c.
#define SDL_BLENDMODE_BLEND_FULL |
Definition at line 66 of file SDL_render.c.
#define SDL_BLENDMODE_MOD_FULL |
Definition at line 74 of file SDL_render.c.
#define SDL_BLENDMODE_MUL_FULL |
Definition at line 78 of file SDL_render.c.
#define SDL_BLENDMODE_NONE_FULL |
Definition at line 62 of file SDL_render.c.
#define SDL_COMPOSE_BLENDMODE | ( | srcColorFactor, | |
dstColorFactor, | |||
colorOperation, | |||
srcAlphaFactor, | |||
dstAlphaFactor, | |||
alphaOperation | |||
) |
Definition at line 53 of file SDL_render.c.
#define SDL_WINDOWRENDERDATA "_SDL_WindowRenderData" |
Definition at line 36 of file SDL_render.c.
|
static |
Definition at line 297 of file SDL_render.c.
References SDL_RenderCommand::next, NULL, SDL_Renderer::render_commands, SDL_Renderer::render_commands_pool, SDL_Renderer::render_commands_tail, renderer, retval, SDL_assert, SDL_calloc, and SDL_OutOfMemory.
Referenced by PrepQueueCmdDrawSolid(), PrepQueueCmdDrawTexture(), QueueCmdClear(), QueueCmdSetClipRect(), QueueCmdSetDrawColor(), and QueueCmdSetViewport().
|
static |
Definition at line 118 of file SDL_render.c.
References SDL_RenderCommand::cliprect, SDL_RenderCommand::color, SDL_RenderCommand::command, SDL_RenderCommand::data, SDL_RenderCommand::draw, i, SDL_RenderCommand::next, SDL_Log, SDL_RENDERCMD_CLEAR, SDL_RENDERCMD_COPY, SDL_RENDERCMD_COPY_EX, SDL_RENDERCMD_DRAW_LINES, SDL_RENDERCMD_DRAW_POINTS, SDL_RENDERCMD_FILL_RECTS, SDL_RENDERCMD_NO_OP, SDL_RENDERCMD_SETCLIPRECT, SDL_RENDERCMD_SETDRAWCOLOR, SDL_RENDERCMD_SETVIEWPORT, and SDL_RenderCommand::viewport.
Referenced by FlushRenderCommands().
|
static |
Definition at line 209 of file SDL_render.c.
References SDL_Renderer::cliprect_queued, SDL_Renderer::color_queued, DebugLogRenderCommands(), SDL_RenderCommand::next, NULL, SDL_Renderer::render_command_generation, SDL_Renderer::render_commands, SDL_Renderer::render_commands_pool, SDL_Renderer::render_commands_tail, renderer, retval, SDL_Renderer::RunCommandQueue, SDL_assert, SDL_FALSE, SDL_Renderer::vertex_data, SDL_Renderer::vertex_data_used, and SDL_Renderer::viewport_queued.
Referenced by FlushRenderCommandsIfNotBatching(), FlushRenderCommandsIfTextureNeeded(), SDL_RenderFlush(), SDL_RenderGetMetalCommandEncoder(), SDL_RenderGetMetalLayer(), SDL_RenderPresent(), SDL_RenderReadPixels(), and SDL_SetRenderTarget().
|
static |
Definition at line 251 of file SDL_render.c.
References SDL_Renderer::batching, FlushRenderCommands(), and renderer.
Referenced by RenderDrawLinesWithRects(), RenderDrawLinesWithRectsF(), RenderDrawPointsWithRects(), RenderDrawPointsWithRectsF(), SDL_RenderClear(), SDL_RenderCopyExF(), SDL_RenderCopyF(), SDL_RenderDrawLines(), SDL_RenderDrawLinesF(), SDL_RenderDrawPoints(), SDL_RenderDrawPointsF(), SDL_RendererEventWatch(), SDL_RenderFillRects(), SDL_RenderFillRectsF(), SDL_RenderSetClipRect(), SDL_RenderSetViewport(), and SDL_SetRenderTarget().
|
static |
Definition at line 240 of file SDL_render.c.
References FlushRenderCommands(), SDL_Renderer::render_command_generation, and renderer.
Referenced by SDL_DestroyTexture(), SDL_GL_BindTexture(), SDL_GL_UnbindTexture(), SDL_LockTexture(), SDL_UpdateTexture(), and SDL_UpdateYUVTexture().
|
static |
Definition at line 1001 of file SDL_render.c.
References i, SDL_Renderer::info, SDL_RendererInfo::num_texture_formats, renderer, SDL_ISPIXELFORMAT_ALPHA, SDL_ISPIXELFORMAT_FOURCC, and SDL_RendererInfo::texture_formats.
Referenced by SDL_CreateTexture().
|
static |
Definition at line 577 of file SDL_render.c.
References SDL_Renderer::logical_h, SDL_Renderer::logical_h_backup, SDL_Renderer::logical_w, SDL_Renderer::logical_w_backup, renderer, SDL_Renderer::scale, SDL_Renderer::scale_backup, SDL_LockMutex, SDL_UnlockMutex, SDL_Renderer::target, SDL_Renderer::target_mutex, viewport, SDL_Renderer::viewport, and SDL_Renderer::viewport_backup.
Referenced by SDL_RendererEventWatch().
|
static |
Definition at line 970 of file SDL_render.c.
References blendMode, renderer, SDL_BLENDMODE_ADD, SDL_BLENDMODE_BLEND, SDL_BLENDMODE_MOD, SDL_BLENDMODE_MUL, SDL_BLENDMODE_NONE, SDL_TRUE, and SDL_Renderer::SupportsBlendMode.
Referenced by SDL_SetRenderDrawBlendMode(), and SDL_SetTextureBlendMode().
|
static |
Definition at line 988 of file SDL_render.c.
References i, SDL_Renderer::info, SDL_RendererInfo::num_texture_formats, renderer, SDL_FALSE, SDL_TRUE, and SDL_RendererInfo::texture_formats.
Referenced by SDL_CreateTexture().
|
static |
Definition at line 417 of file SDL_render.c.
References SDL_Renderer::cliprect_queued, QueueCmdSetClipRect(), QueueCmdSetDrawColor(), QueueCmdSetViewport(), renderer, retval, and SDL_Renderer::viewport_queued.
Referenced by PrepQueueCmdDrawSolid(), and PrepQueueCmdDrawTexture().
|
static |
Definition at line 433 of file SDL_render.c.
References SDL_Renderer::a, AllocateRenderCommand(), SDL_Renderer::b, SDL_Renderer::blendMode, SDL_RenderCommand::command, SDL_RenderCommand::data, SDL_RenderCommand::draw, SDL_Renderer::g, NULL, PrepQueueCmdDraw(), SDL_Renderer::r, and renderer.
Referenced by QueueCmdDrawLines(), QueueCmdDrawPoints(), and QueueCmdFillRects().
|
static |
Definition at line 497 of file SDL_render.c.
References AllocateRenderCommand(), SDL_RenderCommand::command, SDL_RenderCommand::data, SDL_RenderCommand::draw, NULL, PrepQueueCmdDraw(), SDL_Renderer::r, and renderer.
Referenced by QueueCmdCopy(), and QueueCmdCopyEx().
|
static |
Definition at line 400 of file SDL_render.c.
References SDL_Renderer::a, AllocateRenderCommand(), SDL_Renderer::b, SDL_RenderCommand::color, SDL_RenderCommand::command, SDL_RenderCommand::data, SDL_Renderer::g, NULL, SDL_Renderer::r, renderer, and SDL_RENDERCMD_CLEAR.
Referenced by SDL_RenderClear().
|
static |
Definition at line 519 of file SDL_render.c.
References SDL_RenderCommand::command, NULL, PrepQueueCmdDrawTexture(), SDL_Renderer::QueueCopy, renderer, retval, SDL_RENDERCMD_COPY, and SDL_RENDERCMD_NO_OP.
Referenced by SDL_RenderCopyF().
|
static |
Definition at line 533 of file SDL_render.c.
References SDL_RenderCommand::command, NULL, PrepQueueCmdDrawTexture(), SDL_Renderer::QueueCopyEx, renderer, retval, SDL_assert, SDL_RENDERCMD_COPY_EX, and SDL_RENDERCMD_NO_OP.
Referenced by SDL_RenderCopyExF().
|
static |
Definition at line 469 of file SDL_render.c.
References SDL_RenderCommand::command, NULL, PrepQueueCmdDrawSolid(), SDL_Renderer::QueueDrawLines, renderer, retval, SDL_RENDERCMD_DRAW_LINES, and SDL_RENDERCMD_NO_OP.
Referenced by RenderDrawLinesWithRects(), RenderDrawLinesWithRectsF(), SDL_RenderDrawLines(), and SDL_RenderDrawLinesF().
|
static |
Definition at line 455 of file SDL_render.c.
References SDL_RenderCommand::command, NULL, PrepQueueCmdDrawSolid(), SDL_Renderer::QueueDrawPoints, renderer, retval, SDL_RENDERCMD_DRAW_POINTS, and SDL_RENDERCMD_NO_OP.
Referenced by SDL_RenderDrawPoints(), and SDL_RenderDrawPointsF().
|
static |
Definition at line 483 of file SDL_render.c.
References SDL_RenderCommand::command, NULL, PrepQueueCmdDrawSolid(), SDL_Renderer::QueueFillRects, renderer, retval, SDL_RENDERCMD_FILL_RECTS, and SDL_RENDERCMD_NO_OP.
Referenced by RenderDrawLinesWithRects(), RenderDrawLinesWithRectsF(), RenderDrawPointsWithRects(), RenderDrawPointsWithRectsF(), SDL_RenderFillRects(), and SDL_RenderFillRectsF().
|
static |
Definition at line 349 of file SDL_render.c.
References AllocateRenderCommand(), SDL_Renderer::clip_rect, SDL_Renderer::clipping_enabled, SDL_RenderCommand::cliprect, SDL_Renderer::cliprect_queued, SDL_RenderCommand::command, SDL_RenderCommand::data, SDL_Renderer::last_queued_cliprect, SDL_Renderer::last_queued_cliprect_enabled, NULL, renderer, retval, SDL_memcmp, SDL_memcpy, SDL_RENDERCMD_SETCLIPRECT, and SDL_TRUE.
Referenced by PrepQueueCmdDraw(), SDL_RenderSetClipRect(), and SDL_SetRenderTarget().
|
static |
Definition at line 371 of file SDL_render.c.
References AllocateRenderCommand(), SDL_RenderCommand::color, SDL_Renderer::color_queued, SDL_RenderCommand::command, SDL_RenderCommand::data, SDL_Renderer::last_queued_color, NULL, SDL_Renderer::QueueSetDrawColor, renderer, retval, SDL_RENDERCMD_NO_OP, SDL_RENDERCMD_SETDRAWCOLOR, and SDL_TRUE.
Referenced by PrepQueueCmdDraw().
|
static |
Definition at line 326 of file SDL_render.c.
References AllocateRenderCommand(), SDL_RenderCommand::command, SDL_RenderCommand::data, SDL_Renderer::last_queued_viewport, NULL, SDL_Renderer::QueueSetViewport, renderer, retval, SDL_memcmp, SDL_memcpy, SDL_RENDERCMD_NO_OP, SDL_RENDERCMD_SETVIEWPORT, SDL_TRUE, SDL_RenderCommand::viewport, SDL_Renderer::viewport, and SDL_Renderer::viewport_queued.
Referenced by PrepQueueCmdDraw(), SDL_RendererEventWatch(), SDL_RenderSetViewport(), and SDL_SetRenderTarget().
|
static |
Definition at line 2446 of file SDL_render.c.
References FlushRenderCommandsIfNotBatching(), SDL_FRect::h, i, QueueCmdDrawLines(), QueueCmdFillRects(), renderer, retval, SDL_Renderer::scale, SDL_max, SDL_min, SDL_OutOfMemory, SDL_small_alloc, SDL_small_free, SDL_FRect::w, SDL_FPoint::x, SDL_FRect::x, SDL_FPoint::y, and SDL_FRect::y.
Referenced by SDL_RenderDrawLines().
|
static |
Definition at line 2501 of file SDL_render.c.
References FlushRenderCommandsIfNotBatching(), SDL_FRect::h, i, QueueCmdDrawLines(), QueueCmdFillRects(), renderer, retval, SDL_Renderer::scale, SDL_max, SDL_min, SDL_OutOfMemory, SDL_small_alloc, SDL_small_free, SDL_FRect::w, SDL_FPoint::x, SDL_FRect::x, SDL_FPoint::y, and SDL_FRect::y.
Referenced by SDL_RenderDrawLinesF().
|
static |
Definition at line 2284 of file SDL_render.c.
References FlushRenderCommandsIfNotBatching(), SDL_FRect::h, i, QueueCmdFillRects(), renderer, retval, SDL_Renderer::scale, SDL_OutOfMemory, SDL_small_alloc, SDL_small_free, SDL_FRect::w, SDL_FPoint::x, SDL_FRect::x, SDL_FPoint::y, and SDL_FRect::y.
Referenced by SDL_RenderDrawPoints().
|
static |
Definition at line 2354 of file SDL_render.c.
References FlushRenderCommandsIfNotBatching(), SDL_FRect::h, i, QueueCmdFillRects(), renderer, retval, SDL_Renderer::scale, SDL_OutOfMemory, SDL_small_alloc, SDL_small_free, SDL_FRect::w, SDL_FPoint::x, SDL_FRect::x, SDL_FPoint::y, and SDL_FRect::y.
Referenced by SDL_RenderDrawPointsF().
void* SDL_AllocateRenderVertices | ( | SDL_Renderer * | renderer, |
const size_t | numbytes, | ||
const size_t | alignment, | ||
size_t * | offset | ||
) |
Definition at line 263 of file SDL_render.c.
References NULL, numbytes, ptr, renderer, SDL_OutOfMemory, SDL_realloc, SDL_Renderer::vertex_data, SDL_Renderer::vertex_data_allocation, and SDL_Renderer::vertex_data_used.
Referenced by SW_QueueCopy(), SW_QueueCopyEx(), SW_QueueDrawPoints(), and SW_QueueFillRects().
SDL_BlendMode SDL_ComposeCustomBlendMode | ( | SDL_BlendFactor | srcColorFactor, |
SDL_BlendFactor | dstColorFactor, | ||
SDL_BlendOperation | colorOperation, | ||
SDL_BlendFactor | srcAlphaFactor, | ||
SDL_BlendFactor | dstAlphaFactor, | ||
SDL_BlendOperation | alphaOperation | ||
) |
Create a custom blend mode, which may or may not be supported by a given renderer.
srcColorFactor | source color factor |
dstColorFactor | destination color factor |
colorOperation | color operation |
srcAlphaFactor | source alpha factor |
dstAlphaFactor | destination alpha factor |
alphaOperation | alpha operation |
The result of the blend mode operation will be: dstRGB = dstRGB * dstColorFactor colorOperation srcRGB * srcColorFactor and dstA = dstA * dstAlphaFactor alphaOperation srcA * srcAlphaFactor
Definition at line 3352 of file SDL_render.c.
References blendMode, SDL_COMPOSE_BLENDMODE, and SDL_GetShortBlendMode().
SDL_Renderer* SDL_CreateRenderer | ( | SDL_Window * | window, |
int | index, | ||
Uint32 | flags | ||
) |
Create a 2D rendering context for a window.
window | The window where rendering is displayed. |
index | The index of the rendering driver to initialize, or -1 to initialize the first one supporting the requested flags. |
flags | SDL_RendererFlags. |
Definition at line 765 of file SDL_render.c.
References SDL_Renderer::always_batch, Android_ActivityMutex_Lock_Running(), Android_ActivityMutex_Unlock(), SDL_Renderer::batching, SDL_RenderDriver::CreateRenderer, SDL_Renderer::dpi_scale, SDL_RendererInfo::flags, SDL_Renderer::GetOutputSize, SDL_Renderer::hidden, SDL_Renderer::info, SDL_RenderDriver::info, SDL_Renderer::magic, SDL_RendererInfo::name, NULL, SDL_Renderer::render_command_generation, render_drivers, renderer, renderer_magic, SDL_Renderer::scale, SDL_AddEventWatch, SDL_CreateMutex, SDL_FALSE, SDL_GetHint, SDL_GetHintBoolean, SDL_GetNumRenderDrivers(), SDL_GetRenderer(), SDL_GetWindowFlags, SDL_GetWindowSize, SDL_HINT_RENDER_BATCHING, SDL_HINT_RENDER_DRIVER, SDL_HINT_RENDER_VSYNC, SDL_LOG_CATEGORY_RENDER, SDL_LogInfo, SDL_RENDERER_PRESENTVSYNC, SDL_RendererEventWatch(), SDL_RenderSetViewport(), SDL_SetError, SDL_SetWindowData, SDL_strcasecmp, SDL_TRUE, SDL_WINDOW_HIDDEN, SDL_WINDOW_MINIMIZED, SDL_WINDOWRENDERDATA, SDL_Renderer::target_mutex, VerifyDrawQueueFunctions(), SDL_Renderer::window, window_h, window_w, SDL_FPoint::x, and SDL_FPoint::y.
Referenced by SDL_CreateWindowAndRenderer().
SDL_Renderer* SDL_CreateSoftwareRenderer | ( | SDL_Surface * | surface | ) |
Create a 2D software rendering context for a surface.
surface | The surface where rendering is done. |
Definition at line 910 of file SDL_render.c.
References SDL_Renderer::magic, NULL, SDL_Renderer::render_command_generation, renderer, renderer_magic, SDL_Renderer::scale, SDL_CreateMutex, SDL_RenderSetViewport(), SDL_SetError, SW_CreateRendererForSurface(), SDL_Renderer::target_mutex, VerifyDrawQueueFunctions(), SDL_FPoint::x, and SDL_FPoint::y.
SDL_Texture* SDL_CreateTexture | ( | SDL_Renderer * | renderer, |
Uint32 | format, | ||
int | access, | ||
int | w, | ||
int | h | ||
) |
Create a texture for a rendering context.
renderer | The renderer. |
format | The format of the texture. |
access | One of the enumerated values in SDL_TextureAccess. |
w | The width of the texture in pixels. |
h | The height of the texture in pixels. |
Definition at line 1043 of file SDL_render.c.
References CHECK_RENDERER_MAGIC, SDL_Renderer::CreateTexture, GetClosestSupportedFormat(), SDL_Renderer::info, IsSupportedFormat(), SDL_RendererInfo::max_texture_height, SDL_RendererInfo::max_texture_width, NULL, SDL_Texture::prev, renderer, SDL_BYTESPERPIXEL, SDL_calloc, SDL_DestroyTexture(), SDL_GetScaleMode(), SDL_ISPIXELFORMAT_FOURCC, SDL_ISPIXELFORMAT_INDEXED, SDL_OutOfMemory, SDL_SetError, SDL_SW_CreateYUVTexture(), SDL_TEXTUREACCESS_STREAMING, SDL_RendererInfo::texture_formats, texture_magic, and SDL_Renderer::textures.
Referenced by SDL_CreateTextureFromSurface().
SDL_Texture* SDL_CreateTextureFromSurface | ( | SDL_Renderer * | renderer, |
SDL_Surface * | surface | ||
) |
Create a texture from an existing surface.
renderer | The renderer. |
surface | The surface containing pixel data used to fill the texture. |
Definition at line 1142 of file SDL_render.c.
References SDL_Color::a, SDL_PixelFormat::Amask, blendMode, CHECK_RENDERER_MAGIC, SDL_Palette::colors, SDL_PixelFormat::format, i, SDL_Renderer::info, SDL_Palette::ncolors, NULL, SDL_RendererInfo::num_texture_formats, SDL_PixelFormat::palette, SDL_Surface::pitch, SDL_Surface::pixels, renderer, SDL_AllocFormat, SDL_ALPHA_OPAQUE, SDL_BLENDMODE_BLEND, SDL_ConvertSurface, SDL_CreateTexture(), SDL_DestroyTexture(), SDL_FALSE, SDL_FreeFormat, SDL_FreeSurface, SDL_GetSurfaceAlphaMod, SDL_GetSurfaceBlendMode, SDL_GetSurfaceColorMod, SDL_HasColorKey, SDL_ISPIXELFORMAT_ALPHA, SDL_ISPIXELFORMAT_FOURCC, SDL_LockSurface, SDL_MUSTLOCK, SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_UNKNOWN, SDL_SetError, SDL_SetTextureAlphaMod(), SDL_SetTextureBlendMode(), SDL_SetTextureColorMod(), SDL_TEXTUREACCESS_STATIC, SDL_TRUE, SDL_UnlockSurface, SDL_UpdateTexture(), and SDL_RendererInfo::texture_formats.
int SDL_CreateWindowAndRenderer | ( | int | width, |
int | height, | ||
Uint32 | window_flags, | ||
SDL_Window ** | window, | ||
SDL_Renderer ** | renderer | ||
) |
Create a window and default renderer.
width | The width of the window |
height | The height of the window |
window_flags | The flags used to create the window |
window | A pointer filled with the window, or NULL on error |
renderer | A pointer filled with the renderer, or NULL on error |
Definition at line 731 of file SDL_render.c.
References NULL, renderer, SDL_CreateRenderer(), SDL_CreateWindow, and SDL_WINDOWPOS_UNDEFINED.
void SDL_DestroyRenderer | ( | SDL_Renderer * | renderer | ) |
Destroy the rendering context for a window and free associated textures.
Definition at line 3204 of file SDL_render.c.
References CHECK_RENDERER_MAGIC, SDL_Renderer::DestroyRenderer, SDL_Renderer::magic, SDL_RenderCommand::next, NULL, SDL_Renderer::render_commands, SDL_Renderer::render_commands_pool, SDL_Renderer::render_commands_tail, renderer, SDL_assert, SDL_DelEventWatch, SDL_DestroyMutex, SDL_DestroyTexture(), SDL_free, SDL_RendererEventWatch(), SDL_SetWindowData, SDL_WINDOWRENDERDATA, SDL_Renderer::target_mutex, SDL_Renderer::textures, SDL_Renderer::vertex_data, void, and SDL_Renderer::window.
void SDL_DestroyTexture | ( | SDL_Texture * | texture | ) |
Destroy the specified texture.
Definition at line 3161 of file SDL_render.c.
References CHECK_TEXTURE_MAGIC, SDL_Renderer::DestroyTexture, FlushRenderCommandsIfTextureNeeded(), SDL_Texture::next, NULL, renderer, SDL_free, SDL_FreeSurface, SDL_SetRenderTarget(), SDL_SW_DestroyYUVTexture(), SDL_Renderer::target, and SDL_Renderer::textures.
Referenced by SDL_CreateTexture(), SDL_CreateTextureFromSurface(), and SDL_DestroyRenderer().
SDL_FORCE_INLINE SDL_bool SDL_FRectEmpty | ( | const SDL_FRect * | r | ) |
Definition at line 2875 of file SDL_render.c.
References SDL_FALSE, and SDL_TRUE.
Referenced by SDL_HasIntersectionF().
SDL_BlendOperation SDL_GetBlendModeAlphaOperation | ( | SDL_BlendMode | blendMode | ) |
SDL_BlendOperation SDL_GetBlendModeColorOperation | ( | SDL_BlendMode | blendMode | ) |
SDL_BlendFactor SDL_GetBlendModeDstAlphaFactor | ( | SDL_BlendMode | blendMode | ) |
SDL_BlendFactor SDL_GetBlendModeDstColorFactor | ( | SDL_BlendMode | blendMode | ) |
SDL_BlendFactor SDL_GetBlendModeSrcAlphaFactor | ( | SDL_BlendMode | blendMode | ) |
SDL_BlendFactor SDL_GetBlendModeSrcColorFactor | ( | SDL_BlendMode | blendMode | ) |
|
static |
Definition at line 3331 of file SDL_render.c.
References blendMode, SDL_BLENDMODE_ADD, SDL_BLENDMODE_ADD_FULL, SDL_BLENDMODE_BLEND, SDL_BLENDMODE_BLEND_FULL, SDL_BLENDMODE_MOD, SDL_BLENDMODE_MOD_FULL, SDL_BLENDMODE_MUL, SDL_BLENDMODE_MUL_FULL, SDL_BLENDMODE_NONE, and SDL_BLENDMODE_NONE_FULL.
Referenced by SDL_GetBlendModeAlphaOperation(), SDL_GetBlendModeColorOperation(), SDL_GetBlendModeDstAlphaFactor(), SDL_GetBlendModeDstColorFactor(), SDL_GetBlendModeSrcAlphaFactor(), and SDL_GetBlendModeSrcColorFactor().
int SDL_GetNumRenderDrivers | ( | void | ) |
Get the number of 2D rendering drivers available for the current display.
A render driver is a set of code that handles rendering and texture management on a particular display. Normally there is only one, but some drivers may have several available with different capabilities.
Definition at line 553 of file SDL_render.c.
References render_drivers, and SDL_arraysize.
Referenced by SDL_CreateRenderer(), and SDL_GetRenderDriverInfo().
int SDL_GetRenderDrawBlendMode | ( | SDL_Renderer * | renderer, |
SDL_BlendMode * | blendMode | ||
) |
Get the blend mode used for drawing operations.
renderer | The renderer from which blend mode should be queried. |
blendMode | A pointer filled in with the current blend mode. |
Definition at line 2244 of file SDL_render.c.
References blendMode, SDL_Renderer::blendMode, CHECK_RENDERER_MAGIC, and renderer.
int SDL_GetRenderDrawColor | ( | SDL_Renderer * | renderer, |
Uint8 * | r, | ||
Uint8 * | g, | ||
Uint8 * | b, | ||
Uint8 * | a | ||
) |
Get the color used for drawing operations (Rect, Line and Clear).
renderer | The renderer from which drawing color should be queried. |
r | A pointer to the red value used to draw on the rendering target. |
g | A pointer to the green value used to draw on the rendering target. |
b | A pointer to the blue value used to draw on the rendering target. |
a | A pointer to the alpha value used to draw on the rendering target, usually SDL_ALPHA_OPAQUE (255). |
Definition at line 2211 of file SDL_render.c.
References SDL_Renderer::a, SDL_Renderer::b, CHECK_RENDERER_MAGIC, SDL_Renderer::g, SDL_Renderer::r, and renderer.
int SDL_GetRenderDriverInfo | ( | int | index, |
SDL_RendererInfo * | info | ||
) |
Get information about a specific 2D rendering driver for the current display.
index | The index of the driver to query information about. |
info | A pointer to an SDL_RendererInfo struct to be filled with information on the rendering driver. |
Definition at line 563 of file SDL_render.c.
References SDL_RenderDriver::info, render_drivers, SDL_GetNumRenderDrivers(), and SDL_SetError.
SDL_Renderer* SDL_GetRenderer | ( | SDL_Window * | window | ) |
Get the renderer associated with a window.
Definition at line 937 of file SDL_render.c.
References SDL_GetWindowData, and SDL_WINDOWRENDERDATA.
Referenced by SDL_CreateRenderer().
int SDL_GetRendererInfo | ( | SDL_Renderer * | renderer, |
SDL_RendererInfo * | info | ||
) |
Get information about a rendering context.
Definition at line 943 of file SDL_render.c.
References CHECK_RENDERER_MAGIC, SDL_Renderer::info, and renderer.
int SDL_GetRendererOutputSize | ( | SDL_Renderer * | renderer, |
int * | w, | ||
int * | h | ||
) |
Get the output size in pixels of a rendering context.
Definition at line 952 of file SDL_render.c.
References CHECK_RENDERER_MAGIC, SDL_Renderer::GetOutputSize, NULL, renderer, SDL_assert, SDL_GetWindowSize, SDL_QueryTexture(), SDL_SetError, SDL_Renderer::target, and SDL_Renderer::window.
Referenced by SDL_RenderSetViewport(), and UpdateLogicalSize().
SDL_Texture* SDL_GetRenderTarget | ( | SDL_Renderer * | renderer | ) |
Get the current render target or NULL for the default render target.
Definition at line 1933 of file SDL_render.c.
References renderer, and SDL_Renderer::target.
Referenced by SDL_RendererEventWatch().
|
static |
Definition at line 1027 of file SDL_render.c.
References SDL_atoi, SDL_GetHint, SDL_HINT_RENDER_SCALE_QUALITY, SDL_ScaleModeBest, SDL_ScaleModeLinear, SDL_ScaleModeNearest, and SDL_strcasecmp.
Referenced by SDL_CreateTexture().
|
static |
Definition at line 3310 of file SDL_render.c.
References blendMode, SDL_BLENDMODE_ADD, SDL_BLENDMODE_ADD_FULL, SDL_BLENDMODE_BLEND, SDL_BLENDMODE_BLEND_FULL, SDL_BLENDMODE_MOD, SDL_BLENDMODE_MOD_FULL, SDL_BLENDMODE_MUL, SDL_BLENDMODE_MUL_FULL, SDL_BLENDMODE_NONE, and SDL_BLENDMODE_NONE_FULL.
Referenced by SDL_ComposeCustomBlendMode().
int SDL_GetTextureAlphaMod | ( | SDL_Texture * | texture, |
Uint8 * | alpha | ||
) |
Get the additional alpha value used in render copy operations.
texture | The texture to query. |
alpha | A pointer filled in with the current alpha value. |
Definition at line 1363 of file SDL_render.c.
References CHECK_TEXTURE_MAGIC.
int SDL_GetTextureBlendMode | ( | SDL_Texture * | texture, |
SDL_BlendMode * | blendMode | ||
) |
Get the blend mode used for texture copy operations.
texture | The texture to query. |
blendMode | A pointer filled in with the current blend mode. |
Definition at line 1392 of file SDL_render.c.
References blendMode, and CHECK_TEXTURE_MAGIC.
int SDL_GetTextureColorMod | ( | SDL_Texture * | texture, |
Uint8 * | r, | ||
Uint8 * | g, | ||
Uint8 * | b | ||
) |
Get the additional color value used in render copy operations.
texture | The texture to query. |
r | A pointer filled in with the current red color value. |
g | A pointer filled in with the current green color value. |
b | A pointer filled in with the current blue color value. |
Definition at line 1328 of file SDL_render.c.
References CHECK_TEXTURE_MAGIC.
int SDL_GetTextureScaleMode | ( | SDL_Texture * | texture, |
SDL_ScaleMode * | scaleMode | ||
) |
Get the scale mode used for texture scale operations.
texture | The texture to query. |
scaleMode | A pointer filled in with the current scale mode. |
Definition at line 1419 of file SDL_render.c.
References CHECK_TEXTURE_MAGIC.
int SDL_GL_BindTexture | ( | SDL_Texture * | texture, |
float * | texw, | ||
float * | texh | ||
) |
Bind the texture to the current OpenGL/ES/ES2 context for use with OpenGL instructions.
texture | The SDL texture to bind |
texw | A pointer to a float that will be filled with the texture width |
texh | A pointer to a float that will be filled with the texture height |
Definition at line 3253 of file SDL_render.c.
References CHECK_TEXTURE_MAGIC, FlushRenderCommandsIfTextureNeeded(), SDL_Renderer::GL_BindTexture, renderer, and SDL_Unsupported.
int SDL_GL_UnbindTexture | ( | SDL_Texture * | texture | ) |
Unbind a texture from the current OpenGL/ES/ES2 context.
texture | The SDL texture to unbind |
Definition at line 3269 of file SDL_render.c.
References CHECK_TEXTURE_MAGIC, FlushRenderCommandsIfTextureNeeded(), SDL_Renderer::GL_UnbindTexture, renderer, and SDL_Unsupported.
Definition at line 2882 of file SDL_render.c.
References SDL_FRect::h, SDL_FALSE, SDL_FRectEmpty(), SDL_InvalidParamError, SDL_TRUE, SDL_FRect::w, SDL_FRect::x, and SDL_FRect::y.
Referenced by SDL_RenderCopyF().
int SDL_LockTexture | ( | SDL_Texture * | texture, |
const SDL_Rect * | rect, | ||
void ** | pixels, | ||
int * | pitch | ||
) |
Lock a portion of the texture for write-only pixel access.
texture | The texture to lock for access, which was created with SDL_TEXTUREACCESS_STREAMING. |
rect | A pointer to the rectangle to lock for access. If the rect is NULL, the entire texture will be locked. |
pixels | This is filled in with a pointer to the locked pixels, appropriately offset by the locked area. |
pitch | This is filled in with the pitch of the locked pixels. |
Definition at line 1701 of file SDL_render.c.
References CHECK_TEXTURE_MAGIC, FlushRenderCommandsIfTextureNeeded(), SDL_Rect::h, SDL_Renderer::LockTexture, rect, renderer, SDL_LockTextureNative(), SDL_LockTextureYUV(), SDL_SetError, SDL_TEXTUREACCESS_STREAMING, SDL_Rect::w, SDL_Rect::x, and SDL_Rect::y.
Referenced by SDL_LockTextureToSurface(), SDL_UnlockTextureNative(), SDL_UnlockTextureYUV(), SDL_UpdateTextureNative(), SDL_UpdateTextureYUV(), and SDL_UpdateTextureYUVPlanar().
|
static |
Definition at line 1689 of file SDL_render.c.
References rect, SDL_BYTESPERPIXEL, SDL_Rect::x, and SDL_Rect::y.
Referenced by SDL_LockTexture().
int SDL_LockTextureToSurface | ( | SDL_Texture * | texture, |
const SDL_Rect * | rect, | ||
SDL_Surface ** | surface | ||
) |
Lock a portion of the texture for write-only pixel access. Expose it as a SDL surface.
texture | The texture to lock for access, which was created with SDL_TEXTUREACCESS_STREAMING. |
rect | A pointer to the rectangle to lock for access. If the rect is NULL, the entire texture will be locked. |
surface | This is filled in with a SDL surface representing the locked area Surface is freed internally after calling SDL_UnlockTexture or SDL_DestroyTexture. |
Definition at line 1741 of file SDL_render.c.
References SDL_Rect::h, NULL, rect, SDL_CreateRGBSurfaceWithFormatFrom, SDL_IntersectRect, SDL_LockTexture(), SDL_UnlockTexture(), SDL_Rect::w, SDL_Rect::x, and SDL_Rect::y.
|
static |
Definition at line 1681 of file SDL_render.c.
References rect, and SDL_SW_LockYUVTexture().
Referenced by SDL_LockTexture().
int SDL_QueryTexture | ( | SDL_Texture * | texture, |
Uint32 * | format, | ||
int * | access, | ||
int * | w, | ||
int * | h | ||
) |
Query the attributes of a texture.
texture | A texture to be queried. |
format | A pointer filled in with the raw format of the texture. The actual format may differ, but pixel transfers will use this format. |
access | A pointer filled in with the actual access to the texture. |
w | A pointer filled in with the width of the texture in pixels. |
h | A pointer filled in with the height of the texture in pixels. |
Definition at line 1288 of file SDL_render.c.
References CHECK_TEXTURE_MAGIC.
Referenced by SDL_GetRendererOutputSize().
int SDL_RenderClear | ( | SDL_Renderer * | renderer | ) |
Clear the current rendering target with the drawing color.
This function clears the entire rendering target, ignoring the viewport and the clip rectangle.
Definition at line 2253 of file SDL_render.c.
References CHECK_RENDERER_MAGIC, FlushRenderCommandsIfNotBatching(), QueueCmdClear(), renderer, and retval.
int SDL_RenderCopy | ( | SDL_Renderer * | renderer, |
SDL_Texture * | texture, | ||
const SDL_Rect * | srcrect, | ||
const SDL_Rect * | dstrect | ||
) |
Copy a portion of the texture to the current rendering target.
renderer | The renderer which should copy parts of a texture. |
texture | The source texture. |
srcrect | A pointer to the source rectangle, or NULL for the entire texture. |
dstrect | A pointer to the destination rectangle, or NULL for the entire rendering target. |
Definition at line 2929 of file SDL_render.c.
References SDL_Rect::h, SDL_FRect::h, NULL, renderer, SDL_RenderCopyF(), SDL_Rect::w, SDL_FRect::w, SDL_Rect::x, SDL_FRect::x, SDL_Rect::y, and SDL_FRect::y.
int SDL_RenderCopyEx | ( | SDL_Renderer * | renderer, |
SDL_Texture * | texture, | ||
const SDL_Rect * | srcrect, | ||
const SDL_Rect * | dstrect, | ||
const double | angle, | ||
const SDL_Point * | center, | ||
const SDL_RendererFlip | flip | ||
) |
Copy a portion of the source texture to the current rendering target, rotating it by angle around the given center.
renderer | The renderer which should copy parts of a texture. |
texture | The source texture. |
srcrect | A pointer to the source rectangle, or NULL for the entire texture. |
dstrect | A pointer to the destination rectangle, or NULL for the entire rendering target. |
angle | An angle in degrees that indicates the rotation that will be applied to dstrect, rotating it in a clockwise direction |
center | A pointer to a point indicating the point around which dstrect will be rotated (if NULL, rotation will be done around dstrect.w/2, dstrect.h/2). |
flip | An SDL_RendererFlip value stating which flipping actions should be performed on the texture |
Definition at line 3004 of file SDL_render.c.
References SDL_Rect::h, SDL_FRect::h, NULL, renderer, SDL_RenderCopyExF(), SDL_Rect::w, SDL_FRect::w, SDL_Point::x, SDL_FPoint::x, SDL_Rect::x, SDL_FRect::x, SDL_Point::y, SDL_FPoint::y, SDL_Rect::y, and SDL_FRect::y.
int SDL_RenderCopyExF | ( | SDL_Renderer * | renderer, |
SDL_Texture * | texture, | ||
const SDL_Rect * | srcrect, | ||
const SDL_FRect * | dstrect, | ||
const double | angle, | ||
const SDL_FPoint * | center, | ||
const SDL_RendererFlip | flip | ||
) |
Copy a portion of the source texture to the current rendering target, rotating it by angle around the given center.
renderer | The renderer which should copy parts of a texture. |
texture | The source texture. |
srcrect | A pointer to the source rectangle, or NULL for the entire texture. |
dstrect | A pointer to the destination rectangle, or NULL for the entire rendering target. |
angle | An angle in degrees that indicates the rotation that will be applied to dstrect, rotating it in a clockwise direction |
center | A pointer to a point indicating the point around which dstrect will be rotated (if NULL, rotation will be done around dstrect.w/2, dstrect.h/2). |
flip | An SDL_RendererFlip value stating which flipping actions should be performed on the texture |
Definition at line 3031 of file SDL_render.c.
References CHECK_RENDERER_MAGIC, CHECK_TEXTURE_MAGIC, FlushRenderCommandsIfNotBatching(), SDL_Rect::h, SDL_FRect::h, SDL_Renderer::hidden, QueueCmdCopyEx(), SDL_Renderer::QueueCopyEx, SDL_Renderer::render_command_generation, renderer, retval, SDL_Renderer::scale, SDL_FLIP_NONE, SDL_IntersectRect, SDL_RenderCopyF(), SDL_RenderGetViewport(), SDL_SetError, SDL_zero, SDL_Rect::w, SDL_FRect::w, SDL_FPoint::x, SDL_Rect::x, SDL_FRect::x, SDL_FPoint::y, SDL_Rect::y, and SDL_FRect::y.
Referenced by SDL_RenderCopyEx().
int SDL_RenderCopyF | ( | SDL_Renderer * | renderer, |
SDL_Texture * | texture, | ||
const SDL_Rect * | srcrect, | ||
const SDL_FRect * | dstrect | ||
) |
Copy a portion of the texture to the current rendering target.
renderer | The renderer which should copy parts of a texture. |
texture | The source texture. |
srcrect | A pointer to the source rectangle, or NULL for the entire texture. |
dstrect | A pointer to the destination rectangle, or NULL for the entire rendering target. |
Definition at line 2945 of file SDL_render.c.
References CHECK_RENDERER_MAGIC, CHECK_TEXTURE_MAGIC, FlushRenderCommandsIfNotBatching(), SDL_Rect::h, SDL_FRect::h, SDL_Renderer::hidden, QueueCmdCopy(), SDL_Renderer::render_command_generation, renderer, retval, SDL_Renderer::scale, SDL_HasIntersectionF(), SDL_IntersectRect, SDL_RenderGetViewport(), SDL_SetError, SDL_zero, SDL_Rect::w, SDL_FRect::w, SDL_FPoint::x, SDL_Rect::x, SDL_FRect::x, SDL_FPoint::y, SDL_Rect::y, and SDL_FRect::y.
Referenced by SDL_RenderCopy(), and SDL_RenderCopyExF().
int SDL_RenderDrawLine | ( | SDL_Renderer * | renderer, |
int | x1, | ||
int | y1, | ||
int | x2, | ||
int | y2 | ||
) |
Draw a line on the current rendering target.
renderer | The renderer which should draw a line. |
x1 | The x coordinate of the start point. |
y1 | The y coordinate of the start point. |
x2 | The x coordinate of the end point. |
y2 | The y coordinate of the end point. |
Definition at line 2424 of file SDL_render.c.
References renderer, SDL_RenderDrawLinesF(), and SDL_FPoint::x.
int SDL_RenderDrawLineF | ( | SDL_Renderer * | renderer, |
float | x1, | ||
float | y1, | ||
float | x2, | ||
float | y2 | ||
) |
Draw a line on the current rendering target.
renderer | The renderer which should draw a line. |
x1 | The x coordinate of the start point. |
y1 | The y coordinate of the start point. |
x2 | The x coordinate of the end point. |
y2 | The y coordinate of the end point. |
Definition at line 2435 of file SDL_render.c.
References renderer, SDL_RenderDrawLinesF(), and SDL_FPoint::x.
int SDL_RenderDrawLines | ( | SDL_Renderer * | renderer, |
const SDL_Point * | points, | ||
int | count | ||
) |
Draw a series of connected lines on the current rendering target.
renderer | The renderer which should draw multiple lines. |
points | The points along the lines |
count | The number of points, drawing count-1 lines |
Definition at line 2556 of file SDL_render.c.
References CHECK_RENDERER_MAGIC, FlushRenderCommandsIfNotBatching(), SDL_Renderer::hidden, i, QueueCmdDrawLines(), RenderDrawLinesWithRects(), renderer, retval, SDL_Renderer::scale, SDL_OutOfMemory, SDL_SetError, SDL_small_alloc, SDL_small_free, SDL_FPoint::x, and SDL_FPoint::y.
int SDL_RenderDrawLinesF | ( | SDL_Renderer * | renderer, |
const SDL_FPoint * | points, | ||
int | count | ||
) |
Draw a series of connected lines on the current rendering target.
renderer | The renderer which should draw multiple lines. |
points | The points along the lines |
count | The number of points, drawing count-1 lines |
Definition at line 2599 of file SDL_render.c.
References CHECK_RENDERER_MAGIC, FlushRenderCommandsIfNotBatching(), SDL_Renderer::hidden, i, QueueCmdDrawLines(), RenderDrawLinesWithRectsF(), renderer, retval, SDL_Renderer::scale, SDL_OutOfMemory, SDL_SetError, SDL_small_alloc, SDL_small_free, SDL_FPoint::x, and SDL_FPoint::y.
Referenced by SDL_RenderDrawLine(), SDL_RenderDrawLineF(), and SDL_RenderDrawRectF().
int SDL_RenderDrawPoint | ( | SDL_Renderer * | renderer, |
int | x, | ||
int | y | ||
) |
Draw a point on the current rendering target.
renderer | The renderer which should draw a point. |
x | The x coordinate of the point. |
y | The y coordinate of the point. |
Definition at line 2266 of file SDL_render.c.
References renderer, SDL_RenderDrawPointsF(), SDL_FPoint::x, and SDL_FPoint::y.
int SDL_RenderDrawPointF | ( | SDL_Renderer * | renderer, |
float | x, | ||
float | y | ||
) |
Draw a point on the current rendering target.
renderer | The renderer which should draw a point. |
x | The x coordinate of the point. |
y | The y coordinate of the point. |
Definition at line 2275 of file SDL_render.c.
References renderer, SDL_RenderDrawPointsF(), SDL_FPoint::x, and SDL_FPoint::y.
int SDL_RenderDrawPoints | ( | SDL_Renderer * | renderer, |
const SDL_Point * | points, | ||
int | count | ||
) |
Draw multiple points on the current rendering target.
renderer | The renderer which should draw multiple points. |
points | The points to draw |
count | The number of points to draw |
Definition at line 2311 of file SDL_render.c.
References CHECK_RENDERER_MAGIC, FlushRenderCommandsIfNotBatching(), SDL_Renderer::hidden, i, QueueCmdDrawPoints(), RenderDrawPointsWithRects(), renderer, retval, SDL_Renderer::scale, SDL_OutOfMemory, SDL_SetError, SDL_small_alloc, SDL_small_free, SDL_FPoint::x, and SDL_FPoint::y.
int SDL_RenderDrawPointsF | ( | SDL_Renderer * | renderer, |
const SDL_FPoint * | points, | ||
int | count | ||
) |
Draw multiple points on the current rendering target.
renderer | The renderer which should draw multiple points. |
points | The points to draw |
count | The number of points to draw |
Definition at line 2381 of file SDL_render.c.
References CHECK_RENDERER_MAGIC, FlushRenderCommandsIfNotBatching(), SDL_Renderer::hidden, i, QueueCmdDrawPoints(), RenderDrawPointsWithRectsF(), renderer, retval, SDL_Renderer::scale, SDL_OutOfMemory, SDL_SetError, SDL_small_alloc, SDL_small_free, SDL_FPoint::x, and SDL_FPoint::y.
Referenced by SDL_RenderDrawPoint(), and SDL_RenderDrawPointF().
int SDL_RenderDrawRect | ( | SDL_Renderer * | renderer, |
const SDL_Rect * | rect | ||
) |
Draw a rectangle on the current rendering target.
renderer | The renderer which should draw a rectangle. |
rect | A pointer to the destination rectangle, or NULL to outline the entire rendering target. |
Definition at line 2642 of file SDL_render.c.
References SDL_Rect::h, SDL_FRect::h, NULL, rect, renderer, SDL_RenderDrawRectF(), SDL_Rect::w, SDL_FRect::w, SDL_Rect::x, SDL_FRect::x, SDL_Rect::y, and SDL_FRect::y.
Referenced by SDL_RenderDrawRects().
int SDL_RenderDrawRectF | ( | SDL_Renderer * | renderer, |
const SDL_FRect * | rect | ||
) |
Draw a rectangle on the current rendering target.
renderer | The renderer which should draw a rectangle. |
rect | A pointer to the destination rectangle, or NULL to outline the entire rendering target. |
Definition at line 2659 of file SDL_render.c.
References CHECK_RENDERER_MAGIC, SDL_Rect::h, SDL_FRect::h, rect, renderer, SDL_RenderDrawLinesF(), SDL_RenderGetViewport(), SDL_Rect::w, SDL_FRect::w, SDL_Rect::x, SDL_FRect::x, SDL_Rect::y, and SDL_FRect::y.
Referenced by SDL_RenderDrawRect(), and SDL_RenderDrawRectsF().
int SDL_RenderDrawRects | ( | SDL_Renderer * | renderer, |
const SDL_Rect * | rects, | ||
int | count | ||
) |
Draw some number of rectangles on the current rendering target.
renderer | The renderer which should draw multiple rectangles. |
rects | A pointer to an array of destination rectangles. |
count | The number of rectangles. |
Definition at line 2691 of file SDL_render.c.
References CHECK_RENDERER_MAGIC, SDL_Renderer::hidden, i, renderer, SDL_RenderDrawRect(), and SDL_SetError.
int SDL_RenderDrawRectsF | ( | SDL_Renderer * | renderer, |
const SDL_FRect * | rects, | ||
int | count | ||
) |
Draw some number of rectangles on the current rendering target.
renderer | The renderer which should draw multiple rectangles. |
rects | A pointer to an array of destination rectangles. |
count | The number of rectangles. |
Definition at line 2719 of file SDL_render.c.
References CHECK_RENDERER_MAGIC, SDL_Renderer::hidden, i, renderer, SDL_RenderDrawRectF(), and SDL_SetError.
Definition at line 588 of file SDL_render.c.
References SDL_Renderer::dpi_scale, FlushRenderCommandsIfNotBatching(), SDL_Renderer::GetOutputSize, GetWindowViewportValues(), SDL_Rect::h, SDL_Renderer::hidden, SDL_Renderer::logical_w, NULL, QueueCmdSetViewport(), renderer, SDL_FALSE, SDL_FINGERDOWN, SDL_FINGERMOTION, SDL_FINGERUP, SDL_GetRenderTarget(), SDL_GetWindowFlags, SDL_GetWindowFromID, SDL_GetWindowSize, SDL_max, SDL_min, SDL_MOUSEBUTTONDOWN, SDL_MOUSEBUTTONUP, SDL_MOUSEMOTION, SDL_SetRenderTarget(), SDL_TRUE, SDL_WINDOW_HIDDEN, SDL_WINDOW_MINIMIZED, SDL_WINDOWEVENT, SDL_WINDOWEVENT_HIDDEN, SDL_WINDOWEVENT_MAXIMIZED, SDL_WINDOWEVENT_MINIMIZED, SDL_WINDOWEVENT_RESTORED, SDL_WINDOWEVENT_SHOWN, SDL_WINDOWEVENT_SIZE_CHANGED, SDL_Renderer::target, UpdateLogicalSize(), viewport, SDL_Renderer::viewport, SDL_Renderer::viewport_backup, SDL_Rect::w, SDL_Renderer::window, SDL_Renderer::WindowEvent, SDL_FPoint::x, SDL_Rect::x, SDL_FPoint::y, and SDL_Rect::y.
Referenced by SDL_CreateRenderer(), and SDL_DestroyRenderer().
int SDL_RenderFillRect | ( | SDL_Renderer * | renderer, |
const SDL_Rect * | rect | ||
) |
Fill a rectangle on the current rendering target with the drawing color.
renderer | The renderer which should fill a rectangle. |
rect | A pointer to the destination rectangle, or NULL for the entire rendering target. |
Definition at line 2747 of file SDL_render.c.
References CHECK_RENDERER_MAGIC, SDL_Rect::h, SDL_FRect::h, rect, renderer, SDL_RenderFillRectsF(), SDL_RenderGetViewport(), SDL_zero, SDL_Rect::w, SDL_FRect::w, SDL_Rect::x, SDL_FRect::x, SDL_Rect::y, and SDL_FRect::y.
int SDL_RenderFillRectF | ( | SDL_Renderer * | renderer, |
const SDL_FRect * | rect | ||
) |
Fill a rectangle on the current rendering target with the drawing color.
renderer | The renderer which should fill a rectangle. |
rect | A pointer to the destination rectangle, or NULL for the entire rendering target. |
Definition at line 2772 of file SDL_render.c.
References CHECK_RENDERER_MAGIC, SDL_FRect::h, rect, renderer, SDL_RenderFillRectsF(), SDL_RenderGetViewport(), SDL_zero, SDL_FRect::w, SDL_FRect::x, and SDL_FRect::y.
int SDL_RenderFillRects | ( | SDL_Renderer * | renderer, |
const SDL_Rect * | rects, | ||
int | count | ||
) |
Fill some number of rectangles on the current rendering target with the drawing color.
renderer | The renderer which should fill multiple rectangles. |
rects | A pointer to an array of destination rectangles. |
count | The number of rectangles. |
Definition at line 2793 of file SDL_render.c.
References CHECK_RENDERER_MAGIC, FlushRenderCommandsIfNotBatching(), SDL_FRect::h, SDL_Renderer::hidden, i, QueueCmdFillRects(), renderer, retval, SDL_Renderer::scale, SDL_OutOfMemory, SDL_SetError, SDL_small_alloc, SDL_small_free, SDL_FRect::w, SDL_FPoint::x, SDL_FRect::x, SDL_FPoint::y, and SDL_FRect::y.
int SDL_RenderFillRectsF | ( | SDL_Renderer * | renderer, |
const SDL_FRect * | rects, | ||
int | count | ||
) |
Fill some number of rectangles on the current rendering target with the drawing color.
renderer | The renderer which should fill multiple rectangles. |
rects | A pointer to an array of destination rectangles. |
count | The number of rectangles. |
Definition at line 2834 of file SDL_render.c.
References CHECK_RENDERER_MAGIC, FlushRenderCommandsIfNotBatching(), SDL_FRect::h, SDL_Renderer::hidden, i, QueueCmdFillRects(), renderer, retval, SDL_Renderer::scale, SDL_OutOfMemory, SDL_SetError, SDL_small_alloc, SDL_small_free, SDL_FRect::w, SDL_FPoint::x, SDL_FRect::x, SDL_FPoint::y, and SDL_FRect::y.
Referenced by SDL_RenderFillRect(), and SDL_RenderFillRectF().
int SDL_RenderFlush | ( | SDL_Renderer * | renderer | ) |
Force the rendering context to flush any pending commands to the underlying rendering API.
You do not need to (and in fact, shouldn't) call this function unless you are planning to call into OpenGL/Direct3D/Metal/whatever directly in addition to using an SDL_Renderer.
This is for a very-specific case: if you are using SDL's render API, you asked for a specific renderer backend (OpenGL, Direct3D, etc), you set SDL_HINT_RENDER_BATCHING to "1", and you plan to make OpenGL/D3D/whatever calls in addition to SDL render API calls. If all of this applies, you should call SDL_RenderFlush() between calls to SDL's render API and the low-level API you're using in cooperation.
In all other cases, you can ignore this function. This is only here to get maximum performance out of a specific situation. In all other cases, SDL will do the right thing, perhaps at a performance loss.
This function is first available in SDL 2.0.10, and is not needed in 2.0.9 and earlier, as earlier versions did not queue rendering commands at all, instead flushing them to the OS immediately.
Definition at line 257 of file SDL_render.c.
References FlushRenderCommands(), and renderer.
void SDL_RenderGetClipRect | ( | SDL_Renderer * | renderer, |
SDL_Rect * | rect | ||
) |
Get the clip rectangle for the current target.
renderer | The renderer from which clip rectangle should be queried. |
rect | A pointer filled in with the current clip rectangle, or an empty rectangle if clipping is disabled. |
Definition at line 2155 of file SDL_render.c.
References CHECK_RENDERER_MAGIC, SDL_Renderer::clip_rect, SDL_Rect::h, rect, renderer, SDL_Renderer::scale, SDL_Rect::w, SDL_FPoint::x, SDL_Rect::x, SDL_FPoint::y, and SDL_Rect::y.
SDL_bool SDL_RenderGetIntegerScale | ( | SDL_Renderer * | renderer | ) |
Get whether integer scales are forced for resolution-independent rendering.
renderer | The renderer from which integer scaling should be queried. |
Definition at line 2091 of file SDL_render.c.
References CHECK_RENDERER_MAGIC, SDL_Renderer::integer_scale, renderer, and SDL_FALSE.
void SDL_RenderGetLogicalSize | ( | SDL_Renderer * | renderer, |
int * | w, | ||
int * | h | ||
) |
Get device independent resolution for rendering.
renderer | The renderer from which resolution should be queried. |
w | A pointer filled with the width of the logical resolution |
h | A pointer filled with the height of the logical resolution |
Definition at line 2068 of file SDL_render.c.
References CHECK_RENDERER_MAGIC, SDL_Renderer::logical_h, SDL_Renderer::logical_w, and renderer.
void* SDL_RenderGetMetalCommandEncoder | ( | SDL_Renderer * | renderer | ) |
Get the Metal command encoder for the current frame.
renderer | The renderer to query |
Definition at line 3298 of file SDL_render.c.
References CHECK_RENDERER_MAGIC, FlushRenderCommands(), SDL_Renderer::GetMetalCommandEncoder, NULL, and renderer.
void* SDL_RenderGetMetalLayer | ( | SDL_Renderer * | renderer | ) |
Get the CAMetalLayer associated with the given Metal renderer.
renderer | The renderer to query |
Definition at line 3286 of file SDL_render.c.
References CHECK_RENDERER_MAGIC, FlushRenderCommands(), SDL_Renderer::GetMetalLayer, NULL, and renderer.
void SDL_RenderGetScale | ( | SDL_Renderer * | renderer, |
float * | scaleX, | ||
float * | scaleY | ||
) |
Get the drawing scale for the current target.
renderer | The renderer from which drawing scale should be queried. |
scaleX | A pointer filled in with the horizontal scaling factor |
scaleY | A pointer filled in with the vertical scaling factor |
Definition at line 2185 of file SDL_render.c.
References CHECK_RENDERER_MAGIC, renderer, SDL_Renderer::scale, SDL_FPoint::x, and SDL_FPoint::y.
void SDL_RenderGetViewport | ( | SDL_Renderer * | renderer, |
SDL_Rect * | rect | ||
) |
Get the drawing area for the current target.
Definition at line 2121 of file SDL_render.c.
References CHECK_RENDERER_MAGIC, SDL_Rect::h, rect, renderer, SDL_Renderer::scale, SDL_Renderer::viewport, SDL_Rect::w, SDL_FPoint::x, SDL_Rect::x, SDL_FPoint::y, and SDL_Rect::y.
Referenced by SDL_RenderCopyExF(), SDL_RenderCopyF(), SDL_RenderDrawRectF(), SDL_RenderFillRect(), and SDL_RenderFillRectF().
SDL_bool SDL_RenderIsClipEnabled | ( | SDL_Renderer * | renderer | ) |
Get whether clipping is enabled on the given renderer.
renderer | The renderer from which clip state should be queried. |
Definition at line 2168 of file SDL_render.c.
References CHECK_RENDERER_MAGIC, SDL_Renderer::clipping_enabled, renderer, and SDL_FALSE.
void SDL_RenderPresent | ( | SDL_Renderer * | renderer | ) |
Update the screen with rendering performed.
Definition at line 3147 of file SDL_render.c.
References CHECK_RENDERER_MAGIC, FlushRenderCommands(), SDL_Renderer::hidden, renderer, and SDL_Renderer::RenderPresent.
int SDL_RenderReadPixels | ( | SDL_Renderer * | renderer, |
const SDL_Rect * | rect, | ||
Uint32 | format, | ||
void * | pixels, | ||
int | pitch | ||
) |
Read pixels from the current rendering target.
renderer | The renderer from which pixels should be read. |
rect | A pointer to the rectangle to read, or NULL for the entire render target. |
format | The desired format of the pixel data, or 0 to use the format of the rendering target |
pixels | A pointer to be filled in with the pixel data |
pitch | The pitch of the pixels parameter. |
Definition at line 3108 of file SDL_render.c.
References bpp, CHECK_RENDERER_MAGIC, FlushRenderCommands(), SDL_Rect::h, rect, renderer, SDL_Renderer::RenderReadPixels, SDL_BYTESPERPIXEL, SDL_GetWindowPixelFormat, SDL_IntersectRect, SDL_Unsupported, SDL_Renderer::viewport, SDL_Rect::w, SDL_Renderer::window, SDL_Rect::x, and SDL_Rect::y.
int SDL_RenderSetClipRect | ( | SDL_Renderer * | renderer, |
const SDL_Rect * | rect | ||
) |
Set the clip rectangle for the current target.
renderer | The renderer for which clip rectangle should be set. |
rect | A pointer to the rectangle to set as the clip rectangle, relative to the viewport, or NULL to disable clipping. |
Definition at line 2134 of file SDL_render.c.
References CHECK_RENDERER_MAGIC, SDL_Renderer::clip_rect, SDL_Renderer::clipping_enabled, FlushRenderCommandsIfNotBatching(), SDL_Rect::h, QueueCmdSetClipRect(), rect, renderer, retval, SDL_Renderer::scale, SDL_ceil, SDL_FALSE, SDL_floor, SDL_TRUE, SDL_zero, SDL_Rect::w, SDL_FPoint::x, SDL_Rect::x, SDL_FPoint::y, and SDL_Rect::y.
int SDL_RenderSetIntegerScale | ( | SDL_Renderer * | renderer, |
SDL_bool | enable | ||
) |
Set whether to force integer scales for resolution-independent rendering.
renderer | The renderer for which integer scaling should be set. |
enable | Enable or disable integer scaling |
This function restricts the logical viewport to integer values - that is, when a resolution is between two multiples of a logical size, the viewport size is rounded down to the lower multiple.
Definition at line 2081 of file SDL_render.c.
References CHECK_RENDERER_MAGIC, SDL_Renderer::integer_scale, renderer, and UpdateLogicalSize().
int SDL_RenderSetLogicalSize | ( | SDL_Renderer * | renderer, |
int | w, | ||
int | h | ||
) |
Set device independent resolution for rendering.
renderer | The renderer for which resolution should be set. |
w | The width of the logical resolution |
h | The height of the logical resolution |
This function uses the viewport and scaling functionality to allow a fixed logical resolution for rendering, regardless of the actual output resolution. If the actual output resolution doesn't have the same aspect ratio the output rendering will be centered within the output display.
If the output display is a window, mouse events in the window will be filtered and scaled so they seem to arrive within the logical resolution.
Definition at line 2048 of file SDL_render.c.
References CHECK_RENDERER_MAGIC, SDL_Renderer::logical_h, SDL_Renderer::logical_w, NULL, renderer, SDL_RenderSetScale(), SDL_RenderSetViewport(), and UpdateLogicalSize().
int SDL_RenderSetScale | ( | SDL_Renderer * | renderer, |
float | scaleX, | ||
float | scaleY | ||
) |
Set the drawing scale for rendering on the current target.
renderer | The renderer for which the drawing scale should be set. |
scaleX | The horizontal scaling factor |
scaleY | The vertical scaling factor |
The drawing coordinates are scaled by the x/y scaling factors before they are used by the renderer. This allows resolution independent drawing with a single coordinate system.
Definition at line 2175 of file SDL_render.c.
References CHECK_RENDERER_MAGIC, renderer, SDL_Renderer::scale, SDL_FPoint::x, and SDL_FPoint::y.
Referenced by SDL_RenderSetLogicalSize(), and UpdateLogicalSize().
int SDL_RenderSetViewport | ( | SDL_Renderer * | renderer, |
const SDL_Rect * | rect | ||
) |
Set the drawing area for rendering on the current target.
renderer | The renderer for which the drawing area should be set. |
rect | The rectangle representing the drawing area, or NULL to set the viewport to the entire target. |
The x,y of the viewport rect represents the origin for rendering.
Definition at line 2099 of file SDL_render.c.
References CHECK_RENDERER_MAGIC, FlushRenderCommandsIfNotBatching(), SDL_Rect::h, QueueCmdSetViewport(), rect, renderer, retval, SDL_Renderer::scale, SDL_ceil, SDL_floor, SDL_GetRendererOutputSize(), SDL_Renderer::viewport, SDL_Rect::w, SDL_FPoint::x, SDL_Rect::x, SDL_FPoint::y, and SDL_Rect::y.
Referenced by SDL_CreateRenderer(), SDL_CreateSoftwareRenderer(), SDL_RenderSetLogicalSize(), and UpdateLogicalSize().
SDL_bool SDL_RenderTargetSupported | ( | SDL_Renderer * | renderer | ) |
Determines whether a window supports the use of render targets.
renderer | The renderer that will be checked |
Definition at line 1845 of file SDL_render.c.
References SDL_RendererInfo::flags, SDL_Renderer::info, renderer, SDL_FALSE, SDL_RENDERER_TARGETTEXTURE, and SDL_Renderer::SetRenderTarget.
Referenced by SDL_SetRenderTarget().
int SDL_SetRenderDrawBlendMode | ( | SDL_Renderer * | renderer, |
SDL_BlendMode | blendMode | ||
) |
Set the blend mode used for drawing operations (Fill and Line).
renderer | The renderer for which blend mode should be set. |
blendMode | SDL_BlendMode to use for blending. |
Definition at line 2232 of file SDL_render.c.
References blendMode, SDL_Renderer::blendMode, CHECK_RENDERER_MAGIC, IsSupportedBlendMode(), renderer, and SDL_Unsupported.
int SDL_SetRenderDrawColor | ( | SDL_Renderer * | renderer, |
Uint8 | r, | ||
Uint8 | g, | ||
Uint8 | b, | ||
Uint8 | a | ||
) |
Set the color used for drawing operations (Rect, Line and Clear).
renderer | The renderer for which drawing color should be set. |
r | The red value used to draw on the rendering target. |
g | The green value used to draw on the rendering target. |
b | The blue value used to draw on the rendering target. |
a | The alpha value used to draw on the rendering target, usually SDL_ALPHA_OPAQUE (255). |
Definition at line 2198 of file SDL_render.c.
References SDL_Renderer::a, SDL_Renderer::b, CHECK_RENDERER_MAGIC, SDL_Renderer::g, SDL_Renderer::r, and renderer.
int SDL_SetRenderTarget | ( | SDL_Renderer * | renderer, |
SDL_Texture * | texture | ||
) |
Set a texture as the current rendering target.
renderer | The renderer. |
texture | The targeted texture, which must be created with the SDL_TEXTUREACCESS_TARGET flag, or NULL for the default render target |
Definition at line 1854 of file SDL_render.c.
References CHECK_TEXTURE_MAGIC, SDL_Renderer::clip_rect, SDL_Renderer::clip_rect_backup, SDL_Renderer::clipping_enabled, SDL_Renderer::clipping_enabled_backup, FlushRenderCommands(), FlushRenderCommandsIfNotBatching(), SDL_Rect::h, SDL_Renderer::logical_h, SDL_Renderer::logical_h_backup, SDL_Renderer::logical_w, SDL_Renderer::logical_w_backup, QueueCmdSetClipRect(), QueueCmdSetViewport(), renderer, SDL_Renderer::scale, SDL_Renderer::scale_backup, SDL_FALSE, SDL_LockMutex, SDL_RenderTargetSupported(), SDL_SetError, SDL_TEXTUREACCESS_TARGET, SDL_UnlockMutex, SDL_Unsupported, SDL_zero, SDL_Renderer::SetRenderTarget, SDL_Renderer::target, SDL_Renderer::target_mutex, SDL_Renderer::viewport, SDL_Renderer::viewport_backup, SDL_Rect::w, SDL_FPoint::x, SDL_Rect::x, SDL_FPoint::y, and SDL_Rect::y.
Referenced by SDL_DestroyTexture(), and SDL_RendererEventWatch().
int SDL_SetTextureAlphaMod | ( | SDL_Texture * | texture, |
Uint8 | alpha | ||
) |
Set an additional alpha value used in render copy operations.
texture | The texture to update. |
alpha | The alpha value multiplied into copy operations. |
Definition at line 1346 of file SDL_render.c.
References CHECK_TEXTURE_MAGIC, and SDL_TEXTUREMODULATE_ALPHA.
Referenced by SDL_CreateTextureFromSurface().
int SDL_SetTextureBlendMode | ( | SDL_Texture * | texture, |
SDL_BlendMode | blendMode | ||
) |
Set the blend mode used for texture copy operations.
texture | The texture to update. |
blendMode | SDL_BlendMode to use for texture blending. |
Definition at line 1374 of file SDL_render.c.
References blendMode, CHECK_TEXTURE_MAGIC, IsSupportedBlendMode(), renderer, and SDL_Unsupported.
Referenced by SDL_CreateTextureFromSurface().
int SDL_SetTextureColorMod | ( | SDL_Texture * | texture, |
Uint8 | r, | ||
Uint8 | g, | ||
Uint8 | b | ||
) |
Set an additional color value used in render copy operations.
texture | The texture to update. |
r | The red color value multiplied into copy operations. |
g | The green color value multiplied into copy operations. |
b | The blue color value multiplied into copy operations. |
Definition at line 1309 of file SDL_render.c.
References CHECK_TEXTURE_MAGIC, and SDL_TEXTUREMODULATE_COLOR.
Referenced by SDL_CreateTextureFromSurface().
int SDL_SetTextureScaleMode | ( | SDL_Texture * | texture, |
SDL_ScaleMode | scaleMode | ||
) |
Set the scale mode used for texture scale operations.
texture | The texture to update. |
scaleMode | SDL_ScaleMode to use for texture scaling. |
Definition at line 1403 of file SDL_render.c.
References CHECK_TEXTURE_MAGIC, renderer, and SDL_Renderer::SetTextureScaleMode.
void SDL_UnlockTexture | ( | SDL_Texture * | texture | ) |
Unlock a texture, uploading the changes to video memory, if needed. If SDL_LockTextureToSurface() was called for locking, the SDL surface is freed.
Definition at line 1821 of file SDL_render.c.
References CHECK_TEXTURE_MAGIC, NULL, renderer, SDL_FreeSurface, SDL_TEXTUREACCESS_STREAMING, SDL_UnlockTextureNative(), SDL_UnlockTextureYUV(), and SDL_Renderer::UnlockTexture.
Referenced by SDL_LockTextureToSurface(), SDL_UnlockTextureNative(), SDL_UnlockTextureYUV(), SDL_UpdateTextureNative(), SDL_UpdateTextureYUV(), and SDL_UpdateTextureYUVPlanar().
|
static |
Definition at line 1800 of file SDL_render.c.
References SDL_Texture::format, SDL_Rect::h, SDL_Texture::native, NULL, rect, SDL_BYTESPERPIXEL, SDL_ConvertPixels, SDL_LockTexture(), SDL_UnlockTexture(), SDL_Rect::w, SDL_Rect::x, and SDL_Rect::y.
Referenced by SDL_UnlockTexture().
|
static |
Definition at line 1778 of file SDL_render.c.
References SDL_Texture::format, SDL_Rect::h, SDL_Texture::native, NULL, rect, SDL_LockTexture(), SDL_SW_CopyYUVToRGB(), SDL_UnlockTexture(), SDL_Rect::w, SDL_Rect::x, and SDL_Rect::y.
Referenced by SDL_UnlockTexture().
int SDL_UpdateTexture | ( | SDL_Texture * | texture, |
const SDL_Rect * | rect, | ||
const void * | pixels, | ||
int | pitch | ||
) |
Update the given texture rectangle with new pixel data.
texture | The texture to update |
rect | A pointer to the rectangle of pixels to update, or NULL to update the entire texture. |
pixels | The raw pixel data in the format of the texture. |
pitch | The number of bytes in a row of pixel data, including padding between lines. |
The pixel data must be in the format of the texture. The pixel format can be queried with SDL_QueryTexture.
Definition at line 1519 of file SDL_render.c.
References CHECK_TEXTURE_MAGIC, FlushRenderCommandsIfTextureNeeded(), SDL_Rect::h, rect, renderer, SDL_InvalidParamError, SDL_UpdateTextureNative(), SDL_UpdateTextureYUV(), SDL_Renderer::UpdateTexture, SDL_Rect::w, SDL_Rect::x, and SDL_Rect::y.
Referenced by SDL_CreateTextureFromSurface(), SDL_UpdateTextureNative(), SDL_UpdateTextureYUV(), and SDL_UpdateTextureYUVPlanar().
|
static |
Definition at line 1478 of file SDL_render.c.
References SDL_Texture::format, SDL_Rect::h, SDL_Texture::native, NULL, rect, SDL_BYTESPERPIXEL, SDL_ConvertPixels, SDL_free, SDL_LockTexture(), SDL_malloc, SDL_OutOfMemory, SDL_TEXTUREACCESS_STREAMING, SDL_UnlockTexture(), SDL_UpdateTexture(), and SDL_Rect::w.
Referenced by SDL_UpdateTexture().
|
static |
Definition at line 1431 of file SDL_render.c.
References SDL_Texture::format, SDL_Rect::h, SDL_Texture::native, NULL, rect, SDL_BYTESPERPIXEL, SDL_free, SDL_LockTexture(), SDL_malloc, SDL_OutOfMemory, SDL_SW_CopyYUVToRGB(), SDL_SW_UpdateYUVTexture(), SDL_TEXTUREACCESS_STREAMING, SDL_UnlockTexture(), SDL_UpdateTexture(), SDL_Rect::w, SDL_Rect::x, and SDL_Rect::y.
Referenced by SDL_UpdateTexture().
|
static |
Definition at line 1560 of file SDL_render.c.
References SDL_Texture::format, SDL_Rect::h, SDL_Texture::native, NULL, rect, SDL_BYTESPERPIXEL, SDL_free, SDL_LockTexture(), SDL_malloc, SDL_OutOfMemory, SDL_SW_CopyYUVToRGB(), SDL_SW_UpdateYUVTexturePlanar(), SDL_TEXTUREACCESS_STREAMING, SDL_UnlockTexture(), SDL_UpdateTexture(), SDL_Rect::w, SDL_Rect::x, and SDL_Rect::y.
Referenced by SDL_UpdateYUVTexture().
int SDL_UpdateYUVTexture | ( | SDL_Texture * | texture, |
const SDL_Rect * | rect, | ||
const Uint8 * | Yplane, | ||
int | Ypitch, | ||
const Uint8 * | Uplane, | ||
int | Upitch, | ||
const Uint8 * | Vplane, | ||
int | Vpitch | ||
) |
Update a rectangle within a planar YV12 or IYUV texture with new pixel data.
texture | The texture to update |
rect | A pointer to the rectangle of pixels to update, or NULL to update the entire texture. |
Yplane | The raw pixel data for the Y plane. |
Ypitch | The number of bytes between rows of pixel data for the Y plane. |
Uplane | The raw pixel data for the U plane. |
Upitch | The number of bytes between rows of pixel data for the U plane. |
Vplane | The raw pixel data for the V plane. |
Vpitch | The number of bytes between rows of pixel data for the V plane. |
Definition at line 1612 of file SDL_render.c.
References CHECK_TEXTURE_MAGIC, FlushRenderCommandsIfTextureNeeded(), SDL_Rect::h, rect, renderer, SDL_assert, SDL_InvalidParamError, SDL_PIXELFORMAT_IYUV, SDL_PIXELFORMAT_YV12, SDL_SetError, SDL_Unsupported, SDL_UpdateTextureYUVPlanar(), SDL_Renderer::UpdateTextureYUV, SDL_Rect::w, SDL_Rect::x, and SDL_Rect::y.
|
static |
Definition at line 1939 of file SDL_render.c.
References SDL_Rect::h, SDL_Renderer::integer_scale, SDL_Renderer::logical_h, SDL_Renderer::logical_w, NULL, renderer, SDL_ceil, SDL_fabs, SDL_FALSE, SDL_GetCurrentVideoDriver, SDL_GetHint, SDL_GetRendererOutputSize(), SDL_HINT_RENDER_LOGICAL_SIZE_MODE, SDL_RenderSetScale(), SDL_RenderSetViewport(), SDL_strcasecmp, SDL_TRUE, viewport, SDL_Rect::w, SDL_Rect::x, and SDL_Rect::y.
Referenced by SDL_RendererEventWatch(), SDL_RenderSetIntegerScale(), and SDL_RenderSetLogicalSize().
|
static |
Definition at line 751 of file SDL_render.c.
References NULL, SDL_Renderer::QueueCopy, SDL_Renderer::QueueDrawLines, SDL_Renderer::QueueDrawPoints, SDL_Renderer::QueueFillRects, SDL_Renderer::QueueSetDrawColor, SDL_Renderer::QueueSetViewport, renderer, SDL_Renderer::RunCommandQueue, and SDL_assert.
Referenced by SDL_CreateRenderer(), and SDL_CreateSoftwareRenderer().
|
static |
Definition at line 83 of file SDL_render.c.
Referenced by SDL_CreateRenderer(), SDL_GetNumRenderDrivers(), and SDL_GetRenderDriverInfo().
|
static |
Definition at line 114 of file SDL_render.c.
Referenced by SDL_CreateRenderer(), and SDL_CreateSoftwareRenderer().
|
static |
Definition at line 115 of file SDL_render.c.
Referenced by SDL_CreateTexture().