···45454646 /* just blank the render target to gray to start. */
4747 SDL_SetRenderTarget(renderer, render_target);
4848- SDL_SetRenderDrawColor(renderer, 100, 100, 100, 255);
4848+ SDL_SetRenderDrawColor(renderer, 100, 100, 100, SDL_ALPHA_OPAQUE);
4949 SDL_RenderClear(renderer);
5050 SDL_SetRenderTarget(renderer, NULL);
5151 SDL_SetRenderDrawBlendMode(renderer, SDL_BLENDMODE_BLEND);
···9090{
9191 /* make sure we're drawing to the window and not the render target */
9292 SDL_SetRenderTarget(renderer, NULL);
9393- SDL_SetRenderDrawColor(renderer, 0, 0, 0, 255);
9393+ SDL_SetRenderDrawColor(renderer, 0, 0, 0, SDL_ALPHA_OPAQUE);
9494 SDL_RenderClear(renderer); /* just in case. */
9595 SDL_RenderTexture(renderer, render_target, NULL, NULL);
9696 SDL_RenderPresent(renderer);
+1-1
examples/renderer/01-clear/clear.c
···4949 const float red = (float) (0.5 + 0.5 * SDL_sin(now));
5050 const float green = (float) (0.5 + 0.5 * SDL_sin(now + SDL_PI_D * 2 / 3));
5151 const float blue = (float) (0.5 + 0.5 * SDL_sin(now + SDL_PI_D * 4 / 3));
5252- SDL_SetRenderDrawColorFloat(renderer, red, green, blue, 1.0f); /* new color, full alpha. */
5252+ SDL_SetRenderDrawColorFloat(renderer, red, green, blue, SDL_ALPHA_OPAQUE_FLOAT); /* new color, full alpha. */
53535454 /* clear the window to the draw color. */
5555 SDL_RenderClear(renderer);
+5-5
examples/renderer/02-primitives/primitives.c
···5555 SDL_FRect rect;
56565757 /* as you can see from this, rendering draws over whatever was drawn before it. */
5858- SDL_SetRenderDrawColor(renderer, 33, 33, 33, 255); /* dark gray, full alpha */
5858+ SDL_SetRenderDrawColor(renderer, 33, 33, 33, SDL_ALPHA_OPAQUE); /* dark gray, full alpha */
5959 SDL_RenderClear(renderer); /* start with a blank canvas. */
60606161 /* draw a filled rectangle in the middle of the canvas. */
6262- SDL_SetRenderDrawColor(renderer, 0, 0, 255, 255); /* blue, full alpha */
6262+ SDL_SetRenderDrawColor(renderer, 0, 0, 255, SDL_ALPHA_OPAQUE); /* blue, full alpha */
6363 rect.x = rect.y = 100;
6464 rect.w = 440;
6565 rect.h = 280;
6666 SDL_RenderFillRect(renderer, &rect);
67676868 /* draw some points across the canvas. */
6969- SDL_SetRenderDrawColor(renderer, 255, 0, 0, 255); /* red, full alpha */
6969+ SDL_SetRenderDrawColor(renderer, 255, 0, 0, SDL_ALPHA_OPAQUE); /* red, full alpha */
7070 SDL_RenderPoints(renderer, points, SDL_arraysize(points));
71717272 /* draw a unfilled rectangle in-set a little bit. */
7373- SDL_SetRenderDrawColor(renderer, 0, 255, 0, 255); /* green, full alpha */
7373+ SDL_SetRenderDrawColor(renderer, 0, 255, 0, SDL_ALPHA_OPAQUE); /* green, full alpha */
7474 rect.x += 30;
7575 rect.y += 30;
7676 rect.w -= 60;
···7878 SDL_RenderRect(renderer, &rect);
79798080 /* draw two lines in an X across the whole canvas. */
8181- SDL_SetRenderDrawColor(renderer, 255, 255, 0, 255); /* yellow, full alpha */
8181+ SDL_SetRenderDrawColor(renderer, 255, 255, 0, SDL_ALPHA_OPAQUE); /* yellow, full alpha */
8282 SDL_RenderLine(renderer, 0, 0, 640, 480);
8383 SDL_RenderLine(renderer, 0, 480, 640, 0);
8484
+4-4
examples/renderer/03-lines/lines.c
···5656 };
57575858 /* as you can see from this, rendering draws over whatever was drawn before it. */
5959- SDL_SetRenderDrawColor(renderer, 100, 100, 100, 255); /* grey, full alpha */
5959+ SDL_SetRenderDrawColor(renderer, 100, 100, 100, SDL_ALPHA_OPAQUE); /* grey, full alpha */
6060 SDL_RenderClear(renderer); /* start with a blank canvas. */
61616262 /* You can draw lines, one at a time, like these brown ones... */
6363- SDL_SetRenderDrawColor(renderer, 127, 49, 32, 255);
6363+ SDL_SetRenderDrawColor(renderer, 127, 49, 32, SDL_ALPHA_OPAQUE);
6464 SDL_RenderLine(renderer, 240, 450, 400, 450);
6565 SDL_RenderLine(renderer, 240, 356, 400, 356);
6666 SDL_RenderLine(renderer, 240, 356, 240, 450);
6767 SDL_RenderLine(renderer, 400, 356, 400, 450);
68686969 /* You can also draw a series of connected lines in a single batch... */
7070- SDL_SetRenderDrawColor(renderer, 0, 255, 0, 255);
7070+ SDL_SetRenderDrawColor(renderer, 0, 255, 0, SDL_ALPHA_OPAQUE);
7171 SDL_RenderLines(renderer, line_points, SDL_arraysize(line_points));
72727373 /* here's a bunch of lines drawn out from a center point in a circle. */
···7676 const float size = 30.0f;
7777 const float x = 320.0f;
7878 const float y = 95.0f - (size / 2.0f);
7979- SDL_SetRenderDrawColor(renderer, SDL_rand(256), SDL_rand(256), SDL_rand(256), 255);
7979+ SDL_SetRenderDrawColor(renderer, SDL_rand(256), SDL_rand(256), SDL_rand(256), SDL_ALPHA_OPAQUE);
8080 SDL_RenderLine(renderer, x, y, x + SDL_sinf((float) i) * size, y + SDL_cosf((float) i) * size);
8181 }
8282
+2-2
examples/renderer/04-points/points.c
···9797 last_time = now;
98989999 /* as you can see from this, rendering draws over whatever was drawn before it. */
100100- SDL_SetRenderDrawColor(renderer, 0, 0, 0, 255); /* black, full alpha */
100100+ SDL_SetRenderDrawColor(renderer, 0, 0, 0, SDL_ALPHA_OPAQUE); /* black, full alpha */
101101 SDL_RenderClear(renderer); /* start with a blank canvas. */
102102- SDL_SetRenderDrawColor(renderer, 255, 255, 255, 255); /* white, full alpha */
102102+ SDL_SetRenderDrawColor(renderer, 255, 255, 255, SDL_ALPHA_OPAQUE); /* white, full alpha */
103103 SDL_RenderPoints(renderer, points, SDL_arraysize(points)); /* draw all the points! */
104104105105 /* You can also draw single points with SDL_RenderPoint(), but it's
+5-5
examples/renderer/05-rectangles/rectangles.c
···5555 const float scale = ((float) (((int) (now % 1000)) - 500) / 500.0f) * direction;
56565757 /* as you can see from this, rendering draws over whatever was drawn before it. */
5858- SDL_SetRenderDrawColor(renderer, 0, 0, 0, 255); /* black, full alpha */
5858+ SDL_SetRenderDrawColor(renderer, 0, 0, 0, SDL_ALPHA_OPAQUE); /* black, full alpha */
5959 SDL_RenderClear(renderer); /* start with a blank canvas. */
60606161 /* Rectangles are comprised of set of X and Y coordinates, plus width and
···6666 /* Let's draw a single rectangle (square, really). */
6767 rects[0].x = rects[0].y = 100;
6868 rects[0].w = rects[0].h = 100 + (100 * scale);
6969- SDL_SetRenderDrawColor(renderer, 255, 0, 0, 255); /* red, full alpha */
6969+ SDL_SetRenderDrawColor(renderer, 255, 0, 0, SDL_ALPHA_OPAQUE); /* red, full alpha */
7070 SDL_RenderRect(renderer, &rects[0]);
71717272 /* Now let's draw several rectangles with one function call. */
···7676 rects[i].x = (WINDOW_WIDTH - rects[i].w) / 2; /* center it. */
7777 rects[i].y = (WINDOW_HEIGHT - rects[i].h) / 2; /* center it. */
7878 }
7979- SDL_SetRenderDrawColor(renderer, 0, 255, 0, 255); /* green, full alpha */
7979+ SDL_SetRenderDrawColor(renderer, 0, 255, 0, SDL_ALPHA_OPAQUE); /* green, full alpha */
8080 SDL_RenderRects(renderer, rects, 3); /* draw three rectangles at once */
81818282 /* those were rectangle _outlines_, really. You can also draw _filled_ rectangles! */
···8484 rects[0].y = 50;
8585 rects[0].w = 100 + (100 * scale);
8686 rects[0].h = 50 + (50 * scale);
8787- SDL_SetRenderDrawColor(renderer, 0, 0, 255, 255); /* blue, full alpha */
8787+ SDL_SetRenderDrawColor(renderer, 0, 0, 255, SDL_ALPHA_OPAQUE); /* blue, full alpha */
8888 SDL_RenderFillRect(renderer, &rects[0]);
89899090 /* ...and also fill a bunch of rectangles at once... */
···9696 rects[i].w = w;
9797 rects[i].h = h;
9898 }
9999- SDL_SetRenderDrawColor(renderer, 255, 255, 255, 255); /* white, full alpha */
9999+ SDL_SetRenderDrawColor(renderer, 255, 255, 255, SDL_ALPHA_OPAQUE); /* white, full alpha */
100100 SDL_RenderFillRects(renderer, rects, SDL_arraysize(rects));
101101102102 SDL_RenderPresent(renderer); /* put it all on the screen! */
+1-1
examples/renderer/06-textures/textures.c
···8686 const float scale = ((float) (((int) (now % 1000)) - 500) / 500.0f) * direction;
87878888 /* as you can see from this, rendering draws over whatever was drawn before it. */
8989- SDL_SetRenderDrawColor(renderer, 0, 0, 0, 255); /* black, full alpha */
8989+ SDL_SetRenderDrawColor(renderer, 0, 0, 0, SDL_ALPHA_OPAQUE); /* black, full alpha */
9090 SDL_RenderClear(renderer); /* start with a blank canvas. */
91919292 /* Just draw the static texture a few times. You can think of it like a
···8383 }
84848585 /* as you can see from this, rendering draws over whatever was drawn before it. */
8686- SDL_SetRenderDrawColor(renderer, 66, 66, 66, 255); /* grey, full alpha */
8686+ SDL_SetRenderDrawColor(renderer, 66, 66, 66, SDL_ALPHA_OPAQUE); /* grey, full alpha */
8787 SDL_RenderClear(renderer); /* start with a blank canvas. */
88888989 /* Just draw the static texture a few times. You can think of it like a
···8686 const float rotation = (((float) ((int) (now % 2000))) / 2000.0f) * 360.0f;
87878888 /* as you can see from this, rendering draws over whatever was drawn before it. */
8989- SDL_SetRenderDrawColor(renderer, 0, 0, 0, 255); /* black, full alpha */
8989+ SDL_SetRenderDrawColor(renderer, 0, 0, 0, SDL_ALPHA_OPAQUE); /* black, full alpha */
9090 SDL_RenderClear(renderer); /* start with a blank canvas. */
91919292 /* Center this one, and draw it with some rotation so it spins! */
···8686 const float scale = ((float) (((int) (now % 1000)) - 500) / 500.0f) * direction;
87878888 /* as you can see from this, rendering draws over whatever was drawn before it. */
8989- SDL_SetRenderDrawColor(renderer, 0, 0, 0, 255); /* black, full alpha */
8989+ SDL_SetRenderDrawColor(renderer, 0, 0, 0, SDL_ALPHA_OPAQUE); /* black, full alpha */
9090 SDL_RenderClear(renderer); /* start with a blank canvas. */
91919292 /* center this one and make it grow and shrink. */
+1-1
examples/renderer/10-geometry/geometry.c
···8989 int i;
90909191 /* as you can see from this, rendering draws over whatever was drawn before it. */
9292- SDL_SetRenderDrawColor(renderer, 0, 0, 0, 255); /* black, full alpha */
9292+ SDL_SetRenderDrawColor(renderer, 0, 0, 0, SDL_ALPHA_OPAQUE); /* black, full alpha */
9393 SDL_RenderClear(renderer); /* start with a blank canvas. */
94949595 /* Draw a single triangle with a different color at each vertex. Center this one and make it grow and shrink. */
+1-1
examples/renderer/11-color-mods/color-mods.c
···8686 const float blue = (float) (0.5 + 0.5 * SDL_sin(now + SDL_PI_D * 4 / 3));
87878888 /* as you can see from this, rendering draws over whatever was drawn before it. */
8989- SDL_SetRenderDrawColor(renderer, 0, 0, 0, 255); /* black, full alpha */
8989+ SDL_SetRenderDrawColor(renderer, 0, 0, 0, SDL_ALPHA_OPAQUE); /* black, full alpha */
9090 SDL_RenderClear(renderer); /* start with a blank canvas. */
91919292 /* Just draw the static texture a few times. You can think of it like a
+1-1
examples/renderer/14-viewport/viewport.c
···8686 window. It does _not_ scale rendering to fit the viewport. */
87878888 /* as you can see from this, rendering draws over whatever was drawn before it. */
8989- SDL_SetRenderDrawColor(renderer, 0, 0, 0, 255); /* black, full alpha */
8989+ SDL_SetRenderDrawColor(renderer, 0, 0, 0, SDL_ALPHA_OPAQUE); /* black, full alpha */
9090 SDL_RenderClear(renderer); /* start with a blank canvas. */
91919292 /* Draw once with the whole window as the viewport. */
+1-1
examples/renderer/15-cliprect/cliprect.c
···116116 /* okay, now draw! */
117117118118 /* Note that SDL_RenderClear is _not_ affected by the clipping rectangle! */
119119- SDL_SetRenderDrawColor(renderer, 33, 33, 33, 255); /* grey, full alpha */
119119+ SDL_SetRenderDrawColor(renderer, 33, 33, 33, SDL_ALPHA_OPAQUE); /* grey, full alpha */
120120 SDL_RenderClear(renderer); /* start with a blank canvas. */
121121122122 /* stretch the texture across the entire window. Only the piece in the
+1-1
examples/renderer/17-read-pixels/read-pixels.c
···9696 const float rotation = (((float) ((int) (now % 2000))) / 2000.0f) * 360.0f;
97979898 /* as you can see from this, rendering draws over whatever was drawn before it. */
9999- SDL_SetRenderDrawColor(renderer, 0, 0, 0, 255); /* black, full alpha */
9999+ SDL_SetRenderDrawColor(renderer, 0, 0, 0, SDL_ALPHA_OPAQUE); /* black, full alpha */
100100 SDL_RenderClear(renderer); /* start with a blank canvas. */
101101102102 /* Center this one, and draw it with some rotation so it spins! */
+4-4
examples/renderer/18-debug-text/debug-text.c
···4747SDL_AppResult SDL_AppIterate(void *appstate)
4848{
4949 /* as you can see from this, rendering draws over whatever was drawn before it. */
5050- SDL_SetRenderDrawColor(renderer, 0, 0, 0, 255); /* black, full alpha */
5050+ SDL_SetRenderDrawColor(renderer, 0, 0, 0, SDL_ALPHA_OPAQUE); /* black, full alpha */
5151 SDL_RenderClear(renderer); /* start with a blank canvas. */
52525353- SDL_SetRenderDrawColor(renderer, 255, 255, 255, 255); /* white, full alpha */
5353+ SDL_SetRenderDrawColor(renderer, 255, 255, 255, SDL_ALPHA_OPAQUE); /* white, full alpha */
5454 SDL_RenderDebugText(renderer, 272, 100, "Hello world!");
5555 SDL_RenderDebugText(renderer, 224, 150, "This is some debug text.");
56565757- SDL_SetRenderDrawColor(renderer, 51, 102, 255, 255); /* light blue, full alpha */
5757+ SDL_SetRenderDrawColor(renderer, 51, 102, 255, SDL_ALPHA_OPAQUE); /* light blue, full alpha */
5858 SDL_RenderDebugText(renderer, 184, 200, "You can do it in different colors.");
5959- SDL_SetRenderDrawColor(renderer, 255, 255, 255, 255); /* white, full alpha */
5959+ SDL_SetRenderDrawColor(renderer, 255, 255, 255, SDL_ALPHA_OPAQUE); /* white, full alpha */
60606161 SDL_SetRenderScale(renderer, 4.0f, 4.0f);
6262 SDL_RenderDebugText(renderer, 14, 65, "It can be scaled.");