All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
SDL_test_compare.c File Reference
#include "SDL_config.h"
#include "SDL_test.h"

Go to the source code of this file.


int SDLTest_CompareSurfaces (SDL_Surface *surface, SDL_Surface *referenceSurface, int allowable_error)
 Compares a surface and with reference image data for equality. More...


static int _CompareSurfaceCount = 0

Function Documentation

int SDLTest_CompareSurfaces ( SDL_Surface surface,
SDL_Surface referenceSurface,
int  allowable_error 

Compares a surface and with reference image data for equality.

surfaceSurface used in comparison
referenceSurfaceTest Surface used in comparison
allowable_errorAllowable difference (squared) in blending accuracy.
0 if comparison succeeded, >0 (=number of pixels where comparison failed) if comparison failed, -1 if any of the surfaces were NULL, -2 if the surface sizes differ.

Definition at line 39 of file SDL_test_compare.c.

References _CompareSurfaceCount, SDL_PixelFormat::BytesPerPixel, SDL_Surface::format, G, SDL_Surface::h, i, j, NULL, SDL_Surface::pitch, SDL_Surface::pixels, R, ret, SDL_GetRGBA(), SDL_LockSurface(), SDL_SaveBMP, SDL_snprintf(), SDL_UnlockSurface(), SDLTest_LogError(), and SDL_Surface::w.

Variable Documentation

int _CompareSurfaceCount = 0

Definition at line 36 of file SDL_test_compare.c.

Referenced by SDLTest_CompareSurfaces().