testautomation_render.c File Reference
`#include <stdio.h>`
`#include "SDL.h"`
`#include "SDL_test.h"`
Include dependency graph for testautomation_render.c:

Go to the source code of this file.

## Macros

#define | TESTRENDER_SCREEN_W 80
#define | TESTRENDER_SCREEN_H 60
#define | RENDER_COMPARE_FORMAT SDL_PIXELFORMAT_ARGB8888
#define | RENDER_COMPARE_AMASK 0xff000000
#define | RENDER_COMPARE_RMASK 0x00ff0000
#define | RENDER_COMPARE_GMASK 0x0000ff00
#define | RENDER_COMPARE_BMASK 0x000000ff
#define | ALLOWABLE_ERROR_OPAQUE 0
#define | ALLOWABLE_ERROR_BLENDED 64

## Functions

static int | _clearScreen (void)
| Clears the screen. Helper function. More...
static void | _compare (SDL_Surface *referenceSurface, int allowable_error)
| Compares screen pixels with image pixels. Helper function. More...
static int | _hasTexAlpha (void)
| Test to see if we can vary the alpha of the texture. Helper function. More...
static int | _hasTexColor (void)
| Test to see if can set texture color mode. Helper function. More...
static SDL_Texture * | _loadTestFace (void)
| Loads the test image 'Face' as texture. Helper function. More...
static int | _hasBlendModes (void)
| Test to see if we can vary the blend mode. Helper function. More...
static int | _hasDrawColor (void)
| Test to see if we can vary the draw color. Helper function. More...
static int | _isSupported (int code)
| Checks to see if functionality is supported. Helper function. More...
void | InitCreateRenderer (void *arg)
void | CleanupDestroyRenderer (void *arg)
int | render_testGetNumRenderDrivers (void *arg)
| Tests call to SDL_GetNumRenderDrivers. More...
int | render_testPrimitives (void *arg)
| Tests the SDL primitives for rendering. More...
int | render_testPrimitivesBlend (void *arg)
| Tests the SDL primitives with alpha for rendering. More...
int | render_testBlit (void *arg)
| Tests some blitting routines. More...
int | render_testBlitColor (void *arg)
| Blits doing color tests. More...
int | render_testBlitAlpha (void *arg)
| Tests blitting with alpha. More...
static void | _testBlitBlendMode (SDL_Texture *tface, int mode)
| Tests a blend mode. More...
int | render_testBlitBlend (void *arg)
| Tests some more blitting routines. More...

## Variables

SDL_Window * | window = NULL
SDL_Renderer * | renderer = NULL
static const SDLTest_TestCaseReference | renderTest1
static const SDLTest_TestCaseReference | renderTest2
static const SDLTest_TestCaseReference | renderTest3
static const SDLTest_TestCaseReference | renderTest4
static const SDLTest_TestCaseReference | renderTest5
static const SDLTest_TestCaseReference | renderTest6
static const SDLTest_TestCaseReference | renderTest7
static const SDLTest_TestCaseReference * | renderTests []
SDLTest_TestSuiteReference | renderTestSuite

## Macro Definition Documentation

#define ALLOWABLE_ERROR_BLENDED 64

Definition at line 23 of file testautomation_render.c.

Referenced by render_testBlitAlpha(), render_testBlitBlend(), and render_testPrimitivesBlend().

#define ALLOWABLE_ERROR_OPAQUE 0

Definition at line 22 of file testautomation_render.c.

Referenced by render_testBlit(), render_testBlitBlend(), render_testBlitColor(), and render_testPrimitives().

#define RENDER_COMPARE_AMASK 0xff000000

Alpha bit mask.

Definition at line 17 of file testautomation_render.c.

Referenced by _compare().

#define RENDER_COMPARE_BMASK 0x000000ff

Blue bit mask.

Definition at line 20 of file testautomation_render.c.

Referenced by _compare().

#define RENDER_COMPARE_FORMAT SDL_PIXELFORMAT_ARGB8888

Definition at line 16 of file testautomation_render.c.

Referenced by _compare().

#define RENDER_COMPARE_GMASK 0x0000ff00

Green bit mask.

Definition at line 19 of file testautomation_render.c.

Referenced by _compare().

#define RENDER_COMPARE_RMASK 0x00ff0000

Red bit mask.

Definition at line 18 of file testautomation_render.c.

Referenced by _compare().

#define TESTRENDER_SCREEN_H 60

Definition at line 14 of file testautomation_render.c.

Referenced by _compare(), _testBlitBlendMode(), render_testBlit(), render_testBlitAlpha(), render_testBlitBlend(), render_testBlitColor(), and render_testPrimitivesBlend().

#define TESTRENDER_SCREEN_W 80

Original code: automated SDL platform test written by Edgar Simo "bobbens" Extended and extensively updated by aschiffler at ferzkopp dot net

Definition at line 13 of file testautomation_render.c.

Referenced by _compare(), _testBlitBlendMode(), render_testBlit(), render_testBlitAlpha(), render_testBlitBlend(), render_testBlitColor(), render_testPrimitives(), and render_testPrimitivesBlend().

## Function Documentation

static int _clearScreen | ( | void |  | ) |

static

Clears the screen. Helper function.

See also
  http://wiki.libsdl.org/moin.cgi/SDL_SetRenderDrawColor http://wiki.libsdl.org/moin.cgi/SDL_RenderClear http://wiki.libsdl.org/moin.cgi/SDL_RenderPresent http://wiki.libsdl.org/moin.cgi/SDL_SetRenderDrawBlendMode

Definition at line 1036 of file testautomation_render.c.

References SDL_ALPHA_OPAQUE, SDL_BLENDMODE_NONE, SDL_RenderClear, SDL_RenderPresent, SDL_SetRenderDrawBlendMode, SDL_SetRenderDrawColor, and SDLTest_AssertCheck().

Referenced by _testBlitBlendMode(), render_testBlit(), render_testBlitAlpha(), render_testBlitBlend(), render_testBlitColor(), render_testPrimitives(), and render_testPrimitivesBlend().

{
int ret;
/* Set color. */
ret = SDL_SetRenderDrawColor(renderer, 0, 0, 0, SDL_ALPHA_OPAQUE );
SDLTest_AssertCheck(ret == 0, "Validate result from SDL_SetRenderDrawColor, expected: 0, got: %i", ret);
/* Clear screen. */
ret = SDL_RenderClear(renderer);
SDLTest_AssertCheck(ret == 0, "Validate result from SDL_RenderClear, expected: 0, got: %i", ret);
/* Make current */
SDL_RenderPresent(renderer);
/* Set defaults. */
ret = SDL_SetRenderDrawBlendMode(renderer, SDL_BLENDMODE_NONE );
SDLTest_AssertCheck(ret == 0, "Validate result from SDL_SetRenderDrawBlendMode, expected: 0, got: %i", ret);
ret = SDL_SetRenderDrawColor(renderer, 255, 255, 255, SDL_ALPHA_OPAQUE );
SDLTest_AssertCheck(ret == 0, "Validate result from SDL_SetRenderDrawColor, expected: 0, got: %i", ret);
return 0;
}
SDL_BLENDMODE_NONE
Definition: SDL_blendmode.h:42
SDL_SetRenderDrawBlendMode
#define SDL_SetRenderDrawBlendMode
Definition: SDL_dynapi_overrides.h:338
renderer
SDL_Renderer * renderer
Definition: testautomation_render.c:27
SDLTest_AssertCheck
int SDLTest_AssertCheck(int assertCondition, SDL_PRINTF_FORMAT_STRING const char *assertDescription,...) SDL_PRINTF_VARARG_FUNC(2)
Assert for test cases that logs but does not break execution flow on failures. Updates assertion coun...
Definition: SDL_test_assert.c:65
SDL_RenderClear
#define SDL_RenderClear
Definition: SDL_dynapi_overrides.h:340
SDL_SetRenderDrawColor
#define SDL_SetRenderDrawColor
Definition: SDL_dynapi_overrides.h:336
SDL_ALPHA_OPAQUE
#define SDL_ALPHA_OPAQUE
Definition: SDL_pixels.h:45
SDL_RenderPresent
#define SDL_RenderPresent
Definition: SDL_dynapi_overrides.h:352

static void _compare | ( | SDL_Surface * | referenceSurface,
|  | int | allowable_error
| ) |  |

static

Compares screen pixels with image pixels. Helper function.

Parameters

  s | Image to compare against.

See also
  http://wiki.libsdl.org/moin.cgi/SDL_RenderReadPixels http://wiki.libsdl.org/moin.cgi/SDL_CreateRGBSurfaceFrom http://wiki.libsdl.org/moin.cgi/SDL_FreeSurface

Definition at line 992 of file testautomation_render.c.

References SDL_Rect::h, NULL, rect, RENDER_COMPARE_AMASK, RENDER_COMPARE_BMASK, RENDER_COMPARE_FORMAT, RENDER_COMPARE_GMASK, RENDER_COMPARE_RMASK, SDL_CreateRGBSurfaceFrom, SDL_free(), SDL_FreeSurface, SDL_malloc, SDL_RenderReadPixels, SDLTest_AssertCheck(), SDLTest_CompareSurfaces(), TESTRENDER_SCREEN_H, TESTRENDER_SCREEN_W, testSurface, SDL_Rect::w, SDL_Rect::x, and SDL_Rect::y.

Referenced by render_testBlit(), render_testBlitAlpha(), render_testBlitBlend(), render_testBlitColor(), render_testPrimitives(), and render_testPrimitivesBlend().

{
int result;
SDL_Rect rect;
Uint8 *pixels;
SDL_Surface *testSurface;
/* Read pixels. */
pixels = (Uint8 *)SDL_malloc(4*TESTRENDER_SCREEN_W*TESTRENDER_SCREEN_H);
SDLTest_AssertCheck(pixels != NULL, "Validate allocated temp pixel buffer");
if (pixels == NULL) return;
/* Explicitly specify the rect in case the window isn't the expected size... */
rect.x = 0;
rect.y = 0;
rect.w = TESTRENDER_SCREEN_W;
rect.h = TESTRENDER_SCREEN_H;
result = SDL_RenderReadPixels(renderer, &rect, RENDER_COMPARE_FORMAT, pixels, 80*4 );
SDLTest_AssertCheck(result == 0, "Validate result from SDL_RenderReadPixels, expected: 0, got: %i", result);
/* Create surface. */
testSurface = SDL_CreateRGBSurfaceFrom(pixels, TESTRENDER_SCREEN_W, TESTRENDER_SCREEN_H, 32, TESTRENDER_SCREEN_W*4,
RENDER_COMPARE_RMASK, RENDER_COMPARE_GMASK, RENDER_COMPARE_BMASK, RENDER_COMPARE_AMASK);
SDLTest_AssertCheck(testSurface != NULL, "Verify result from SDL_CreateRGBSurfaceFrom is not NULL");
/* Compare surface. */
result = SDLTest_CompareSurfaces( testSurface, referenceSurface, allowable_error );
SDLTest_AssertCheck(result == 0, "Validate result from SDLTest_CompareSurfaces, expected: 0, got: %i", result);
/* Clean up. */
SDL_free(pixels);
SDL_FreeSurface(testSurface);
}
SDL_RenderReadPixels
#define SDL_RenderReadPixels
Definition: SDL_dynapi_overrides.h:351
RENDER_COMPARE_RMASK
#define RENDER_COMPARE_RMASK
Definition: testautomation_render.c:18
SDLTest_CompareSurfaces
int SDLTest_CompareSurfaces(SDL_Surface *surface, SDL_Surface *referenceSurface, int allowable_error)
Compares a surface and with reference image data for equality.
Definition: SDL_test_compare.c:39
result
GLuint64EXT * result
Definition: SDL_opengl_glext.h:9432
rect
SDL_Rect rect
Definition: testrelative.c:27
SDL_Surface
A collection of pixels used in software blitting.
Definition: SDL_surface.h:69
RENDER_COMPARE_AMASK
#define RENDER_COMPARE_AMASK
Definition: testautomation_render.c:17
pixels
GLint GLint GLsizei GLsizei GLsizei GLint GLenum GLenum const GLvoid * pixels
Definition: SDL_opengl.h:1565
SDL_CreateRGBSurfaceFrom
#define SDL_CreateRGBSurfaceFrom
Definition: SDL_dynapi_overrides.h:449
RENDER_COMPARE_FORMAT
#define RENDER_COMPARE_FORMAT
Definition: testautomation_render.c:16
renderer
SDL_Renderer * renderer
Definition: testautomation_render.c:27
SDLTest_AssertCheck
int SDLTest_AssertCheck(int assertCondition, SDL_PRINTF_FORMAT_STRING const char *assertDescription,...) SDL_PRINTF_VARARG_FUNC(2)
Assert for test cases that logs but does not break execution flow on failures. Updates assertion coun...
Definition: SDL_test_assert.c:65
SDL_FreeSurface
#define SDL_FreeSurface
Definition: SDL_dynapi_overrides.h:450
Uint8
uint8_t Uint8
An unsigned 8-bit integer type.
Definition: SDL_stdinc.h:139
SDL_free
void SDL_free(void *mem)
SDL_Rect::x
int x
Definition: SDL_rect.h:66
SDL_Rect::w
int w
Definition: SDL_rect.h:67
NULL
#define NULL
Definition: begin_code.h:143
RENDER_COMPARE_BMASK
#define RENDER_COMPARE_BMASK
Definition: testautomation_render.c:20
SDL_Rect::h
int h
Definition: SDL_rect.h:67
testSurface
static SDL_Surface * testSurface
Definition: testautomation_surface.c:28
TESTRENDER_SCREEN_W
#define TESTRENDER_SCREEN_W
Definition: testautomation_render.c:13
SDL_malloc
#define SDL_malloc
Definition: SDL_dynapi_overrides.h:380
RENDER_COMPARE_GMASK
#define RENDER_COMPARE_GMASK
Definition: testautomation_render.c:19
TESTRENDER_SCREEN_H
#define TESTRENDER_SCREEN_H
Definition: testautomation_render.c:14
SDL_Rect::y
int y
Definition: SDL_rect.h:66
SDL_Rect
A rectangle, with the origin at the upper left.
Definition: SDL_rect.h:64

static int _hasBlendModes | ( | void |  | ) |

static

Test to see if we can vary the blend mode. Helper function.

See also
  http://wiki.libsdl.org/moin.cgi/SDL_SetRenderDrawBlendMode http://wiki.libsdl.org/moin.cgi/SDL_GetRenderDrawBlendMode

Definition at line 824 of file testautomation_render.c.

References _isSupported(), SDL_BLENDMODE_ADD, SDL_BLENDMODE_BLEND, SDL_BLENDMODE_MOD, SDL_BLENDMODE_NONE, SDL_GetRenderDrawBlendMode, and SDL_SetRenderDrawBlendMode.

Referenced by render_testBlitBlend(), and render_testPrimitivesBlend().

{
int fail;
int ret;
SDL_BlendMode mode;
fail = 0;
ret = SDL_SetRenderDrawBlendMode(renderer, SDL_BLENDMODE_BLEND );
if (!_isSupported(ret))
fail = 1;
ret = SDL_GetRenderDrawBlendMode(renderer, &mode );
if (!_isSupported(ret))
fail = 1;
ret = (mode != SDL_BLENDMODE_BLEND);
if (!_isSupported(ret))
fail = 1;
ret = SDL_SetRenderDrawBlendMode(renderer, SDL_BLENDMODE_ADD );
if (!_isSupported(ret))
fail = 1;
ret = SDL_GetRenderDrawBlendMode(renderer, &mode );
if (!_isSupported(ret))
fail = 1;
ret = (mode != SDL_BLENDMODE_ADD);
if (!_isSupported(ret))
fail = 1;
ret = SDL_SetRenderDrawBlendMode(renderer, SDL_BLENDMODE_MOD );
if (!_isSupported(ret))
fail = 1;
ret = SDL_GetRenderDrawBlendMode(renderer, &mode );
if (!_isSupported(ret))
fail = 1;
ret = (mode != SDL_BLENDMODE_MOD);
if (!_isSupported(ret))
fail = 1;
ret = SDL_SetRenderDrawBlendMode(renderer, SDL_BLENDMODE_NONE );
if (!_isSupported(ret))
fail = 1;
ret = SDL_GetRenderDrawBlendMode(renderer, &mode );
if (!_isSupported(ret))
fail = 1;
ret = (mode != SDL_BLENDMODE_NONE);
if (!_isSupported(ret))
fail = 1;
return !fail;
}
SDL_GetRenderDrawBlendMode
#define SDL_GetRenderDrawBlendMode
Definition: SDL_dynapi_overrides.h:339
SDL_BLENDMODE_NONE
Definition: SDL_blendmode.h:42
SDL_BlendMode
SDL_BlendMode
The blend mode used in SDL_RenderCopy() and drawing operations.
Definition: SDL_blendmode.h:40
SDL_SetRenderDrawBlendMode
#define SDL_SetRenderDrawBlendMode
Definition: SDL_dynapi_overrides.h:338
SDL_BLENDMODE_MOD
Definition: SDL_blendmode.h:50
renderer
SDL_Renderer * renderer
Definition: testautomation_render.c:27
mode
GLenum mode
Definition: SDL_opengl_glext.h:1122
_isSupported
static int _isSupported(int code)
Checks to see if functionality is supported. Helper function.
Definition: testautomation_render.c:773
SDL_BLENDMODE_ADD
Definition: SDL_blendmode.h:47
SDL_BLENDMODE_BLEND
Definition: SDL_blendmode.h:44

static int _hasDrawColor | ( | void |  | ) |

static

Test to see if we can vary the draw color. Helper function.

See also
  http://wiki.libsdl.org/moin.cgi/SDL_SetRenderDrawColor http://wiki.libsdl.org/moin.cgi/SDL_GetRenderDrawColor

Definition at line 786 of file testautomation_render.c.

References _isSupported(), SDL_ALPHA_OPAQUE, SDL_GetRenderDrawColor, and SDL_SetRenderDrawColor.

Referenced by render_testBlit(), render_testPrimitives(), and render_testPrimitivesBlend().

{
int ret, fail;
Uint8 r, g, b, a;
fail = 0;
/* Set color. */
ret = SDL_SetRenderDrawColor(renderer, 100, 100, 100, 100 );
if (!_isSupported(ret))
fail = 1;
ret = SDL_GetRenderDrawColor(renderer, &r, &g, &b, &a );
if (!_isSupported(ret))
fail = 1;
/* Restore natural. */
ret = SDL_SetRenderDrawColor(renderer, 0, 0, 0, SDL_ALPHA_OPAQUE );
if (!_isSupported(ret))
fail = 1;
/* Something failed, consider not available. */
if (fail)
return 0;
/* Not set properly, consider failed. */
else if ((r != 100) || (g != 100) || (b != 100) || (a != 100))
return 0;
return 1;
}
r
GLdouble GLdouble GLdouble r
Definition: SDL_opengl.h:2072
g
GLboolean GLboolean g
Definition: SDL_opengl_glext.h:1109
renderer
SDL_Renderer * renderer
Definition: testautomation_render.c:27
Uint8
uint8_t Uint8
An unsigned 8-bit integer type.
Definition: SDL_stdinc.h:139
SDL_GetRenderDrawColor
#define SDL_GetRenderDrawColor
Definition: SDL_dynapi_overrides.h:337
_isSupported
static int _isSupported(int code)
Checks to see if functionality is supported. Helper function.
Definition: testautomation_render.c:773
SDL_SetRenderDrawColor
#define SDL_SetRenderDrawColor
Definition: SDL_dynapi_overrides.h:336
SDL_ALPHA_OPAQUE
#define SDL_ALPHA_OPAQUE
Definition: SDL_pixels.h:45
a
GLboolean GLboolean GLboolean GLboolean a
Definition: SDL_opengl_glext.h:1109
b
GLboolean GLboolean GLboolean b
Definition: SDL_opengl_glext.h:1109

static int _hasTexAlpha | ( | void |  | ) |

static

Test to see if we can vary the alpha of the texture. Helper function.

See also
  http://wiki.libsdl.org/moin.cgi/SDL_SetTextureAlphaMod http://wiki.libsdl.org/moin.cgi/SDL_GetTextureAlphaMod http://wiki.libsdl.org/moin.cgi/SDL_DestroyTexture

Definition at line 950 of file testautomation_render.c.

References _isSupported(), _loadTestFace(), NULL, SDL_DestroyTexture, SDL_GetTextureAlphaMod, and SDL_SetTextureAlphaMod.

Referenced by render_testBlitAlpha(), and render_testBlitBlend().

{
int fail;
int ret;
SDL_Texture *tface;
Uint8 a;
/* Get test face. */
tface = _loadTestFace();
if (tface == NULL)
return 0;
/* See if supported. */
fail = 0;
ret = SDL_SetTextureAlphaMod( tface, 100 );
if (!_isSupported(ret))
fail = 1;
ret = SDL_GetTextureAlphaMod( tface, &a );
if (!_isSupported(ret))
fail = 1;
/* Clean up. */
SDL_DestroyTexture( tface );
if (fail)
return 0;
else if (a != 100)
return 0;
return 1;
}
SDL_Texture
Definition: SDL_sysrender.h:49
_loadTestFace
static SDL_Texture * _loadTestFace(void)
Loads the test image &#39;Face&#39; as texture. Helper function.
Definition: testautomation_render.c:880
SDL_GetTextureAlphaMod
#define SDL_GetTextureAlphaMod
Definition: SDL_dynapi_overrides.h:318
Uint8
uint8_t Uint8
An unsigned 8-bit integer type.
Definition: SDL_stdinc.h:139
_isSupported
static int _isSupported(int code)
Checks to see if functionality is supported. Helper function.
Definition: testautomation_render.c:773
NULL
#define NULL
Definition: begin_code.h:143
SDL_DestroyTexture
#define SDL_DestroyTexture
Definition: SDL_dynapi_overrides.h:353
a
GLboolean GLboolean GLboolean GLboolean a
Definition: SDL_opengl_glext.h:1109
SDL_SetTextureAlphaMod
#define SDL_SetTextureAlphaMod
Definition: SDL_dynapi_overrides.h:317

static int _hasTexColor | ( | void |  | ) |

static

Test to see if can set texture color mode. Helper function.

See also
  http://wiki.libsdl.org/moin.cgi/SDL_SetTextureColorMod http://wiki.libsdl.org/moin.cgi/SDL_GetTextureColorMod http://wiki.libsdl.org/moin.cgi/SDL_DestroyTexture

Definition at line 910 of file testautomation_render.c.

References _isSupported(), _loadTestFace(), NULL, SDL_DestroyTexture, SDL_GetTextureColorMod, and SDL_SetTextureColorMod.

Referenced by render_testBlitBlend().

{
int fail;
int ret;
SDL_Texture *tface;
Uint8 r, g, b;
/* Get test face. */
tface = _loadTestFace();
if (tface == NULL)
return 0;
/* See if supported. */
fail = 0;
ret = SDL_SetTextureColorMod( tface, 100, 100, 100 );
if (!_isSupported(ret))
fail = 1;
ret = SDL_GetTextureColorMod( tface, &r, &g, &b );
if (!_isSupported(ret))
fail = 1;
/* Clean up. */
SDL_DestroyTexture( tface );
if (fail)
return 0;
else if ((r != 100) || (g != 100) || (b != 100))
return 0;
return 1;
}
r
GLdouble GLdouble GLdouble r
Definition: SDL_opengl.h:2072
SDL_Texture
Definition: SDL_sysrender.h:49
_loadTestFace
static SDL_Texture * _loadTestFace(void)
Loads the test image &#39;Face&#39; as texture. Helper function.
Definition: testautomation_render.c:880
g
GLboolean GLboolean g
Definition: SDL_opengl_glext.h:1109
SDL_GetTextureColorMod
#define SDL_GetTextureColorMod
Definition: SDL_dynapi_overrides.h:316
Uint8
uint8_t Uint8
An unsigned 8-bit integer type.
Definition: SDL_stdinc.h:139
SDL_SetTextureColorMod
#define SDL_SetTextureColorMod
Definition: SDL_dynapi_overrides.h:315
_isSupported
static int _isSupported(int code)
Checks to see if functionality is supported. Helper function.
Definition: testautomation_render.c:773
NULL
#define NULL
Definition: begin_code.h:143
SDL_DestroyTexture
#define SDL_DestroyTexture
Definition: SDL_dynapi_overrides.h:353
b
GLboolean GLboolean GLboolean b
Definition: SDL_opengl_glext.h:1109

static int _isSupported | ( | int | code | ) |

static

Checks to see if functionality is supported. Helper function.

Definition at line 773 of file testautomation_render.c.

Referenced by _hasBlendModes(), _hasDrawColor(), _hasTexAlpha(), and _hasTexColor().

{
return (code == 0);
}

static SDL_Texture * _loadTestFace | ( | void |  | ) |

static

Loads the test image 'Face' as texture. Helper function.

See also
  http://wiki.libsdl.org/moin.cgi/SDL_CreateTextureFromSurface

Definition at line 880 of file testautomation_render.c.

References NULL, SDL_CreateTextureFromSurface, SDL_FreeSurface, SDL_GetError, SDLTest_ImageFace(), and SDLTest_LogError().

Referenced by _hasTexAlpha(), _hasTexColor(), render_testBlit(), render_testBlitAlpha(), render_testBlitBlend(), and render_testBlitColor().

{
SDL_Surface *face;
SDL_Texture *tface;
face = SDLTest_ImageFace();
if (face == NULL) {
return NULL;
}
tface = SDL_CreateTextureFromSurface(renderer, face);
if (tface == NULL) {
SDLTest_LogError("SDL_CreateTextureFromSurface() failed with error: %s", SDL_GetError());
}
SDL_FreeSurface(face);
return tface;
}
SDL_GetError
#define SDL_GetError
Definition: SDL_dynapi_overrides.h:119
SDLTest_ImageFace
SDL_Surface * SDLTest_ImageFace()
Returns the Face test image as SDL_Surface.
Definition: SDL_test_imageFace.c:224
SDL_Surface
A collection of pixels used in software blitting.
Definition: SDL_surface.h:69
SDL_Texture
Definition: SDL_sysrender.h:49
renderer
SDL_Renderer * renderer
Definition: testautomation_render.c:27
SDLTest_LogError
void SDLTest_LogError(SDL_PRINTF_FORMAT_STRING const char *fmt,...) SDL_PRINTF_VARARG_FUNC(1)
Prints given message with a timestamp in the TEST category and the ERROR priority.
Definition: SDL_test_log.c:89
face
GLenum GLuint GLint GLenum face
Definition: SDL_opengl_glext.h:3019
SDL_CreateTextureFromSurface
#define SDL_CreateTextureFromSurface
Definition: SDL_dynapi_overrides.h:313
SDL_FreeSurface
#define SDL_FreeSurface
Definition: SDL_dynapi_overrides.h:450
NULL
#define NULL
Definition: begin_code.h:143

static void _testBlitBlendMode | ( | SDL_Texture * | tface,
|  | int | mode
| ) |  |

static

Tests a blend mode.

See also
  http://wiki.libsdl.org/moin.cgi/SDL_SetTextureBlendMode http://wiki.libsdl.org/moin.cgi/SDL_RenderCopy

Definition at line 583 of file testautomation_render.c.

References _clearScreen(), SDL_Rect::h, i, j, NULL, rect, SDL_QueryTexture, SDL_RenderCopy, SDL_SetTextureBlendMode, SDLTest_AssertCheck(), TESTRENDER_SCREEN_H, TESTRENDER_SCREEN_W, SDL_Rect::w, SDL_Rect::x, and SDL_Rect::y.

Referenced by render_testBlitBlend().

{
int ret;
Uint32 tformat;
int taccess, tw, th;
int i, j, ni, nj;
SDL_Rect rect;
int checkFailCount1;
int checkFailCount2;
/* Clear surface. */
_clearScreen();
/* Constant values. */
ret = SDL_QueryTexture(tface, &tformat, &taccess, &tw, &th);
SDLTest_AssertCheck(ret == 0, "Verify result from SDL_QueryTexture, expected 0, got %i", ret);
rect.w = tw;
rect.h = th;
ni = TESTRENDER_SCREEN_W - tw;
nj = TESTRENDER_SCREEN_H - th;
/* Test blend mode. */
checkFailCount1 = 0;
checkFailCount2 = 0;
for (j=0; j <= nj; j+=4) {
for (i=0; i <= ni; i+=4) {
/* Set blend mode. */
ret = SDL_SetTextureBlendMode( tface, (SDL_BlendMode)mode );
if (ret != 0) checkFailCount1++;
/* Blitting. */
rect.x = i;
rect.y = j;
ret = SDL_RenderCopy(renderer, tface, NULL, &rect );
if (ret != 0) checkFailCount2++;
}
}
SDLTest_AssertCheck(checkFailCount1 == 0, "Validate results from calls to SDL_SetTextureBlendMode, expected: 0, got: %i", checkFailCount1);
SDLTest_AssertCheck(checkFailCount2 == 0, "Validate results from calls to SDL_RenderCopy, expected: 0, got: %i", checkFailCount2);
}
Uint32
uint32_t Uint32
An unsigned 32-bit integer type.
Definition: SDL_stdinc.h:157
SDL_BlendMode
SDL_BlendMode
The blend mode used in SDL_RenderCopy() and drawing operations.
Definition: SDL_blendmode.h:40
rect
SDL_Rect rect
Definition: testrelative.c:27
SDL_SetTextureBlendMode
#define SDL_SetTextureBlendMode
Definition: SDL_dynapi_overrides.h:319
SDL_RenderCopy
#define SDL_RenderCopy
Definition: SDL_dynapi_overrides.h:349
renderer
SDL_Renderer * renderer
Definition: testautomation_render.c:27
SDLTest_AssertCheck
int SDLTest_AssertCheck(int assertCondition, SDL_PRINTF_FORMAT_STRING const char *assertDescription,...) SDL_PRINTF_VARARG_FUNC(2)
Assert for test cases that logs but does not break execution flow on failures. Updates assertion coun...
Definition: SDL_test_assert.c:65
SDL_QueryTexture
#define SDL_QueryTexture
Definition: SDL_dynapi_overrides.h:314
mode
GLenum mode
Definition: SDL_opengl_glext.h:1122
SDL_Rect::x
int x
Definition: SDL_rect.h:66
SDL_Rect::w
int w
Definition: SDL_rect.h:67
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:42
NULL
#define NULL
Definition: begin_code.h:143
SDL_Rect::h
int h
Definition: SDL_rect.h:67
TESTRENDER_SCREEN_W
#define TESTRENDER_SCREEN_W
Definition: testautomation_render.c:13
_clearScreen
static int _clearScreen(void)
Clears the screen. Helper function.
Definition: testautomation_render.c:1036
TESTRENDER_SCREEN_H
#define TESTRENDER_SCREEN_H
Definition: testautomation_render.c:14
SDL_Rect::y
int y
Definition: SDL_rect.h:66
SDL_Rect
A rectangle, with the origin at the upper left.
Definition: SDL_rect.h:64
j
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int int in j)
Definition: SDL_x11sym.h:42

void CleanupDestroyRenderer | ( | void * | arg | ) |

Definition at line 66 of file testautomation_render.c.

References NULL, SDL_DestroyRenderer, SDL_DestroyWindow, and SDLTest_AssertPass().

{
if (renderer != NULL) {
SDL_DestroyRenderer(renderer);
renderer = NULL;
SDLTest_AssertPass("SDL_DestroyRenderer()");
}
if (window != NULL) {
SDL_DestroyWindow(window);
window = NULL;
SDLTest_AssertPass("SDL_DestroyWindow");
}
}
SDLTest_AssertPass
void SDLTest_AssertPass(SDL_PRINTF_FORMAT_STRING const char *assertDescription,...) SDL_PRINTF_VARARG_FUNC(1)
Explicitly pass without checking an assertion condition. Updates assertion counter.
Definition: SDL_test_assert.c:94
window
SDL_Window * window
Definition: testautomation_render.c:26
renderer
SDL_Renderer * renderer
Definition: testautomation_render.c:27
NULL
#define NULL
Definition: begin_code.h:143
SDL_DestroyRenderer
#define SDL_DestroyRenderer
Definition: SDL_dynapi_overrides.h:354
SDL_DestroyWindow
#define SDL_DestroyWindow
Definition: SDL_dynapi_overrides.h:553

void InitCreateRenderer | ( | void * | arg | ) |

Create software renderer for tests

Definition at line 43 of file testautomation_render.c.

References NULL, SDL_CreateRenderer, SDL_CreateWindow, SDL_DestroyWindow, SDL_RENDERER_ACCELERATED, SDLTest_AssertCheck(), and SDLTest_AssertPass().

{
int posX = 100, posY = 100, width = 320, height = 240;
renderer = NULL;
window = SDL_CreateWindow("render_testCreateRenderer", posX, posY, width, height, 0);
SDLTest_AssertPass("SDL_CreateWindow()");
SDLTest_AssertCheck(window != NULL, "Check SDL_CreateWindow result");
if (window == NULL) {
return;
}
renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_ACCELERATED);
SDLTest_AssertPass("SDL_CreateRenderer()");
SDLTest_AssertCheck(renderer != 0, "Check SDL_CreateRenderer result");
if (renderer == NULL) {
SDL_DestroyWindow(window);
return;
}
}
width
GLint GLint GLsizei width
Definition: SDL_opengl.h:1565
SDL_RENDERER_ACCELERATED
Definition: SDL_render.h:67
SDLTest_AssertPass
void SDLTest_AssertPass(SDL_PRINTF_FORMAT_STRING const char *assertDescription,...) SDL_PRINTF_VARARG_FUNC(1)
Explicitly pass without checking an assertion condition. Updates assertion counter.
Definition: SDL_test_assert.c:94
window
SDL_Window * window
Definition: testautomation_render.c:26
SDL_CreateWindow
#define SDL_CreateWindow
Definition: SDL_dynapi_overrides.h:518
height
GLint GLint GLsizei GLsizei height
Definition: SDL_opengl.h:1565
renderer
SDL_Renderer * renderer
Definition: testautomation_render.c:27
SDLTest_AssertCheck
int SDLTest_AssertCheck(int assertCondition, SDL_PRINTF_FORMAT_STRING const char *assertDescription,...) SDL_PRINTF_VARARG_FUNC(2)
Assert for test cases that logs but does not break execution flow on failures. Updates assertion coun...
Definition: SDL_test_assert.c:65
NULL
#define NULL
Definition: begin_code.h:143
SDL_DestroyWindow
#define SDL_DestroyWindow
Definition: SDL_dynapi_overrides.h:553
SDL_CreateRenderer
#define SDL_CreateRenderer
Definition: SDL_dynapi_overrides.h:307

int render_testBlit | ( | void * | arg | ) |

Tests some blitting routines.

See also
  http://wiki.libsdl.org/moin.cgi/SDL_RenderCopy http://wiki.libsdl.org/moin.cgi/SDL_DestroyTexture

Definition at line 362 of file testautomation_render.c.

References _clearScreen(), _compare(), _hasDrawColor(), _loadTestFace(), ALLOWABLE_ERROR_OPAQUE, SDL_Rect::h, i, j, NULL, rect, referenceSurface, SDL_DestroyTexture, SDL_FreeSurface, SDL_QueryTexture, SDL_RenderCopy, SDL_RenderPresent, SDLTest_AssertCheck(), SDLTest_ImageBlit(), TEST_ABORTED, TEST_COMPLETED, TESTRENDER_SCREEN_H, TESTRENDER_SCREEN_W, SDL_Rect::w, SDL_Rect::x, and SDL_Rect::y.

{
int ret;
SDL_Rect rect;
SDL_Texture *tface;
SDL_Surface *referenceSurface = NULL;
Uint32 tformat;
int taccess, tw, th;
int i, j, ni, nj;
int checkFailCount1;
/* Clear surface. */
_clearScreen();
/* Need drawcolor or just skip test. */
SDLTest_AssertCheck(_hasDrawColor(), "_hasDrawColor)");
/* Create face surface. */
tface = _loadTestFace();
SDLTest_AssertCheck(tface != NULL, "Verify _loadTestFace() result");
if (tface == NULL) {
return TEST_ABORTED;
}
/* Constant values. */
ret = SDL_QueryTexture(tface, &tformat, &taccess, &tw, &th);
SDLTest_AssertCheck(ret == 0, "Verify result from SDL_QueryTexture, expected 0, got %i", ret);
rect.w = tw;
rect.h = th;
ni = TESTRENDER_SCREEN_W - tw;
nj = TESTRENDER_SCREEN_H - th;
/* Loop blit. */
checkFailCount1 = 0;
for (j=0; j <= nj; j+=4) {
for (i=0; i <= ni; i+=4) {
/* Blitting. */
rect.x = i;
rect.y = j;
ret = SDL_RenderCopy(renderer, tface, NULL, &rect );
if (ret != 0) checkFailCount1++;
}
}
SDLTest_AssertCheck(checkFailCount1 == 0, "Validate results from calls to SDL_RenderCopy, expected: 0, got: %i", checkFailCount1);
/* Make current */
SDL_RenderPresent(renderer);
/* See if it's the same */
referenceSurface = SDLTest_ImageBlit();
_compare(referenceSurface, ALLOWABLE_ERROR_OPAQUE );
/* Clean up. */
SDL_DestroyTexture( tface );
SDL_FreeSurface(referenceSurface);
referenceSurface = NULL;
return TEST_COMPLETED;
}
TEST_ABORTED
#define TEST_ABORTED
Definition: SDL_test_harness.h:51
Uint32
uint32_t Uint32
An unsigned 32-bit integer type.
Definition: SDL_stdinc.h:157
rect
SDL_Rect rect
Definition: testrelative.c:27
SDL_Surface
A collection of pixels used in software blitting.
Definition: SDL_surface.h:69
_compare
static void _compare(SDL_Surface *reference, int allowable_error)
Compares screen pixels with image pixels. Helper function.
Definition: testautomation_render.c:992
SDL_Texture
Definition: SDL_sysrender.h:49
_loadTestFace
static SDL_Texture * _loadTestFace(void)
Loads the test image &#39;Face&#39; as texture. Helper function.
Definition: testautomation_render.c:880
SDL_RenderCopy
#define SDL_RenderCopy
Definition: SDL_dynapi_overrides.h:349
renderer
SDL_Renderer * renderer
Definition: testautomation_render.c:27
SDLTest_AssertCheck
int SDLTest_AssertCheck(int assertCondition, SDL_PRINTF_FORMAT_STRING const char *assertDescription,...) SDL_PRINTF_VARARG_FUNC(2)
Assert for test cases that logs but does not break execution flow on failures. Updates assertion coun...
Definition: SDL_test_assert.c:65
SDL_FreeSurface
#define SDL_FreeSurface
Definition: SDL_dynapi_overrides.h:450
SDLTest_ImageBlit
SDL_Surface * SDLTest_ImageBlit()
Returns the Blit test image as SDL_Surface.
Definition: SDL_test_imageBlit.c:541
SDL_QueryTexture
#define SDL_QueryTexture
Definition: SDL_dynapi_overrides.h:314
SDL_Rect::x
int x
Definition: SDL_rect.h:66
TEST_COMPLETED
#define TEST_COMPLETED
Definition: SDL_test_harness.h:53
SDL_Rect::w
int w
Definition: SDL_rect.h:67
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:42
NULL
#define NULL
Definition: begin_code.h:143
ALLOWABLE_ERROR_OPAQUE
#define ALLOWABLE_ERROR_OPAQUE
Definition: testautomation_render.c:22
_hasDrawColor
static int _hasDrawColor(void)
Test to see if we can vary the draw color. Helper function.
Definition: testautomation_render.c:786
SDL_DestroyTexture
#define SDL_DestroyTexture
Definition: SDL_dynapi_overrides.h:353
SDL_Rect::h
int h
Definition: SDL_rect.h:67
TESTRENDER_SCREEN_W
#define TESTRENDER_SCREEN_W
Definition: testautomation_render.c:13
_clearScreen
static int _clearScreen(void)
Clears the screen. Helper function.
Definition: testautomation_render.c:1036
TESTRENDER_SCREEN_H
#define TESTRENDER_SCREEN_H
Definition: testautomation_render.c:14
referenceSurface
static SDL_Surface * referenceSurface
Definition: testautomation_surface.c:27
SDL_Rect::y
int y
Definition: SDL_rect.h:66
SDL_Rect
A rectangle, with the origin at the upper left.
Definition: SDL_rect.h:64
SDL_RenderPresent
#define SDL_RenderPresent
Definition: SDL_dynapi_overrides.h:352
j
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int int in j)
Definition: SDL_x11sym.h:42

int render_testBlitAlpha | ( | void * | arg | ) |

Tests blitting with alpha.

See also
  http://wiki.libsdl.org/moin.cgi/SDL_SetTextureAlphaMod http://wiki.libsdl.org/moin.cgi/SDL_RenderCopy http://wiki.libsdl.org/moin.cgi/SDL_DestroyTexture

Definition at line 506 of file testautomation_render.c.

References _clearScreen(), _compare(), _hasTexAlpha(), _loadTestFace(), ALLOWABLE_ERROR_BLENDED, SDL_Rect::h, i, j, NULL, rect, referenceSurface, SDL_DestroyTexture, SDL_FreeSurface, SDL_QueryTexture, SDL_RenderCopy, SDL_RenderPresent, SDL_SetTextureAlphaMod, SDLTest_AssertCheck(), SDLTest_ImageBlitAlpha(), TEST_ABORTED, TEST_COMPLETED, TESTRENDER_SCREEN_H, TESTRENDER_SCREEN_W, SDL_Rect::w, SDL_Rect::x, and SDL_Rect::y.

{
int ret;
SDL_Rect rect;
SDL_Texture *tface;
SDL_Surface *referenceSurface = NULL;
Uint32 tformat;
int taccess, tw, th;
int i, j, ni, nj;
int checkFailCount1;
int checkFailCount2;
/* Clear surface. */
_clearScreen();
/* Need alpha or just skip test. */
SDLTest_AssertCheck(_hasTexAlpha(), "_hasTexAlpha");
/* Create face surface. */
tface = _loadTestFace();
SDLTest_AssertCheck(tface != NULL, "Verify _loadTestFace() result");
if (tface == NULL) {
return TEST_ABORTED;
}
/* Constant values. */
ret = SDL_QueryTexture(tface, &tformat, &taccess, &tw, &th);
SDLTest_AssertCheck(ret == 0, "Verify result from SDL_QueryTexture, expected 0, got %i", ret);
rect.w = tw;
rect.h = th;
ni = TESTRENDER_SCREEN_W - tw;
nj = TESTRENDER_SCREEN_H - th;
/* Test blitting with alpha mod. */
checkFailCount1 = 0;
checkFailCount2 = 0;
for (j=0; j <= nj; j+=4) {
for (i=0; i <= ni; i+=4) {
/* Set alpha mod. */
ret = SDL_SetTextureAlphaMod( tface, (255/ni)*i );
if (ret != 0) checkFailCount1++;
/* Blitting. */
rect.x = i;
rect.y = j;
ret = SDL_RenderCopy(renderer, tface, NULL, &rect );
if (ret != 0) checkFailCount2++;
}
}
SDLTest_AssertCheck(checkFailCount1 == 0, "Validate results from calls to SDL_SetTextureAlphaMod, expected: 0, got: %i", checkFailCount1);
SDLTest_AssertCheck(checkFailCount2 == 0, "Validate results from calls to SDL_RenderCopy, expected: 0, got: %i", checkFailCount2);
/* Make current */
SDL_RenderPresent(renderer);
/* See if it's the same. */
referenceSurface = SDLTest_ImageBlitAlpha();
_compare(referenceSurface, ALLOWABLE_ERROR_BLENDED );
/* Clean up. */
SDL_DestroyTexture( tface );
SDL_FreeSurface(referenceSurface);
referenceSurface = NULL;
return TEST_COMPLETED;
}
TEST_ABORTED
#define TEST_ABORTED
Definition: SDL_test_harness.h:51
Uint32
uint32_t Uint32
An unsigned 32-bit integer type.
Definition: SDL_stdinc.h:157
rect
SDL_Rect rect
Definition: testrelative.c:27
SDL_Surface
A collection of pixels used in software blitting.
Definition: SDL_surface.h:69
_compare
static void _compare(SDL_Surface *reference, int allowable_error)
Compares screen pixels with image pixels. Helper function.
Definition: testautomation_render.c:992
SDL_Texture
Definition: SDL_sysrender.h:49
_loadTestFace
static SDL_Texture * _loadTestFace(void)
Loads the test image &#39;Face&#39; as texture. Helper function.
Definition: testautomation_render.c:880
SDL_RenderCopy
#define SDL_RenderCopy
Definition: SDL_dynapi_overrides.h:349
renderer
SDL_Renderer * renderer
Definition: testautomation_render.c:27
SDLTest_AssertCheck
int SDLTest_AssertCheck(int assertCondition, SDL_PRINTF_FORMAT_STRING const char *assertDescription,...) SDL_PRINTF_VARARG_FUNC(2)
Assert for test cases that logs but does not break execution flow on failures. Updates assertion coun...
Definition: SDL_test_assert.c:65
SDL_FreeSurface
#define SDL_FreeSurface
Definition: SDL_dynapi_overrides.h:450
SDL_QueryTexture
#define SDL_QueryTexture
Definition: SDL_dynapi_overrides.h:314
SDL_Rect::x
int x
Definition: SDL_rect.h:66
TEST_COMPLETED
#define TEST_COMPLETED
Definition: SDL_test_harness.h:53
SDL_Rect::w
int w
Definition: SDL_rect.h:67
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:42
NULL
#define NULL
Definition: begin_code.h:143
ALLOWABLE_ERROR_BLENDED
#define ALLOWABLE_ERROR_BLENDED
Definition: testautomation_render.c:23
SDL_DestroyTexture
#define SDL_DestroyTexture
Definition: SDL_dynapi_overrides.h:353
SDL_Rect::h
int h
Definition: SDL_rect.h:67
TESTRENDER_SCREEN_W
#define TESTRENDER_SCREEN_W
Definition: testautomation_render.c:13
_clearScreen
static int _clearScreen(void)
Clears the screen. Helper function.
Definition: testautomation_render.c:1036
SDLTest_ImageBlitAlpha
SDL_Surface * SDLTest_ImageBlitAlpha()
Returns the BlitAlpha test image as SDL_Surface.
Definition: SDL_test_imageBlit.c:1536
TESTRENDER_SCREEN_H
#define TESTRENDER_SCREEN_H
Definition: testautomation_render.c:14
referenceSurface
static SDL_Surface * referenceSurface
Definition: testautomation_surface.c:27
SDL_Rect::y
int y
Definition: SDL_rect.h:66
_hasTexAlpha
static int _hasTexAlpha(void)
Test to see if we can vary the alpha of the texture. Helper function.
Definition: testautomation_render.c:950
SDL_Rect
A rectangle, with the origin at the upper left.
Definition: SDL_rect.h:64
SDL_RenderPresent
#define SDL_RenderPresent
Definition: SDL_dynapi_overrides.h:352
SDL_SetTextureAlphaMod
#define SDL_SetTextureAlphaMod
Definition: SDL_dynapi_overrides.h:317
j
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int int in j)
Definition: SDL_x11sym.h:42

int render_testBlitBlend | ( | void * | arg | ) |

Tests some more blitting routines.

See also
  http://wiki.libsdl.org/moin.cgi/SDL_SetTextureColorMod http://wiki.libsdl.org/moin.cgi/SDL_SetTextureAlphaMod http://wiki.libsdl.org/moin.cgi/SDL_SetTextureBlendMode http://wiki.libsdl.org/moin.cgi/SDL_DestroyTexture

Definition at line 635 of file testautomation_render.c.

References _clearScreen(), _compare(), _hasBlendModes(), _hasTexAlpha(), _hasTexColor(), _loadTestFace(), _testBlitBlendMode(), ALLOWABLE_ERROR_BLENDED, ALLOWABLE_ERROR_OPAQUE, SDL_Rect::h, i, j, NULL, rect, referenceSurface, SDL_BLENDMODE_ADD, SDL_BLENDMODE_BLEND, SDL_BLENDMODE_MOD, SDL_BLENDMODE_NONE, SDL_DestroyTexture, SDL_FreeSurface, SDL_QueryTexture, SDL_RenderCopy, SDL_RenderPresent, SDL_SetTextureAlphaMod, SDL_SetTextureBlendMode, SDL_SetTextureColorMod, SDLTest_AssertCheck(), SDLTest_ImageBlitBlend(), SDLTest_ImageBlitBlendAdd(), SDLTest_ImageBlitBlendAll(), SDLTest_ImageBlitBlendMod(), SDLTest_ImageBlitBlendNone(), TEST_ABORTED, TEST_COMPLETED, TESTRENDER_SCREEN_H, TESTRENDER_SCREEN_W, SDL_Rect::w, SDL_Rect::x, and SDL_Rect::y.

{
int ret;
SDL_Rect rect;
SDL_Texture *tface;
SDL_Surface *referenceSurface = NULL;
Uint32 tformat;
int taccess, tw, th;
int i, j, ni, nj;
int mode;
int checkFailCount1;
int checkFailCount2;
int checkFailCount3;
int checkFailCount4;
SDLTest_AssertCheck(_hasBlendModes(), "_hasBlendModes");
SDLTest_AssertCheck(_hasTexColor(), "_hasTexColor");
SDLTest_AssertCheck(_hasTexAlpha(), "_hasTexAlpha");
/* Create face surface. */
tface = _loadTestFace();
SDLTest_AssertCheck(tface != NULL, "Verify _loadTestFace() result");
if (tface == NULL) {
return TEST_ABORTED;
}
/* Constant values. */
ret = SDL_QueryTexture(tface, &tformat, &taccess, &tw, &th);
SDLTest_AssertCheck(ret == 0, "Verify result from SDL_QueryTexture, expected 0, got %i", ret);
rect.w = tw;
rect.h = th;
ni = TESTRENDER_SCREEN_W - tw;
nj = TESTRENDER_SCREEN_H - th;
/* Set alpha mod. */
ret = SDL_SetTextureAlphaMod( tface, 100 );
SDLTest_AssertCheck(ret == 0, "Validate result from SDL_SetTextureAlphaMod, expected: 0, got: %i", ret);
/* Test None. */
_testBlitBlendMode( tface, SDL_BLENDMODE_NONE );
referenceSurface = SDLTest_ImageBlitBlendNone();
/* Make current and compare */
SDL_RenderPresent(renderer);
_compare(referenceSurface, ALLOWABLE_ERROR_OPAQUE );
SDL_FreeSurface(referenceSurface);
referenceSurface = NULL;
/* Test Blend. */
_testBlitBlendMode( tface, SDL_BLENDMODE_BLEND );
referenceSurface = SDLTest_ImageBlitBlend();
/* Make current and compare */
SDL_RenderPresent(renderer);
_compare(referenceSurface, ALLOWABLE_ERROR_BLENDED );
SDL_FreeSurface(referenceSurface);
referenceSurface = NULL;
/* Test Add. */
_testBlitBlendMode( tface, SDL_BLENDMODE_ADD );
referenceSurface = SDLTest_ImageBlitBlendAdd();
/* Make current and compare */
SDL_RenderPresent(renderer);
_compare(referenceSurface, ALLOWABLE_ERROR_BLENDED );
SDL_FreeSurface(referenceSurface);
referenceSurface = NULL;
/* Test Mod. */
_testBlitBlendMode( tface, SDL_BLENDMODE_MOD);
referenceSurface = SDLTest_ImageBlitBlendMod();
/* Make current and compare */
SDL_RenderPresent(renderer);
_compare(referenceSurface, ALLOWABLE_ERROR_BLENDED );
SDL_FreeSurface(referenceSurface);
referenceSurface = NULL;
/* Clear surface. */
_clearScreen();
/* Loop blit. */
checkFailCount1 = 0;
checkFailCount2 = 0;
checkFailCount3 = 0;
checkFailCount4 = 0;
for (j=0; j <= nj; j+=4) {
for (i=0; i <= ni; i+=4) {
/* Set color mod. */
ret = SDL_SetTextureColorMod( tface, (255/nj)*j, (255/ni)*i, (255/nj)*j );
if (ret != 0) checkFailCount1++;
/* Set alpha mod. */
ret = SDL_SetTextureAlphaMod( tface, (100/ni)*i );
if (ret != 0) checkFailCount2++;
/* Crazy blending mode magic. */
mode = (i/4*j/4) % 4;
if (mode==0) mode = SDL_BLENDMODE_NONE;
else if (mode==1) mode = SDL_BLENDMODE_BLEND;
else if (mode==2) mode = SDL_BLENDMODE_ADD;
else if (mode==3) mode = SDL_BLENDMODE_MOD;
ret = SDL_SetTextureBlendMode( tface, (SDL_BlendMode)mode );
if (ret != 0) checkFailCount3++;
/* Blitting. */
rect.x = i;
rect.y = j;
ret = SDL_RenderCopy(renderer, tface, NULL, &rect );
if (ret != 0) checkFailCount4++;
}
}
SDLTest_AssertCheck(checkFailCount1 == 0, "Validate results from calls to SDL_SetTextureColorMod, expected: 0, got: %i", checkFailCount1);
SDLTest_AssertCheck(checkFailCount2 == 0, "Validate results from calls to SDL_SetTextureAlphaMod, expected: 0, got: %i", checkFailCount2);
SDLTest_AssertCheck(checkFailCount3 == 0, "Validate results from calls to SDL_SetTextureBlendMode, expected: 0, got: %i", checkFailCount3);
SDLTest_AssertCheck(checkFailCount4 == 0, "Validate results from calls to SDL_RenderCopy, expected: 0, got: %i", checkFailCount4);
/* Clean up. */
SDL_DestroyTexture( tface );
/* Make current */
SDL_RenderPresent(renderer);
/* Check to see if final image matches. */
referenceSurface = SDLTest_ImageBlitBlendAll();
_compare(referenceSurface, ALLOWABLE_ERROR_BLENDED);
SDL_FreeSurface(referenceSurface);
referenceSurface = NULL;
return TEST_COMPLETED;
}
TEST_ABORTED
#define TEST_ABORTED
Definition: SDL_test_harness.h:51
SDLTest_ImageBlitBlendAll
SDL_Surface * SDLTest_ImageBlitBlendAll()
Returns the BlitBlendAll test image as SDL_Surface.
Definition: SDL_test_imageBlitBlend.c:2822
Uint32
uint32_t Uint32
An unsigned 32-bit integer type.
Definition: SDL_stdinc.h:157
SDL_BLENDMODE_NONE
Definition: SDL_blendmode.h:42
SDL_BlendMode
SDL_BlendMode
The blend mode used in SDL_RenderCopy() and drawing operations.
Definition: SDL_blendmode.h:40
rect
SDL_Rect rect
Definition: testrelative.c:27
_testBlitBlendMode
static void _testBlitBlendMode(SDL_Texture *tface, int mode)
Tests a blend mode.
Definition: testautomation_render.c:583
SDL_Surface
A collection of pixels used in software blitting.
Definition: SDL_surface.h:69
_compare
static void _compare(SDL_Surface *reference, int allowable_error)
Compares screen pixels with image pixels. Helper function.
Definition: testautomation_render.c:992
SDL_SetTextureBlendMode
#define SDL_SetTextureBlendMode
Definition: SDL_dynapi_overrides.h:319
SDLTest_ImageBlitBlend
SDL_Surface * SDLTest_ImageBlitBlend()
Returns the BlitBlend test image as SDL_Surface.
Definition: SDL_test_imageBlitBlend.c:1111
SDLTest_ImageBlitBlendNone
SDL_Surface * SDLTest_ImageBlitBlendNone()
Returns the BlitBlendNone test image as SDL_Surface.
Definition: SDL_test_imageBlitBlend.c:2354
SDL_Texture
Definition: SDL_sysrender.h:49
SDL_BLENDMODE_MOD
Definition: SDL_blendmode.h:50
SDLTest_ImageBlitBlendAdd
SDL_Surface * SDLTest_ImageBlitBlendAdd()
Returns the BlitBlendAdd test image as SDL_Surface.
Definition: SDL_test_imageBlitBlend.c:581
_loadTestFace
static SDL_Texture * _loadTestFace(void)
Loads the test image &#39;Face&#39; as texture. Helper function.
Definition: testautomation_render.c:880
SDL_RenderCopy
#define SDL_RenderCopy
Definition: SDL_dynapi_overrides.h:349
renderer
SDL_Renderer * renderer
Definition: testautomation_render.c:27
SDLTest_AssertCheck
int SDLTest_AssertCheck(int assertCondition, SDL_PRINTF_FORMAT_STRING const char *assertDescription,...) SDL_PRINTF_VARARG_FUNC(2)
Assert for test cases that logs but does not break execution flow on failures. Updates assertion coun...
Definition: SDL_test_assert.c:65
_hasTexColor
static int _hasTexColor(void)
Test to see if can set texture color mode. Helper function.
Definition: testautomation_render.c:910
SDL_FreeSurface
#define SDL_FreeSurface
Definition: SDL_dynapi_overrides.h:450
SDL_QueryTexture
#define SDL_QueryTexture
Definition: SDL_dynapi_overrides.h:314
mode
GLenum mode
Definition: SDL_opengl_glext.h:1122
SDL_SetTextureColorMod
#define SDL_SetTextureColorMod
Definition: SDL_dynapi_overrides.h:315
SDL_Rect::x
int x
Definition: SDL_rect.h:66
TEST_COMPLETED
#define TEST_COMPLETED
Definition: SDL_test_harness.h:53
SDL_Rect::w
int w
Definition: SDL_rect.h:67
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:42
NULL
#define NULL
Definition: begin_code.h:143
ALLOWABLE_ERROR_BLENDED
#define ALLOWABLE_ERROR_BLENDED
Definition: testautomation_render.c:23
ALLOWABLE_ERROR_OPAQUE
#define ALLOWABLE_ERROR_OPAQUE
Definition: testautomation_render.c:22
_hasBlendModes
static int _hasBlendModes(void)
Test to see if we can vary the blend mode. Helper function.
Definition: testautomation_render.c:824
SDL_DestroyTexture
#define SDL_DestroyTexture
Definition: SDL_dynapi_overrides.h:353
SDL_Rect::h
int h
Definition: SDL_rect.h:67
SDL_BLENDMODE_ADD
Definition: SDL_blendmode.h:47
TESTRENDER_SCREEN_W
#define TESTRENDER_SCREEN_W
Definition: testautomation_render.c:13
_clearScreen
static int _clearScreen(void)
Clears the screen. Helper function.
Definition: testautomation_render.c:1036
TESTRENDER_SCREEN_H
#define TESTRENDER_SCREEN_H
Definition: testautomation_render.c:14
SDLTest_ImageBlitBlendMod
SDL_Surface * SDLTest_ImageBlitBlendMod()
Returns the BlitBlendMod test image as SDL_Surface.
Definition: SDL_test_imageBlitBlend.c:1541
referenceSurface
static SDL_Surface * referenceSurface
Definition: testautomation_surface.c:27
SDL_Rect::y
int y
Definition: SDL_rect.h:66
_hasTexAlpha
static int _hasTexAlpha(void)
Test to see if we can vary the alpha of the texture. Helper function.
Definition: testautomation_render.c:950
SDL_Rect
A rectangle, with the origin at the upper left.
Definition: SDL_rect.h:64
SDL_RenderPresent
#define SDL_RenderPresent
Definition: SDL_dynapi_overrides.h:352
SDL_SetTextureAlphaMod
#define SDL_SetTextureAlphaMod
Definition: SDL_dynapi_overrides.h:317
SDL_BLENDMODE_BLEND
Definition: SDL_blendmode.h:44
j
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int int in j)
Definition: SDL_x11sym.h:42

int render_testBlitColor | ( | void * | arg | ) |

Blits doing color tests.

See also
  http://wiki.libsdl.org/moin.cgi/SDL_SetTextureColorMod http://wiki.libsdl.org/moin.cgi/SDL_RenderCopy http://wiki.libsdl.org/moin.cgi/SDL_DestroyTexture

Definition at line 432 of file testautomation_render.c.

References _clearScreen(), _compare(), _loadTestFace(), ALLOWABLE_ERROR_OPAQUE, SDL_Rect::h, i, j, NULL, rect, referenceSurface, SDL_DestroyTexture, SDL_FreeSurface, SDL_QueryTexture, SDL_RenderCopy, SDL_RenderPresent, SDL_SetTextureColorMod, SDLTest_AssertCheck(), SDLTest_ImageBlitColor(), TEST_ABORTED, TEST_COMPLETED, TESTRENDER_SCREEN_H, TESTRENDER_SCREEN_W, SDL_Rect::w, SDL_Rect::x, and SDL_Rect::y.

{
int ret;
SDL_Rect rect;
SDL_Texture *tface;
SDL_Surface *referenceSurface = NULL;
Uint32 tformat;
int taccess, tw, th;
int i, j, ni, nj;
int checkFailCount1;
int checkFailCount2;
/* Clear surface. */
_clearScreen();
/* Create face surface. */
tface = _loadTestFace();
SDLTest_AssertCheck(tface != NULL, "Verify _loadTestFace() result");
if (tface == NULL) {
return TEST_ABORTED;
}
/* Constant values. */
ret = SDL_QueryTexture(tface, &tformat, &taccess, &tw, &th);
SDLTest_AssertCheck(ret == 0, "Verify result from SDL_QueryTexture, expected 0, got %i", ret);
rect.w = tw;
rect.h = th;
ni = TESTRENDER_SCREEN_W - tw;
nj = TESTRENDER_SCREEN_H - th;
/* Test blitting with color mod. */
checkFailCount1 = 0;
checkFailCount2 = 0;
for (j=0; j <= nj; j+=4) {
for (i=0; i <= ni; i+=4) {
/* Set color mod. */
ret = SDL_SetTextureColorMod( tface, (255/nj)*j, (255/ni)*i, (255/nj)*j );
if (ret != 0) checkFailCount1++;
/* Blitting. */
rect.x = i;
rect.y = j;
ret = SDL_RenderCopy(renderer, tface, NULL, &rect );
if (ret != 0) checkFailCount2++;
}
}
SDLTest_AssertCheck(checkFailCount1 == 0, "Validate results from calls to SDL_SetTextureColorMod, expected: 0, got: %i", checkFailCount1);
SDLTest_AssertCheck(checkFailCount2 == 0, "Validate results from calls to SDL_RenderCopy, expected: 0, got: %i", checkFailCount2);
/* Make current */
SDL_RenderPresent(renderer);
/* See if it's the same. */
referenceSurface = SDLTest_ImageBlitColor();
_compare(referenceSurface, ALLOWABLE_ERROR_OPAQUE );
/* Clean up. */
SDL_DestroyTexture( tface );
SDL_FreeSurface(referenceSurface);
referenceSurface = NULL;
return TEST_COMPLETED;
}
TEST_ABORTED
#define TEST_ABORTED
Definition: SDL_test_harness.h:51
Uint32
uint32_t Uint32
An unsigned 32-bit integer type.
Definition: SDL_stdinc.h:157
rect
SDL_Rect rect
Definition: testrelative.c:27
SDL_Surface
A collection of pixels used in software blitting.
Definition: SDL_surface.h:69
_compare
static void _compare(SDL_Surface *reference, int allowable_error)
Compares screen pixels with image pixels. Helper function.
Definition: testautomation_render.c:992
SDLTest_ImageBlitColor
SDL_Surface * SDLTest_ImageBlitColor()
Returns the BlitColor test image as SDL_Surface.
Definition: SDL_test_imageBlit.c:1024
SDL_Texture
Definition: SDL_sysrender.h:49
_loadTestFace
static SDL_Texture * _loadTestFace(void)
Loads the test image &#39;Face&#39; as texture. Helper function.
Definition: testautomation_render.c:880
SDL_RenderCopy
#define SDL_RenderCopy
Definition: SDL_dynapi_overrides.h:349
renderer
SDL_Renderer * renderer
Definition: testautomation_render.c:27
SDLTest_AssertCheck
int SDLTest_AssertCheck(int assertCondition, SDL_PRINTF_FORMAT_STRING const char *assertDescription,...) SDL_PRINTF_VARARG_FUNC(2)
Assert for test cases that logs but does not break execution flow on failures. Updates assertion coun...
Definition: SDL_test_assert.c:65
SDL_FreeSurface
#define SDL_FreeSurface
Definition: SDL_dynapi_overrides.h:450
SDL_QueryTexture
#define SDL_QueryTexture
Definition: SDL_dynapi_overrides.h:314
SDL_SetTextureColorMod
#define SDL_SetTextureColorMod
Definition: SDL_dynapi_overrides.h:315
SDL_Rect::x
int x
Definition: SDL_rect.h:66
TEST_COMPLETED
#define TEST_COMPLETED
Definition: SDL_test_harness.h:53
SDL_Rect::w
int w
Definition: SDL_rect.h:67
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:42
NULL
#define NULL
Definition: begin_code.h:143
ALLOWABLE_ERROR_OPAQUE
#define ALLOWABLE_ERROR_OPAQUE
Definition: testautomation_render.c:22
SDL_DestroyTexture
#define SDL_DestroyTexture
Definition: SDL_dynapi_overrides.h:353
SDL_Rect::h
int h
Definition: SDL_rect.h:67
TESTRENDER_SCREEN_W
#define TESTRENDER_SCREEN_W
Definition: testautomation_render.c:13
_clearScreen
static int _clearScreen(void)
Clears the screen. Helper function.
Definition: testautomation_render.c:1036
TESTRENDER_SCREEN_H
#define TESTRENDER_SCREEN_H
Definition: testautomation_render.c:14
referenceSurface
static SDL_Surface * referenceSurface
Definition: testautomation_surface.c:27
SDL_Rect::y
int y
Definition: SDL_rect.h:66
SDL_Rect
A rectangle, with the origin at the upper left.
Definition: SDL_rect.h:64
SDL_RenderPresent
#define SDL_RenderPresent
Definition: SDL_dynapi_overrides.h:352
j
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int int in j)
Definition: SDL_x11sym.h:42

int render_testGetNumRenderDrivers | ( | void * | arg | ) |

Tests call to SDL_GetNumRenderDrivers.

See also
  http://wiki.libsdl.org/moin.cgi/SDL_GetNumRenderDrivers

Definition at line 89 of file testautomation_render.c.

References SDL_GetNumRenderDrivers, SDLTest_AssertCheck(), and TEST_COMPLETED.

{
int n;
n = SDL_GetNumRenderDrivers();
SDLTest_AssertCheck(n >= 1, "Number of renderers >= 1, reported as %i", n);
return TEST_COMPLETED;
}
n
GLdouble n
Definition: SDL_opengl_glext.h:1952
SDL_GetNumRenderDrivers
#define SDL_GetNumRenderDrivers
Definition: SDL_dynapi_overrides.h:304
SDLTest_AssertCheck
int SDLTest_AssertCheck(int assertCondition, SDL_PRINTF_FORMAT_STRING const char *assertDescription,...) SDL_PRINTF_VARARG_FUNC(2)
Assert for test cases that logs but does not break execution flow on failures. Updates assertion coun...
Definition: SDL_test_assert.c:65
TEST_COMPLETED
#define TEST_COMPLETED
Definition: SDL_test_harness.h:53

int render_testPrimitives | ( | void * | arg | ) |

Tests the SDL primitives for rendering.

See also
  http://wiki.libsdl.org/moin.cgi/SDL_SetRenderDrawColor http://wiki.libsdl.org/moin.cgi/SDL_RenderFillRect http://wiki.libsdl.org/moin.cgi/SDL_RenderDrawLine

Definition at line 107 of file testautomation_render.c.

References _clearScreen(), _compare(), _hasDrawColor(), ALLOWABLE_ERROR_OPAQUE, SDL_Rect::h, NULL, rect, referenceSurface, SDL_ALPHA_OPAQUE, SDL_FreeSurface, SDL_RenderDrawLine, SDL_RenderDrawPoint, SDL_RenderFillRect, SDL_RenderPresent, SDL_SetRenderDrawColor, SDLTest_AssertCheck(), SDLTest_ImagePrimitives(), TEST_COMPLETED, TESTRENDER_SCREEN_W, SDL_Rect::w, SDL_Rect::x, and SDL_Rect::y.

{
int ret;
int x, y;
SDL_Rect rect;
SDL_Surface *referenceSurface = NULL;
int checkFailCount1;
int checkFailCount2;
/* Clear surface. */
_clearScreen();
/* Need drawcolor or just skip test. */
SDLTest_AssertCheck(_hasDrawColor(), "_hasDrawColor");
/* Draw a rectangle. */
rect.x = 40;
rect.y = 0;
rect.w = 40;
rect.h = 80;
ret = SDL_SetRenderDrawColor(renderer, 13, 73, 200, SDL_ALPHA_OPAQUE );
SDLTest_AssertCheck(ret == 0, "Validate result from SDL_SetRenderDrawColor, expected: 0, got: %i", ret);
ret = SDL_RenderFillRect(renderer, &rect );
SDLTest_AssertCheck(ret == 0, "Validate result from SDL_RenderFillRect, expected: 0, got: %i", ret);
/* Draw a rectangle. */
rect.x = 10;
rect.y = 10;
rect.w = 60;
rect.h = 40;
ret = SDL_SetRenderDrawColor(renderer, 200, 0, 100, SDL_ALPHA_OPAQUE );
SDLTest_AssertCheck(ret == 0, "Validate result from SDL_SetRenderDrawColor, expected: 0, got: %i", ret);
ret = SDL_RenderFillRect(renderer, &rect );
SDLTest_AssertCheck(ret == 0, "Validate result from SDL_RenderFillRect, expected: 0, got: %i", ret);
/* Draw some points like so:
* X.X.X.X..
* .X.X.X.X.
* X.X.X.X.. */
checkFailCount1 = 0;
checkFailCount2 = 0;
for (y=0; y<3; y++) {
for (x = y % 2; x<TESTRENDER_SCREEN_W; x+=2) {
ret = SDL_SetRenderDrawColor(renderer, x*y, x*y/2, x*y/3, SDL_ALPHA_OPAQUE );
if (ret != 0) checkFailCount1++;
ret = SDL_RenderDrawPoint(renderer, x, y );
if (ret != 0) checkFailCount2++;
}
}
SDLTest_AssertCheck(checkFailCount1 == 0, "Validate results from calls to SDL_SetRenderDrawColor, expected: 0, got: %i", checkFailCount1);
SDLTest_AssertCheck(checkFailCount2 == 0, "Validate results from calls to SDL_RenderDrawPoint, expected: 0, got: %i", checkFailCount2);
/* Draw some lines. */
ret = SDL_SetRenderDrawColor(renderer, 0, 255, 0, SDL_ALPHA_OPAQUE );
SDLTest_AssertCheck(ret == 0, "Validate result from SDL_SetRenderDrawColor");
ret = SDL_RenderDrawLine(renderer, 0, 30, TESTRENDER_SCREEN_W, 30 );
SDLTest_AssertCheck(ret == 0, "Validate result from SDL_RenderDrawLine, expected: 0, got: %i", ret);
ret = SDL_SetRenderDrawColor(renderer, 55, 55, 5, SDL_ALPHA_OPAQUE );
SDLTest_AssertCheck(ret == 0, "Validate result from SDL_SetRenderDrawColor, expected: 0, got: %i", ret);
ret = SDL_RenderDrawLine(renderer, 40, 30, 40, 60 );
SDLTest_AssertCheck(ret == 0, "Validate result from SDL_RenderDrawLine, expected: 0, got: %i", ret);
ret = SDL_SetRenderDrawColor(renderer, 5, 105, 105, SDL_ALPHA_OPAQUE );
SDLTest_AssertCheck(ret == 0, "Validate result from SDL_SetRenderDrawColor, expected: 0, got: %i", ret);
ret = SDL_RenderDrawLine(renderer, 0, 0, 29, 29 );
SDLTest_AssertCheck(ret == 0, "Validate result from SDL_RenderDrawLine, expected: 0, got: %i", ret);
ret = SDL_RenderDrawLine(renderer, 29, 30, 0, 59 );
SDLTest_AssertCheck(ret == 0, "Validate result from SDL_RenderDrawLine, expected: 0, got: %i", ret);
ret = SDL_RenderDrawLine(renderer, 79, 0, 50, 29 );
SDLTest_AssertCheck(ret == 0, "Validate result from SDL_RenderDrawLine, expected: 0, got: %i", ret);
ret = SDL_RenderDrawLine(renderer, 79, 59, 50, 30 );
SDLTest_AssertCheck(ret == 0, "Validate result from SDL_RenderDrawLine, expected: 0, got: %i", ret);
/* Make current */
SDL_RenderPresent(renderer);
/* See if it's the same. */
referenceSurface = SDLTest_ImagePrimitives();
_compare(referenceSurface, ALLOWABLE_ERROR_OPAQUE );
/* Clean up. */
SDL_FreeSurface(referenceSurface);
referenceSurface = NULL;
return TEST_COMPLETED;
}
SDL_RenderDrawPoint
#define SDL_RenderDrawPoint
Definition: SDL_dynapi_overrides.h:341
x
GLint GLint GLint GLint GLint x
Definition: SDL_opengl.h:1567
rect
SDL_Rect rect
Definition: testrelative.c:27
SDL_RenderFillRect
#define SDL_RenderFillRect
Definition: SDL_dynapi_overrides.h:347
SDL_Surface
A collection of pixels used in software blitting.
Definition: SDL_surface.h:69
_compare
static void _compare(SDL_Surface *reference, int allowable_error)
Compares screen pixels with image pixels. Helper function.
Definition: testautomation_render.c:992
renderer
SDL_Renderer * renderer
Definition: testautomation_render.c:27
y
GLint GLint GLint GLint GLint GLint y
Definition: SDL_opengl.h:1567
SDLTest_AssertCheck
int SDLTest_AssertCheck(int assertCondition, SDL_PRINTF_FORMAT_STRING const char *assertDescription,...) SDL_PRINTF_VARARG_FUNC(2)
Assert for test cases that logs but does not break execution flow on failures. Updates assertion coun...
Definition: SDL_test_assert.c:65
SDL_FreeSurface
#define SDL_FreeSurface
Definition: SDL_dynapi_overrides.h:450
SDL_Rect::x
int x
Definition: SDL_rect.h:66
TEST_COMPLETED
#define TEST_COMPLETED
Definition: SDL_test_harness.h:53
SDL_Rect::w
int w
Definition: SDL_rect.h:67
NULL
#define NULL
Definition: begin_code.h:143
ALLOWABLE_ERROR_OPAQUE
#define ALLOWABLE_ERROR_OPAQUE
Definition: testautomation_render.c:22
_hasDrawColor
static int _hasDrawColor(void)
Test to see if we can vary the draw color. Helper function.
Definition: testautomation_render.c:786
SDL_Rect::h
int h
Definition: SDL_rect.h:67
TESTRENDER_SCREEN_W
#define TESTRENDER_SCREEN_W
Definition: testautomation_render.c:13
_clearScreen
static int _clearScreen(void)
Clears the screen. Helper function.
Definition: testautomation_render.c:1036
SDL_SetRenderDrawColor
#define SDL_SetRenderDrawColor
Definition: SDL_dynapi_overrides.h:336
SDL_ALPHA_OPAQUE
#define SDL_ALPHA_OPAQUE
Definition: SDL_pixels.h:45
SDL_RenderDrawLine
#define SDL_RenderDrawLine
Definition: SDL_dynapi_overrides.h:343
referenceSurface
static SDL_Surface * referenceSurface
Definition: testautomation_surface.c:27
SDL_Rect::y
int y
Definition: SDL_rect.h:66
SDL_Rect
A rectangle, with the origin at the upper left.
Definition: SDL_rect.h:64
SDL_RenderPresent
#define SDL_RenderPresent
Definition: SDL_dynapi_overrides.h:352
SDLTest_ImagePrimitives
SDL_Surface * SDLTest_ImagePrimitives()
Returns the Primitives test image as SDL_Surface.
Definition: SDL_test_imagePrimitives.c:491

int render_testPrimitivesBlend | ( | void * | arg | ) |

Tests the SDL primitives with alpha for rendering.

See also
  http://wiki.libsdl.org/moin.cgi/SDL_SetRenderDrawColor http://wiki.libsdl.org/moin.cgi/SDL_SetRenderDrawBlendMode http://wiki.libsdl.org/moin.cgi/SDL_RenderFillRect

Definition at line 213 of file testautomation_render.c.

References _clearScreen(), _compare(), _hasBlendModes(), _hasDrawColor(), ALLOWABLE_ERROR_BLENDED, SDL_Rect::h, i, j, NULL, rect, referenceSurface, SDL_BLENDMODE_ADD, SDL_BLENDMODE_BLEND, SDL_BLENDMODE_NONE, SDL_FreeSurface, SDL_RenderDrawLine, SDL_RenderDrawPoint, SDL_RenderFillRect, SDL_RenderPresent, SDL_SetRenderDrawBlendMode, SDL_SetRenderDrawColor, SDLTest_AssertCheck(), SDLTest_ImagePrimitivesBlend(), TEST_COMPLETED, TESTRENDER_SCREEN_H, TESTRENDER_SCREEN_W, SDL_Rect::w, SDL_Rect::x, and SDL_Rect::y.

{
int ret;
int i, j;
SDL_Rect rect;
SDL_Surface *referenceSurface = NULL;
int checkFailCount1;
int checkFailCount2;
int checkFailCount3;
/* Clear surface. */
_clearScreen();
/* Need drawcolor and blendmode or just skip test. */
SDLTest_AssertCheck(_hasDrawColor(), "_hasDrawColor");
SDLTest_AssertCheck(_hasBlendModes(), "_hasBlendModes");
/* Create some rectangles for each blend mode. */
ret = SDL_SetRenderDrawColor(renderer, 255, 255, 255, 0 );
SDLTest_AssertCheck(ret == 0, "Validate result from SDL_SetRenderDrawColor, expected: 0, got: %i", ret);
ret = SDL_SetRenderDrawBlendMode(renderer, SDL_BLENDMODE_NONE );
SDLTest_AssertCheck(ret == 0, "Validate result from SDL_SetRenderDrawBlendMode, expected: 0, got: %i", ret);
ret = SDL_RenderFillRect(renderer, NULL );
SDLTest_AssertCheck(ret == 0, "Validate result from SDL_RenderFillRect, expected: 0, got: %i", ret);
rect.x = 10;
rect.y = 25;
rect.w = 40;
rect.h = 25;
ret = SDL_SetRenderDrawColor(renderer, 240, 10, 10, 75 );
SDLTest_AssertCheck(ret == 0, "Validate result from SDL_SetRenderDrawColor, expected: 0, got: %i", ret);
ret = SDL_SetRenderDrawBlendMode(renderer, SDL_BLENDMODE_ADD );
SDLTest_AssertCheck(ret == 0, "Validate result from SDL_SetRenderDrawBlendMode, expected: 0, got: %i", ret);
ret = SDL_RenderFillRect(renderer, &rect );
SDLTest_AssertCheck(ret == 0, "Validate result from SDL_RenderFillRect, expected: 0, got: %i", ret);
rect.x = 30;
rect.y = 40;
rect.w = 45;
rect.h = 15;
ret = SDL_SetRenderDrawColor(renderer, 10, 240, 10, 100 );
SDLTest_AssertCheck(ret == 0, "Validate result from SDL_SetRenderDrawColor, expected: 0, got: %i", ret);
ret = SDL_SetRenderDrawBlendMode(renderer, SDL_BLENDMODE_BLEND );
SDLTest_AssertCheck(ret == 0, "Validate result from SDL_SetRenderDrawBlendMode, expected: 0, got: %i", ret);
ret = SDL_RenderFillRect(renderer, &rect );
SDLTest_AssertCheck(ret == 0, "Validate result from SDL_RenderFillRect, expected: 0, got: %i", ret);
rect.x = 25;
rect.y = 25;
rect.w = 25;
rect.h = 25;
ret = SDL_SetRenderDrawColor(renderer, 10, 10, 240, 125 );
SDLTest_AssertCheck(ret == 0, "Validate result from SDL_SetRenderDrawColor, expected: 0, got: %i", ret);
ret = SDL_SetRenderDrawBlendMode(renderer, SDL_BLENDMODE_NONE );
SDLTest_AssertCheck(ret == 0, "Validate result from SDL_SetRenderDrawBlendMode, expected: 0, got: %i", ret);
ret = SDL_RenderFillRect(renderer, &rect );
SDLTest_AssertCheck(ret == 0, "Validate result from SDL_RenderFillRect, expected: 0, got: %i", ret);
/* Draw blended lines, lines for everyone. */
checkFailCount1 = 0;
checkFailCount2 = 0;
checkFailCount3 = 0;
for (i=0; i<TESTRENDER_SCREEN_W; i+=2) {
ret = SDL_SetRenderDrawColor(renderer, 60+2*i, 240-2*i, 50, 3*i );
if (ret != 0) checkFailCount1++;
ret = SDL_SetRenderDrawBlendMode(renderer,(((i/2)%3)==0) ? SDL_BLENDMODE_BLEND :
(((i/2)%3)==1) ? SDL_BLENDMODE_ADD : SDL_BLENDMODE_NONE );
if (ret != 0) checkFailCount2++;
ret = SDL_RenderDrawLine(renderer, 0, 0, i, 59 );
if (ret != 0) checkFailCount3++;
}
SDLTest_AssertCheck(checkFailCount1 == 0, "Validate results from calls to SDL_SetRenderDrawColor, expected: 0, got: %i", checkFailCount1);
SDLTest_AssertCheck(checkFailCount2 == 0, "Validate results from calls to SDL_SetRenderDrawBlendMode, expected: 0, got: %i", checkFailCount2);
SDLTest_AssertCheck(checkFailCount3 == 0, "Validate results from calls to SDL_RenderDrawLine, expected: 0, got: %i", checkFailCount3);
checkFailCount1 = 0;
checkFailCount2 = 0;
checkFailCount3 = 0;
for (i=0; i<TESTRENDER_SCREEN_H; i+=2) {
ret = SDL_SetRenderDrawColor(renderer, 60+2*i, 240-2*i, 50, 3*i );
if (ret != 0) checkFailCount1++;
ret = SDL_SetRenderDrawBlendMode(renderer,(((i/2)%3)==0) ? SDL_BLENDMODE_BLEND :
(((i/2)%3)==1) ? SDL_BLENDMODE_ADD : SDL_BLENDMODE_NONE );
if (ret != 0) checkFailCount2++;
ret = SDL_RenderDrawLine(renderer, 0, 0, 79, i );
if (ret != 0) checkFailCount3++;
}
SDLTest_AssertCheck(checkFailCount1 == 0, "Validate results from calls to SDL_SetRenderDrawColor, expected: 0, got: %i", checkFailCount1);
SDLTest_AssertCheck(checkFailCount2 == 0, "Validate results from calls to SDL_SetRenderDrawBlendMode, expected: 0, got: %i", checkFailCount2);
SDLTest_AssertCheck(checkFailCount3 == 0, "Validate results from calls to SDL_RenderDrawLine, expected: 0, got: %i", checkFailCount3);
/* Draw points. */
checkFailCount1 = 0;
checkFailCount2 = 0;
checkFailCount3 = 0;
for (j=0; j<TESTRENDER_SCREEN_H; j+=3) {
for (i=0; i<TESTRENDER_SCREEN_W; i+=3) {
ret = SDL_SetRenderDrawColor(renderer, j*4, i*3, j*4, i*3 );
if (ret != 0) checkFailCount1++;
ret = SDL_SetRenderDrawBlendMode(renderer, ((((i+j)/3)%3)==0) ? SDL_BLENDMODE_BLEND :
((((i+j)/3)%3)==1) ? SDL_BLENDMODE_ADD : SDL_BLENDMODE_NONE );
if (ret != 0) checkFailCount2++;
ret = SDL_RenderDrawPoint(renderer, i, j );
if (ret != 0) checkFailCount3++;
}
}
SDLTest_AssertCheck(checkFailCount1 == 0, "Validate results from calls to SDL_SetRenderDrawColor, expected: 0, got: %i", checkFailCount1);
SDLTest_AssertCheck(checkFailCount2 == 0, "Validate results from calls to SDL_SetRenderDrawBlendMode, expected: 0, got: %i", checkFailCount2);
SDLTest_AssertCheck(checkFailCount3 == 0, "Validate results from calls to SDL_RenderDrawPoint, expected: 0, got: %i", checkFailCount3);
/* Make current */
SDL_RenderPresent(renderer);
/* See if it's the same. */
referenceSurface = SDLTest_ImagePrimitivesBlend();
_compare(referenceSurface, ALLOWABLE_ERROR_BLENDED );
/* Clean up. */
SDL_FreeSurface(referenceSurface);
referenceSurface = NULL;
return TEST_COMPLETED;
}
SDL_RenderDrawPoint
#define SDL_RenderDrawPoint
Definition: SDL_dynapi_overrides.h:341
SDL_BLENDMODE_NONE
Definition: SDL_blendmode.h:42
rect
SDL_Rect rect
Definition: testrelative.c:27
SDL_RenderFillRect
#define SDL_RenderFillRect
Definition: SDL_dynapi_overrides.h:347
SDL_Surface
A collection of pixels used in software blitting.
Definition: SDL_surface.h:69
_compare
static void _compare(SDL_Surface *reference, int allowable_error)
Compares screen pixels with image pixels. Helper function.
Definition: testautomation_render.c:992
SDL_SetRenderDrawBlendMode
#define SDL_SetRenderDrawBlendMode
Definition: SDL_dynapi_overrides.h:338
renderer
SDL_Renderer * renderer
Definition: testautomation_render.c:27
SDLTest_ImagePrimitivesBlend
SDL_Surface * SDLTest_ImagePrimitivesBlend()
Returns the PrimitivesBlend test image as SDL_Surface.
Definition: SDL_test_imagePrimitivesBlend.c:673
SDLTest_AssertCheck
int SDLTest_AssertCheck(int assertCondition, SDL_PRINTF_FORMAT_STRING const char *assertDescription,...) SDL_PRINTF_VARARG_FUNC(2)
Assert for test cases that logs but does not break execution flow on failures. Updates assertion coun...
Definition: SDL_test_assert.c:65
SDL_FreeSurface
#define SDL_FreeSurface
Definition: SDL_dynapi_overrides.h:450
SDL_Rect::x
int x
Definition: SDL_rect.h:66
TEST_COMPLETED
#define TEST_COMPLETED
Definition: SDL_test_harness.h:53
SDL_Rect::w
int w
Definition: SDL_rect.h:67
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:42
NULL
#define NULL
Definition: begin_code.h:143
ALLOWABLE_ERROR_BLENDED
#define ALLOWABLE_ERROR_BLENDED
Definition: testautomation_render.c:23
_hasDrawColor
static int _hasDrawColor(void)
Test to see if we can vary the draw color. Helper function.
Definition: testautomation_render.c:786
_hasBlendModes
static int _hasBlendModes(void)
Test to see if we can vary the blend mode. Helper function.
Definition: testautomation_render.c:824
SDL_Rect::h
int h
Definition: SDL_rect.h:67
SDL_BLENDMODE_ADD
Definition: SDL_blendmode.h:47
TESTRENDER_SCREEN_W
#define TESTRENDER_SCREEN_W
Definition: testautomation_render.c:13
_clearScreen
static int _clearScreen(void)
Clears the screen. Helper function.
Definition: testautomation_render.c:1036
SDL_SetRenderDrawColor
#define SDL_SetRenderDrawColor
Definition: SDL_dynapi_overrides.h:336
TESTRENDER_SCREEN_H
#define TESTRENDER_SCREEN_H
Definition: testautomation_render.c:14
SDL_RenderDrawLine
#define SDL_RenderDrawLine
Definition: SDL_dynapi_overrides.h:343
referenceSurface
static SDL_Surface * referenceSurface
Definition: testautomation_surface.c:27
SDL_Rect::y
int y
Definition: SDL_rect.h:66
SDL_Rect
A rectangle, with the origin at the upper left.
Definition: SDL_rect.h:64
SDL_RenderPresent
#define SDL_RenderPresent
Definition: SDL_dynapi_overrides.h:352
SDL_BLENDMODE_BLEND
Definition: SDL_blendmode.h:44
j
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int int in j)
Definition: SDL_x11sym.h:42

## Variable Documentation

SDL_Renderer* renderer = NULL

Definition at line 27 of file testautomation_render.c.

Referenced by IsSDLWindowEventPending(), LoadSprite(), loop(), main(), Redraw(), SDL_CreateRenderer(), SDL_CreateSoftwareRenderer(), SDL_CreateTexture(), SDL_CreateWindowTexture(), SDL_DestroyTexture(), SDL_GL_BindTexture(), SDL_GL_UnbindTexture(), SDL_LockTexture(), SDL_RendererEventWatch(), SDL_SetTextureAlphaMod(), SDL_SetTextureBlendMode(), SDL_SetTextureColorMod(), SDL_UnlockTexture(), SDL_UpdateTexture(), SDL_UpdateYUVTexture(), and SW_CreateRendererForSurface().

const SDLTest_TestCaseReference renderTest1

static

Initial value:
=
{ (SDLTest_TestCaseFp)render_testGetNumRenderDrivers, "render_testGetNumRenderDrivers", "Tests call to SDL_GetNumRenderDrivers", TEST_ENABLED }
render_testGetNumRenderDrivers
int render_testGetNumRenderDrivers(void *arg)
Tests call to SDL_GetNumRenderDrivers.
Definition: testautomation_render.c:89
SDLTest_TestCaseFp
int(* SDLTest_TestCaseFp)(void *arg)
Definition: SDL_test_harness.h:67
TEST_ENABLED
#define TEST_ENABLED
Definition: SDL_test_harness.h:47

Definition at line 1064 of file testautomation_render.c.

const SDLTest_TestCaseReference renderTest2

static

Initial value:
=
{ (SDLTest_TestCaseFp)render_testPrimitives, "render_testPrimitives", "Tests rendering primitives", TEST_ENABLED }
render_testPrimitives
int render_testPrimitives(void *arg)
Tests the SDL primitives for rendering.
Definition: testautomation_render.c:107
SDLTest_TestCaseFp
int(* SDLTest_TestCaseFp)(void *arg)
Definition: SDL_test_harness.h:67
TEST_ENABLED
#define TEST_ENABLED
Definition: SDL_test_harness.h:47

Definition at line 1067 of file testautomation_render.c.

const SDLTest_TestCaseReference renderTest3

static

Initial value:
=
{ (SDLTest_TestCaseFp)render_testPrimitivesBlend, "render_testPrimitivesBlend", "Tests rendering primitives with blending", TEST_DISABLED }
SDLTest_TestCaseFp
int(* SDLTest_TestCaseFp)(void *arg)
Definition: SDL_test_harness.h:67
TEST_DISABLED
#define TEST_DISABLED
Definition: SDL_test_harness.h:48
render_testPrimitivesBlend
int render_testPrimitivesBlend(void *arg)
Tests the SDL primitives with alpha for rendering.
Definition: testautomation_render.c:213

Definition at line 1071 of file testautomation_render.c.

const SDLTest_TestCaseReference renderTest4

static

Initial value:
=
{ (SDLTest_TestCaseFp)render_testBlit, "render_testBlit", "Tests blitting", TEST_ENABLED }
SDLTest_TestCaseFp
int(* SDLTest_TestCaseFp)(void *arg)
Definition: SDL_test_harness.h:67
render_testBlit
int render_testBlit(void *arg)
Tests some blitting routines.
Definition: testautomation_render.c:362
TEST_ENABLED
#define TEST_ENABLED
Definition: SDL_test_harness.h:47

Definition at line 1074 of file testautomation_render.c.

const SDLTest_TestCaseReference renderTest5

static

Initial value:
=
{ (SDLTest_TestCaseFp)render_testBlitColor, "render_testBlitColor", "Tests blitting with color", TEST_ENABLED }
SDLTest_TestCaseFp
int(* SDLTest_TestCaseFp)(void *arg)
Definition: SDL_test_harness.h:67
TEST_ENABLED
#define TEST_ENABLED
Definition: SDL_test_harness.h:47
render_testBlitColor
int render_testBlitColor(void *arg)
Blits doing color tests.
Definition: testautomation_render.c:432

Definition at line 1077 of file testautomation_render.c.

const SDLTest_TestCaseReference renderTest6

static

Initial value:
=
{ (SDLTest_TestCaseFp)render_testBlitAlpha, "render_testBlitAlpha", "Tests blitting with alpha", TEST_DISABLED }
SDLTest_TestCaseFp
int(* SDLTest_TestCaseFp)(void *arg)
Definition: SDL_test_harness.h:67
TEST_DISABLED
#define TEST_DISABLED
Definition: SDL_test_harness.h:48
render_testBlitAlpha
int render_testBlitAlpha(void *arg)
Tests blitting with alpha.
Definition: testautomation_render.c:506

Definition at line 1081 of file testautomation_render.c.

const SDLTest_TestCaseReference renderTest7

static

Initial value:
=
{ (SDLTest_TestCaseFp)render_testBlitBlend, "render_testBlitBlend", "Tests blitting with blending", TEST_DISABLED }
SDLTest_TestCaseFp
int(* SDLTest_TestCaseFp)(void *arg)
Definition: SDL_test_harness.h:67
TEST_DISABLED
#define TEST_DISABLED
Definition: SDL_test_harness.h:48
render_testBlitBlend
int render_testBlitBlend(void *arg)
Tests some more blitting routines.
Definition: testautomation_render.c:635

Definition at line 1085 of file testautomation_render.c.

const SDLTest_TestCaseReference* renderTests[]

static

Initial value:
= {
&renderTest1, &renderTest2, &renderTest3, &renderTest4, &renderTest5, &renderTest6, &renderTest7, NULL
}
renderTest2
static const SDLTest_TestCaseReference renderTest2
Definition: testautomation_render.c:1067
renderTest3
static const SDLTest_TestCaseReference renderTest3
Definition: testautomation_render.c:1071
renderTest1
static const SDLTest_TestCaseReference renderTest1
Definition: testautomation_render.c:1064
renderTest7
static const SDLTest_TestCaseReference renderTest7
Definition: testautomation_render.c:1085
NULL
#define NULL
Definition: begin_code.h:143
renderTest6
static const SDLTest_TestCaseReference renderTest6
Definition: testautomation_render.c:1081
renderTest5
static const SDLTest_TestCaseReference renderTest5
Definition: testautomation_render.c:1077
renderTest4
static const SDLTest_TestCaseReference renderTest4
Definition: testautomation_render.c:1074

Definition at line 1089 of file testautomation_render.c.

SDLTest_TestSuiteReference renderTestSuite

Initial value:
= {
"Render",
InitCreateRenderer,
renderTests,
CleanupDestroyRenderer
}
CleanupDestroyRenderer
void CleanupDestroyRenderer(void *arg)
Definition: testautomation_render.c:66
InitCreateRenderer
void InitCreateRenderer(void *arg)
Definition: testautomation_render.c:43
renderTests
static const SDLTest_TestCaseReference * renderTests[]
Definition: testautomation_render.c:1089

Definition at line 1094 of file testautomation_render.c.

SDL_Window* window = NULL

Definition at line 26 of file testautomation_render.c.

Referenced by _createMouseSuiteTestWindow(), _createVideoSuiteTestWindow(), FullscreenTo(), keyboard_getKeyboardFocus(), loop(), main(), mouse_getMouseFocus(), mouse_warpMouseInWindow(), SDL_CreateRenderer(), SDL_CreateWindow(), SDL_CreateWindowFrom(), SDL_GetFocusWindow(), SDL_GetWindowFromID(), SDL_GL_CreateContext(), SDL_GL_MakeCurrent(), SDL_PromptAssertion(), SDL_RendererEventWatch(), SDL_RestoreMousePosition(), SDL_SetKeyboardFocus(), SDL_SetMouseFocus(), SDL_ShowSimpleMessageBox(), SDL_StartTextInput(), SDL_StopTextInput(), SDL_UpdateWindowGrab(), SDLTest_CommonEvent(), ShouldUseTextureFramebuffer(), SW_RenderPresent(), syswm_getWindowWMInfo(), video_createWindowVariousFlags(), video_createWindowVariousPositions(), video_createWindowVariousSizes(), video_getSetWindowData(), video_getSetWindowGrab(), video_getSetWindowMaximumSize(), video_getSetWindowMinimumSize(), video_getSetWindowPosition(), video_getSetWindowSize(), video_getWindowBrightness(), video_getWindowDisplayMode(), video_getWindowDisplayModeNegative(), video_getWindowFlags(), video_getWindowGammaRamp(), video_getWindowId(), video_getWindowPixelFormat(), WatchGameController(), WatchJoystick(), and WINRT_ProcessWindowSizeChange().