1.1 --- a/src/test/SDL_test_imagePrimitives.c Thu Dec 20 08:50:36 2012 -0800
1.2 +++ b/src/test/SDL_test_imagePrimitives.c Sat Dec 22 16:06:55 2012 -0800
1.3 @@ -485,3 +485,28 @@
1.4 "\310\15I\310\15I\310\15I\310\15I\310\5ii",
1.5 };
1.6
1.7 +/**
1.8 + * \brief Returns the Primitives test image as SDL_Surface.
1.9 + */
1.10 +SDL_Surface *SDLTest_ImagePrimitives()
1.11 +{
1.12 + SDL_Surface *surface = SDL_CreateRGBSurfaceFrom(
1.13 + (void*)SDLTest_imagePrimitives.pixel_data,
1.14 + SDLTest_imagePrimitives.width,
1.15 + SDLTest_imagePrimitives.height,
1.16 + SDLTest_imagePrimitives.bytes_per_pixel * 8,
1.17 + SDLTest_imagePrimitives.width * SDLTest_imagePrimitives.bytes_per_pixel,
1.18 +#if (SDL_BYTEORDER == SDL_BIG_ENDIAN)
1.19 + 0xff000000, /* Red bit mask. */
1.20 + 0x00ff0000, /* Green bit mask. */
1.21 + 0x0000ff00, /* Blue bit mask. */
1.22 + 0x000000ff /* Alpha bit mask. */
1.23 +#else
1.24 + 0x000000ff, /* Red bit mask. */
1.25 + 0x0000ff00, /* Green bit mask. */
1.26 + 0x00ff0000, /* Blue bit mask. */
1.27 + 0xff000000 /* Alpha bit mask. */
1.28 +#endif
1.29 + );
1.30 + return surface;
1.31 +}