Go to the documentation of this file.
24 #include "SDL_config.h"
30 "[--video driver]",
"[--renderer driver]",
"[--gldebug]",
31 "[--info all|video|modes|render|event]",
32 "[--log all|error|system|audio|video|render|input]",
"[--display N]",
33 "[--fullscreen | --fullscreen-desktop | --windows N]",
"[--title title]",
34 "[--icon icon.bmp]",
"[--center | --position X,Y]",
"[--geometry WxH]",
35 "[--min-geometry WxH]",
"[--max-geometry WxH]",
"[--logical WxH]",
36 "[--scale N]",
"[--depth N]",
"[--refresh R]",
"[--vsync]",
"[--noframe]",
37 "[--resize]",
"[--minimize]",
"[--maximize]",
"[--grab]",
38 "[--allow-highdpi]",
"[--usable-bounds]"
42 "[--rate N]",
"[--format U8|S8|U16|U16LE|U16BE|S16|S16LE|S16BE]",
43 "[--channels N]",
"[--samples N]"
65 for (
i = 1; argv[
i]; ++
i) {
81 state->window_title = argv[0];
82 state->window_flags = 0;
87 state->num_windows = 1;
88 state->audiospec.freq = 22050;
90 state->audiospec.channels = 2;
91 state->audiospec.samples = 2048;
94 state->gl_red_size = 3;
95 state->gl_green_size = 3;
96 state->gl_blue_size = 2;
97 state->gl_alpha_size = 0;
98 state->gl_buffer_size = 0;
99 state->gl_depth_size = 16;
100 state->gl_stencil_size = 0;
101 state->gl_double_buffer = 1;
102 state->gl_accum_red_size = 0;
103 state->gl_accum_green_size = 0;
104 state->gl_accum_blue_size = 0;
105 state->gl_accum_alpha_size = 0;
106 state->gl_stereo = 0;
107 state->gl_multisamplebuffers = 0;
108 state->gl_multisamplesamples = 0;
109 state->gl_retained_backing = 1;
110 state->gl_accelerated = -1;
119 char **argv =
state->argv;
223 state->num_windows = 1;
228 state->num_windows = 1;
274 while (*
y && *
y !=
',') {
288 state->window_x = -1;
289 state->window_y = -1;
290 state->window_w = -1;
291 state->window_h = -1;
302 while (*
h && *
h !=
'x') {
321 while (*
h && *
h !=
'x') {
340 while (*
h && *
h !=
'x') {
359 while (*
h && *
h !=
'x') {
503 SDL_Log(
" %s",
"[--trackmem]");
518 for (
i = 0; options[
i] !=
NULL;
i++) {
525 BuildCommonUsageString(
char **pstr,
const char **strlist,
const int numitems,
const char **strlist2,
const int numitems2)
531 for (
i = 0;
i < numitems;
i++) {
535 for (
i = 0;
i < numitems2;
i++) {
544 for (
i = 0;
i < numitems-1;
i++) {
551 for (
i = 0;
i < numitems2-1;
i++) {
578 return "[--trackmem]";
740 for (
i = 0;
i <
sizeof(info->
flags) * 8; ++
i) {
742 if (info->
flags & flag) {
763 SDL_Log(
" Max Texture Size: %dx%d\n",
793 const int DRAGGABLE_TITLE = 32;
801 SDL_Log(
"SDL_HITTEST_RESIZE_TOPLEFT\n");
804 SDL_Log(
"SDL_HITTEST_RESIZE_BOTTOMLEFT\n");
807 SDL_Log(
"SDL_HITTEST_RESIZE_LEFT\n");
812 SDL_Log(
"SDL_HITTEST_RESIZE_TOPRIGHT\n");
815 SDL_Log(
"SDL_HITTEST_RESIZE_BOTTOMRIGHT\n");
818 SDL_Log(
"SDL_HITTEST_RESIZE_RIGHT\n");
822 SDL_Log(
"SDL_HITTEST_RESIZE_BOTTOM\n");
825 SDL_Log(
"SDL_HITTEST_RESIZE_TOP\n");
827 }
else if (area->
y < DRAGGABLE_TITLE) {
828 SDL_Log(
"SDL_HITTEST_DRAGGABLE\n");
845 SDL_Log(
"No built-in video drivers\n");
848 for (
i = 0;
i <
n; ++
i) {
858 SDL_Log(
"Couldn't initialize video driver: %s\n",
883 if (
state->gl_accelerated >= 0) {
885 state->gl_accelerated);
888 if (
state->gl_major_version) {
892 if (
state->gl_debug) {
895 if (
state->gl_profile_mask) {
905 Uint32 Rmask, Gmask, Bmask, Amask;
906 #if SDL_VIDEO_DRIVER_WINDOWS
907 int adapterIndex = 0;
911 SDL_Log(
"Number of displays: %d\n",
n);
912 for (
i = 0;
i <
n; ++
i) {
923 SDL_Log(
"Bounds: %dx%d at %d,%d\n", bounds.
w, bounds.
h, bounds.
x, bounds.
y);
924 SDL_Log(
"Usable bounds: %dx%d at %d,%d\n", usablebounds.
w, usablebounds.
h, usablebounds.
x, usablebounds.
y);
925 SDL_Log(
"DPI: %fx%f\n", hdpi, vdpi);
930 SDL_Log(
" Current mode: %dx%d@%dHz, %d bits-per-pixel (%s)\n",
933 if (Rmask || Gmask || Bmask) {
934 SDL_Log(
" Red Mask = 0x%.8x\n", Rmask);
935 SDL_Log(
" Green Mask = 0x%.8x\n", Gmask);
936 SDL_Log(
" Blue Mask = 0x%.8x\n", Bmask);
938 SDL_Log(
" Alpha Mask = 0x%.8x\n", Amask);
944 SDL_Log(
"No available fullscreen video modes\n");
946 SDL_Log(
" Fullscreen video modes:\n");
947 for (
j = 0;
j <
m; ++
j) {
950 &Gmask, &Bmask, &Amask);
951 SDL_Log(
" Mode %d: %dx%d@%dHz, %d bits-per-pixel (%s)\n",
954 if (Rmask || Gmask || Bmask) {
955 SDL_Log(
" Red Mask = 0x%.8x\n",
957 SDL_Log(
" Green Mask = 0x%.8x\n",
959 SDL_Log(
" Blue Mask = 0x%.8x\n",
962 SDL_Log(
" Alpha Mask = 0x%.8x\n",
968 #if SDL_VIDEO_DRIVER_WINDOWS
971 SDL_Log(
"D3D9 Adapter Index: %d", adapterIndex);
975 SDL_Log(
"DXGI Adapter Index: %d Output Index: %d", adapterIndex, outputIndex);
985 SDL_Log(
"No built-in render drivers\n");
987 SDL_Log(
"Built-in render drivers:\n");
988 for (
i = 0;
i <
n; ++
i) {
996 switch (
state->depth) {
1017 sizeof(*
state->windows));
1020 sizeof(*
state->renderers));
1023 sizeof(*
state->targets));
1028 for (
i = 0;
i <
state->num_windows; ++
i) {
1036 if ((
r.x == -1) && (
r.y == -1) && (
r.w == -1) && (
r.h == -1)) {
1040 if (
state->num_windows > 1) {
1042 state->window_title,
i + 1);
1048 if (!
state->windows[
i]) {
1049 SDL_Log(
"Couldn't create window: %s\n",
1053 if (
state->window_minW ||
state->window_minH) {
1056 if (
state->window_maxW ||
state->window_maxH) {
1062 printf(
"Window requested size %dx%d, got %dx%d\n",
state->window_w,
state->window_h,
w,
h);
1067 SDL_Log(
"Can't set up fullscreen display mode: %s\n",
1078 if (
state->window_icon) {
1088 if (!
state->skip_renderer
1089 && (
state->renderdriver
1092 if (
state->renderdriver) {
1095 for (
j = 0;
j <
n; ++
j) {
1104 SDL_Log(
"Couldn't find render driver named %s",
1105 state->renderdriver);
1111 if (!
state->renderers[
i]) {
1112 SDL_Log(
"Couldn't create renderer: %s\n",
1118 }
else if (
state->scale != 0.) {
1124 SDL_Log(
"Current renderer:\n");
1136 SDL_Log(
"No built-in audio drivers\n");
1139 for (
i = 0;
i <
n; ++
i) {
1149 SDL_Log(
"Couldn't initialize audio driver: %s\n",
1170 switch (orientation)
1172 #define CASE(X) case SDL_ORIENTATION_##X: return #X
1175 CASE(LANDSCAPE_FLIPPED);
1177 CASE(PORTRAIT_FLIPPED);
1179 default:
return "???";
1188 #define AXIS_CASE(ax) case SDL_CONTROLLER_AXIS_##ax: return #ax
1197 default:
return "???";
1206 #define BUTTON_CASE(btn) case SDL_CONTROLLER_BUTTON_##btn: return #btn
1224 default:
return "???";
1236 switch (
event->type) {
1238 switch (
event->display.event) {
1243 SDL_Log(
"SDL EVENT: Display %d got unknown event 0x%4.4x",
1244 event->display.display,
event->display.event);
1249 switch (
event->window.event) {
1251 SDL_Log(
"SDL EVENT: Window %d shown",
event->window.windowID);
1254 SDL_Log(
"SDL EVENT: Window %d hidden",
event->window.windowID);
1257 SDL_Log(
"SDL EVENT: Window %d exposed",
event->window.windowID);
1260 SDL_Log(
"SDL EVENT: Window %d moved to %d,%d",
1262 event->window.data2);
1265 SDL_Log(
"SDL EVENT: Window %d resized to %dx%d",
1267 event->window.data2);
1270 SDL_Log(
"SDL EVENT: Window %d changed size to %dx%d",
1272 event->window.data2);
1275 SDL_Log(
"SDL EVENT: Window %d minimized",
event->window.windowID);
1278 SDL_Log(
"SDL EVENT: Window %d maximized",
event->window.windowID);
1281 SDL_Log(
"SDL EVENT: Window %d restored",
event->window.windowID);
1284 SDL_Log(
"SDL EVENT: Mouse entered window %d",
1285 event->window.windowID);
1288 SDL_Log(
"SDL EVENT: Mouse left window %d",
event->window.windowID);
1291 SDL_Log(
"SDL EVENT: Window %d gained keyboard focus",
1292 event->window.windowID);
1295 SDL_Log(
"SDL EVENT: Window %d lost keyboard focus",
1296 event->window.windowID);
1299 SDL_Log(
"SDL EVENT: Window %d closed",
event->window.windowID);
1302 SDL_Log(
"SDL EVENT: Window %d take focus",
event->window.windowID);
1305 SDL_Log(
"SDL EVENT: Window %d hit test",
event->window.windowID);
1308 SDL_Log(
"SDL EVENT: Window %d got unknown event 0x%4.4x",
1309 event->window.windowID,
event->window.event);
1314 SDL_Log(
"SDL EVENT: Keyboard: key pressed in window %d: scancode 0x%08X = %s, keycode 0x%08X = %s",
1315 event->key.windowID,
1316 event->key.keysym.scancode,
1321 SDL_Log(
"SDL EVENT: Keyboard: key released in window %d: scancode 0x%08X = %s, keycode 0x%08X = %s",
1322 event->key.windowID,
1323 event->key.keysym.scancode,
1328 SDL_Log(
"SDL EVENT: Keyboard: text editing \"%s\" in window %d",
1332 SDL_Log(
"SDL EVENT: Keyboard: text input \"%s\" in window %d",
1336 SDL_Log(
"SDL EVENT: Keymap changed");
1339 SDL_Log(
"SDL EVENT: Mouse: moved to %d,%d (%d,%d) in window %d",
1342 event->motion.windowID);
1345 SDL_Log(
"SDL EVENT: Mouse: button %d pressed at %d,%d with click count %d in window %d",
1347 event->button.windowID);
1350 SDL_Log(
"SDL EVENT: Mouse: button %d released at %d,%d with click count %d in window %d",
1352 event->button.windowID);
1355 SDL_Log(
"SDL EVENT: Mouse: wheel scrolled %d in x and %d in y (reversed: %d) in window %d",
1359 SDL_Log(
"SDL EVENT: Joystick index %d attached",
1360 event->jdevice.which);
1363 SDL_Log(
"SDL EVENT: Joystick %d removed",
1364 event->jdevice.which);
1367 SDL_Log(
"SDL EVENT: Joystick %d: ball %d moved by %d,%d",
1373 const char *position =
"UNKNOWN";
1374 switch (
event->jhat.value) {
1376 position =
"CENTER";
1382 position =
"RIGHTUP";
1388 position =
"RIGHTDOWN";
1394 position =
"LEFTDOWN";
1400 position =
"LEFTUP";
1403 SDL_Log(
"SDL EVENT: Joystick %d: hat %d moved to %s",
event->jhat.which,
1404 event->jhat.hat, position);
1408 SDL_Log(
"SDL EVENT: Joystick %d: button %d pressed",
1409 event->jbutton.which,
event->jbutton.button);
1412 SDL_Log(
"SDL EVENT: Joystick %d: button %d released",
1413 event->jbutton.which,
event->jbutton.button);
1416 SDL_Log(
"SDL EVENT: Controller index %d attached",
1417 event->cdevice.which);
1420 SDL_Log(
"SDL EVENT: Controller %d removed",
1421 event->cdevice.which);
1424 SDL_Log(
"SDL EVENT: Controller %d axis %d ('%s') value: %d",
1428 event->caxis.value);
1431 SDL_Log(
"SDL EVENT: Controller %d button %d ('%s') down",
1436 SDL_Log(
"SDL EVENT: Controller %d button %d ('%s') up",
1441 SDL_Log(
"SDL EVENT: Clipboard updated");
1445 SDL_Log(
"SDL EVENT: Finger: motion touch=%ld, finger=%ld, x=%f, y=%f, dx=%f, dy=%f, pressure=%f",
1446 (
long)
event->tfinger.touchId,
1447 (
long)
event->tfinger.fingerId,
1453 SDL_Log(
"SDL EVENT: Finger: %s touch=%ld, finger=%ld, x=%f, y=%f, dx=%f, dy=%f, pressure=%f",
1455 (
long)
event->tfinger.touchId,
1456 (
long)
event->tfinger.fingerId,
1461 SDL_Log(
"SDL_EVENT: Dollar gesture detect: %ld", (
long)
event->dgesture.gestureId);
1464 SDL_Log(
"SDL_EVENT: Dollar gesture record: %ld", (
long)
event->dgesture.gestureId);
1467 SDL_Log(
"SDL_EVENT: Multi gesture fingers: %d",
event->mgesture.numFingers);
1471 SDL_Log(
"SDL EVENT: render device reset");
1474 SDL_Log(
"SDL EVENT: render targets reset");
1478 SDL_Log(
"SDL EVENT: App terminating");
1481 SDL_Log(
"SDL EVENT: App running low on memory");
1484 SDL_Log(
"SDL EVENT: App will enter the background");
1487 SDL_Log(
"SDL EVENT: App entered the background");
1490 SDL_Log(
"SDL EVENT: App will enter the foreground");
1493 SDL_Log(
"SDL EVENT: App entered the foreground");
1496 SDL_Log(
"SDL EVENT: Drag and drop beginning");
1499 SDL_Log(
"SDL EVENT: Drag and drop file: '%s'",
event->drop.file);
1502 SDL_Log(
"SDL EVENT: Drag and drop text: '%s'",
event->drop.file);
1505 SDL_Log(
"SDL EVENT: Drag and drop ending");
1508 SDL_Log(
"SDL EVENT: Quit requested");
1532 0x00FF0000, 0x0000FF00, 0x000000FF,
1534 0x000000FF, 0x0000FF00, 0x00FF0000,
1588 switch (
event->type) {
1590 switch (
event->window.event) {
1595 for (
i = 0;
i <
state->num_windows; ++
i) {
1601 if (
state->renderers[
i]) {
1620 switch (
event->key.keysym.sym) {
1625 for (
i = 0;
i <
state->num_windows; ++
i) {
1666 if (currentIndex >= 0 && numDisplays >= 1) {
1669 dest = (currentIndex + numDisplays - 1) % numDisplays;
1671 dest = (currentIndex + numDisplays + 1) % numDisplays;
1673 SDL_Log(
"Centering on display %d\n", dest);
1684 const int delta = 100;
1693 SDL_Log(
"Setting position to (%d, %d)\n",
x,
y);
1720 printf(
"Copied text to clipboard\n");
1724 for (
i = 0;
i <
state->num_windows; ++
i) {
1726 if (
state->renderers[
i]) {
1747 SDL_Log(
"%sapturing mouse %s!\n", shouldCapture ?
"C" :
"Unc", (rc == 0) ?
"succeeded" :
"failed");
1756 printf(
"Clipboard: %s\n",
text);
1758 printf(
"Clipboard is empty\n");
1813 }
else if (withAlt) {
1824 }
else if (withShift) {
1854 SDL_Log(
"ABSOLUTE MOUSE: (%d, %d)%s%s%s%s%s\n",
x,
y,
1899 lastEvent =
event->motion;
1922 if (
state->targets) {
1923 for (
i = 0;
i <
state->num_windows; ++
i) {
1930 if (
state->renderers) {
1931 for (
i = 0;
i <
state->num_windows; ++
i) {
1932 if (
state->renderers[
i]) {
SDL_bool SDLTest_CommonDefaultArgs(SDLTest_CommonState *state, const int argc, char **argv)
Easy argument handling when test app doesn't need any custom args.
@ SDL_WINDOW_MOUSE_CAPTURE
#define SDL_GetWindowDisplayIndex
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
@ SDL_CONTROLLERDEVICEREMOVED
@ SDL_PIXELFORMAT_ARGB1555
#define SDL_SetClipboardText
#define SDL_GetPixelFormatName
@ SDL_WINDOW_ALLOW_HIGHDPI
SDL_bool SDL_DXGIGetOutputInfo(int displayIndex, int *adapterIndex, int *outputIndex)
Returns the DXGI Adapter and Output indices for the specified display index.
@ SDL_GL_RETAINED_BACKING
#define SDL_SetWindowMinimumSize
Mouse motion event structure (event.motion.*)
@ SDL_APP_DIDENTERBACKGROUND
@ SDL_APP_DIDENTERFOREGROUND
A collection of pixels used in software blitting.
@ SDL_DISPLAYEVENT_ORIENTATION
#define SDL_WINDOWPOS_CENTERED
#define SDL_PRINTF_FORMAT_STRING
@ SDL_PIXELFORMAT_INDEX1LSB
#define SDL_GetNumVideoDrivers
#define SDL_SetWindowSize
#define SDL_RenderGetClipRect
GLboolean GLboolean GLboolean b
set set set set set set set macro pixldst1 abits if abits op else op endif endm macro pixldst2 abits if abits op else op endif endm macro pixldst4 abits if abits op else op endif endm macro pixldst0 abits op endm macro pixldst3 mem_operand op endm macro pixldst30 mem_operand op endm macro pixldst abits if abits elseif abits elseif abits elseif abits elseif abits pixldst0 abits else pixldst0 abits pixldst0 abits pixldst0 abits pixldst0 abits endif elseif abits else pixldst0 abits pixldst0 abits endif elseif abits else error unsupported bpp *numpix else pixst endif endm macro pixld1_s mem_operand if asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl elseif asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl else error unsupported endif endm macro pixld2_s mem_operand if mov asr add asl add asl mov asr sub UNIT_X add asl mov asr add asl add asl mov asr add UNIT_X add asl else pixld1_s mem_operand pixld1_s mem_operand endif endm macro pixld0_s mem_operand if asr adds SRC_WIDTH_FIXED bpl add asl elseif asr adds SRC_WIDTH_FIXED bpl add asl endif endm macro pixld_s_internal mem_operand if mem_operand pixld2_s mem_operand pixdeinterleave basereg elseif mem_operand elseif mem_operand elseif mem_operand elseif mem_operand pixld0_s mem_operand else pixld0_s mem_operand pixld0_s mem_operand pixld0_s mem_operand pixld0_s mem_operand endif elseif mem_operand else pixld0_s mem_operand pixld0_s mem_operand endif elseif mem_operand else error unsupported mem_operand if bpp mem_operand endif endm macro vuzp8 reg2 vuzp d d ®2 endm macro vzip8 reg2 vzip d d ®2 endm macro pixdeinterleave basereg basereg basereg basereg basereg endif endm macro pixinterleave basereg basereg basereg basereg basereg endif endm macro PF boost_increment endif if endif PF tst PF addne PF subne PF cmp ORIG_W if endif if endif if endif PF subge ORIG_W PF subges if endif if endif if endif endif endm macro cache_preload_simple endif if dst_r_bpp pld[DST_R, #(PREFETCH_DISTANCE_SIMPLE *dst_r_bpp/8)] endif if mask_bpp pld endif[MASK, #(PREFETCH_DISTANCE_SIMPLE *mask_bpp/8)] endif endif endm macro fetch_mask_pixblock pixld mask_basereg pixblock_size MASK endm macro ensure_destination_ptr_alignment process_pixblock_tail_head if beq irp skip1 beq endif SRC MASK if dst_r_bpp DST_R else add endif PF add sub src_basereg pixdeinterleave mask_basereg pixdeinterleave dst_r_basereg process_pixblock_head pixblock_size cache_preload_simple process_pixblock_tail pixinterleave dst_w_basereg irp beq endif process_pixblock_tail_head tst beq irp if pixblock_size chunk_size tst beq pixld_src SRC pixld MASK if DST_R else pixld DST_R endif if
GLuint GLsizei const GLchar * message
@ SDL_WINDOWEVENT_FOCUS_LOST
#define SDL_GetNumRenderDrivers
#define SDL_GetDisplayMode
void SDLTest_CommonLogUsage(SDLTest_CommonState *state, const char *argv0, const char **options)
Logs command line usage info.
@ SDL_GL_ACCELERATED_VISUAL
#define SDL_SetWindowDisplayMode
#define SDL_GetDisplayName
@ SDL_CONTROLLERBUTTONDOWN
static void SDL_snprintfcat(SDL_OUT_Z_CAP(maxlen) char *text, size_t maxlen, SDL_PRINTF_FORMAT_STRING const char *fmt,...)
#define SDL_SetWindowFullscreen
@ SDL_GL_MULTISAMPLEBUFFERS
GLuint GLuint GLsizei count
#define SDL_GetWindowFlags
static void SDLTest_ScreenShot(SDL_Renderer *renderer)
GLdouble GLdouble GLdouble r
@ SDL_WINDOWEVENT_RESIZED
#define SDL_BUTTON_X2MASK
@ SDL_WINDOW_FULLSCREEN_DESKTOP
#define SDL_WINDOWPOS_UNDEFINED
#define SDL_GetDesktopDisplayMode
SDL_FORCE_INLINE SDL_bool SDL_RectEmpty(const SDL_Rect *r)
Returns true if the rectangle has no area.
@ SDL_GL_ACCUM_GREEN_SIZE
@ SDL_HITTEST_RESIZE_TOPLEFT
#define SDL_WINDOWPOS_ISCENTERED(X)
int SDLTest_CommonArg(SDLTest_CommonState *state, int index)
Process one common argument.
#define SDL_GetDisplayUsableBounds
@ SDL_GL_CONTEXT_MINOR_VERSION
GLfloat GLfloat GLfloat GLfloat h
GLuint GLsizei GLsizei * length
@ SDL_CONTROLLERDEVICEADDED
#define SDL_SetWindowIcon
#define SDL_GetNumVideoDisplays
static void SDLTest_PrintRendererFlag(char *text, size_t maxlen, Uint32 flag)
Information on the capabilities of a render driver or context.
@ SDL_APP_WILLENTERFOREGROUND
@ SDL_CONTROLLERAXISMOTION
static const char * video_usage[]
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
@ SDL_RENDER_TARGETS_RESET
#define SDL_SetRelativeMouseMode
The type used to identify a window.
#define SDL_GetRenderDriverInfo
The structure that defines a display mode.
#define SDL_GetKeyboardFocus
static const char * ControllerButtonName(const SDL_GameControllerButton button)
static SDL_Surface * SDLTest_LoadIcon(const char *file)
#define SDL_GetWindowSize
#define SDL_MinimizeWindow
static void SDLTest_PrintPixelFormat(char *text, size_t maxlen, Uint32 format)
@ SDL_GL_CONTEXT_DEBUG_FLAG
@ SDL_HITTEST_RESIZE_BOTTOMRIGHT
#define SDL_ShowSimpleMessageBox
static char * common_usage_audio
@ SDL_HITTEST_RESIZE_TOPRIGHT
#define SDL_SetWindowGrab
SDL_HitTestResult
Possible return values from the SDL_HitTest callback.
@ SDL_PIXELFORMAT_ARGB4444
void SDLTest_LogAllocations(void)
Print a log of any outstanding allocations.
@ SDL_GL_ACCUM_ALPHA_SIZE
GLint GLint GLint GLint GLint x
EGLSurface EGLNativeWindowType * window
#define SDL_GL_SetAttribute
#define SDL_GetRelativeMouseMode
@ SDL_HITTEST_RESIZE_BOTTOM
#define SDL_RenderGetViewport
static void SDLTest_PrintRenderer(SDL_RendererInfo *info)
#define SDL_GetClipboardText
#define DEFAULT_WINDOW_HEIGHT
@ SDL_RENDERER_PRESENTVSYNC
@ SDL_PIXELFORMAT_ARGB2101010
#define SDL_WINDOWPOS_UNDEFINED_DISPLAY(X)
int SDL_Direct3D9GetAdapterIndex(int displayIndex)
Returns the D3D9 adapter index that matches the specified display index.
set set set set set set set set set set set set set set set set set set set set *set set set macro pixldst op &r &cond WK op &r &cond WK op &r &cond WK else op &m &cond &ia op &r &cond WK else op &m &cond &ia elseif elseif else error unsupported base if elseif elseif else error unsupported unaligned pixldst unaligned endm macro pixst base base else pixldst base endif endm macro PF base if bpp PF set rept prefetch_distance PF set OFFSET endr endif endm macro preload_leading_step2 base if bpp ifc DST PF PF else if bpp lsl PF PF lsl PF PF lsl PF PF PF else PF lsl PF lsl PF lsl PF endif SIZE macro preload_middle scratch_holds_offset if bpp if else PF PF endif endif endif endm macro preload_trailing base if bpp if bpp *pix_per_block PF PF lsl PF PF PF PF PF else PF lsl PF X
#define DEFAULT_WINDOW_WIDTH
@ SDL_HITTEST_RESIZE_LEFT
static const char * BuildCommonUsageString(char **pstr, const char **strlist, const int numitems, const char **strlist2, const int numitems2)
@ SDL_WINDOWEVENT_EXPOSED
@ SDL_PIXELFORMAT_ABGR1555
#define SDL_PixelFormatEnumToMasks
#define SDL_GetWindowFromID
static char * common_usage_video
#define SDL_GetWindowPosition
@ SDL_WINDOWEVENT_HIT_TEST
static char text[MAX_TEXT_LENGTH]
@ SDL_WINDOW_INPUT_GRABBED
@ SDL_APP_WILLENTERBACKGROUND
@ SDL_PIXELFORMAT_ABGR4444
@ SDL_WINDOWEVENT_SIZE_CHANGED
#define SDL_RenderSetLogicalSize
@ SDL_PIXELFORMAT_ARGB8888
#define SDL_GetDisplayBounds
#define SDL_LoadBMP(file)
#define SDL_RestoreWindow
static SDL_HitTestResult SDLTest_ExampleHitTestCallback(SDL_Window *win, const SDL_Point *area, void *data)
#define SDL_BUTTON_X1MASK
#define SDL_SetWindowOpacity
@ SDL_WINDOWEVENT_MINIMIZED
#define SDL_WINDOWPOS_CENTERED_DISPLAY(X)
@ SDL_WINDOWEVENT_TAKE_FOCUS
int SDLTest_TrackAllocations(void)
Start tracking SDL memory allocations.
#define SDL_GetAudioDriver
const char * SDLTest_CommonUsage(SDLTest_CommonState *state)
Returns common usage information.
#define SDL_OutOfMemory()
#define SDL_GetCurrentAudioDriver
@ SDL_MESSAGEBOX_INFORMATION
@ SDL_GL_CONTEXT_MAJOR_VERSION
@ SDL_GL_CONTEXT_PROFILE_MASK
#define SDL_GetWindowOpacity
void SDLTest_CommonEvent(SDLTest_CommonState *state, SDL_Event *event, int *done)
Common event handler for test windows.
GLint GLint GLint GLint GLint GLint y
#define SDL_GetVideoDriver
#define SDL_RenderSetScale
set set set set set set set macro pixldst1 abits if abits op else op endif endm macro pixldst2 abits if abits op else op endif endm macro pixldst4 abits if abits op else op endif endm macro pixldst0 abits op endm macro pixldst3 mem_operand op endm macro pixldst30 mem_operand op endm macro pixldst abits if abits elseif abits elseif abits elseif abits elseif abits pixldst0 abits else pixldst0 abits pixldst0 abits pixldst0 abits pixldst0 abits endif elseif abits else pixldst0 abits pixldst0 abits endif elseif abits else error unsupported bpp
#define SDL_CreateRGBSurface
@ SDL_HITTEST_RESIZE_RIGHT
#define SDL_arraysize(array)
@ SDL_PIXELFORMAT_INDEX1MSB
#define SDL_DestroyTexture
#define SDL_GetScancodeName
static char * common_usage_videoaudio
static SDL_Renderer * renderer
#define SDL_GetWindowGrab
@ SDL_PIXELFORMAT_INDEX4LSB
#define SDL_GetCurrentVideoDriver
#define SDL_SetWindowHitTest
The structure that defines a point (integer)
#define SDL_LogSetPriority
#define SDL_SetWindowBordered
@ SDL_RENDERER_TARGETTEXTURE
@ SDL_PIXELFORMAT_RGBA8888
SDLTest_CommonState * SDLTest_CommonCreateState(char **argv, Uint32 flags)
Parse command line parameters and create common state.
A rectangle, with the origin at the upper left (integer).
@ SDL_RENDER_DEVICE_RESET
@ SDL_LOG_PRIORITY_VERBOSE
set set set set set set set set set set set set set set set set set set set set *set set set macro pixldst op &r &cond WK op &r &cond WK op &r &cond WK else op &m &cond &ia op &r &cond WK else op &m &cond &ia elseif elseif else error unsupported base if elseif elseif else error unsupported unaligned pixldst unaligned endm macro pixst base base else pixldst base endif endm macro PF base if bpp PF set rept prefetch_distance PF set OFFSET endr endif endm macro preload_leading_step2 base if bpp ifc DST PF PF else if bpp lsl PF PF lsl PF PF lsl PF PF PF else PF lsl PF lsl PF lsl PF endif SIZE macro preload_middle scratch_holds_offset if bpp if else PF PF endif endif endif endm macro preload_trailing base if bpp if bpp *pix_per_block PF PF lsl PF PF PF PF PF else PF lsl PF lsl PF PF PF PF PF base if bpp if narrow_case &&bpp<=dst_w_bpp) PF bic, WK0, base, #31 PF pld,[WK0] PF add, WK1, base, X, LSL #bpp_shift PF sub, WK1, WK1, #1 PF bic, WK1, WK1, #31 PF cmp, WK1, WK0 PF beq, 90f PF pld,[WK1]90:.else PF bic, WK0, base, #31 PF pld,[WK0] PF add, WK1, base, X, lsl #bpp_shift PF sub, WK1, WK1, #1 PF bic, WK1, WK1, #31 PF cmp, WK1, WK0 PF beq, 92f91:PF add, WK0, WK0, #32 PF cmp, WK0, WK1 PF pld,[WK0] PF bne, 91b92:.endif .endif.endm.macro conditional_process1_helper cond, process_head, process_tail, numbytes, firstreg, unaligned_src, unaligned_mask, decrementx process_head cond, numbytes, firstreg, unaligned_src, unaligned_mask, 0 .if decrementx sub &cond X, X, #8 *numbytes/dst_w_bpp .endif process_tail cond, numbytes, firstreg .if !((flags) &FLAG_PROCESS_DOES_STORE) pixst cond, numbytes, firstreg, DST .endif.endm.macro conditional_process1 cond, process_head, process_tail, numbytes, firstreg, unaligned_src, unaligned_mask, decrementx .if(flags) &FLAG_BRANCH_OVER .ifc cond, mi bpl 100f .endif .ifc cond, cs bcc 100f .endif .ifc cond, ne beq 100f .endif conditional_process1_helper, process_head, process_tail, numbytes, firstreg, unaligned_src, unaligned_mask, decrementx100:.else conditional_process1_helper cond, process_head, process_tail, numbytes, firstreg, unaligned_src, unaligned_mask, decrementx .endif.endm.macro conditional_process2 test, cond1, cond2, process_head, process_tail, numbytes1, numbytes2, firstreg1, firstreg2, unaligned_src, unaligned_mask, decrementx .if(flags) &(FLAG_DST_READWRITE|FLAG_BRANCH_OVER|FLAG_PROCESS_CORRUPTS_PSR|FLAG_PROCESS_DOES_STORE) test conditional_process1 cond1, process_head, process_tail, numbytes1, firstreg1, unaligned_src, unaligned_mask, decrementx .if(flags) &FLAG_PROCESS_CORRUPTS_PSR test .endif conditional_process1 cond2, process_head, process_tail, numbytes2, firstreg2, unaligned_src, unaligned_mask, decrementx .else test process_head cond1, numbytes1, firstreg1, unaligned_src, unaligned_mask, 0 process_head cond2, numbytes2, firstreg2, unaligned_src, unaligned_mask, 0 .if decrementx sub &cond1 X, X, #8 *numbytes1/dst_w_bpp sub &cond2 X, X, #8 *numbytes2/dst_w_bpp .endif process_tail cond1, numbytes1, firstreg1 process_tail cond2, numbytes2, firstreg2 pixst cond1, numbytes1, firstreg1, DST pixst cond2, numbytes2, firstreg2, DST .endif.endm.macro test_bits_1_0_ptr .if(flags) &FLAG_PROCESS_CORRUPTS_WK0 movs SCRATCH, X, lsl #32-1 .else movs SCRATCH, WK0, lsl #32-1 .endif.endm.macro test_bits_3_2_ptr .if(flags) &FLAG_PROCESS_CORRUPTS_WK0 movs SCRATCH, X, lsl #32-3 .else movs SCRATCH, WK0, lsl #32-3 .endif.endm.macro leading_15bytes process_head, process_tail .set DECREMENT_X, 1 .if(flags) &FLAG_PROCESS_CORRUPTS_WK0 .set DECREMENT_X, 0 sub X, X, WK0, lsr #dst_bpp_shift str X,[sp, #LINE_SAVED_REG_COUNT *4] mov X, WK0 .endif .if dst_w_bpp==8 conditional_process2 test_bits_1_0_ptr, mi, cs, process_head, process_tail, 1, 2, 1, 2, 1, 1, DECREMENT_X .elseif dst_w_bpp==16 test_bits_1_0_ptr conditional_process1 cs, process_head, process_tail, 2, 2, 1, 1, DECREMENT_X .endif conditional_process2 test_bits_3_2_ptr, mi, cs, process_head, process_tail, 4, 8, 1, 2, 1, 1, DECREMENT_X .if(flags) &FLAG_PROCESS_CORRUPTS_WK0 ldr X,[sp, #LINE_SAVED_REG_COUNT *4] .endif.endm.macro test_bits_3_2_pix movs SCRATCH, X, lsl #dst_bpp_shift+32-3.endm.macro test_bits_1_0_pix .if dst_w_bpp==8 movs SCRATCH, X, lsl #dst_bpp_shift+32-1 .else movs SCRATCH, X, lsr #1 .endif.endm.macro trailing_15bytes process_head, process_tail, unaligned_src, unaligned_mask conditional_process2 test_bits_3_2_pix, cs, mi, process_head, process_tail, 8, 4, 0, 2, unaligned_src, unaligned_mask, 0 .if dst_w_bpp==16 test_bits_1_0_pix conditional_process1 cs, process_head, process_tail, 2, 0, unaligned_src, unaligned_mask, 0 .elseif dst_w_bpp==8 conditional_process2 test_bits_1_0_pix, cs, mi, process_head, process_tail, 2, 1, 0, 1, unaligned_src, unaligned_mask, 0 .endif.endm.macro wide_case_inner_loop process_head, process_tail, unaligned_src, unaligned_mask, dst_alignment110:.set SUBBLOCK, 0 .rept pix_per_block *dst_w_bpp/128 process_head, 16, 0, unaligned_src, unaligned_mask, 1 .if(src_bpp > 0) &&(mask_bpp==0) &&((flags) &FLAG_PROCESS_PRESERVES_SCRATCH) preload_middle src_bpp, SRC, 1 .elseif(src_bpp==0) &&(mask_bpp > 0) &&((flags) &FLAG_PROCESS_PRESERVES_SCRATCH) preload_middle mask_bpp, MASK, 1 .else preload_middle src_bpp, SRC, 0 preload_middle mask_bpp, MASK, 0 .endif .if(dst_r_bpp > 0) &&((SUBBLOCK % 2)==0) &&(((flags) &FLAG_NO_PRELOAD_DST)==0) PF pld,[DST, #32 *prefetch_distance - dst_alignment] .endif process_tail, 16, 0 .if !((flags) &FLAG_PROCESS_DOES_STORE) pixst, 16, 0, DST .endif .set SUBBLOCK, SUBBLOCK+1 .endr subs X, X, #pix_per_block bhs 110b.endm.macro wide_case_inner_loop_and_trailing_pixels process_head, process_tail, process_inner_loop, exit_label, unaligned_src, unaligned_mask .if dst_r_bpp > tst bne process_inner_loop DST_PRELOAD_BIAS endif preload_trailing SRC preload_trailing MASK DST endif add medium_case_inner_loop_and_trailing_pixels unaligned_mask endm macro medium_case_inner_loop_and_trailing_pixels DST endif subs bhs tst beq exit_label trailing_15bytes unaligned_mask endm macro narrow_case_inner_loop_and_trailing_pixels unaligned_mask tst conditional_process1 trailing_15bytes unaligned_mask endm macro switch_on_alignment exit_label if bne endif if bne endif action if endif if bne endif action if endif endif endm macro end_of_line last_one if SINGLE_SCANLINE ifc b endif else if vars_spilled word LINE_SAVED_REGS endif subs Y
#define SDL_MaximizeWindow
@ SDL_PIXELFORMAT_UNKNOWN
@ SDL_LOG_CATEGORY_SYSTEM
@ SDL_PIXELFORMAT_BGRA8888
#define SDL_GetGlobalMouseState
static void SDLTest_PrintEvent(SDL_Event *event)
#define SDL_GetDisplayDPI
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)
@ SDL_PIXELFORMAT_INDEX4MSB
@ SDL_WINDOWEVENT_RESTORED
#define SDL_LogSetAllPriority
const SDL_PRINTF_FORMAT_STRING char int const SDL_PRINTF_FORMAT_STRING char int const SDL_PRINTF_FORMAT_STRING char int const SDL_PRINTF_FORMAT_STRING char const char const SDL_SCANF_FORMAT_STRING char return SDL_ThreadFunction const char void return Uint32 return Uint32 SDL_AssertionHandler void SDL_SpinLock SDL_atomic_t int int return SDL_atomic_t return void void void return void return int return SDL_AudioSpec SDL_AudioSpec return int int return return int SDL_RWops int SDL_AudioSpec Uint8 Uint32 return SDL_AudioCVT SDL_AudioFormat Uint8 int SDL_AudioFormat Uint8 int return Uint8 const Uint8 Uint32 int const char return return return return return return return return Uint32 return Uint32 SDL_Event return SDL_Event int return SDL_EventFilter void SDL_EventFilter void SDL_EventFilter void int return const char const char return SDL_JoystickGUID return int return int return SDL_GameController return int return const char return SDL_GameController SDL_GameControllerAxis return const char return SDL_GameController SDL_GameControllerButton return SDL_GameController SDL_RWops return SDL_TouchID SDL_RWops return int return int return return SDL_Joystick return SDL_Haptic SDL_Haptic return SDL_Haptic return SDL_Haptic SDL_HapticEffect return SDL_Haptic int Uint32 return SDL_Haptic int SDL_Haptic int return SDL_Haptic return SDL_Haptic return SDL_Haptic return SDL_Haptic return const char const char return const char SDL_HintCallback void int return SDL_Joystick return SDL_Joystick return const char return SDL_Joystick return SDL_Joystick return SDL_Joystick return int return SDL_Joystick int return SDL_Joystick int return return return SDL_Scancode return SDL_Scancode return SDL_Keycode return return const char return void int SDL_LogPriority SDL_LogOutputFunction void Uint32 const char const char SDL_Window return int int return SDL_Window int int return SDL_Surface int int return SDL_Cursor return int return SDL_mutex return SDL_mutex return Uint32 return SDL_sem return SDL_sem Uint32 return SDL_sem return SDL_cond SDL_cond return SDL_cond SDL_mutex Uint32 return Uint32 int Uint32 Uint32 Uint32 Uint32 return Uint32 return int return SDL_Palette const SDL_Color int int return const SDL_PixelFormat Uint8 Uint8 Uint8 return Uint32 const SDL_PixelFormat Uint8 Uint8 Uint8 float Uint16 int int return const SDL_Rect const SDL_Rect SDL_Rect return const SDL_Point int const SDL_Rect SDL_Rect return return int int Uint32 SDL_Window SDL_Renderer return SDL_Surface return SDL_Renderer SDL_RendererInfo return SDL_Renderer Uint32 int int int return SDL_Texture Uint32 int int int return SDL_Texture Uint8 Uint8 Uint8 return SDL_Texture Uint8 return SDL_Texture SDL_BlendMode return SDL_Texture const SDL_Rect const Uint8 int const Uint8 int const Uint8 int return SDL_Texture SDL_Renderer SDL_Texture return SDL_Renderer int int return SDL_Renderer const SDL_Rect return SDL_Renderer const SDL_Rect return SDL_Renderer float float return SDL_Renderer Uint8 Uint8 Uint8 Uint8 return SDL_Renderer SDL_BlendMode return SDL_Renderer return SDL_Renderer const SDL_Point int return SDL_Renderer const SDL_Point int return SDL_Renderer const SDL_Rect int return SDL_Renderer const SDL_Rect int return SDL_Renderer SDL_Texture const SDL_Rect const SDL_Rect const double const SDL_Point const SDL_RendererFlip return SDL_Renderer SDL_Renderer SDL_Texture return void int return return SDL_RWops return SDL_RWops return SDL_RWops return SDL_RWops return SDL_RWops Uint16 return SDL_RWops Uint32 return SDL_RWops Uint64 return const char unsigned int unsigned int unsigned int unsigned int Uint32 return SDL_Window SDL_Surface SDL_WindowShapeMode return size_t return void size_t return const char return void size_t size_t int(*) int return int return int size_t return size_t return const wchar_t return const wchar_t size_t retur SDL_OUT_Z_CAP)(c) char *a
@ SDL_RENDERER_ACCELERATED
Uint32 texture_formats[16]
#define SDL_CreateRenderer
#define SDL_RenderSetClipRect
@ SDL_WINDOWEVENT_FOCUS_GAINED
#define SDL_DestroyRenderer
#define SDL_SaveBMP(surface, file)
SDL_bool SDLTest_CommonInit(SDLTest_CommonState *state)
Open test window.
#define SDL_GetNumDisplayModes
#define SDL_SetWindowPosition
static const char * DisplayOrientationName(int orientation)
static void FullscreenTo(int index, int windowId)
@ SDL_PIXELFORMAT_ABGR8888
#define SDL_RenderReadPixels
#define SDL_HAT_RIGHTDOWN
static const char * audio_usage[]
@ SDL_LOG_CATEGORY_RENDER
static const char * ControllerAxisName(const SDL_GameControllerAxis axis)
#define SDL_SetWindowMaximumSize
#define SDL_DestroyWindow
void SDLTest_CommonQuit(SDLTest_CommonState *state)
Close test window.
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)
#define SDL_WINDOWPOS_ISUNDEFINED(X)
@ SDL_HITTEST_RESIZE_BOTTOMLEFT
#define SDL_GetNumAudioDrivers
@ SDL_WINDOWEVENT_MAXIMIZED
@ SDL_GL_MULTISAMPLESAMPLES
Uint32 num_texture_formats
GLubyte GLubyte GLubyte GLubyte w
#define SDL_GetRendererInfo