World of Might and Magic
0.2.0
Open reimplementation of Might and Magic 6 7 8 game engine
|
Классы | |
struct | SDL_RendererInfo |
Information on the capabilities of a render driver or context. Подробнее... | |
Определения типов | |
typedef struct SDL_RendererInfo | SDL_RendererInfo |
Information on the capabilities of a render driver or context. Подробнее... | |
typedef struct SDL_Renderer | SDL_Renderer |
typedef struct SDL_Texture | SDL_Texture |
Перечисления | |
enum | SDL_RendererFlags { SDL_RENDERER_SOFTWARE = 0x00000001, SDL_RENDERER_ACCELERATED = 0x00000002, SDL_RENDERER_PRESENTVSYNC = 0x00000004, SDL_RENDERER_TARGETTEXTURE = 0x00000008 } |
Flags used when creating a rendering context. Подробнее... | |
enum | SDL_ScaleMode { SDL_ScaleModeNearest, SDL_ScaleModeLinear, SDL_ScaleModeBest } |
The scaling mode for a texture. Подробнее... | |
enum | SDL_TextureAccess { SDL_TEXTUREACCESS_STATIC, SDL_TEXTUREACCESS_STREAMING, SDL_TEXTUREACCESS_TARGET } |
The access pattern allowed for a texture. Подробнее... | |
enum | SDL_TextureModulate { SDL_TEXTUREMODULATE_NONE = 0x00000000, SDL_TEXTUREMODULATE_COLOR = 0x00000001, SDL_TEXTUREMODULATE_ALPHA = 0x00000002 } |
The texture channel modulation used in SDL_RenderCopy(). Подробнее... | |
enum | SDL_RendererFlip { SDL_FLIP_NONE = 0x00000000, SDL_FLIP_HORIZONTAL = 0x00000001, SDL_FLIP_VERTICAL = 0x00000002 } |
Flip constants for SDL_RenderCopyEx. Подробнее... | |
Функции | |
DECLSPEC int SDLCALL | SDL_GetNumRenderDrivers (void) |
Get the number of 2D rendering drivers available for the current display. Подробнее... | |
DECLSPEC int SDLCALL | SDL_GetRenderDriverInfo (int index, SDL_RendererInfo *info) |
Get information about a specific 2D rendering driver for the current display. Подробнее... | |
DECLSPEC int SDLCALL | SDL_CreateWindowAndRenderer (int width, int height, Uint32 window_flags, SDL_Window **window, SDL_Renderer **renderer) |
Create a window and default renderer. Подробнее... | |
DECLSPEC SDL_Renderer *SDLCALL | SDL_CreateRenderer (SDL_Window *window, int index, Uint32 flags) |
Create a 2D rendering context for a window. Подробнее... | |
DECLSPEC SDL_Renderer *SDLCALL | SDL_CreateSoftwareRenderer (SDL_Surface *surface) |
Create a 2D software rendering context for a surface. Подробнее... | |
DECLSPEC SDL_Renderer *SDLCALL | SDL_GetRenderer (SDL_Window *window) |
Get the renderer associated with a window. Подробнее... | |
DECLSPEC int SDLCALL | SDL_GetRendererInfo (SDL_Renderer *renderer, SDL_RendererInfo *info) |
Get information about a rendering context. Подробнее... | |
DECLSPEC int SDLCALL | SDL_GetRendererOutputSize (SDL_Renderer *renderer, int *w, int *h) |
Get the output size in pixels of a rendering context. Подробнее... | |
DECLSPEC SDL_Texture *SDLCALL | SDL_CreateTexture (SDL_Renderer *renderer, Uint32 format, int access, int w, int h) |
Create a texture for a rendering context. Подробнее... | |
DECLSPEC SDL_Texture *SDLCALL | SDL_CreateTextureFromSurface (SDL_Renderer *renderer, SDL_Surface *surface) |
Create a texture from an existing surface. Подробнее... | |
DECLSPEC int SDLCALL | SDL_QueryTexture (SDL_Texture *texture, Uint32 *format, int *access, int *w, int *h) |
Query the attributes of a texture. Подробнее... | |
DECLSPEC int SDLCALL | SDL_SetTextureColorMod (SDL_Texture *texture, Uint8 r, Uint8 g, Uint8 b) |
Set an additional color value used in render copy operations. Подробнее... | |
DECLSPEC int SDLCALL | SDL_GetTextureColorMod (SDL_Texture *texture, Uint8 *r, Uint8 *g, Uint8 *b) |
Get the additional color value used in render copy operations. Подробнее... | |
DECLSPEC int SDLCALL | SDL_SetTextureAlphaMod (SDL_Texture *texture, Uint8 alpha) |
Set an additional alpha value used in render copy operations. Подробнее... | |
DECLSPEC int SDLCALL | SDL_GetTextureAlphaMod (SDL_Texture *texture, Uint8 *alpha) |
Get the additional alpha value used in render copy operations. Подробнее... | |
DECLSPEC int SDLCALL | SDL_SetTextureBlendMode (SDL_Texture *texture, SDL_BlendMode blendMode) |
Set the blend mode used for texture copy operations. Подробнее... | |
DECLSPEC int SDLCALL | SDL_GetTextureBlendMode (SDL_Texture *texture, SDL_BlendMode *blendMode) |
Get the blend mode used for texture copy operations. Подробнее... | |
DECLSPEC int SDLCALL | SDL_SetTextureScaleMode (SDL_Texture *texture, SDL_ScaleMode scaleMode) |
Set the scale mode used for texture scale operations. Подробнее... | |
DECLSPEC int SDLCALL | SDL_GetTextureScaleMode (SDL_Texture *texture, SDL_ScaleMode *scaleMode) |
Get the scale mode used for texture scale operations. Подробнее... | |
DECLSPEC int SDLCALL | SDL_UpdateTexture (SDL_Texture *texture, const SDL_Rect *rect, const void *pixels, int pitch) |
Update the given texture rectangle with new pixel data. Подробнее... | |
DECLSPEC int SDLCALL | 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. Подробнее... | |
DECLSPEC int SDLCALL | SDL_LockTexture (SDL_Texture *texture, const SDL_Rect *rect, void **pixels, int *pitch) |
Lock a portion of the texture for write-only pixel access. Подробнее... | |
DECLSPEC int SDLCALL | 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. Подробнее... | |
DECLSPEC void SDLCALL | 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. Подробнее... | |
DECLSPEC SDL_bool SDLCALL | SDL_RenderTargetSupported (SDL_Renderer *renderer) |
Determines whether a window supports the use of render targets. Подробнее... | |
DECLSPEC int SDLCALL | SDL_SetRenderTarget (SDL_Renderer *renderer, SDL_Texture *texture) |
Set a texture as the current rendering target. Подробнее... | |
DECLSPEC SDL_Texture *SDLCALL | SDL_GetRenderTarget (SDL_Renderer *renderer) |
Get the current render target or NULL for the default render target. Подробнее... | |
DECLSPEC int SDLCALL | SDL_RenderSetLogicalSize (SDL_Renderer *renderer, int w, int h) |
Set device independent resolution for rendering. Подробнее... | |
DECLSPEC void SDLCALL | SDL_RenderGetLogicalSize (SDL_Renderer *renderer, int *w, int *h) |
Get device independent resolution for rendering. Подробнее... | |
DECLSPEC int SDLCALL | SDL_RenderSetIntegerScale (SDL_Renderer *renderer, SDL_bool enable) |
Set whether to force integer scales for resolution-independent rendering. Подробнее... | |
DECLSPEC SDL_bool SDLCALL | SDL_RenderGetIntegerScale (SDL_Renderer *renderer) |
Get whether integer scales are forced for resolution-independent rendering. Подробнее... | |
DECLSPEC int SDLCALL | SDL_RenderSetViewport (SDL_Renderer *renderer, const SDL_Rect *rect) |
Set the drawing area for rendering on the current target. Подробнее... | |
DECLSPEC void SDLCALL | SDL_RenderGetViewport (SDL_Renderer *renderer, SDL_Rect *rect) |
Get the drawing area for the current target. Подробнее... | |
DECLSPEC int SDLCALL | SDL_RenderSetClipRect (SDL_Renderer *renderer, const SDL_Rect *rect) |
Set the clip rectangle for the current target. Подробнее... | |
DECLSPEC void SDLCALL | SDL_RenderGetClipRect (SDL_Renderer *renderer, SDL_Rect *rect) |
Get the clip rectangle for the current target. Подробнее... | |
DECLSPEC SDL_bool SDLCALL | SDL_RenderIsClipEnabled (SDL_Renderer *renderer) |
Get whether clipping is enabled on the given renderer. Подробнее... | |
DECLSPEC int SDLCALL | SDL_RenderSetScale (SDL_Renderer *renderer, float scaleX, float scaleY) |
Set the drawing scale for rendering on the current target. Подробнее... | |
DECLSPEC void SDLCALL | SDL_RenderGetScale (SDL_Renderer *renderer, float *scaleX, float *scaleY) |
Get the drawing scale for the current target. Подробнее... | |
DECLSPEC int SDLCALL | SDL_SetRenderDrawColor (SDL_Renderer *renderer, Uint8 r, Uint8 g, Uint8 b, Uint8 a) |
Set the color used for drawing operations (Rect, Line and Clear). Подробнее... | |
DECLSPEC int SDLCALL | SDL_GetRenderDrawColor (SDL_Renderer *renderer, Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a) |
Get the color used for drawing operations (Rect, Line and Clear). Подробнее... | |
DECLSPEC int SDLCALL | SDL_SetRenderDrawBlendMode (SDL_Renderer *renderer, SDL_BlendMode blendMode) |
Set the blend mode used for drawing operations (Fill and Line). Подробнее... | |
DECLSPEC int SDLCALL | SDL_GetRenderDrawBlendMode (SDL_Renderer *renderer, SDL_BlendMode *blendMode) |
Get the blend mode used for drawing operations. Подробнее... | |
DECLSPEC int SDLCALL | SDL_RenderClear (SDL_Renderer *renderer) |
Clear the current rendering target with the drawing color. Подробнее... | |
DECLSPEC int SDLCALL | SDL_RenderDrawPoint (SDL_Renderer *renderer, int x, int y) |
Draw a point on the current rendering target. Подробнее... | |
DECLSPEC int SDLCALL | SDL_RenderDrawPoints (SDL_Renderer *renderer, const SDL_Point *points, int count) |
Draw multiple points on the current rendering target. Подробнее... | |
DECLSPEC int SDLCALL | SDL_RenderDrawLine (SDL_Renderer *renderer, int x1, int y1, int x2, int y2) |
Draw a line on the current rendering target. Подробнее... | |
DECLSPEC int SDLCALL | SDL_RenderDrawLines (SDL_Renderer *renderer, const SDL_Point *points, int count) |
Draw a series of connected lines on the current rendering target. Подробнее... | |
DECLSPEC int SDLCALL | SDL_RenderDrawRect (SDL_Renderer *renderer, const SDL_Rect *rect) |
Draw a rectangle on the current rendering target. Подробнее... | |
DECLSPEC int SDLCALL | SDL_RenderDrawRects (SDL_Renderer *renderer, const SDL_Rect *rects, int count) |
Draw some number of rectangles on the current rendering target. Подробнее... | |
DECLSPEC int SDLCALL | SDL_RenderFillRect (SDL_Renderer *renderer, const SDL_Rect *rect) |
Fill a rectangle on the current rendering target with the drawing color. Подробнее... | |
DECLSPEC int SDLCALL | 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. Подробнее... | |
DECLSPEC int SDLCALL | 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. Подробнее... | |
DECLSPEC int SDLCALL | 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. Подробнее... | |
DECLSPEC int SDLCALL | SDL_RenderDrawPointF (SDL_Renderer *renderer, float x, float y) |
Draw a point on the current rendering target. Подробнее... | |
DECLSPEC int SDLCALL | SDL_RenderDrawPointsF (SDL_Renderer *renderer, const SDL_FPoint *points, int count) |
Draw multiple points on the current rendering target. Подробнее... | |
DECLSPEC int SDLCALL | SDL_RenderDrawLineF (SDL_Renderer *renderer, float x1, float y1, float x2, float y2) |
Draw a line on the current rendering target. Подробнее... | |
DECLSPEC int SDLCALL | SDL_RenderDrawLinesF (SDL_Renderer *renderer, const SDL_FPoint *points, int count) |
Draw a series of connected lines on the current rendering target. Подробнее... | |
DECLSPEC int SDLCALL | SDL_RenderDrawRectF (SDL_Renderer *renderer, const SDL_FRect *rect) |
Draw a rectangle on the current rendering target. Подробнее... | |
DECLSPEC int SDLCALL | SDL_RenderDrawRectsF (SDL_Renderer *renderer, const SDL_FRect *rects, int count) |
Draw some number of rectangles on the current rendering target. Подробнее... | |
DECLSPEC int SDLCALL | SDL_RenderFillRectF (SDL_Renderer *renderer, const SDL_FRect *rect) |
Fill a rectangle on the current rendering target with the drawing color. Подробнее... | |
DECLSPEC int SDLCALL | 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. Подробнее... | |
DECLSPEC int SDLCALL | 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. Подробнее... | |
DECLSPEC int SDLCALL | 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. Подробнее... | |
DECLSPEC int SDLCALL | SDL_RenderReadPixels (SDL_Renderer *renderer, const SDL_Rect *rect, Uint32 format, void *pixels, int pitch) |
Read pixels from the current rendering target. Подробнее... | |
DECLSPEC void SDLCALL | SDL_RenderPresent (SDL_Renderer *renderer) |
Update the screen with rendering performed. Подробнее... | |
DECLSPEC void SDLCALL | SDL_DestroyTexture (SDL_Texture *texture) |
Destroy the specified texture. Подробнее... | |
DECLSPEC void SDLCALL | SDL_DestroyRenderer (SDL_Renderer *renderer) |
Destroy the rendering context for a window and free associated textures. Подробнее... | |
DECLSPEC int SDLCALL | SDL_RenderFlush (SDL_Renderer *renderer) |
Force the rendering context to flush any pending commands to the underlying rendering API. Подробнее... | |
DECLSPEC int SDLCALL | 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. Подробнее... | |
DECLSPEC int SDLCALL | SDL_GL_UnbindTexture (SDL_Texture *texture) |
Unbind a texture from the current OpenGL/ES/ES2 context. Подробнее... | |
DECLSPEC void *SDLCALL | SDL_RenderGetMetalLayer (SDL_Renderer *renderer) |
Get the CAMetalLayer associated with the given Metal renderer. Подробнее... | |
DECLSPEC void *SDLCALL | SDL_RenderGetMetalCommandEncoder (SDL_Renderer *renderer) |
Get the Metal command encoder for the current frame. Подробнее... | |
Header file for SDL 2D rendering functions.
This API supports the following features:
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
См. определение в файле SDL_render.h
typedef struct SDL_RendererInfo SDL_RendererInfo |
Information on the capabilities of a render driver or context.
typedef struct SDL_Renderer SDL_Renderer |
См. определение в файле SDL_render.h строка 132
typedef struct SDL_Texture SDL_Texture |
См. определение в файле SDL_render.h строка 138
enum SDL_RendererFlags |
Flags used when creating a rendering context.
См. определение в файле SDL_render.h строка 64
enum SDL_ScaleMode |
The scaling mode for a texture.
Элементы перечислений | |
---|---|
SDL_ScaleModeNearest | nearest pixel sampling |
SDL_ScaleModeLinear | linear filtering |
SDL_ScaleModeBest | anisotropic filtering |
См. определение в файле SDL_render.h строка 91
enum SDL_TextureAccess |
The access pattern allowed for a texture.
Элементы перечислений | |
---|---|
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_render.h строка 101
enum SDL_TextureModulate |
The texture channel modulation used in SDL_RenderCopy().
Элементы перечислений | |
---|---|
SDL_TEXTUREMODULATE_NONE | No modulation |
SDL_TEXTUREMODULATE_COLOR | srcC = srcC * color |
SDL_TEXTUREMODULATE_ALPHA | srcA = srcA * alpha |
См. определение в файле SDL_render.h строка 111
enum SDL_RendererFlip |
Flip constants for SDL_RenderCopyEx.
Элементы перечислений | |
---|---|
SDL_FLIP_NONE | Do not flip |
SDL_FLIP_HORIZONTAL | flip horizontally |
SDL_FLIP_VERTICAL | flip vertically |
См. определение в файле SDL_render.h строка 121
DECLSPEC int SDLCALL 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.
DECLSPEC int SDLCALL 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. |
DECLSPEC int SDLCALL 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 |
DECLSPEC SDL_Renderer* SDLCALL 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. |
DECLSPEC SDL_Renderer* SDLCALL SDL_CreateSoftwareRenderer | ( | SDL_Surface * | surface | ) |
Create a 2D software rendering context for a surface.
surface | The surface where rendering is done. |
DECLSPEC SDL_Renderer* SDLCALL SDL_GetRenderer | ( | SDL_Window * | window | ) |
Get the renderer associated with a window.
DECLSPEC int SDLCALL SDL_GetRendererInfo | ( | SDL_Renderer * | renderer, |
SDL_RendererInfo * | info | ||
) |
Get information about a rendering context.
DECLSPEC int SDLCALL SDL_GetRendererOutputSize | ( | SDL_Renderer * | renderer, |
int * | w, | ||
int * | h | ||
) |
Get the output size in pixels of a rendering context.
DECLSPEC SDL_Texture* SDLCALL 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. |
DECLSPEC SDL_Texture* SDLCALL 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. |
DECLSPEC int SDLCALL 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. |
DECLSPEC int SDLCALL 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. |
DECLSPEC int SDLCALL 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. |
DECLSPEC int SDLCALL 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. |
DECLSPEC int SDLCALL 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. |
DECLSPEC int SDLCALL 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. |
DECLSPEC int SDLCALL 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. |
DECLSPEC int SDLCALL 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. |
DECLSPEC int SDLCALL 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. |
DECLSPEC int SDLCALL 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.
DECLSPEC int SDLCALL 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. |
DECLSPEC int SDLCALL 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. |
DECLSPEC int SDLCALL 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. |
DECLSPEC void SDLCALL 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.
DECLSPEC SDL_bool SDLCALL SDL_RenderTargetSupported | ( | SDL_Renderer * | renderer | ) |
Determines whether a window supports the use of render targets.
renderer | The renderer that will be checked |
DECLSPEC int SDLCALL 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 |
DECLSPEC SDL_Texture* SDLCALL SDL_GetRenderTarget | ( | SDL_Renderer * | renderer | ) |
Get the current render target or NULL for the default render target.
DECLSPEC int SDLCALL 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.
DECLSPEC void SDLCALL 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 |
DECLSPEC int SDLCALL 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.
DECLSPEC SDL_bool SDLCALL 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. |
DECLSPEC int SDLCALL 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.
DECLSPEC void SDLCALL SDL_RenderGetViewport | ( | SDL_Renderer * | renderer, |
SDL_Rect * | rect | ||
) |
Get the drawing area for the current target.
DECLSPEC int SDLCALL 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. |
DECLSPEC void SDLCALL 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. |
DECLSPEC SDL_bool SDLCALL SDL_RenderIsClipEnabled | ( | SDL_Renderer * | renderer | ) |
Get whether clipping is enabled on the given renderer.
renderer | The renderer from which clip state should be queried. |
DECLSPEC int SDLCALL 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.
DECLSPEC void SDLCALL 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 |
DECLSPEC int SDLCALL 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). |
DECLSPEC int SDLCALL 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). |
DECLSPEC int SDLCALL 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. |
DECLSPEC int SDLCALL 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. |
DECLSPEC int SDLCALL 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.
DECLSPEC int SDLCALL 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. |
DECLSPEC int SDLCALL 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 |
DECLSPEC int SDLCALL 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. |
DECLSPEC int SDLCALL 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 |
DECLSPEC int SDLCALL 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. |
DECLSPEC int SDLCALL 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. |
DECLSPEC int SDLCALL 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. |
DECLSPEC int SDLCALL 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. |
DECLSPEC int SDLCALL 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. |
DECLSPEC int SDLCALL 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 |
DECLSPEC int SDLCALL 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. |
DECLSPEC int SDLCALL 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 |
DECLSPEC int SDLCALL 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. |
DECLSPEC int SDLCALL 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 |
DECLSPEC int SDLCALL 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. |
DECLSPEC int SDLCALL 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. |
DECLSPEC int SDLCALL 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. |
DECLSPEC int SDLCALL 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. |
DECLSPEC int SDLCALL 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. |
DECLSPEC int SDLCALL 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 |
DECLSPEC int SDLCALL 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. |
DECLSPEC void SDLCALL SDL_RenderPresent | ( | SDL_Renderer * | renderer | ) |
Update the screen with rendering performed.
DECLSPEC void SDLCALL SDL_DestroyTexture | ( | SDL_Texture * | texture | ) |
Destroy the specified texture.
DECLSPEC void SDLCALL SDL_DestroyRenderer | ( | SDL_Renderer * | renderer | ) |
Destroy the rendering context for a window and free associated textures.
DECLSPEC int SDLCALL 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.
DECLSPEC int SDLCALL 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 |
DECLSPEC int SDLCALL SDL_GL_UnbindTexture | ( | SDL_Texture * | texture | ) |
Unbind a texture from the current OpenGL/ES/ES2 context.
texture | The SDL texture to unbind |
DECLSPEC void* SDLCALL SDL_RenderGetMetalLayer | ( | SDL_Renderer * | renderer | ) |
Get the CAMetalLayer associated with the given Metal renderer.
renderer | The renderer to query |
DECLSPEC void* SDLCALL SDL_RenderGetMetalCommandEncoder | ( | SDL_Renderer * | renderer | ) |
Get the Metal command encoder for the current frame.
renderer | The renderer to query |