Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Allow points to be outside the window bounds, stress testing the clip…
Browse files Browse the repository at this point in the history
…ping code.
  • Loading branch information
slouken committed Dec 12, 2009
1 parent a272422 commit 1349bf6
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions test/testdraw2.c
Expand Up @@ -107,10 +107,10 @@ DrawLines(SDL_WindowID window)
SDL_RenderLine(0, window_h / 2, window_w - 1, window_h / 2);
SDL_RenderLine(window_w / 2, 0, window_w / 2, window_h - 1);
} else {
x1 = rand() % window_w;
x2 = rand() % window_w;
y1 = rand() % window_h;
y2 = rand() % window_h;
x1 = (rand() % (window_w*2)) - window_w;
x2 = (rand() % (window_w*2)) - window_w;
y1 = (rand() % (window_h*2)) - window_h;
y2 = (rand() % (window_h*2)) - window_h;
SDL_RenderLine(x1, y1, x2, y2);
}
}
Expand Down Expand Up @@ -157,8 +157,8 @@ DrawRects(SDL_WindowID window)

rect.w = rand() % (window_h / 2);
rect.h = rand() % (window_h / 2);
rect.x = (rand() % window_w) - (rect.w / 2);
rect.y = (rand() % window_w) - (rect.h / 2);
rect.x = (rand() % (window_w*2) - window_w) - (rect.w / 2);
rect.y = (rand() % (window_h*2) - window_h) - (rect.h / 2);
SDL_RenderRect(&rect);
}
SDL_SetRenderDrawBlendMode(SDL_BLENDMODE_NONE);
Expand Down

0 comments on commit 1349bf6

Please sign in to comment.