Commit Graph

54 Commits (a0934a23fd0c308a58ec0b7c908829980f34fb6b)

Author SHA1 Message Date
Sam Lantinga 791df27a30 Fixed compiler warning on Android 2019-09-09 13:50:46 -07:00
Ozkan Sezer 4953e050f5 use SDL_zeroa at more places where the argument is an array. 2019-07-31 05:11:40 +03:00
Ryan C. Gordon b5d3b6fc25 test: unify all the command line usage logging. 2019-05-28 17:39:13 -04:00
Ryan C. Gordon 00e5eeb40e test: added SDLTest_CommonDefaultArgs()
This is for test apps that don't need custom command line arguments; it lets
us reduce the boilerplate code a tiny bit.
2019-05-19 01:45:15 -04:00
Sam Lantinga 5e13087b0f Updated copyright for 2019 2019-01-04 22:01:14 -08:00
Sylvain Becker 252dc85e95 Fix warnings detected on Android build 2018-12-06 09:22:00 +01:00
Sam Lantinga b815ad56fc Fixed bug 4366 - Compile throws a warning on RPI (Raspbian Stretch)
midwan

When trying to compile on a Raspberry Pi 3, running Raspbian Stretch (fully updated), a warning appears:

/home/pi/projects/SDL/src/test/SDL_test_memory.c: In function ?SDL_TrackAllocation?:
/home/pi/projects/SDL/src/test/SDL_test_memory.c:112:109: warning: format ?%llx? expects argument of type ?long long unsigned int?, but argument 5 has type ?unw_word_t {aka unsigned int}? [-Wformat=]
                 snprintf(entry->stack_names[stack_index], sizeof(entry->stack_names[stack_index]), "%s+0x%llx", sym, offset);
2018-11-12 16:42:49 -08:00
Sam Lantinga f225af0c1e Added SDL_GetDisplayOrientation() to get the display orientation, and added a new event SDL_DISPLAYEVENT to notify the application when the orientation changes.
Documented the values returned by the accelerometer and gyroscope sensors
2018-08-22 21:48:28 -07:00
Ryan C. Gordon e061a92dc9 Some drag'and'drop improvements.
First: disable d'n'd events by default; most apps don't need these at all, and
if an app doesn't explicitly handle these, each drop on the window will cause
a memory leak if the events are enabled. This follows the guidelines we have
for SDL_TEXTINPUT events already.

Second: when events are enabled or disabled, signal the video layer, as it
might be able to inform the OS, causing UI changes or optimizations (for
example, dropping a file icon on a Cocoa app that isn't accepting drops will
cause macOS to show a rejection animation instead of the drop operation just
vanishing into the ether, X11 might show a different cursor when dragging
onto an accepting window, etc).

Third: fill in the drop event details in the test library and enable the
events in testwm.c for making sure this all works as expected.
2018-08-02 16:03:47 -04:00
Ozkan Sezer 08de74ec49 use the 'aborts' pragma of Watcom for SDL_NORETURN functions
SDL_ExitProcess(), SDL_AbortAssertion() and SDLTest_BailOut().

(Commit 303c1e0fb0cf for bug #4100 removed SDL_NORETURN from
SDL_ExitProcess() and SDL_AbortAssertion() in order to avoid
warnings from windows builds, but that's temporary I guess..)
2018-06-13 14:45:02 +03:00
Ozkan Sezer 3ea093cc85 SDL_test_fuzzer.c: fix strict aliasing warnings by using a union. 2018-02-25 10:15:00 +03:00
Sam Lantinga e3cc5b2c6b Updated copyright for 2018 2018-01-03 10:03:25 -08:00
Sam Lantinga 1c43705bab Fixed compiler warning 2017-12-09 13:05:56 -08:00
Sam Lantinga cf9236488a Fixed bug 3879 - add missing SDLCALL to SDLTest_TrackedMalloc & co.
Ozkan Sezer

The attached trivial patch adds missing SDLCALL to SDLTest_TrackedMalloc & co.
2017-10-13 09:50:04 -07:00
Sam Lantinga 22b6df511b Use the lower-case hex output to match other stack trace printouts 2017-10-12 14:46:28 -07:00
Sam Lantinga 7079195697 Fixed compiler warning 2017-10-12 14:44:54 -07:00
Sam Lantinga 5fc2017661 Fixed bug 3877 - missing SDLCALL in SDLTest_ExampleHitTestCallback
Ozkan Sezer

Following trivial patch adds missing SDLCALL to SDLTest_ExampleHitTestCallback()
2017-10-12 14:25:07 -07:00
Sam Lantinga 41a60394d0 Added missing file 2017-10-12 14:20:17 -07:00
Sam Lantinga 9c580e14c9 Added functions to query and set the SDL memory allocation functions:
SDL_GetMemoryFunctions()
    SDL_SetMemoryFunctions()
    SDL_GetNumAllocations()
2017-10-12 13:44:28 -07:00
Sam Lantinga f4f9e39f62 Fixed bug 3874 - Compiler warnings SDL_Surface.c and SDL_cocoakeyboard.m 2017-10-12 08:41:11 -07:00
Sam Lantinga 0fea9164eb Added an example for SDL_SetWindowHitTest() when you create a borderless resizable window. 2017-09-22 17:29:32 -07:00
Sam Lantinga e8059221bd Fixed bug 3806 - Fixes for MSVC compiler warnings
Simon Hug

These are the remaining compiler warnings I see in the current tip cb049cae7c3c.

- SDL_test_log.c defines _CRT_SECURE_NO_WARNINGS without checking if it was already set.

- SDL_windowskeyboard.c converts integers to pointers without going over the (U)INT_PTR types. That bothers MSVC.
2017-09-08 18:26:25 -07:00
Sam Lantinga 4657d9f33c We don't need to pass the renderer into SDLTest_CleanupTextDrawing() 2017-09-08 04:53:31 -07:00
Sam Lantinga 65c55fdd84 Fixed build 2017-09-08 04:38:46 -07:00
Sam Lantinga b0b3da7702 Added a function to clean up test text drawing 2017-09-08 04:14:05 -07:00
Sam Lantinga 9ca6292372 Added some missing render capability flags 2017-08-29 23:14:39 -07:00
Sam Lantinga c3d428d402 Fixed line breaks in verbose test logging output 2017-08-29 23:12:26 -07:00
Sam Lantinga 94e0f3e95b Added some debug messaging for previously unhandled events 2017-08-29 22:52:17 -07:00
Ryan C. Gordon ae667da638 Fixed a bunch of compiler warnings. 2017-08-29 15:52:49 -04:00
Sam Lantinga ded5b3a4b4 Fixed crash at shutdown if the window couldn't be created 2017-08-27 21:05:18 -07:00
Ryan C. Gordon 25e3a1ec90 vulkan: Initial Vulkan support!
This work was done by Jacob Lifshay and Mark Callow; I'm just merging it
into revision control.
2017-08-27 22:15:57 -04:00
Sam Lantinga b2e2bcc203 Added test debug logs for additional event types 2017-08-12 20:21:34 -07:00
Sam Lantinga 3c852360f6 Fixed bug 3646 - SDL_test_common.c: Add key bindings for testing SDL_SetWindowPosition
Eric Wasylishen

Alt-Up/Down/Left/Right switches between displays using SDL_WINDOWPOS_CENTERED_DISPLAY

Shift-Up/Down/Left/Right shifts the window by 100px
2017-08-11 10:42:26 -07:00
Ryan C. Gordon cff9e5a876 test: info now reports usable display bounds and DPI (thanks, Eric!).
Fixes Bugzilla #3652.
2017-05-18 16:29:10 -04:00
Philipp Wiesemann 33ff5bd148 Fixed typo in log message. 2017-02-03 23:30:29 +01:00
Sam Lantinga 800a72eb17 Switch stderr output to SDL_Log() so it shows up on Windows and mobile devices 2017-01-31 10:19:56 -08:00
Sam Lantinga 45b774e3f7 Updated copyright for 2017 2017-01-01 18:33:28 -08:00
Ryan C. Gordon 232ae68864 Still more compiler warning fixes for various platforms. 2016-11-23 17:20:28 -05:00
Ryan C. Gordon 40c2a6fb55 Fixed more compiler warnings. 2016-11-23 11:49:26 -05:00
Sam Lantinga eaca3958ad Fixed bug 3494 - SDL_test_fuzzer.c fails compile since r10604
Ozkan Sezer

As of hg rev. 10604 (http://hg.libsdl.org/SDL/rev/4fe01fd25855),
SDL_test_fuzzer.c fails to build again
2016-11-20 21:24:09 -08:00
Sam Lantinga 818d1d3e80 Fixed bug 1646 - Warnings from clang with -Weverything 2016-11-15 01:30:08 -08:00
Sam Lantinga c1e292fcf8 Fixed build error with missing function prototype in the SDL_test_harness.h header 2016-11-13 23:09:42 -08:00
Sam Lantinga 57d01d7d67 Patch from Sylvain to fix clang warnings 2016-11-13 22:57:41 -08:00
Sam Lantinga 74e1dd4c6f Define _GNU_SOURCE when building SDL 2016-11-11 13:14:00 -08:00
Sam Lantinga 9dfe54006e We should be using a string constant for the strftime format string 2016-10-01 10:38:15 -07:00
Bastien Nocera 7edd2261e7 Fix "format not a string literal" errors
With GCC 6.1.

https://bugzilla.libsdl.org/show_bug.cgi?id=3375
2016-10-01 10:36:24 -07:00
Sam Lantinga f1e0b9af20 Added debug output for new window events 2016-09-29 16:10:08 -07:00
Philipp Wiesemann f4d33fcbba Fixed compile warnings in test library about formats strings not being literals.
Partially fixes Bugzilla #3375.
2016-06-25 19:40:44 +02:00
Philipp Wiesemann 1d1ba58f28 Fixed compile warnings about uninitialized variables in test library.
Found by buildbot.
2016-01-06 22:39:29 +01:00
Ryan C. Gordon 3bdaf4c611 Added SDL_SetWindowOpacity() and SDL_GetWindowOpacity().
This is currently implemented for X11, Cocoa, Windows, and DirectFB.

This patch is based on work in Unreal Engine 4's fork of SDL,
compliments of Epic Games.
2016-01-05 02:46:10 -05:00