33 #define SDL_WINDOWRENDERDATA "_SDL_WindowRenderData"
35 #define CHECK_RENDERER_MAGIC(renderer, retval) \
36 if (!renderer || renderer->magic != &renderer_magic) { \
37 SDL_SetError("Invalid renderer"); \
41 #define CHECK_TEXTURE_MAGIC(texture, retval) \
42 if (!texture || texture->magic != &texture_magic) { \
43 SDL_SetError("Invalid texture"); \
48 #if !SDL_RENDER_DISABLED
50 #if SDL_VIDEO_RENDER_D3D
53 #if SDL_VIDEO_RENDER_OGL
56 #if SDL_VIDEO_RENDER_OGL_ES2
59 #if SDL_VIDEO_RENDER_OGL_ES
62 #if SDL_VIDEO_RENDER_DIRECTFB
63 &DirectFB_RenderDriver,
65 #if SDL_VIDEO_RENDER_PSP
80 #if !SDL_RENDER_DISABLED
90 #if !SDL_RENDER_DISABLED
92 return SDL_SetError(
"index must be in the range of 0 - %d",
98 return SDL_SetError(
"SDL not built with rendering support");
109 if (window == renderer->
window) {
189 width, height, window_flags);
206 #if !SDL_RENDER_DISABLED
217 SDL_SetError(
"Renderer already associated with window");
233 for (index = 0; index <
n; ++
index) {
245 for (index = 0; index <
n; ++
index) {
248 if ((driver->
info.
flags & flags) == flags) {
264 SDL_SetError(
"index must be -1 or in the range of 0 - %d",
274 renderer->
window = window;
291 "Created renderer: %s", renderer->
info.
name);
303 #if !SDL_RENDER_DISABLED
333 *info = renderer->
info;
346 }
else if (renderer->
window) {
351 SDL_SetError(
"Renderer doesn't support querying output size");
409 if (w <= 0 || h <= 0) {
492 SDL_SetError(
"SDL_CreateTextureFromSurface() passed NULL surface");
513 surface->
w, surface->
h);
571 *format = texture->
format;
574 *access = texture->
access;
593 if (r < 255 || g < 255 || b < 255) {
693 const void *
pixels,
int pitch)
704 full_rect.
w = texture->
w;
705 full_rect.
h = texture->
h;
713 if (
SDL_LockTexture(native, rect, &native_pixels, &native_pitch) < 0) {
717 rect->
w, rect->
h, native_pixels, native_pitch);
730 rect->
w, rect->
h, temp_pixels, temp_pitch);
739 const void *
pixels,
int pitch)
748 if (
SDL_LockTexture(native, rect, &native_pixels, &native_pitch) < 0) {
752 texture->
format, pixels, pitch,
753 native->
format, native_pixels, native_pitch);
766 texture->
format, pixels, pitch,
767 native->
format, temp_pixels, temp_pitch);
776 const void *
pixels,
int pitch)
793 full_rect.
w = texture->
w;
794 full_rect.
h = texture->
h;
800 }
else if (texture->
native) {
804 return renderer->
UpdateTexture(renderer, texture, rect, pixels, pitch);
810 const Uint8 *Yplane,
int Ypitch,
811 const Uint8 *Uplane,
int Upitch,
812 const Uint8 *Vplane,
int Vpitch)
823 full_rect.
w = texture->
w;
824 full_rect.
h = texture->
h;
832 if (
SDL_LockTexture(native, rect, &native_pixels, &native_pitch) < 0) {
836 rect->
w, rect->
h, native_pixels, native_pitch);
849 rect->
w, rect->
h, temp_pixels, temp_pitch);
857 const Uint8 *Yplane,
int Ypitch,
858 const Uint8 *Uplane,
int Upitch,
859 const Uint8 *Vplane,
int Vpitch)
887 return SDL_SetError(
"Texture format must by YV12 or IYUV");
893 full_rect.
w = texture->
w;
894 full_rect.
h = texture->
h;
905 return renderer->
UpdateTextureYUV(renderer, texture, rect, Yplane, Ypitch, Uplane, Upitch, Vplane, Vpitch);
914 void **
pixels,
int *pitch)
921 void **
pixels,
int *pitch)
925 rect->
y * texture->
pitch +
927 *pitch = texture->
pitch;
933 void **
pixels,
int *pitch)
941 return SDL_SetError(
"SDL_LockTexture(): texture must be streaming");
947 full_rect.
w = texture->
w;
948 full_rect.
h = texture->
h;
954 }
else if (texture->
native) {
958 return renderer->
LockTexture(renderer, texture, rect, pixels, pitch);
975 if (
SDL_LockTexture(native, &rect, &native_pixels, &native_pitch) < 0) {
979 rect.
w, rect.
h, native_pixels, native_pitch);
991 rect->
y * texture->
pitch +
993 int pitch = texture->
pitch;
995 if (
SDL_LockTexture(native, rect, &native_pixels, &native_pitch) < 0) {
999 texture->
format, pixels, pitch,
1000 native->
format, native_pixels, native_pitch);
1016 }
else if (texture->
native) {
1039 if (texture == renderer->
target) {
1047 if (renderer != texture->
renderer) {
1048 return SDL_SetError(
"Texture was not created with this renderer");
1051 return SDL_SetError(
"Texture not created with SDL_TEXTUREACCESS_TARGET");
1055 texture = texture->
native;
1059 if (texture && !renderer->
target) {
1078 renderer->
scale.
x = 1.0f;
1079 renderer->
scale.
y = 1.0f;
1120 real_aspect = (
float)w /
h;
1125 if (
SDL_fabs(want_aspect-real_aspect) < 0.0001) {
1129 }
else if (want_aspect > real_aspect) {
1135 viewport.
y = (h - viewport.
h) / 2;
1143 viewport.
x = (w - viewport.
w) / 2;
1253 renderer->
scale.
x = scaleX;
1254 renderer->
scale.
y = scaleY;
1264 *scaleX = renderer->
scale.
x;
1267 *scaleY = renderer->
scale.
y;
1357 for (i = 0; i <
count; ++
i) {
1358 frects[
i].
x = points[
i].
x * renderer->
scale.
x;
1359 frects[
i].
y = points[
i].
y * renderer->
scale.
y;
1382 return SDL_SetError(
"SDL_RenderDrawPoints(): Passed NULL points");
1392 if (renderer->
scale.
x != 1.0f || renderer->
scale.
y != 1.0f) {
1400 for (i = 0; i <
count; ++
i) {
1401 fpoints[
i].
x = points[
i].
x * renderer->
scale.
x;
1402 fpoints[
i].
y = points[
i].
y * renderer->
scale.
y;
1441 for (i = 0; i < count-1; ++
i) {
1442 if (points[i].
x == points[i+1].
x) {
1443 int minY =
SDL_min(points[i].
y, points[i+1].y);
1444 int maxY =
SDL_max(points[i].y, points[i+1].y);
1446 frect = &frects[nrects++];
1447 frect->
x = points[
i].
x * renderer->
scale.
x;
1448 frect->
y = minY * renderer->
scale.
y;
1450 frect->
h = (maxY - minY + 1) * renderer->
scale.
y;
1451 }
else if (points[i].
y == points[i+1].
y) {
1452 int minX =
SDL_min(points[i].
x, points[i+1].x);
1453 int maxX =
SDL_max(points[i].x, points[i+1].x);
1455 frect = &frects[nrects++];
1456 frect->
x = minX * renderer->
scale.
x;
1457 frect->
y = points[
i].
y * renderer->
scale.
y;
1458 frect->
w = (maxX - minX + 1) * renderer->
scale.
x;
1462 fpoints[0].
x = points[
i].
x * renderer->
scale.
x;
1463 fpoints[0].
y = points[
i].
y * renderer->
scale.
y;
1464 fpoints[1].
x = points[i+1].
x * renderer->
scale.
x;
1465 fpoints[1].
y = points[i+1].
y * renderer->
scale.
y;
1491 return SDL_SetError(
"SDL_RenderDrawLines(): Passed NULL points");
1501 if (renderer->
scale.
x != 1.0f || renderer->
scale.
y != 1.0f) {
1509 for (i = 0; i <
count; ++
i) {
1510 fpoints[
i].
x = points[
i].
x * renderer->
scale.
x;
1511 fpoints[
i].
y = points[
i].
y * renderer->
scale.
y;
1537 points[0].
x = rect->
x;
1538 points[0].
y = rect->
y;
1539 points[1].
x = rect->
x+rect->
w-1;
1540 points[1].
y = rect->
y;
1541 points[2].
x = rect->
x+rect->
w-1;
1542 points[2].
y = rect->
y+rect->
h-1;
1543 points[3].
x = rect->
x;
1544 points[3].
y = rect->
y+rect->
h-1;
1545 points[4].
x = rect->
x;
1546 points[4].
y = rect->
y;
1559 return SDL_SetError(
"SDL_RenderDrawRects(): Passed NULL rects");
1569 for (i = 0; i <
count; ++
i) {
1580 SDL_Rect full_rect = { 0, 0, 0, 0 };
1605 return SDL_SetError(
"SDL_RenderFillRects(): Passed NULL rects");
1619 for (i = 0; i <
count; ++
i) {
1620 frects[
i].
x = rects[
i].
x * renderer->
scale.
x;
1621 frects[
i].
y = rects[
i].
y * renderer->
scale.
y;
1622 frects[
i].
w = rects[
i].
w * renderer->
scale.
x;
1623 frects[
i].
h = rects[
i].
h * renderer->
scale.
y;
1637 SDL_Rect real_srcrect = { 0, 0, 0, 0 };
1638 SDL_Rect real_dstrect = { 0, 0, 0, 0 };
1644 if (renderer != texture->
renderer) {
1645 return SDL_SetError(
"Texture was not created with this renderer");
1650 real_srcrect.
w = texture->
w;
1651 real_srcrect.
h = texture->
h;
1665 real_dstrect = *dstrect;
1669 texture = texture->
native;
1677 frect.
x = real_dstrect.
x * renderer->
scale.
x;
1678 frect.
y = real_dstrect.
y * renderer->
scale.
y;
1679 frect.
w = real_dstrect.
w * renderer->
scale.
x;
1680 frect.
h = real_dstrect.
h * renderer->
scale.
y;
1682 return renderer->
RenderCopy(renderer, texture, &real_srcrect, &frect);
1691 SDL_Rect real_srcrect = { 0, 0, 0, 0 };
1692 SDL_Rect real_dstrect = { 0, 0, 0, 0 };
1700 if (renderer != texture->
renderer) {
1701 return SDL_SetError(
"Texture was not created with this renderer");
1704 return SDL_SetError(
"Renderer does not support RenderCopyEx");
1709 real_srcrect.
w = texture->
w;
1710 real_srcrect.
h = texture->
h;
1719 real_dstrect = *dstrect;
1727 texture = texture->
native;
1730 if(center) real_center = *center;
1732 real_center.
x = real_dstrect.
w/2;
1733 real_center.
y = real_dstrect.
h/2;
1736 frect.
x = real_dstrect.
x * renderer->
scale.
x;
1737 frect.
y = real_dstrect.
y * renderer->
scale.
y;
1738 frect.
w = real_dstrect.
w * renderer->
scale.
x;
1739 frect.
h = real_dstrect.
h * renderer->
scale.
y;
1741 fcenter.
x = real_center.
x * renderer->
scale.
x;
1742 fcenter.
y = real_center.
y * renderer->
scale.
y;
1744 return renderer->
RenderCopyEx(renderer, texture, &real_srcrect, &frect, angle, &fcenter, flip);
1771 if (real_rect.
y > rect->
y) {
1772 pixels = (
Uint8 *)pixels + pitch * (real_rect.
y - rect->
y);
1774 if (real_rect.
x > rect->
x) {
1776 pixels = (
Uint8 *)pixels + bpp * (real_rect.
x - rect->
x);
1781 format, pixels, pitch);
1804 if (texture == renderer->
target) {
1810 if (texture->
next) {
1813 if (texture->
prev) {
DECLSPEC int SDLCALL SDL_SetRenderDrawBlendMode(SDL_Renderer *renderer, SDL_BlendMode blendMode)
Set the blend mode used for drawing operations (Fill and Line).
int(* UpdateClipRect)(SDL_Renderer *renderer)
SDL_MouseMotionEvent motion
DECLSPEC void SDLCALL SDL_RenderGetClipRect(SDL_Renderer *renderer, SDL_Rect *rect)
Get the clip rectangle for the current target.
DECLSPEC 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).
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_FreeSurface(SDL_Surface *surface)
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_GL_UnbindTexture(SDL_Texture *texture)
Unbind a texture from the current OpenGL/ES/ES2 context.
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 SDL_SetRenderDrawColor(SDL_Renderer *renderer, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
Set the color used for drawing operations (Rect, Line and Clear).
SDL_SW_YUVTexture * SDL_SW_CreateYUVTexture(Uint32 format, int w, int h)
static Uint32 GetClosestSupportedFormat(SDL_Renderer *renderer, Uint32 format)
GLfloat GLfloat GLfloat GLfloat h
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)
DECLSPEC double SDLCALL SDL_fabs(double x)
DECLSPEC void *SDLCALL SDL_calloc(size_t nmemb, size_t size)
void(* WindowEvent)(SDL_Renderer *renderer, const SDL_WindowEvent *event)
DECLSPEC void SDLCALL SDL_FreeFormat(SDL_PixelFormat *format)
Free an SDL_PixelFormat structure.
#define SDL_HINT_RENDER_VSYNC
A variable controlling whether updates to the SDL screen surface should be synchronized with the vert...
SDL_BlendMode
The blend mode used in SDL_RenderCopy() and drawing 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_RenderSetScale(SDL_Renderer *renderer, float scaleX, float scaleY)
Set the drawing scale for rendering on the current target.
DECLSPEC int SDLCALL SDL_ConvertPixels(int width, int height, Uint32 src_format, const void *src, int src_pitch, Uint32 dst_format, void *dst, int dst_pitch)
Copy a block of pixels of one format to another format.
SDL_Rect clip_rect_backup
int(* RenderClear)(SDL_Renderer *renderer)
#define SDL_ISPIXELFORMAT_INDEXED(format)
#define SDL_stack_free(data)
int(* RenderDrawPoints)(SDL_Renderer *renderer, const SDL_FPoint *points, int count)
DECLSPEC int SDLCALL SDL_CreateWindowAndRenderer(int width, int height, Uint32 window_flags, SDL_Window **window, SDL_Renderer **renderer)
Create a window and default renderer.
int(* SetRenderTarget)(SDL_Renderer *renderer, SDL_Texture *texture)
int(* CreateTexture)(SDL_Renderer *renderer, SDL_Texture *texture)
SDL_Renderer *(* CreateRenderer)(SDL_Window *window, Uint32 flags)
DECLSPEC void SDLCALL SDL_DestroyTexture(SDL_Texture *texture)
Destroy the specified texture.
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_RenderDrawLine(SDL_Renderer *renderer, int x1, int y1, int x2, int y2)
Draw a line on the current rendering target.
The structure that defines a point.
A collection of pixels used in software blitting.
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 void SDLCALL SDL_free(void *mem)
Uint32 texture_formats[16]
int SDL_SW_LockYUVTexture(SDL_SW_YUVTexture *swdata, const SDL_Rect *rect, void **pixels, int *pitch)
EGLSurface EGLint EGLint EGLint EGLint height
GLboolean GLboolean GLboolean GLboolean a
#define SDL_BYTESPERPIXEL(X)
DECLSPEC void SDLCALL SDL_GetWindowSize(SDL_Window *window, int *w, int *h)
Get the size of a window's client area.
DECLSPEC void SDLCALL SDL_RenderGetScale(SDL_Renderer *renderer, float *scaleX, float *scaleY)
Get the drawing scale for the current target.
void(* UnlockTexture)(SDL_Renderer *renderer, SDL_Texture *texture)
static int SDL_UpdateTextureNative(SDL_Texture *texture, const SDL_Rect *rect, const void *pixels, int pitch)
#define SDL_WINDOWPOS_UNDEFINED
#define SDL_ISPIXELFORMAT_ALPHA(format)
DECLSPEC int SDLCALL SDL_GetRendererOutputSize(SDL_Renderer *renderer, int *w, int *h)
Get the output size of a rendering context.
DECLSPEC int SDLCALL SDL_RenderSetLogicalSize(SDL_Renderer *renderer, int w, int h)
Set device independent resolution for rendering.
static int RenderDrawPointsWithRects(SDL_Renderer *renderer, const SDL_Point *points, int count)
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.
#define SDL_InvalidParamError(param)
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_GetColorKey(SDL_Surface *surface, Uint32 *key)
Gets the color key (transparent pixel) in a blittable surface.
GLuint GLfloat GLfloat GLfloat GLfloat y1
DECLSPEC SDL_Renderer *SDLCALL SDL_CreateRenderer(SDL_Window *window, int index, Uint32 flags)
Create a 2D rendering context for a window.
GLfixed GLfixed GLfixed y2
static char texture_magic
DECLSPEC int SDLCALL SDL_RenderDrawPoint(SDL_Renderer *renderer, int x, int y)
Draw a point on the current rendering target.
static int SDL_LockTextureYUV(SDL_Texture *texture, const SDL_Rect *rect, void **pixels, int *pitch)
static int RenderDrawLinesWithRects(SDL_Renderer *renderer, const SDL_Point *points, int count)
DECLSPEC void SDLCALL SDL_UnlockTexture(SDL_Texture *texture)
Unlock a texture, uploading the changes to video memory, if needed.
SDL_Renderer * SW_CreateRendererForSurface(SDL_Surface *surface)
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_GetRenderDrawBlendMode(SDL_Renderer *renderer, SDL_BlendMode *blendMode)
Get the blend mode used for drawing operations.
DECLSPEC int SDLCALL SDL_SetTextureBlendMode(SDL_Texture *texture, SDL_BlendMode blendMode)
Set the blend mode used for texture copy operations.
static void SDL_UnlockTextureNative(SDL_Texture *texture)
uint32_t Uint32
An unsigned 32-bit integer type.
DECLSPEC Uint32 SDLCALL SDL_GetWindowPixelFormat(SDL_Window *window)
Get the pixel format associated with the window.
int SDL_SW_UpdateYUVTexture(SDL_SW_YUVTexture *swdata, const SDL_Rect *rect, const void *pixels, int pitch)
DECLSPEC void SDLCALL SDL_UnlockSurface(SDL_Surface *surface)
DECLSPEC int SDLCALL SDL_SetRenderTarget(SDL_Renderer *renderer, SDL_Texture *texture)
Set a texture as the current rendering target.
int(* LockTexture)(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect *rect, void **pixels, int *pitch)
DECLSPEC int SDLCALL SDL_QueryTexture(SDL_Texture *texture, Uint32 *format, int *access, int *w, int *h)
Query the attributes of a texture.
#define CHECK_RENDERER_MAGIC(renderer, retval)
int(* UpdateTextureYUV)(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect *rect, const Uint8 *Yplane, int Ypitch, const Uint8 *Uplane, int Upitch, const Uint8 *Vplane, int Vpitch)
DECLSPEC SDL_PixelFormat *SDLCALL SDL_AllocFormat(Uint32 pixel_format)
Create an SDL_PixelFormat structure from a pixel format enum.
int(* UpdateTexture)(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect *rect, const void *pixels, int pitch)
DECLSPEC SDL_bool SDLCALL SDL_IntersectRect(const SDL_Rect *A, const SDL_Rect *B, SDL_Rect *result)
Calculate the intersection of two rectangles.
SDL_RenderDriver SW_RenderDriver
DECLSPEC SDL_Renderer *SDLCALL SDL_GetRenderer(SDL_Window *window)
Get the renderer associated with a window.
EGLSurface EGLint EGLint EGLint width
DECLSPEC int SDLCALL SDL_GetSurfaceColorMod(SDL_Surface *surface, Uint8 *r, Uint8 *g, Uint8 *b)
Get the additional color value used in blit operations.
DECLSPEC SDL_Renderer *SDLCALL SDL_CreateSoftwareRenderer(SDL_Surface *surface)
Create a 2D software rendering context for a surface.
DECLSPEC SDL_bool SDLCALL SDL_HasIntersection(const SDL_Rect *A, const SDL_Rect *B)
Determine whether two rectangles intersect.
int(* RenderDrawLines)(SDL_Renderer *renderer, const SDL_FPoint *points, int count)
DECLSPEC SDL_Window *SDLCALL SDL_GetWindowFromID(Uint32 id)
Get a window from a stored ID, or NULL if it doesn't exist.
DECLSPEC void *SDLCALL SDL_SetWindowData(SDL_Window *window, const char *name, void *userdata)
Associate an arbitrary named pointer with a window.
DECLSPEC void SDLCALL SDL_RenderGetLogicalSize(SDL_Renderer *renderer, int *w, int *h)
Get device independent resolution for rendering.
DECLSPEC SDL_Texture *SDLCALL SDL_CreateTextureFromSurface(SDL_Renderer *renderer, SDL_Surface *surface)
Create a texture from an existing surface.
GLint GLenum GLsizei GLsizei GLsizei GLint GLenum format
DECLSPEC int SDLCALL SDL_SetError(const char *fmt,...)
DECLSPEC void *SDLCALL SDL_malloc(size_t size)
int(* SetTextureColorMod)(SDL_Renderer *renderer, SDL_Texture *texture)
DECLSPEC void *SDLCALL SDL_GetWindowData(SDL_Window *window, const char *name)
Retrieve the data pointer associated with a window.
DECLSPEC Uint32 SDLCALL SDL_GetWindowFlags(SDL_Window *window)
Get the window flags.
void SDL_SW_DestroyYUVTexture(SDL_SW_YUVTexture *swdata)
GLclampf GLclampf GLclampf alpha
DECLSPEC SDL_Surface *SDLCALL SDL_ConvertSurface(SDL_Surface *src, const SDL_PixelFormat *fmt, Uint32 flags)
DECLSPEC const char *SDLCALL SDL_GetHint(const char *name)
Get a hint.
DECLSPEC double SDLCALL SDL_floor(double x)
void(* DestroyTexture)(SDL_Renderer *renderer, SDL_Texture *texture)
int(* RenderCopy)(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect *srcrect, const SDL_FRect *dstrect)
GLenum GLenum GLenum GLenum GLenum scale
static int UpdateLogicalSize(SDL_Renderer *renderer)
SDL_RendererFlip
Flip constants for SDL_RenderCopyEx.
static int SDL_UpdateTextureYUV(SDL_Texture *texture, const SDL_Rect *rect, const void *pixels, int pitch)
DECLSPEC void SDLCALL SDL_AddEventWatch(SDL_EventFilter filter, void *userdata)
GLuint GLfloat GLfloat GLfloat x1
#define SDL_assert(condition)
int(* SetTextureBlendMode)(SDL_Renderer *renderer, SDL_Texture *texture)
DECLSPEC int SDLCALL SDL_RenderClear(SDL_Renderer *renderer)
Clear the current rendering target with the drawing color.
EGLSurface EGLint EGLint y
#define SDL_OutOfMemory()
DECLSPEC SDL_bool SDLCALL SDL_RenderTargetSupported(SDL_Renderer *renderer)
Determines whether a window supports the use of render targets.
GLenum GLenum GLuint texture
#define SDL_arraysize(array)
DECLSPEC void SDLCALL SDL_RenderGetViewport(SDL_Renderer *renderer, SDL_Rect *rect)
Get the drawing area for the current target.
DECLSPEC int SDLCALL SDL_RenderDrawRect(SDL_Renderer *renderer, const SDL_Rect *rect)
Draw a rectangle on the current rendering target.
int(* GetOutputSize)(SDL_Renderer *renderer, int *w, int *h)
DECLSPEC int SDLCALL SDL_SetTextureAlphaMod(SDL_Texture *texture, Uint8 alpha)
Set an additional alpha value used in render copy operations.
DECLSPEC SDL_Window *SDLCALL SDL_CreateWindow(const char *title, int x, int y, int w, int h, Uint32 flags)
Create a window with the specified position, dimensions, and flags.
GLint GLenum GLsizei GLsizei GLsizei GLint GLenum GLenum const GLvoid * pixels
int(* GL_BindTexture)(SDL_Renderer *renderer, SDL_Texture *texture, float *texw, float *texh)
Information on the capabilities of a render driver or context.
static const SDL_RenderDriver * render_drivers[]
#define SDL_WINDOWRENDERDATA
static SDL_bool IsSupportedFormat(SDL_Renderer *renderer, Uint32 format)
DECLSPEC int SDLCALL SDL_GetTextureBlendMode(SDL_Texture *texture, SDL_BlendMode *blendMode)
Get the blend mode used for texture copy operations.
DECLSPEC void SDLCALL SDL_DelEventWatch(SDL_EventFilter filter, void *userdata)
int(* RenderReadPixels)(SDL_Renderer *renderer, const SDL_Rect *rect, Uint32 format, void *pixels, int pitch)
DECLSPEC int SDLCALL SDL_GetRendererInfo(SDL_Renderer *renderer, SDL_RendererInfo *info)
Get information about a rendering context.
GLenum GLsizei GLsizei GLsizei GLsizei GLbitfield flags
int(* GL_UnbindTexture)(SDL_Renderer *renderer, SDL_Texture *texture)
#define CHECK_TEXTURE_MAGIC(texture, retval)
int SDL_SW_UpdateYUVTexturePlanar(SDL_SW_YUVTexture *swdata, const SDL_Rect *rect, const Uint8 *Yplane, int Ypitch, const Uint8 *Uplane, int Upitch, const Uint8 *Vplane, int Vpitch)
int(* RenderFillRects)(SDL_Renderer *renderer, const SDL_FRect *rects, int count)
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.
uint8_t Uint8
An unsigned 8-bit integer type.
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_RenderSetClipRect(SDL_Renderer *renderer, const SDL_Rect *rect)
Set the clip rectangle for the current target.
int SDL_SW_CopyYUVToRGB(SDL_SW_YUVTexture *swdata, const SDL_Rect *srcrect, Uint32 target_format, int w, int h, void *pixels, int pitch)
#define SDL_HINT_RENDER_DRIVER
A variable specifying which render driver to use.
DECLSPEC double SDLCALL SDL_ceil(double x)
SDL_MouseButtonEvent button
GLdouble GLdouble GLdouble r
GLdouble GLdouble GLdouble b
Uint32 num_texture_formats
GLint GLint GLint GLint GLint w
#define SDL_stack_alloc(type, count)
static char renderer_magic
DECLSPEC int SDLCALL SDL_GetNumRenderDrivers(void)
Get the number of 2D rendering drivers available for the current display.
int(* UpdateViewport)(SDL_Renderer *renderer)
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.
GLuint GLdouble GLdouble GLint GLint const GLdouble * points
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 int SDLCALL SDL_GetSurfaceAlphaMod(SDL_Surface *surface, Uint8 *alpha)
Get the additional alpha value used in blit operations.
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_RenderFillRect(SDL_Renderer *renderer, const SDL_Rect *rect)
Fill a rectangle on the current rendering target with the drawing color.
#define SDL_ISPIXELFORMAT_FOURCC(format)
int(* RenderCopyEx)(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)
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.
void(* RenderPresent)(SDL_Renderer *renderer)
void(* DestroyRenderer)(SDL_Renderer *renderer)
DECLSPEC void SDLCALL SDL_LogInfo(int category, const char *fmt,...)
Log a message with SDL_LOG_PRIORITY_INFO.
int(* SetTextureAlphaMod)(SDL_Renderer *renderer, SDL_Texture *texture)
DECLSPEC int SDLCALL SDL_GetRenderDriverInfo(int index, SDL_RendererInfo *info)
Get information about a specific 2D rendering driver for the current display.
static void SDL_UnlockTextureYUV(SDL_Texture *texture)
DECLSPEC int SDLCALL SDL_LockSurface(SDL_Surface *surface)
Sets up a surface for directly accessing the pixels.
#define SDL_Unsupported()
DECLSPEC int SDLCALL SDL_strcasecmp(const char *str1, const char *str2)
static int SDL_RendererEventWatch(void *userdata, SDL_Event *event)
A rectangle, with the origin at the upper left.
static int SDL_LockTextureNative(SDL_Texture *texture, const SDL_Rect *rect, void **pixels, int *pitch)
DECLSPEC void SDLCALL SDL_DestroyRenderer(SDL_Renderer *renderer)
Destroy the rendering context for a window and free associated textures.
DECLSPEC void SDLCALL SDL_RenderPresent(SDL_Renderer *renderer)
Update the screen with rendering performed.
DECLSPEC int SDLCALL SDL_GetSurfaceBlendMode(SDL_Surface *surface, SDL_BlendMode *blendMode)
Get the blend mode used for blit operations.
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...
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.