diff test/automated/surface/surface.c @ 3596:f638ded38b8a

Added SDL_RenderClear() as a fast method of clearing the screen to the drawing color. Renamed SDL_RenderPoint() and SDL_RenderLine() to SDL_RenderDrawPoint() and SDL_RenderDrawLine(). Added API for rectangle drawing (as opposed to filling) Added placeholder API functions for circles and ellipses ... I'm not sure whether these will stay. Optimized software line drawing quite a bit. Added support for Wu's anti-aliased line drawing, currently disabled by default.
author Sam Lantinga <slouken@libsdl.org>
date Wed, 23 Dec 2009 01:55:00 +0000
parents c32c53fca10d
children 947201caa46e
line wrap: on
line diff
--- a/test/automated/surface/surface.c	Fri Dec 18 08:19:18 2009 +0000
+++ b/test/automated/surface/surface.c	Wed Dec 23 01:55:00 2009 +0000
@@ -56,8 +56,7 @@
 
    /* Set transparent pixel as the pixel at (0,0) */
    if (face->format->palette) {
-      ret = SDL_SetColorKey(face, (SDL_SRCCOLORKEY | SDL_RLEACCEL),
-            *(Uint8 *) face->pixels);
+      ret = SDL_SetColorKey(face, SDL_RLEACCEL, *(Uint8 *) face->pixels);
       if (SDL_ATassert( "SDL_SetColorKey", ret == 0))
          return;
    }
@@ -184,29 +183,29 @@
       return;
 
    /* Create some rectangles for each blend mode. */
-   ret = SDL_BlendRect( testsur, NULL, SDL_BLENDMODE_NONE, 255, 255, 255, 0 );
-   if (SDL_ATassert( "SDL_BlendRect", ret == 0))
+   ret = SDL_BlendFillRect( testsur, NULL, SDL_BLENDMODE_NONE, 255, 255, 255, 0 );
+   if (SDL_ATassert( "SDL_BlendFillRect", ret == 0))
       return;
    rect.x = 10;
    rect.y = 25;
    rect.w = 40;
    rect.h = 25;
-   ret = SDL_BlendRect( testsur, &rect, SDL_BLENDMODE_ADD, 240, 10, 10, 75 );
-   if (SDL_ATassert( "SDL_BlendRect", ret == 0))
+   ret = SDL_BlendFillRect( testsur, &rect, SDL_BLENDMODE_ADD, 240, 10, 10, 75 );
+   if (SDL_ATassert( "SDL_BlendFillRect", ret == 0))
       return;
    rect.x = 30;
    rect.y = 40;
    rect.w = 45;
    rect.h = 15;
-   ret = SDL_BlendRect( testsur, &rect, SDL_BLENDMODE_BLEND, 10, 240, 10, 100 );
-   if (SDL_ATassert( "SDL_BlendRect", ret == 0))
+   ret = SDL_BlendFillRect( testsur, &rect, SDL_BLENDMODE_BLEND, 10, 240, 10, 100 );
+   if (SDL_ATassert( "SDL_BlendFillRect", ret == 0))
       return;
    rect.x = 25;
    rect.y = 25;
    rect.w = 25;
    rect.h = 25;
-   ret = SDL_BlendRect( testsur, &rect, SDL_BLENDMODE_MOD, 10, 10, 240, 125 );
-   if (SDL_ATassert( "SDL_BlendRect", ret == 0))
+   ret = SDL_BlendFillRect( testsur, &rect, SDL_BLENDMODE_MOD, 10, 10, 240, 125 );
+   if (SDL_ATassert( "SDL_BlendFillRect", ret == 0))
       return;
 
    /* Draw blended lines, lines for everyone. */