changeset 2892:e4bafaa29c65

Add a few test pattern lines
author Sam Lantinga <slouken@libsdl.org>
date Sat, 20 Dec 2008 18:26:06 +0000
parents 3e7856518a34
children e67f3f3bf221
files test/testlines2.c
diffstat 1 files changed, 12 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/test/testlines2.c	Sat Dec 20 13:55:45 2008 +0000
+++ b/test/testlines2.c	Sat Dec 20 18:26:06 2008 +0000
@@ -63,11 +63,18 @@
         SDL_SetRenderDrawColor(255, (Uint8) current_color,
                                (Uint8) current_color, (Uint8) current_alpha);
 
-        x1 = rand() % window_w;
-        x2 = rand() % window_w;
-        y1 = rand() % window_h;
-        y2 = rand() % window_h;
-        SDL_RenderLine(x1, y1, x2, y2);
+        if (i == 0) {
+            SDL_RenderLine(0, 0, window_w, window_h);
+            SDL_RenderLine(0, window_h, window_w, 0);
+            SDL_RenderLine(0, window_h/2, window_w, window_h/2);
+            SDL_RenderLine(window_w/2, 0, window_w/2, window_h);
+        } else {
+            x1 = rand() % window_w;
+            x2 = rand() % window_w;
+            y1 = rand() % window_h;
+            y2 = rand() % window_h;
+            SDL_RenderLine(x1, y1, x2, y2);
+        }
     }
     SDL_SetRenderDrawBlendMode(SDL_BLENDMODE_NONE);