Added interfaces for batch drawing of points, lines and rects:
SDL_DrawPoints() SDL_BlendPoints() SDL_BlendLines() SDL_DrawLines() SDL_FillRects() SDL_BlendRects() SDL_RenderPoints() SDL_RenderLines() SDL_RenderRects() Renamed SDL_RenderFill() to SDL_RenderRect() --HG-- extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404279
This commit is contained in:
parent
304a6bbb6c
commit
8ee9720297
26 changed files with 1236 additions and 567 deletions
|
@ -150,7 +150,7 @@ DrawRects(SDL_WindowID window)
|
|||
SDL_SetRenderDrawBlendMode(SDL_BLENDMODE_NONE);
|
||||
for (i = 0; i < num_rects; ++i) {
|
||||
SDL_SetRenderDrawColor(255, 127, 0, 255);
|
||||
SDL_RenderFill(&rects[i]);
|
||||
SDL_RenderRect(&rects[i]);
|
||||
}
|
||||
SDL_SetRenderDrawBlendMode(SDL_BLENDMODE_NONE);
|
||||
}
|
||||
|
@ -197,7 +197,7 @@ DrawRectRectIntersections(SDL_WindowID window)
|
|||
SDL_Rect r;
|
||||
if (SDL_IntersectRect(&rects[i], &rects[j], &r)) {
|
||||
SDL_SetRenderDrawColor(255, 200, 0, 255);
|
||||
SDL_RenderFill(&r);
|
||||
SDL_RenderRect(&r);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -272,7 +272,7 @@ main(int argc, char *argv[])
|
|||
for (i = 0; i < state->num_windows; ++i) {
|
||||
SDL_SelectRenderer(state->windows[i]);
|
||||
SDL_SetRenderDrawColor(0xA0, 0xA0, 0xA0, 0xFF);
|
||||
SDL_RenderFill(NULL);
|
||||
SDL_RenderRect(NULL);
|
||||
}
|
||||
|
||||
srand(time(NULL));
|
||||
|
@ -326,7 +326,7 @@ main(int argc, char *argv[])
|
|||
case SDL_WINDOWEVENT_EXPOSED:
|
||||
SDL_SelectRenderer(event.window.windowID);
|
||||
SDL_SetRenderDrawColor(0xA0, 0xA0, 0xA0, 0xFF);
|
||||
SDL_RenderFill(NULL);
|
||||
SDL_RenderRect(NULL);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
@ -337,7 +337,7 @@ main(int argc, char *argv[])
|
|||
for (i = 0; i < state->num_windows; ++i) {
|
||||
SDL_SelectRenderer(state->windows[i]);
|
||||
SDL_SetRenderDrawColor(0xA0, 0xA0, 0xA0, 0xFF);
|
||||
SDL_RenderFill(NULL);
|
||||
SDL_RenderRect(NULL);
|
||||
|
||||
DrawRects(state->windows[i]);
|
||||
DrawPoints(state->windows[i]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue