Mercurial > sdl-ios-xcode
diff test/automated/render/render.c @ 3471:da53c4046c65
Use 45 degree lines for the diagonal test to avoid aliasing errors in line drawing.
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Sat, 21 Nov 2009 06:28:25 +0000 |
parents | 383c2058d973 |
children | 2c07bb579922 |
line wrap: on
line diff
--- a/test/automated/render/render.c Sat Nov 21 06:19:34 2009 +0000 +++ b/test/automated/render/render.c Sat Nov 21 06:28:25 2009 +0000 @@ -431,7 +431,16 @@ ret = SDL_SetRenderDrawColor( 5, 105, 105, SDL_ALPHA_OPAQUE ); if (SDL_ATassert( "SDL_SetRenderDrawColor", ret == 0)) return -1; - ret = SDL_RenderLine( 0, 60, 80, 0 ); + ret = SDL_RenderLine( 0, 0, 29, 29 ); + if (SDL_ATassert( "SDL_RenderLine", ret == 0)) + return -1; + ret = SDL_RenderLine( 29, 30, 0, 59 ); + if (SDL_ATassert( "SDL_RenderLine", ret == 0)) + return -1; + ret = SDL_RenderLine( 79, 0, 50, 29 ); + if (SDL_ATassert( "SDL_RenderLine", ret == 0)) + return -1; + ret = SDL_RenderLine( 79, 59, 50, 30 ); if (SDL_ATassert( "SDL_RenderLine", ret == 0)) return -1; @@ -1013,7 +1022,7 @@ goto err_cleanup; /* Create window. */ wid = SDL_CreateWindow( msg, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, - 80, 60, 0 ); + 80, 60, SDL_WINDOW_SHOWN ); if (SDL_ATassert( "SDL_CreateWindow", wid!=0 )) goto err_cleanup; /* Check title. */ @@ -1032,7 +1041,7 @@ /* both add SDL_WINDOW_OPENGL flag for window, that was last used */ SDL_DestroyWindow(wid); wid = SDL_CreateWindow( msg, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, - 80, 60, 0 ); + 80, 60, SDL_WINDOW_SHOWN ); if (SDL_ATassert( "SDL_CreateWindow", wid!=0 )) goto err_cleanup; @@ -1040,10 +1049,12 @@ ret = SDL_GetRenderDriverInfo( j, &renderer ); if (ret != 0) goto err_cleanup; + /* Set testcase name. */ snprintf( msg, sizeof(msg), "Renderer %s", renderer.name ); SDL_ATprintVerbose( 1, " %d) %s\n", j+1, renderer.name ); SDL_ATbegin( msg ); + /* Set renderer. */ ret = SDL_CreateRenderer( wid, j, 0 ); if (SDL_ATassert( "SDL_CreateRenderer", ret==0 ))