21 #include "../SDL_internal.h" 32 #if defined(__ANDROID__) 33 # include "../core/android/SDL_android.h" 36 #define SDL_WINDOWRENDERDATA "_SDL_WindowRenderData" 38 #define CHECK_RENDERER_MAGIC(renderer, retval) \ 39 SDL_assert(renderer && renderer->magic == &renderer_magic); \ 40 if (!renderer || renderer->magic != &renderer_magic) { \ 41 SDL_SetError("Invalid renderer"); \ 45 #define CHECK_TEXTURE_MAGIC(texture, retval) \ 46 SDL_assert(texture && texture->magic == &texture_magic); \ 47 if (!texture || texture->magic != &texture_magic) { \ 48 SDL_SetError("Invalid texture"); \ 53 #define SDL_COMPOSE_BLENDMODE(srcColorFactor, dstColorFactor, colorOperation, \ 54 srcAlphaFactor, dstAlphaFactor, alphaOperation) \ 55 (SDL_BlendMode)(((Uint32)colorOperation << 0) | \ 56 ((Uint32)srcColorFactor << 4) | \ 57 ((Uint32)dstColorFactor << 8) | \ 58 ((Uint32)alphaOperation << 16) | \ 59 ((Uint32)srcAlphaFactor << 20) | \ 60 ((Uint32)dstAlphaFactor << 24)) 62 #define SDL_BLENDMODE_NONE_FULL \ 63 SDL_COMPOSE_BLENDMODE(SDL_BLENDFACTOR_ONE, SDL_BLENDFACTOR_ZERO, SDL_BLENDOPERATION_ADD, \ 64 SDL_BLENDFACTOR_ONE, SDL_BLENDFACTOR_ZERO, SDL_BLENDOPERATION_ADD) 66 #define SDL_BLENDMODE_BLEND_FULL \ 67 SDL_COMPOSE_BLENDMODE(SDL_BLENDFACTOR_SRC_ALPHA, SDL_BLENDFACTOR_ONE_MINUS_SRC_ALPHA, SDL_BLENDOPERATION_ADD, \ 68 SDL_BLENDFACTOR_ONE, SDL_BLENDFACTOR_ONE_MINUS_SRC_ALPHA, SDL_BLENDOPERATION_ADD) 70 #define SDL_BLENDMODE_ADD_FULL \ 71 SDL_COMPOSE_BLENDMODE(SDL_BLENDFACTOR_SRC_ALPHA, SDL_BLENDFACTOR_ONE, SDL_BLENDOPERATION_ADD, \ 72 SDL_BLENDFACTOR_ZERO, SDL_BLENDFACTOR_ONE, SDL_BLENDOPERATION_ADD) 74 #define SDL_BLENDMODE_MOD_FULL \ 75 SDL_COMPOSE_BLENDMODE(SDL_BLENDFACTOR_ZERO, SDL_BLENDFACTOR_SRC_COLOR, SDL_BLENDOPERATION_ADD, \ 76 SDL_BLENDFACTOR_ZERO, SDL_BLENDFACTOR_ONE, SDL_BLENDOPERATION_ADD) 78 #if !SDL_RENDER_DISABLED 80 #if SDL_VIDEO_RENDER_D3D 83 #if SDL_VIDEO_RENDER_D3D11 86 #if SDL_VIDEO_RENDER_METAL 89 #if SDL_VIDEO_RENDER_OGL 92 #if SDL_VIDEO_RENDER_OGL_ES2 95 #if SDL_VIDEO_RENDER_OGL_ES 98 #if SDL_VIDEO_RENDER_DIRECTFB 101 #if SDL_VIDEO_RENDER_PSP 116 SDL_Log(
"Render commands to flush:");
124 SDL_Log(
" %u. set viewport (first=%u, rect={(%d, %d), %dx%d})", i++,
131 SDL_Log(
" %u. set cliprect (enabled=%s, rect={(%d, %d), %dx%d})", i++,
138 SDL_Log(
" %u. set draw color (first=%u, r=%d, g=%d, b=%d, a=%d)", i++,
145 SDL_Log(
" %u. clear (first=%u, r=%d, g=%d, b=%d, a=%d)", i++,
152 SDL_Log(
" %u. draw points (first=%u, count=%u, r=%d, g=%d, b=%d, a=%d, blend=%d)", i++,
153 (
unsigned int) cmd->
data.
draw.first,
154 (
unsigned int) cmd->
data.
draw.count,
161 SDL_Log(
" %u. draw lines (first=%u, count=%u, r=%d, g=%d, b=%d, a=%d, blend=%d)", i++,
162 (
unsigned int) cmd->
data.
draw.first,
163 (
unsigned int) cmd->
data.
draw.count,
170 SDL_Log(
" %u. fill rects (first=%u, count=%u, r=%d, g=%d, b=%d, a=%d, blend=%d)", i++,
171 (
unsigned int) cmd->
data.
draw.first,
172 (
unsigned int) cmd->
data.
draw.count,
179 SDL_Log(
" %u. copy (first=%u, count=%u, r=%d, g=%d, b=%d, a=%d, blend=%d, tex=%p)", i++,
180 (
unsigned int) cmd->
data.
draw.first,
181 (
unsigned int) cmd->
data.
draw.count,
189 SDL_Log(
" %u. copyex (first=%u, count=%u, r=%d, g=%d, b=%d, a=%d, blend=%d, tex=%p)", i++,
190 (
unsigned int) cmd->
data.
draw.first,
191 (
unsigned int) cmd->
data.
draw.count,
287 size_t aligner, aligned;
293 const size_t gapoffset = gap->
offset;
294 aligner = (alignment && ((gap->
offset % alignment) != 0)) ? (alignment - (gap->
offset % alignment)) : 0;
295 aligned = gapoffset + aligner;
298 if ((aligner < gap->
len) && ((gap->
len - aligner) >= numbytes)) {
300 if (gap->
len == numbytes) {
305 }
else if (aligned == gapoffset) {
307 gap->
len -= numbytes;
308 }
else if (((aligned - gapoffset) + numbytes) == gap->
len) {
309 gap->
len -= numbytes;
315 newgap->
offset = aligned + numbytes;
316 newgap->
len = gap->
len - (aligner + numbytes);
337 const size_t newsize = current_allocation * 2;
359 newgap->
len = aligner;
361 prevgap->
next = newgap;
377 if (retval !=
NULL) {
447 const Uint32 color = ((a << 24) | (r << 16) | (g << 8) | b);
598 retval = renderer->
QueueCopy(renderer, cmd, texture, srcrect, dstrect);
615 retval = renderer->
QueueCopyEx(renderer, cmd, texture, srcquad, dstrect, angle, center, flip);
629 #if !SDL_RENDER_DISABLED 639 #if !SDL_RENDER_DISABLED 641 return SDL_SetError(
"index must be in the range of 0 - %d",
647 return SDL_SetError(
"SDL not built with rendering support");
668 if (window == renderer->
window) {
727 if (window == renderer->
window) {
728 int logical_w, logical_h;
733 event->motion.x -= (int)(viewport.
x * renderer->
dpi_scale.
x);
734 event->motion.y -= (int)(viewport.
y * renderer->
dpi_scale.
y);
752 if (window == renderer->
window) {
753 int logical_w, logical_h;
758 event->button.x -= (int)(viewport.
x * renderer->
dpi_scale.
x);
759 event->button.y -= (int)(viewport.
y * renderer->
dpi_scale.
y);
767 int logical_w, logical_h;
776 event->tfinger.x *= (w - 1);
777 event->tfinger.y *= (h - 1);
779 event->tfinger.x -= (viewport.
x * renderer->
dpi_scale.
x);
780 event->tfinger.y -= (viewport.
y * renderer->
dpi_scale.
y);
781 event->tfinger.x = (
event->tfinger.x / (scale.
x * renderer->
dpi_scale.
x));
782 event->tfinger.y = (
event->tfinger.y / (scale.
y * renderer->
dpi_scale.
y));
785 event->tfinger.x =
event->tfinger.x / (logical_w - 1);
787 event->tfinger.x = 0.5f;
790 event->tfinger.y =
event->tfinger.y / (logical_h - 1);
792 event->tfinger.y = 0.5f;
806 width, height, window_flags);
837 #if !SDL_RENDER_DISABLED 843 #if defined(__ANDROID__) 853 SDL_SetError(
"Renderer already associated with window");
868 for (index = 0; index <
n; ++
index) {
883 for (index = 0; index <
n; ++
index) {
886 if ((driver->
info.
flags & flags) == flags) {
902 SDL_SetError(
"index must be -1 or in the range of 0 - %d",
938 int output_w, output_h;
939 if (renderer->
GetOutputSize(renderer, &output_w, &output_h) == 0) {
941 renderer->
dpi_scale.
x = (float)window_w / output_w;
942 renderer->
dpi_scale.
y = (float)window_h / output_h;
959 "Created renderer: %s", renderer->
info.
name);
961 #if defined(__ANDROID__) 968 #if defined(__ANDROID__) 982 #if !SDL_RENDER_DISABLED 1017 *info = renderer->
info;
1030 }
else if (renderer->
window) {
1035 return SDL_SetError(
"Renderer doesn't support querying output size");
1129 if (w <= 0 || h <= 0) {
1180 if (texture->
prev) {
1189 if (!texture->
yuv) {
1219 SDL_SetError(
"SDL_CreateTextureFromSurface() passed NULL surface");
1283 surface->
w, surface->
h);
1302 if (direct_update) {
1359 *format = texture->
format;
1362 *access = texture->
access;
1378 if (r < 255 || g < 255 || b < 255) {
1433 *alpha = texture->
a;
1469 const void *
pixels,
int pitch)
1480 full_rect.
w = texture->
w;
1481 full_rect.
h = texture->
h;
1486 void *native_pixels =
NULL;
1487 int native_pitch = 0;
1489 if (
SDL_LockTexture(native, rect, &native_pixels, &native_pitch) < 0) {
1493 rect->
w, rect->
h, native_pixels, native_pitch);
1498 const size_t alloclen = rect->
h * temp_pitch;
1505 rect->
w, rect->
h, temp_pixels, temp_pitch);
1515 const void *
pixels,
int pitch)
1519 if (!rect->
w || !rect->
h) {
1525 void *native_pixels =
NULL;
1526 int native_pitch = 0;
1528 if (
SDL_LockTexture(native, rect, &native_pixels, &native_pitch) < 0) {
1532 texture->
format, pixels, pitch,
1533 native->
format, native_pixels, native_pitch);
1538 const size_t alloclen = rect->
h * temp_pitch;
1545 texture->
format, pixels, pitch,
1546 native->
format, temp_pixels, temp_pitch);
1556 const void *
pixels,
int pitch)
1572 full_rect.
w = texture->
w;
1573 full_rect.
h = texture->
h;
1577 if ((rect->
w == 0) || (rect->
h == 0)) {
1579 }
else if (texture->
yuv) {
1581 }
else if (texture->
native) {
1588 return renderer->
UpdateTexture(renderer, texture, rect, pixels, pitch);
1594 const Uint8 *Yplane,
int Ypitch,
1595 const Uint8 *Uplane,
int Upitch,
1596 const Uint8 *Vplane,
int Vpitch)
1607 full_rect.
w = texture->
w;
1608 full_rect.
h = texture->
h;
1611 if (!rect->
w || !rect->
h) {
1617 void *native_pixels =
NULL;
1618 int native_pitch = 0;
1620 if (
SDL_LockTexture(native, rect, &native_pixels, &native_pitch) < 0) {
1624 rect->
w, rect->
h, native_pixels, native_pitch);
1629 const size_t alloclen = rect->
h * temp_pitch;
1636 rect->
w, rect->
h, temp_pixels, temp_pitch);
1645 const Uint8 *Yplane,
int Ypitch,
1646 const Uint8 *Uplane,
int Upitch,
1647 const Uint8 *Vplane,
int Vpitch)
1675 return SDL_SetError(
"Texture format must by YV12 or IYUV");
1681 full_rect.
w = texture->
w;
1682 full_rect.
h = texture->
h;
1686 if (!rect->
w || !rect->
h) {
1700 return renderer->
UpdateTextureYUV(renderer, texture, rect, Yplane, Ypitch, Uplane, Upitch, Vplane, Vpitch);
1709 void **
pixels,
int *pitch)
1716 void **
pixels,
int *pitch)
1720 rect->
y * texture->
pitch +
1722 *pitch = texture->
pitch;
1728 void **
pixels,
int *pitch)
1735 return SDL_SetError(
"SDL_LockTexture(): texture must be streaming");
1741 full_rect.
w = texture->
w;
1742 full_rect.
h = texture->
h;
1751 }
else if (texture->
native) {
1759 return renderer->
LockTexture(renderer, texture, rect, pixels, pitch);
1767 void *native_pixels =
NULL;
1768 int native_pitch = 0;
1773 rect.
w = texture->
w;
1774 rect.
h = texture->
h;
1776 if (
SDL_LockTexture(native, &rect, &native_pixels, &native_pitch) < 0) {
1780 rect.
w, rect.
h, native_pixels, native_pitch);
1788 void *native_pixels =
NULL;
1789 int native_pitch = 0;
1792 rect->
y * texture->
pitch +
1794 int pitch = texture->
pitch;
1796 if (
SDL_LockTexture(native, rect, &native_pixels, &native_pitch) < 0) {
1800 texture->
format, pixels, pitch,
1801 native->
format, native_pixels, native_pitch);
1815 }
else if (texture->
native) {
1838 if (texture == renderer->
target) {
1848 if (renderer != texture->
renderer) {
1849 return SDL_SetError(
"Texture was not created with this renderer");
1852 return SDL_SetError(
"Texture not created with SDL_TEXTUREACCESS_TARGET");
1856 texture = texture->
native;
1862 if (texture && !renderer->
target) {
1885 renderer->
scale.
x = 1.0f;
1886 renderer->
scale.
y = 1.0f;
1926 int scale_policy = 0;
1937 if (hint && (*hint ==
'1' ||
SDL_strcasecmp(hint,
"overscan") == 0)) {
1938 #if SDL_VIDEO_RENDER_D3D 1946 if (overscan_supported) {
1955 real_aspect = (
float)w /
h;
1961 if (want_aspect > real_aspect) {
1962 scale = (float)(w / renderer->
logical_w);
1967 viewport.
x = (w - viewport.
w) / 2;
1969 viewport.
y = (
h - viewport.
h) / 2;
1972 }
else if (
SDL_fabs(want_aspect-real_aspect) < 0.0001) {
1976 }
else if (want_aspect > real_aspect) {
1977 if (scale_policy == 1) {
1986 viewport.
x = (w - viewport.
w) / 2;
1994 viewport.
y = (
h - viewport.
h) / 2;
1998 if (scale_policy == 1) {
2007 viewport.
y = (
h - viewport.
h) / 2;
2015 viewport.
x = (w - viewport.
w) / 2;
2158 renderer->
scale.
x = scaleX;
2159 renderer->
scale.
y = scaleY;
2169 *scaleX = renderer->
scale.
x;
2172 *scaleY = renderer->
scale.
y;
2248 fpoint.
x = (float) x;
2249 fpoint.
y = (float) y;
2275 for (i = 0; i <
count; ++
i) {
2276 frects[
i].
x = points[
i].
x * renderer->
scale.
x;
2277 frects[
i].
y = points[
i].
y * renderer->
scale.
y;
2301 return SDL_SetError(
"SDL_RenderDrawPoints(): Passed NULL points");
2312 if (renderer->
scale.
x != 1.0f || renderer->
scale.
y != 1.0f) {
2320 for (i = 0; i <
count; ++
i) {
2321 fpoints[
i].
x = points[
i].
x * renderer->
scale.
x;
2322 fpoints[
i].
y = points[
i].
y * renderer->
scale.
y;
2345 for (i = 0; i <
count; ++
i) {
2346 frects[
i].
x = fpoints[
i].
x * renderer->
scale.
x;
2347 frects[
i].
y = fpoints[
i].
y * renderer->
scale.
y;
2371 return SDL_SetError(
"SDL_RenderDrawFPoints(): Passed NULL points");
2382 if (renderer->
scale.
x != 1.0f || renderer->
scale.
y != 1.0f) {
2390 for (i = 0; i <
count; ++
i) {
2391 fpoints[
i].
x = points[
i].
x * renderer->
scale.
x;
2392 fpoints[
i].
y = points[
i].
y * renderer->
scale.
y;
2406 points[0].
x = (float) x1;
2407 points[0].
y = (float) y1;
2408 points[1].
x = (float) x2;
2409 points[1].
y = (float) y2;
2440 for (i = 0; i < count-1; ++
i) {
2441 if (points[i].
x == points[i+1].
x) {
2443 const int maxY =
SDL_max(points[i].y, points[i+1].y);
2445 frect = &frects[nrects++];
2446 frect->
x = points[
i].
x * renderer->
scale.
x;
2447 frect->
y = minY * renderer->
scale.
y;
2449 frect->
h = (maxY - minY + 1) * renderer->
scale.
y;
2450 }
else if (points[i].
y == points[i+1].
y) {
2451 const int minX =
SDL_min(points[i].
x, points[i+1].x);
2452 const int maxX =
SDL_max(points[i].x, points[i+1].x);
2454 frect = &frects[nrects++];
2455 frect->
x = minX * renderer->
scale.
x;
2456 frect->
y = points[
i].
y * renderer->
scale.
y;
2457 frect->
w = (maxX - minX + 1) * renderer->
scale.
x;
2461 fpoints[0].
x = points[
i].
x * renderer->
scale.
x;
2462 fpoints[0].
y = points[
i].
y * renderer->
scale.
y;
2463 fpoints[1].
x = points[i+1].
x * renderer->
scale.
x;
2464 fpoints[1].
y = points[i+1].
y * renderer->
scale.
y;
2495 for (i = 0; i < count-1; ++
i) {
2496 if (points[i].
x == points[i+1].
x) {
2497 const int minY = (int)
SDL_min(points[i].
y, points[i+1].y);
2498 const int maxY = (int)
SDL_max(points[i].y, points[i+1].y);
2500 frect = &frects[nrects++];
2501 frect->
x = points[
i].
x * renderer->
scale.
x;
2502 frect->
y = minY * renderer->
scale.
y;
2504 frect->
h = (maxY - minY + 1) * renderer->
scale.
y;
2505 }
else if (points[i].
y == points[i+1].
y) {
2506 const int minX = (int)
SDL_min(points[i].
x, points[i+1].x);
2507 const int maxX = (int)
SDL_max(points[i].x, points[i+1].x);
2509 frect = &frects[nrects++];
2510 frect->
x = minX * renderer->
scale.
x;
2511 frect->
y = points[
i].
y * renderer->
scale.
y;
2512 frect->
w = (maxX - minX + 1) * renderer->
scale.
x;
2516 fpoints[0].
x = points[
i].
x * renderer->
scale.
x;
2517 fpoints[0].
y = points[
i].
y * renderer->
scale.
y;
2518 fpoints[1].
x = points[i+1].
x * renderer->
scale.
x;
2519 fpoints[1].
y = points[i+1].
y * renderer->
scale.
y;
2546 return SDL_SetError(
"SDL_RenderDrawLines(): Passed NULL points");
2557 if (renderer->
scale.
x != 1.0f || renderer->
scale.
y != 1.0f) {
2565 for (i = 0; i <
count; ++
i) {
2566 fpoints[
i].
x = points[
i].
x * renderer->
scale.
x;
2567 fpoints[
i].
y = points[
i].
y * renderer->
scale.
y;
2589 return SDL_SetError(
"SDL_RenderDrawLines(): Passed NULL points");
2600 if (renderer->
scale.
x != 1.0f || renderer->
scale.
y != 1.0f) {
2608 for (i = 0; i <
count; ++
i) {
2609 fpoints[
i].
x = points[
i].
x * renderer->
scale.
x;
2610 fpoints[
i].
y = points[
i].
y * renderer->
scale.
y;
2627 frect.
x = (float) rect->
x;
2628 frect.
y = (
float) rect->
y;
2629 frect.
w = (float) rect->
w;
2630 frect.
h = (
float) rect->
h;
2651 frect.
w = (float) r.
w;
2652 frect.
h = (
float) r.
h;
2656 points[0].
x = rect->
x;
2657 points[0].
y = rect->
y;
2658 points[1].
x = rect->
x+rect->
w-1;
2659 points[1].
y = rect->
y;
2660 points[2].
x = rect->
x+rect->
w-1;
2661 points[2].
y = rect->
y+rect->
h-1;
2662 points[3].
x = rect->
x;
2663 points[3].
y = rect->
y+rect->
h-1;
2664 points[4].
x = rect->
x;
2665 points[4].
y = rect->
y;
2678 return SDL_SetError(
"SDL_RenderDrawRects(): Passed NULL rects");
2689 for (i = 0; i <
count; ++
i) {
2706 return SDL_SetError(
"SDL_RenderDrawRects(): Passed NULL rects");
2717 for (i = 0; i <
count; ++
i) {
2734 frect.
x = (float) rect->
x;
2735 frect.
y = (
float) rect->
y;
2736 frect.
w = (float) rect->
w;
2737 frect.
h = (
float) rect->
h;
2744 frect.
w = (float) r.
w;
2745 frect.
h = (
float) r.
h;
2764 frect.
w = (float) r.
w;
2765 frect.
h = (
float) r.
h;
2783 return SDL_SetError(
"SDL_RenderFillRects(): Passed NULL rects");
2798 for (i = 0; i <
count; ++
i) {
2799 frects[
i].
x = rects[
i].
x * renderer->
scale.
x;
2800 frects[
i].
y = rects[
i].
y * renderer->
scale.
y;
2801 frects[
i].
w = rects[
i].
w * renderer->
scale.
x;
2802 frects[
i].
h = rects[
i].
h * renderer->
scale.
y;
2824 return SDL_SetError(
"SDL_RenderFillFRects(): Passed NULL rects");
2839 for (i = 0; i <
count; ++
i) {
2840 frects[
i].
x = rects[
i].
x * renderer->
scale.
x;
2841 frects[
i].
y = rects[
i].
y * renderer->
scale.
y;
2842 frects[
i].
w = rects[
i].
w * renderer->
scale.
x;
2843 frects[
i].
h = rects[
i].
h * renderer->
scale.
y;
2863 float Amin, Amax, Bmin, Bmax;
2914 dstfrect.
x = (float) dstrect->
x;
2915 dstfrect.
y = (
float) dstrect->
y;
2916 dstfrect.
w = (float) dstrect->
w;
2917 dstfrect.
h = (
float) dstrect->
h;
2918 pdstfrect = &dstfrect;
2935 if (renderer != texture->
renderer) {
2936 return SDL_SetError(
"Texture was not created with this renderer");
2946 real_srcrect.
w = texture->
w;
2947 real_srcrect.
h = texture->
h;
2956 real_dstrect.
x = 0.0f;
2957 real_dstrect.
y = 0.0f;
2958 real_dstrect.
w = (float) r.
w;
2959 real_dstrect.
h = (
float) r.
h;
2964 real_dstrect = *dstrect;
2968 texture = texture->
native;
2971 real_dstrect.
x *= renderer->
scale.
x;
2972 real_dstrect.
y *= renderer->
scale.
y;
2973 real_dstrect.
w *= renderer->
scale.
x;
2974 real_dstrect.
h *= renderer->
scale.
y;
2978 retval =
QueueCmdCopy(renderer, texture, &real_srcrect, &real_dstrect);
2993 dstfrect.
x = (float) dstrect->
x;
2994 dstfrect.
y = (
float) dstrect->
y;
2995 dstfrect.
w = (float) dstrect->
w;
2996 dstfrect.
h = (
float) dstrect->
h;
2997 pdstfrect = &dstfrect;
3001 fcenter.
x = (float) center->
x;
3002 fcenter.
y = (
float) center->
y;
3003 pfcenter = &fcenter;
3006 return SDL_RenderCopyExF(renderer, texture, srcrect, pdstfrect, angle, pfcenter, flip);
3019 if (flip ==
SDL_FLIP_NONE && (
int)(angle/360) == angle/360) {
3026 if (renderer != texture->
renderer) {
3027 return SDL_SetError(
"Texture was not created with this renderer");
3030 return SDL_SetError(
"Renderer does not support RenderCopyEx");
3040 real_srcrect.
w = texture->
w;
3041 real_srcrect.
h = texture->
h;
3050 real_dstrect = *dstrect;
3055 real_dstrect.
x = 0.0f;
3056 real_dstrect.
y = 0.0f;
3057 real_dstrect.
w = (float) r.
w;
3058 real_dstrect.
h = (
float) r.
h;
3062 texture = texture->
native;
3066 real_center = *center;
3068 real_center.
x = real_dstrect.
w / 2.0f;
3069 real_center.
y = real_dstrect.
h / 2.0f;
3072 real_dstrect.
x *= renderer->
scale.
x;
3073 real_dstrect.
y *= renderer->
scale.
y;
3074 real_dstrect.
w *= renderer->
scale.
x;
3075 real_dstrect.
h *= renderer->
scale.
y;
3077 real_center.
x *= renderer->
scale.
x;
3078 real_center.
y *= renderer->
scale.
y;
3082 retval =
QueueCmdCopyEx(renderer, texture, &real_srcrect, &real_dstrect, angle, &real_center, flip);
3112 if (real_rect.
y > rect->
y) {
3113 pixels = (
Uint8 *)pixels + pitch * (real_rect.
y - rect->
y);
3115 if (real_rect.
x > rect->
x) {
3117 pixels = (
Uint8 *)pixels + bpp * (real_rect.
x - rect->
x);
3122 format, pixels, pitch);
3147 if (texture == renderer->
target) {
3155 if (texture->
next) {
3158 if (texture->
prev) {
3198 while (cmd !=
NULL) {
3207 nextgap = gap->
next;
3212 nextgap = gap->
next;
3337 srcAlphaFactor, dstAlphaFactor, alphaOperation);
SDL_BlendFactor SDL_GetBlendModeSrcColorFactor(SDL_BlendMode blendMode)
SDL_BlendFactor
The normalized factor used to multiply pixel components.
int SDL_CreateWindowAndRenderer(int width, int height, Uint32 window_flags, SDL_Window **window, SDL_Renderer **renderer)
Create a window and default renderer.
static SDL_AllocVertGap * AllocateVertexGap(SDL_Renderer *renderer)
GLenum GLenum GLenum GLenum GLenum scale
SDL_FORCE_INLINE SDL_bool SDL_FRectEmpty(const SDL_FRect *r)
SDL_MouseMotionEvent motion
#define SDL_DelEventWatch
GLdouble GLdouble GLdouble r
#define SDL_GetWindowData
int(* LockTexture)(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect *rect, void **pixels, int *pitch)
GLuint GLfloat GLfloat GLfloat x1
SDL_SW_YUVTexture * SDL_SW_CreateYUVTexture(Uint32 format, int w, int h)
struct SDL_RenderCommand::@30::@31 viewport
static int RenderDrawPointsWithRectsF(SDL_Renderer *renderer, const SDL_FPoint *fpoints, const int count)
#define SDL_UnlockSurface
SDL_AllocVertGap * vertex_data_gaps_pool
static Uint32 GetClosestSupportedFormat(SDL_Renderer *renderer, Uint32 format)
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_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.
#define SDL_HINT_RENDER_VSYNC
A variable controlling whether updates to the SDL screen surface should be synchronized with the vert...
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.
int(* RenderReadPixels)(SDL_Renderer *renderer, const SDL_Rect *rect, Uint32 format, void *pixels, int pitch)
static int FlushRenderCommands(SDL_Renderer *renderer)
void Android_ActivityMutex_Lock_Running(void)
int SDL_SetRenderDrawBlendMode(SDL_Renderer *renderer, SDL_BlendMode blendMode)
Set the blend mode used for drawing operations (Fill and Line).
void * SDL_RenderGetMetalCommandEncoder(SDL_Renderer *renderer)
Get the Metal command encoder for the current frame.
int SDL_GetRendererInfo(SDL_Renderer *renderer, SDL_RendererInfo *info)
Get information about a rendering context.
SDL_Rect clip_rect_backup
static void GetWindowViewportValues(SDL_Renderer *renderer, int *logical_w, int *logical_h, SDL_Rect *viewport, SDL_FPoint *scale)
GLint GLint GLint GLint GLint x
struct SDL_RenderCommand::@30::@32 cliprect
#define SDL_HINT_RENDER_BATCHING
A variable controlling whether the 2D render API is compatible or efficient.
#define SDL_ISPIXELFORMAT_INDEXED(format)
static int RenderDrawPointsWithRects(SDL_Renderer *renderer, const SDL_Point *points, const int count)
SDL_RenderDriver GLES_RenderDriver
SDL_BlendMode
The blend mode used in SDL_RenderCopy() and drawing operations.
SDL_bool(* SupportsBlendMode)(SDL_Renderer *renderer, SDL_BlendMode blendMode)
SDL_RenderDriver DirectFB_RenderDriver
#define SDL_ConvertSurface
GLuint GLuint GLsizei count
static int RenderDrawLinesWithRectsF(SDL_Renderer *renderer, const SDL_FPoint *points, const int count)
int SDL_RenderDrawPointF(SDL_Renderer *renderer, float x, float y)
Draw a point on the current rendering target.
void * SDL_AllocateRenderVertices(SDL_Renderer *renderer, const size_t numbytes, const size_t alignment, size_t *offset)
struct SDL_AllocVertGap * next
#define SDL_HINT_RENDER_SCALE_QUALITY
A variable controlling the scaling quality.
SDL_RenderDriver D3D11_RenderDriver
struct SDL_RenderCommand::@30::@34 color
GLfloat GLfloat GLfloat GLfloat h
int(* QueueSetDrawColor)(SDL_Renderer *renderer, SDL_RenderCommand *cmd)
SDL_Texture * SDL_GetRenderTarget(SDL_Renderer *renderer)
Get the current render target or NULL for the default render target.
GLfixed GLfixed GLfixed y2
SDL_RenderDriver PSP_RenderDriver
static SDL_ScaleMode SDL_GetScaleMode(void)
The structure that defines a point (integer)
A collection of pixels used in software blitting.
static SDL_RenderCommand * AllocateRenderCommand(SDL_Renderer *renderer)
Uint32 texture_formats[16]
SDL_BlendFactor SDL_GetBlendModeDstAlphaFactor(SDL_BlendMode blendMode)
#define SDL_GetWindowFlags
static int QueueCmdCopy(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect *srcrect, const SDL_FRect *dstrect)
int SDL_SW_LockYUVTexture(SDL_SW_YUVTexture *swdata, const SDL_Rect *rect, void **pixels, int *pitch)
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.
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).
int(* QueueCopyEx)(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture *texture, const SDL_Rect *srcquad, const SDL_FRect *dstrect, const double angle, const SDL_FPoint *center, const SDL_RendererFlip flip)
SDL_BlendOperation SDL_GetBlendModeColorOperation(SDL_BlendMode blendMode)
SDL_RendererFlip
Flip constants for SDL_RenderCopyEx.
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.
#define SDL_BYTESPERPIXEL(X)
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...
static int FlushRenderCommandsIfTextureNeeded(SDL_Texture *texture)
static int SDL_UpdateTextureNative(SDL_Texture *texture, const SDL_Rect *rect, const void *pixels, int pitch)
int SDL_RenderDrawPoint(SDL_Renderer *renderer, int x, int y)
Draw a point on the current rendering target.
#define SDL_WINDOWPOS_UNDEFINED
SDL_RenderDriver GL_RenderDriver
#define SDL_ISPIXELFORMAT_ALPHA(format)
#define SDL_InvalidParamError(param)
int SDL_RenderSetViewport(SDL_Renderer *renderer, const SDL_Rect *rect)
Set the drawing area for rendering on the current target.
void SDL_RenderPresent(SDL_Renderer *renderer)
Update the screen with rendering performed.
int SDL_RenderReadPixels(SDL_Renderer *renderer, const SDL_Rect *rect, Uint32 format, void *pixels, int pitch)
Read pixels from the current rendering target.
#define SDL_IntersectRect
SDL_BlendOperation
The blend operation used when combining source and destination pixel components.
static char texture_magic
void SDL_RenderGetLogicalSize(SDL_Renderer *renderer, int *w, int *h)
Get device independent resolution for rendering.
int SDL_GetRendererOutputSize(SDL_Renderer *renderer, int *w, int *h)
Get the output size in pixels of a rendering context.
static int SDL_LockTextureYUV(SDL_Texture *texture, const SDL_Rect *rect, void **pixels, int *pitch)
GLfloat GLfloat GLfloat alpha
GLuint GLint GLboolean GLint GLenum access
int SDL_RenderFillRect(SDL_Renderer *renderer, const SDL_Rect *rect)
Fill a rectangle on the current rendering target with the drawing color.
SDL_Rect last_queued_viewport
void(* DestroyRenderer)(SDL_Renderer *renderer)
GLint GLint GLsizei width
GLfixed GLfixed GLint GLint GLfixed points
void * SDL_RenderGetMetalLayer(SDL_Renderer *renderer)
Get the CAMetalLayer associated with the given Metal renderer.
int(* GetOutputSize)(SDL_Renderer *renderer, int *w, int *h)
int SDL_QueryTexture(SDL_Texture *texture, Uint32 *format, int *access, int *w, int *h)
Query the attributes of a texture.
int SDL_RenderFlush(SDL_Renderer *renderer)
Force the rendering context to flush any pending commands to the underlying rendering API...
static SDL_INLINE void DebugLogRenderCommands(const SDL_RenderCommand *cmd)
#define SDL_GetHintBoolean
#define SDL_GetSurfaceBlendMode
SDL_Renderer * SW_CreateRendererForSurface(SDL_Surface *surface)
static void SDL_UnlockTextureNative(SDL_Texture *texture)
static SDL_BlendMode blendMode
int SDL_GetTextureBlendMode(SDL_Texture *texture, SDL_BlendMode *blendMode)
Get the blend mode used for texture copy operations.
#define SDL_SetWindowData
int SDL_RenderDrawLinesF(SDL_Renderer *renderer, const SDL_FPoint *points, int count)
Draw a series of connected lines on the current rendering target.
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
static SDL_BlendMode SDL_GetShortBlendMode(SDL_BlendMode blendMode)
SDL_Renderer * SDL_CreateSoftwareRenderer(SDL_Surface *surface)
Create a 2D software rendering context for a surface.
int(* UpdateTexture)(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect *rect, const void *pixels, int pitch)
int SDL_SW_UpdateYUVTexture(SDL_SW_YUVTexture *swdata, const SDL_Rect *rect, const void *pixels, int pitch)
#define SDL_small_alloc(type, count, pisstack)
SDL_RenderCommand * render_commands_tail
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)
#define SDL_GetWindowSize
int SDL_SetTextureBlendMode(SDL_Texture *texture, SDL_BlendMode blendMode)
Set the blend mode used for texture copy operations.
int(* QueueCopy)(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture *texture, const SDL_Rect *srcrect, const SDL_FRect *dstrect)
SDL_RenderDriver METAL_RenderDriver
static int QueueCmdFillRects(SDL_Renderer *renderer, const SDL_FRect *rects, const int count)
SDL_RenderDriver GLES2_RenderDriver
GLenum GLenum GLuint texture
#define CHECK_RENDERER_MAGIC(renderer, retval)
SDL_BlendOperation SDL_GetBlendModeAlphaOperation(SDL_BlendMode blendMode)
static SDL_INLINE void VerifyDrawQueueFunctions(const SDL_Renderer *renderer)
void SDL_DestroyTexture(SDL_Texture *texture)
Destroy the specified texture.
void SDL_DestroyRenderer(SDL_Renderer *renderer)
Destroy the rendering context for a window and free associated textures.
SDL_RenderDriver SW_RenderDriver
int SDL_RenderDrawRects(SDL_Renderer *renderer, const SDL_Rect *rects, int count)
Draw some number of rectangles on the current rendering target.
struct SDL_RenderCommand::@30::@33 draw
SDL_RenderCommand * render_commands_pool
static SDL_Renderer * renderer
int SDL_RenderDrawPoints(SDL_Renderer *renderer, const SDL_Point *points, int count)
Draw multiple points on the current rendering target.
int SDL_RenderDrawLineF(SDL_Renderer *renderer, float x1, float y1, float x2, float y2)
Draw a line on the current rendering target.
void SDL_UnlockTexture(SDL_Texture *texture)
Unlock a texture, uploading the changes to video memory, if needed.
static int RenderDrawLinesWithRects(SDL_Renderer *renderer, const SDL_Point *points, const int count)
static SDL_INLINE int FlushRenderCommandsIfNotBatching(SDL_Renderer *renderer)
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.
int SDL_GetRenderDrawBlendMode(SDL_Renderer *renderer, SDL_BlendMode *blendMode)
Get the blend mode used for drawing operations.
SDL_Texture * SDL_CreateTextureFromSurface(SDL_Renderer *renderer, SDL_Surface *surface)
Create a texture from an existing surface.
int(* QueueSetViewport)(SDL_Renderer *renderer, SDL_RenderCommand *cmd)
#define SDL_BLENDMODE_BLEND_FULL
int SDL_RenderSetIntegerScale(SDL_Renderer *renderer, SDL_bool enable)
Set whether to force integer scales for resolution-independent rendering.
SDL_Rect last_queued_cliprect
GLfloat GLfloat GLfloat GLfloat maxX
int(* GL_BindTexture)(SDL_Renderer *renderer, SDL_Texture *texture, float *texw, float *texh)
SDL_RenderCommand * render_commands
GLubyte GLubyte GLubyte GLubyte w
void *(* GetMetalLayer)(SDL_Renderer *renderer)
void(* UnlockTexture)(SDL_Renderer *renderer, SDL_Texture *texture)
size_t vertex_data_allocation
SDL_Renderer *(* CreateRenderer)(SDL_Window *window, Uint32 flags)
#define SDL_BLENDMODE_MOD_FULL
int SDL_RenderDrawRect(SDL_Renderer *renderer, const SDL_Rect *rect)
Draw a rectangle on the current rendering target.
Uint32 last_command_generation
GLint GLint GLint GLint GLint GLint y
int SDL_GetNumRenderDrivers(void)
Get the number of 2D rendering drivers available for the current display.
void SDL_SW_DestroyYUVTexture(SDL_SW_YUVTexture *swdata)
static SDL_bool SDL_HasIntersectionF(const SDL_FRect *A, const SDL_FRect *B)
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.
int(* SetRenderTarget)(SDL_Renderer *renderer, SDL_Texture *texture)
SDL_RenderDriver D3D_RenderDriver
GLint GLint GLsizei GLsizei GLsizei GLint GLenum GLenum const GLvoid * pixels
static int QueueCmdSetDrawColor(SDL_Renderer *renderer, const Uint8 r, const Uint8 g, const Uint8 b, const Uint8 a)
#define SDL_GetWindowFromID
Uint32 render_command_generation
int SDL_GetTextureColorMod(SDL_Texture *texture, Uint8 *r, Uint8 *g, Uint8 *b)
Get the additional color value used in render copy operations.
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.
int(* QueueDrawLines)(SDL_Renderer *renderer, SDL_RenderCommand *cmd, const SDL_FPoint *points, int count)
SDL_bool SDL_RenderGetIntegerScale(SDL_Renderer *renderer)
Get whether integer scales are forced for resolution-independent rendering.
SDL_bool SDL_RenderTargetSupported(SDL_Renderer *renderer)
Determines whether a window supports the use of render targets.
int(* GL_UnbindTexture)(SDL_Renderer *renderer, SDL_Texture *texture)
int(* RunCommandQueue)(SDL_Renderer *renderer, SDL_RenderCommand *cmd, void *vertices, size_t vertsize)
#define SDL_BLENDMODE_NONE_FULL
static int UpdateLogicalSize(SDL_Renderer *renderer)
#define SDL_GetSurfaceAlphaMod
static int PrepQueueCmdDraw(SDL_Renderer *renderer, const Uint8 r, const Uint8 g, const Uint8 b, const Uint8 a)
static int SDL_UpdateTextureYUV(SDL_Texture *texture, const SDL_Rect *rect, const void *pixels, int pitch)
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
int SDL_RenderSetScale(SDL_Renderer *renderer, float scaleX, float scaleY)
Set the drawing scale for rendering on the current target.
int SDL_SetTextureAlphaMod(SDL_Texture *texture, Uint8 alpha)
Set an additional alpha value used in render copy operations.
void SDL_RenderGetClipRect(SDL_Renderer *renderer, SDL_Rect *rect)
Get the clip rectangle for the current target.
#define SDL_assert(condition)
int SDL_UpdateTexture(SDL_Texture *texture, const SDL_Rect *rect, const void *pixels, int pitch)
Update the given texture rectangle with new pixel data.
#define SDL_HINT_RENDER_LOGICAL_SIZE_MODE
A variable controlling the scaling policy for SDL_RenderSetLogicalSize.
int SDL_RenderClear(SDL_Renderer *renderer)
Clear the current rendering target with the drawing color.
SDL_bool SDL_RenderIsClipEnabled(SDL_Renderer *renderer)
Get whether clipping is enabled on the given renderer.
#define SDL_OutOfMemory()
int SDL_RenderDrawRectF(SDL_Renderer *renderer, const SDL_FRect *rect)
Draw a rectangle on the current rendering target.
#define SDL_GetCurrentVideoDriver
static int QueueCmdClear(SDL_Renderer *renderer)
GLfloat GLfloat GLfloat GLfloat GLfloat maxY
SDL_BlendFactor SDL_GetBlendModeSrcAlphaFactor(SDL_BlendMode blendMode)
Information on the capabilities of a render driver or context.
static const SDL_RenderDriver * render_drivers[]
#define SDL_WINDOWRENDERDATA
int SDL_RenderDrawPointsF(SDL_Renderer *renderer, const SDL_FPoint *points, int count)
Draw multiple points on the current rendering target.
static SDL_bool IsSupportedFormat(SDL_Renderer *renderer, Uint32 format)
GLint GLint GLsizei GLsizei height
SDL_Renderer * SDL_CreateRenderer(SDL_Window *window, int index, Uint32 flags)
Create a 2D rendering context for a window.
int(* QueueDrawPoints)(SDL_Renderer *renderer, SDL_RenderCommand *cmd, const SDL_FPoint *points, int count)
#define SDL_GetSurfaceColorMod
EGLSurface EGLNativeWindowType * window
#define CHECK_TEXTURE_MAGIC(texture, retval)
#define SDL_AddEventWatch
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)
SDL_AllocVertGap vertex_data_gaps
SDL_RenderCommandType command
int SDL_RenderDrawLines(SDL_Renderer *renderer, const SDL_Point *points, int count)
Draw a series of connected lines on the current rendering target.
SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char const char SDL_SCANF_FORMAT_STRING const char return SDL_ThreadFunction const char void return Uint32 return Uint32 void
static SDL_RenderCommand * PrepQueueCmdDrawSolid(SDL_Renderer *renderer, const SDL_RenderCommandType cmdtype)
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.
The type used to identify a window.
union SDL_RenderCommand::@30 data
#define SDL_GetWindowPixelFormat
SDL_Renderer * SDL_GetRenderer(SDL_Window *window)
Get the renderer associated with a window.
SDL_BlendFactor SDL_GetBlendModeDstColorFactor(SDL_BlendMode blendMode)
#define SDL_small_free(ptr, isstack)
void SDL_RenderGetViewport(SDL_Renderer *renderer, SDL_Rect *rect)
Get the drawing area 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)
int(* QueueFillRects)(SDL_Renderer *renderer, SDL_RenderCommand *cmd, const SDL_FRect *rects, int count)
#define SDL_HINT_RENDER_DRIVER
A variable specifying which render driver to use.
static int QueueCmdSetViewport(SDL_Renderer *renderer)
void(* WindowEvent)(SDL_Renderer *renderer, const SDL_WindowEvent *event)
void SDL_RenderGetScale(SDL_Renderer *renderer, float *scaleX, float *scaleY)
Get the drawing scale for the current target.
int SDL_SetTextureColorMod(SDL_Texture *texture, Uint8 r, Uint8 g, Uint8 b)
Set an additional color value used in render copy operations.
SDL_MouseButtonEvent button
static int QueueCmdDrawLines(SDL_Renderer *renderer, const SDL_FPoint *points, const int count)
SDL_bool last_queued_cliprect_enabled
Uint32 num_texture_formats
int SDL_RenderSetClipRect(SDL_Renderer *renderer, const SDL_Rect *rect)
Set the clip rectangle for the current target.
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...
#define SDL_arraysize(array)
static char renderer_magic
void Android_ActivityMutex_Unlock(void)
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).
#define SDL_BLENDMODE_ADD_FULL
static int QueueCmdSetClipRect(SDL_Renderer *renderer)
#define SDL_ConvertPixels
void(* DestroyTexture)(SDL_Renderer *renderer, SDL_Texture *texture)
int(* CreateTexture)(SDL_Renderer *renderer, SDL_Texture *texture)
void(* RenderPresent)(SDL_Renderer *renderer)
#define SDL_ISPIXELFORMAT_FOURCC(format)
static SDL_RenderCommand * PrepQueueCmdDrawTexture(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_RenderCommandType cmdtype)
EGLSurface EGLint * rects
static SDL_BlendMode SDL_GetLongBlendMode(SDL_BlendMode blendMode)
int SDL_RenderSetLogicalSize(SDL_Renderer *renderer, int w, int h)
Set device independent resolution for rendering.
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)
struct SDL_RenderCommand * next
GLboolean GLboolean GLboolean GLboolean a
int SDL_SetRenderTarget(SDL_Renderer *renderer, SDL_Texture *texture)
Set a texture as the current rendering target.
int SDL_RenderDrawLine(SDL_Renderer *renderer, int x1, int y1, int x2, int y2)
Draw a line on the current rendering target.
static void SDL_UnlockTextureYUV(SDL_Texture *texture)
GLboolean GLboolean GLboolean b
SDL_bool clipping_enabled_backup
#define SDL_Unsupported()
SDL_Texture * SDL_CreateTexture(SDL_Renderer *renderer, Uint32 format, int access, int w, int h)
Create a texture for a rendering context.
int SDL_GetTextureAlphaMod(SDL_Texture *texture, Uint8 *alpha)
Get the additional alpha value used in render copy operations.
SDL_bool clipping_enabled
A rectangle, with the origin at the upper left (floating point).
int SDL_RenderFillRectF(SDL_Renderer *renderer, const SDL_FRect *rect)
Fill a rectangle on the current rendering target with the drawing color.
static int SDL_RendererEventWatch(void *userdata, SDL_Event *event)
The structure that defines a point (floating point)
#define SDL_COMPOSE_BLENDMODE(srcColorFactor, dstColorFactor, colorOperation, srcAlphaFactor, dstAlphaFactor, alphaOperation)
A rectangle, with the origin at the upper left (integer).
int SDL_GL_UnbindTexture(SDL_Texture *texture)
Unbind a texture from the current OpenGL/ES/ES2 context.
static int SDL_LockTextureNative(SDL_Texture *texture, const SDL_Rect *rect, void **pixels, int *pitch)
static int QueueCmdDrawPoints(SDL_Renderer *renderer, const SDL_FPoint *points, const int count)
int SDL_RenderDrawRectsF(SDL_Renderer *renderer, const SDL_FRect *rects, int count)
Draw some number of rectangles on the current rendering target.
void *(* GetMetalCommandEncoder)(SDL_Renderer *renderer)
int SDL_GetRenderDriverInfo(int index, SDL_RendererInfo *info)
Get information about a specific 2D rendering driver for the current display.
static SDL_bool IsSupportedBlendMode(SDL_Renderer *renderer, SDL_BlendMode blendMode)