Commit Graph

1226 Commits

Author SHA1 Message Date
Ryan C. Gordon
bd539b9ed1 Added a hint to specify new thread stack size (thanks, Gabriel!).
Fixes Bugzilla #2019.

(we'll do a better fix when we break the API in SDL 2.1.)
2015-05-26 21:13:27 -04:00
Ryan C. Gordon
97bb9113e9 Make dot easier to see in testrelative. 2015-05-26 11:32:06 -04:00
Sam Lantinga
78f2198e6c Updated the copyright year to 2015 2015-05-26 06:27:46 -07:00
Sam Lantinga
37547897ee Fixed bug 2989 - Memory loss in clipboard_testClipboardTextFunctions 2015-05-26 06:16:43 -07:00
Philipp Wiesemann
89eb93d305 Removed redundant NULL check in test program. 2015-05-21 21:27:53 +02:00
Philipp Wiesemann
951d768224 Changed clean-up order in test program. 2015-05-21 21:25:32 +02:00
Philipp Wiesemann
dbd2fc4f33 Fixed undefined key access in test program. 2015-05-21 21:25:14 +02:00
Philipp Wiesemann
a96660cbde Added missing loop cancel for Emscripten in test programs. 2015-05-18 21:21:14 +02:00
Philipp Wiesemann
8c5b82840a Fixed compiling test program with Emscripten. 2015-05-18 21:17:13 +02:00
Philipp Wiesemann
adceb46138 Fixed handling only one event per frame in test program. 2015-05-18 21:12:16 +02:00
Philipp Wiesemann
dc0241fc19 Fixed implicit function declaration in test program. 2015-05-06 21:09:33 +02:00
Ryan C. Gordon
d4eb1ea6a2 checkkeys: report SDL_TEXTEDITING events. 2015-05-01 01:19:00 -04:00
Ryan C. Gordon
8e60ed9d07 checkkeys: Readded the KEYUP event test. 2015-05-01 01:12:48 -04:00
Ryan C. Gordon
44708540f3 Cleanups in the joystick code.
Removed some redundant state and other confusions.

Fixes Bugzilla #2738.
2015-03-24 13:52:01 -04:00
Philipp Wiesemann
7b6434ad97 Updated test program for Emscripten. 2015-03-23 20:21:45 +01:00
Ryan C. Gordon
4b56f12266 Immediately minimize the goofy window in testaudiohotplug. 2015-03-19 22:20:12 -04:00
Ryan C. Gordon
8dc3028044 Initial work on audio device hotplug support.
This fills in the core pieces and fully implements it for Mac OS X.

Most other platforms, at the moment, will report a disconnected device if
it fails to write audio, but don't notice if the system's device list changed
at all.
2015-03-16 02:11:39 -04:00
Philipp Wiesemann
cb8c446d69 Updated name of assert type in test program. 2015-03-15 19:25:10 +01:00
Philipp Wiesemann
2b26e95343 Removed redundant include statements from test programs.
The needed header files are already included with SDL.h. Still including them in
the test programs is confusing because it somehow suggests they would be needed.
2015-02-18 21:31:21 +01:00
Philipp Wiesemann
5ac1343c94 Fixed compile warning about unused variable in wave test program. 2015-02-15 11:33:39 +01:00
Philipp Wiesemann
4c8d5e20a7 Fixed test programs for joystick not exiting on events after first disconnect.
Exit was broken since the main loop extraction needed for Emscripten support
because the former local but now global variables were not reset correctly.
2015-02-12 21:40:53 +01:00
Philipp Wiesemann
0a22818c0d Fixed bug 2873 - Joystick test won't reload after reattach
lectem

-plug in the joystick
-start testjoystick 0
-unplug
-replug

The joystick is detected but doesn't enter the loop anymore since done==SDL_TRUE
2015-02-10 20:40:03 +01:00
Philipp Wiesemann
f45215f76a Fixed compiling test with older C. 2015-02-10 20:31:05 +01:00
Philipp Wiesemann
0405296f1c Fixed bug 2866 - testrelative.c: patch to make the orange box wrap around
Eric Wasylishen

Here's a patch to make the 'testrelative' demo program more useful: it just makes the orange rectangle wrap around. Previously, the orange cursor would just disappear off screen if you move the mouse a lot in one direction, so it was hard to tell if relative mouse mode was still working.
2015-02-07 22:40:36 +01:00
Philipp Wiesemann
ace64af532 Fixed two warnings about initialized but unused local variables in tests. 2015-01-16 23:03:14 +01:00
Philipp Wiesemann
313c38e43f Removed missing test program from Makefile. 2014-12-25 22:47:04 +01:00
Philipp Wiesemann
024f1a0155 Fixed compile errors in example programs. 2014-12-25 21:42:56 +01:00
Ryan C. Gordon
e9afc9c6e2 Maybe actually patched to compile this time? 2014-12-24 22:22:35 -05:00
Ryan C. Gordon
2197ac814d Really patched to compile this time? 2014-12-24 13:21:28 -05:00
Ryan C. Gordon
13699c157c Patched to compile. 2014-12-24 13:16:27 -05:00
Ryan C. Gordon
9a4c98c6f9 Maybe patched to compile on Windows for real now? 2014-12-24 02:12:16 -05:00
Ryan C. Gordon
5f91cafa6c Patched to compile on Windows. 2014-12-24 02:06:38 -05:00
Ryan C. Gordon
c6db647a88 Patched to compile on non-Emscripten targets. 2014-12-24 02:01:12 -05:00
Ryan C. Gordon
a9626cb76e Initial merge of Emscripten port!
With this commit, you can compile SDL2 with Emscripten
( http://emscripten.org/ ), and make your SDL-based C/C++ program
into a web app.

This port was due to the efforts of several people, including: Charlie Birks,
Sathyanarayanan Gunasekaran, Jukka Jylänki, Alon Zakai, Edward Rudd,
Bruce Mitchener, and Martin Gerhardy. (Thanks, everyone!)
2014-12-18 00:19:52 -05:00
Philipp Wiesemann
8ff1310094 Removed unused includes and functions from test program. 2014-12-12 21:51:30 +01:00
Philipp Wiesemann
2e4bd2c43c Replaced sqrt() with SDL_sqrt() in test program. 2014-12-12 21:02:46 +01:00
Philipp Wiesemann
7ddeda565f Removed global variable from test program.
On Android starting the application after a previous quit did not always work.
Android keeps VM processes for a faster restart and therefore the loaded *.so.
2014-12-12 21:00:25 +01:00
Philipp Wiesemann
e30a942695 Fixed setting text to clipboard in controllermap program. 2014-12-10 21:13:43 +01:00
Philipp Wiesemann
2d19a942a0 Added comments in example program. 2014-12-10 21:10:55 +01:00
Edward Rudd
73fc93717d switch to use SDL_PRI* macros for long long formatting everywhere. 2014-12-03 12:23:17 -05:00
Andreas Schiffler
7ab7d56257 Fix assert format strings/parameters in testautomation modules; improve output of SDL_CompareSurfaces to aid debugging; update platform_testSetErrorInvalidInput for SDL changes 2014-11-30 20:55:27 -08:00
Edward Rudd
e591fb0470 add "i" shortcut to testgesture tool to log # of fingers down on the touch devices. 2014-11-23 15:39:28 -05:00
Philipp Wiesemann
74d4888a0c Added missing brackets in test source assert messages. 2014-11-07 10:02:45 +01:00
Philipp Wiesemann
523d555063 Fixed two typos in test source. 2014-11-07 10:01:20 +01:00
Ryan C. Gordon
4563873c18 Haptic: Deal with negative periodic magnitudes (thanks, Elias!).
A negative periodic magnitude doesn't exist in Windows' and MacOS' FF APIs

The periodic magnitude parameter of the SDL Haptic API is based on the Linux
 FF API, so it means they are not directly compatible:
    'dwMagnitude' is a 'DWORD', which is unsigned.

Fixes Bugzilla #2701.
2014-09-17 14:49:36 -04:00
Gabriel Jacobo
bcce626c90 [Android] Fixes #2480, music does not pause when process backgrounded
This modifies SDL_PauseAudio behavior to pause all audio devices instead of
just the default one (required on Android, at least for testmultiaudio on my
Nexus 4 which reported 2 audio devices).
It also changes SDL_PauseAudioDevice to retain the device lock from pause until
resume in order to save battery in mobile devices.
2014-09-17 11:41:12 -03:00
Philipp Wiesemann
c626378e71 Fixed typos in test program. 2014-08-20 22:51:56 +02:00
Philipp Wiesemann
3d544f92eb Fixed not needed standard includes in test program. 2014-08-20 22:49:59 +02:00
Philipp Wiesemann
4406b42cfe Fixed warnings about unused value in test program. 2014-08-20 22:47:07 +02:00
Philipp Wiesemann
d38c5d2aaf Fixed warnings about unused functions in test program. 2014-08-20 22:44:15 +02:00
Philipp Wiesemann
948b6afbce Fixed warnings about missing initializers in test program. 2014-08-20 22:40:56 +02:00
Sam Lantinga
71c7e4c8d4 Fixed bug 2688 - failure to build test/loopwavequeue.c on Linux 2014-08-17 10:10:41 -07:00
Ryan C. Gordon
923f894f97 Haptic: Add some missing haptic types to test, and fix wrong array-sizes.
Thanks, Elias!

Fixes Bugzilla #2686.
(along with the last several commits.)
2014-08-16 16:50:10 -04:00
Ryan C. Gordon
5f4bff4acc Haptic: Fix the saturation and deadband parameters' available range.
There was a misconception that Linux's saturation and deadband parameters -
on which the corresponding SDL parameters were based - use only half of the
possible range.

Thanks, Elias!

Partially fixes Bugzilla #2686.
2014-08-16 16:47:42 -04:00
Sam Lantinga
06d9ee1f36 Added NV12 and NV21 texture support for OpenGL and OpenGL ES 2.0 renderers 2014-08-06 11:34:54 -07:00
Ryan C. Gordon
01187b701d Added audio device buffer queueing API. 2014-07-22 21:41:49 -04:00
Andreas Schiffler
90b4c62548 Update audio testautomation: more coverage; added SDL_PauseAudio test /w callback coverage 2014-07-07 23:33:57 -07:00
Andreas Schiffler
f5652223b7 Enable 2 disabled audio tests (since bug 1396 is fixed and they pass now) 2014-07-07 20:26:21 -07:00
Sam Lantinga
d3ba7acc11 Fixed compiler warning 2014-07-07 10:39:02 -07:00
Shawn Walker
f0b0159135 2620 solaris port missing atomics if not using gcc 2014-07-05 16:11:23 -07:00
Ryan C. Gordon
e59e44ff6b Merged Ryan's SDL-gui-backend branch.
Adds three APIs, and implements them on X11, Cocoa, and Windows:

- SDL_CaptureMouse()
- SDL_GetGlobalMouseState()
- SDL_SetWindowHitTest()
2014-06-25 17:06:12 -04:00
Sam Lantinga
2582c3aa59 Don't redefine standard macros, use SDL specific macros instead to avoid compiler warnings 2014-06-23 11:06:50 -07:00
Sam Lantinga
fee876047b commit 9e211e646f9d51dc1372c9f3c8f47a78caf4f2a5
Author: Sam Clegg <sbc@chromium.org>
Date:   Fri Jun 20 12:52:11 2014

    Fix win32 build which was failing due to missing PRIs64.

    This change adds definitions for the C99 PRIs16 and PRIu64
    which are missing from <stdint.h> on at last win32 and
    possibly other platforms.

    These already existed in testgesture.c so I removed them
    from there also.
2014-06-21 11:24:06 -07:00
Philipp Wiesemann
2bee37f5eb Fixed format string faults in audio tests.
They were found by the recent code annotations.
2014-06-09 17:25:03 +02:00
Gabriel Jacobo
adce68ed69 Fixes audio for Native Client, and other fixes...
- SDL_NaClMount, SDL_NaClUmount
- Default mounting of https at / in SDL's main function
- More documentation in README-nacl.txt
2014-06-08 18:18:13 -03:00
Sam Lantinga
78ac74b7b6 Fixed compile warnings 2014-06-07 18:20:25 -07:00
Sam Lantinga
5f09dd3a75 Fixed initializing test event queue 2014-06-07 17:25:56 -07:00
Sam Lantinga
21743a2a53 Fixed another loopwave crash with no command line arguments 2014-06-07 17:25:35 -07:00
Sam Lantinga
f5dbc4eebe Fixed loopwave crash with no command line arguments 2014-06-07 17:09:32 -07:00
Gabriel Jacobo
c9de793322 Adds missing Makefile for NACL test and a couple of smaller fixes 2014-06-06 18:33:17 -03:00
Gabriel Jacobo
01a18871e3 Chrome's Native Client backend implementation 2014-06-06 15:45:59 -03:00
Ryan C. Gordon
e3a707d94e Minor tweaks to testhittesting. 2014-06-05 00:49:25 -04:00
Ionut Leonte
686a5dabf5 Added SDL_HITTEST_RESIZE_*, and implemented for X11. 2014-06-05 00:45:16 -04:00
Ryan C. Gordon
00dd38cb3d Patched to compile on Visual Studio. 2014-05-30 01:48:26 -04:00
Ryan C. Gordon
724a3607f6 Make some printf() calls into SDL_Log() so I can see them on Windows. :) 2014-05-30 01:48:08 -04:00
Philipp Wiesemann
9854504fc3 Added missing stdio include in test program. 2014-05-29 22:48:10 +02:00
Philipp Wiesemann
fa039cce2f Fixed use of uninitialized variable warning in test program. 2014-05-29 22:44:08 +02:00
Ryan C. Gordon
5dc5c34ad7 Added a few debug printf() calls. 2014-05-28 01:27:27 -04:00
Ryan C. Gordon
7af1c6e050 Changed drag area API to a hit-testing API.
There were several good arguments for this: it's how Windows works with
 WM_NCHITTEST, SDL doesn't need to manage a list of rects, it allows more
 control over the regions (how do you use rects to cleanly surround a circular
 button?), the callback can be more optimized than a iterating a list of
 rects, and you don't have to send an updated list of rects whenever the
 window resizes or layout changes.
2014-05-28 01:22:47 -04:00
Ryan C. Gordon
6146fd1f61 First shot at SDL_SetWindowDragAreas().
Only Cocoa implemented right now.
2014-05-27 01:27:42 -04:00
Philipp Wiesemann
cbfd769a05 Changed C++ style comments. 2014-05-18 21:11:30 +02:00
Philipp Wiesemann
275dddab6b Changed C++ style comments to fix pedantic warnings. 2014-05-17 22:02:25 +02:00
Gabriel Jacobo
0ed35a7e64 A few more ANDROID for __ANDROID__ replacements 2014-05-10 15:57:09 -03:00
Dimitris Zenios
8adc9938a4 __ANDROID__ is the correct macro to check for an android system.ANDROID is only defined in NDK build system (.mk) and not in the standalone NDK. 2014-05-05 22:21:26 +03:00
Sam Lantinga
dca69c99ea Fixed the inertia effect in the test program 2014-04-26 12:29:40 -07:00
Philipp Wiesemann
ab11da111a Removed global variable from test program. 2014-04-19 15:28:13 +02:00
Sam Lantinga
cbd1d2988e Fixed bug 2475 - Incorrect SDL_Log() format specifiers in test/testgesture.c
rettichschnidi

The floats should not be interpreted as integers. Patch against the current head attached.
2014-04-17 22:40:57 -07:00
Philipp Wiesemann
8cc0a1f080 Removed empty statements. 2014-04-05 23:50:09 +02:00
Philipp Wiesemann
776bf83675 Removed unused variable from test program. 2014-04-04 23:56:15 +02:00
Sam Lantinga
29e7293ecc Fixed assertion loading button.bmp in testgamecontroller 2014-03-29 12:27:27 -07:00
Gabriel Jacobo
e51bee5598 Fixes #2456, controllermap's undo does not work correctly (by Bogdan Marinov) 2014-03-24 11:42:09 -03:00
Sam Lantinga
377cd2e535 Fixed warning on Mac OS X 2014-03-23 23:08:26 -07:00
Andreas Schiffler
76293d2333 Fix visualstudio build break introduced by changeset 8645 2014-03-19 21:48:32 -07:00
Andreas Schiffler
353b516a34 Add input validation to SDL_getenv/SDL_setenv; update Stdlib testsuite; add Hints testsuite 2014-03-19 21:39:55 -07:00
Ryan C. Gordon
7005ad71ce controllermap: Don't treat SDL_HAT_CENTERED as a valid input. 2014-03-18 12:33:57 -04:00
Andreas Schiffler
147451d2ca Fix bug/add test coverage for SDLTest_GenerateRunSeed helper; improve test harness adding output of repro steps for failures; improve negative test for SDL_GetError/SDL_SetError 2014-03-11 07:17:56 -07:00
Sam Lantinga
0ae88759fb Integrated David Ludwig's support for Windows RT 2014-03-09 11:36:47 -07:00
Sam Lantinga
32547d0c59 Fixed line endings on WinRT source code 2014-03-09 11:06:11 -07:00
Gabriel Jacobo
16abbefb81 Improve testgles2 exit behavior (useful on Android) 2014-02-20 16:12:11 -03:00
Ryan C. Gordon
e450b2f9d9 Make controllermap, etc, work on platforms with hardcoded window sizes.
This makes sure everything renders correctly, even if, say, an Android device
gives you a certain "window" size no matter what you ask for.
2014-02-10 11:29:48 -05:00
Gabriel Jacobo
acd58f19d8 Backed out 51935d107921
The render target usage in controllermap is required if you are forced to use
the app at a different resolution than the one the art has been made for, for
example on Android, where you don't control the resolution.
(The coordinates for each button are hardcoded to the art size, and appear out
of place otherwise)
2014-02-10 09:26:22 -03:00
Ryan C. Gordon
802397a171 Removed unused function. 2014-02-10 01:43:01 -05:00
Ryan C. Gordon
c18be74a8e Replace testgamecontroller visualization mode with something more useful. 2014-02-10 01:41:58 -05:00
Ryan C. Gordon
87dd51b115 No need to use a render target here. 2014-02-09 15:20:41 -05:00
Edward Rudd
ca1ebb24b6 slight adjustment to the hot plug test to allow it to be run with hap tics disabled 2014-02-07 09:35:33 -05:00
Ryan C. Gordon
85219a6a5d Fixed return values on testhotplug mainline. 2014-02-06 07:38:41 -05:00
Ryan C. Gordon
fd7ded0e94 Fixed copyright date. 2014-02-06 07:38:04 -05:00
Edward Rudd
943e4dc475 add testdropfile to OS X Project 2014-02-04 18:21:39 -05:00
Edward Rudd
2d6feda57f allow safely quitting the hotplug test by pressing button 0 on the joystick 2014-02-04 15:40:51 -05:00
Edward Rudd
80dbd8ae39 testhotplug: Actually log the SDL_Error that occured on failures 2014-02-03 23:08:53 -05:00
Edward Rudd
48e9978f42 add logging for the case when haptic is not detected on the joystick as well. 2014-02-03 23:01:19 -05:00
Edward Rudd
92a8ee88f0 add simple test showing off hotplugging of joysticks w/ haptic. 2014-02-03 22:52:18 -05:00
Sam Lantinga
dba255c1e5 Fixed bug 2374 - Update copyright for 2014...
Is it that time already??
2014-02-02 00:53:27 -08:00
Sam Lantinga
921f2abe11 Fixed bug 2376 - no SDL_HasAVX
Haneef Mubarak

AVX is the successor to SSE* and is fairly widely available. As such, it really ought to be detectable.

This functionality ought to be trivial to implement, and not having it means being forced to write an ugly workaround to check for AVX (so that normal SSE can be used if AVX is not available).

Here is an example on detecting AVX from SO (it actually shows ways to cehck for all of teh fancy instructions):

http://stackoverflow.com/questions/6121792/how-to-check-if-a-cpu-supports-the-sse3-instruction-set
2014-02-02 00:33:31 -08:00
Edward Rudd
049d8ae9a5 some fixes to the testshape.c code so it more correctly works. 2014-01-08 14:18:11 -05:00
David Ludwig
c96c4f3dc4 WinRT: merged with latest SDL 2.x/HG code
SDL 2.x recently accepted patches to enable OpenGL ES 2 support via Google's ANGLE library.  The thought is to try to eventually merge SDL/WinRT's OpenGL code with SDL-official's.
2013-11-28 22:09:21 -05:00
Ryan C. Gordon
aea9ef3f9f Regenerate the configure scripts. 2013-11-25 00:11:52 -05:00
Philipp Wiesemann
2cef47a75e Fixed access of command line arguments on Android in two test programs. 2013-12-25 00:11:28 +01:00
Philipp Wiesemann
00d7d30fd5 Fixed unused local variable warning in test program source. 2013-12-25 00:04:31 +01:00
Philipp Wiesemann
7107a779df Fixed missing return warning in test program source. 2013-12-24 19:55:41 +01:00
Sam Lantinga
ca345234a8 Changed testgamecontroller to wait for controllers to be reattached, the way testjoystick does. 2013-12-23 15:55:08 -08:00
Gabriel Jacobo
74cba7bdbe Wayland support
Based on the original port to Wayland by: Joel Teichroeb, Benjamin Franzke, Scott Moreau, et al.

Additional changes in this commit, done by me:

* Wayland uses the common EGL framework
* EGL can now create a desktop OpenGL context
* testgl2 loads GL functions dynamically, no need to link to libGL anymore
* Assorted fixes to the Wayland backend

Tested on the Weston Compositor (v1.0.5) that ships with Ubuntu 13.10,
running Weston under X. Tests ran: testrendercopyex (all backends), testgl2, testgles2,testintersections
2013-12-14 20:18:43 -03:00
Sam Lantinga
f92e7a48c8 Fixed bug 2294 - testdrawchessboard.c Sets the render color alpha to 0x0.
Brandon Schaefer

This means everything will render black if the software rendering backend selects a pixel format that supports alpha. So it seems best to at lease assume alpha is supported.
2013-12-11 21:13:45 -08:00
Gabriel Jacobo
d5a570b8bf [Android] Handle native thread finishing when not commanded from the Java side 2013-12-05 10:51:38 -03:00
Gabriel Jacobo
7deb0ea7c9 Adds SDL_GameControllerAddMappingsFromRW, updates controllermap
SDL_GameControllerAddMappingsFromFile is now a convenience macro.

controllermap can now skip bindings by pressing space or clicking/touching the
screen.
2013-12-03 12:01:28 -03:00
Gabriel Jacobo
a0af4271a0 Adds controllermap utility to test suite. 2013-12-02 19:35:04 -03:00
Philipp Wiesemann
fa6e49b05a Removed second return statement. 2013-11-23 18:37:36 +01:00
Gabriel Jacobo
3fcc35f5bb OpenGL ES support for Windows 2013-11-22 13:24:53 -03:00
Gabriel Jacobo
fbda2dcacf Adds testgles2
Source code copied from: https://github.com/fantasydr/sdl-2.0-gles (thanks!)

Minor fixes, configure script changes done by me.
2013-11-19 10:56:38 -03:00
Sam Lantinga
c99ca2935f Fixed compile warning, thanks to Michael Pohoreski 2013-11-16 10:25:46 -08:00
Sam Lantinga
1a3156f0c9 Added viewport test, contributed by Andreas Schiffler and improved by me and Ryan Gordon.
If it works correctly you should see a square moving from the upper left to the lower right, with a little yellow box at the top of the moving square.

You can pass --target as a command line option to have it use a render target instead of rendering directly to the screen.  The output should be identical in this case.
2013-11-15 22:05:26 -08:00
Ryan C. Gordon
b444dd2714 Renamed things named after BeOS to be named after Haiku instead. 2013-11-14 11:51:24 -05:00
Sam Lantinga
4b94b3ca8a Turn off resizable flag by default, you can always pass the --resize command line option if you need it. 2013-11-11 02:00:58 -08:00
Gabriel Jacobo
becbba3801 [Android] Fixes Bug 2041 - can't get SDL_QUIT event...
Thanks to Denis Bernard!

Also, changed the Android manifest so the app doesn't quit with orientation
changes, and made testgles.c exit properly on Android.
2013-11-06 11:23:24 -03:00
Sam Lantinga
9cbfde6d89 Fixed bug 2190 - test/testdrawchessboard.c line endings
Joseph Carter
test/testdrawchessboard.c checks out of hg with DOS line endings on non-dos systems.  Fixed via:

perl -pi -e 's/\r//g' test/testdrawchessboard.c
2013-11-03 11:27:06 -08:00
Philipp Wiesemann
badb94560e Changed parameter name for gesture template save functions from "src" to "dst". 2013-11-02 12:07:21 +01:00
David Ludwig
529fcd3ee3 WinRT: merged with SDL 2.0.1 codebase 2013-10-27 21:26:46 -04:00
Andreas Schiffler
5c8f35435e Fix error assert for negative cases of pixels_getPixelFormatName test 2013-10-21 23:17:37 -07:00
Sam Lantinga
2451a67018 Fixed building using MinGW
Our SDL_windows.h needed to be included before anything else so UNICODE is defined.
2013-10-17 23:02:29 -07:00
Sam Lantinga
a19fbe773d Fixed compiling on Mac OS X, added a system RAM test 2013-10-17 11:56:33 -07:00
Sam Lantinga
fdc0f72d69 Fixed bug 2149 - Don't search for libusbhid except on BSD
Joseph Carter

There's a whole set of configure tests for BSD's libusbhid, and they only matter on BSD.  However, if you have the library on Linux, it gets pulled in as library bloat.  And it's bloat of the highest order since not a single function call to the library is ever made unless you're on a *BSD.
2013-10-13 19:49:45 -07:00
Edward Rudd
23058a432a added simple Drag & drop test 2013-10-12 11:21:40 -04:00
Sam Lantinga
6fca598f55 Updated SDL to version 2.0.1 2013-10-10 21:50:25 -07:00
Gabriel Jacobo
8eae84fcf7 Adds gl_profile_mask to test framework, uses it in testgles 2013-10-10 00:49:57 -03:00
Gabriel Jacobo
d62885425b Fixes testgles and testgl 2013-10-09 11:30:01 -03:00
Sam Lantinga
deb0d06de7 Fixed bug 2132 - Tests may use invalid SDL_window pointers when windows are closed
norfanin

Some of the tests keep using the pointers of a destroyed SDL_Window when the common event handling handled the close event. The event handler itself does not NULL the pointer after the destruction.

The attached patch adds a loop in the handler that will assign NULL to the destroyed window. It also adds checks to some of the tests so they skip those windows by checking for NULL.
2013-10-05 19:09:03 -07:00
Sam Lantinga
bea5cdbbd7 Report an error if creating a render target fails 2013-10-03 21:41:09 -07:00
David Ludwig
e27f29bfa9 WinRT: made testthread log output via SDL_Log
- this will allow output to be read via Visual C++'s Output pane
2013-08-20 21:55:13 -04:00
David Ludwig
373ffd0dac WinRT: merged with SDL 2.0.0 codebase (aka. SDL hg rev d6a8fa507a45) 2013-08-12 22:29:55 -04:00
Philipp Wiesemann
37516af4c1 Corrected comment in test program. 2013-08-10 23:07:28 +02:00
Ryan C. Gordon
2fbbecf909 Replaced SDL_HAPTIC_SQUARE with SDL_HAPTIC_LEFTRIGHT.
We needed a bit, so we're hoping no one needs this effect, especially when
it's fairly close to SDL_HAPTIC_SINE, we hope.

SDL_HAPTIC_LEFTRIGHT maps to XInput's functionality, so this removes the SINE
code for the XInput driver to keep things clean.

This also makes the simplified Rumble API use SDL_HAPTIC_LEFTRIGHT if
SDL_HAPTIC_SINE isn't available, to keep XInput working.

When we break the ABI, and can extend the supported capabilities field from
a Uint16, we'll add SDL_HAPTIC_SQUARE back in.

This patch is based on work by Ethan Lee.
2013-08-10 13:38:09 -04:00
Andreas Schiffler
2bf318cac0 Update video_getSetWindowSize for windows 2013-08-08 22:10:00 -07:00
Andreas Schiffler
ea498a599d Fix Bug 2021: Win32: Stack overflow due to recursive SDL_LogOutput on SDL_LogError without console; fix off-by-one error in SDLtest test suite 2013-08-08 21:29:30 -07:00
Philipp Wiesemann
1de7a622ab Changed test program to be more compatible C. 2013-07-27 21:11:12 +02:00
Philipp Wiesemann
719f8227e0 Removed unused variable from test program. 2013-07-27 21:07:07 +02:00
Philipp Wiesemann
af2f530b05 Removed unused parameter in test program. 2013-07-27 21:05:04 +02:00
Philipp Wiesemann
81450906db Corrected words in comments of test programs. 2013-07-27 21:02:50 +02:00
Sam Lantinga
aab0048d87 Added example of using the software renderer and window surface API, contributed by Nitin Jain. 2013-07-27 03:48:23 -07:00
Sam Lantinga
7eff345ecb Updated the copyright year for the test programs 2013-07-25 09:51:21 -07:00
Philipp Wiesemann
d139035d90 Removed unused variables to fix warnings in test program. 2013-07-24 22:19:01 +02:00
Sam Lantinga
976949bd01 Finished updating testoverlay2 for the new API and added it to the Visual Studio 2010 projects 2013-07-23 12:46:22 -07:00
Sam Lantinga
4862c1fc30 Updated blend semantics so blending uses the following formula:
dstRGB = (srcRGB * srcA) + (dstRGB * (1-srcA))
    dstA = srcA + (dstA * (1-srcA))
This allows proper compositing semantics without requiring premultiplied alpha.

Needs full unit test coverage and bug fixes!
2013-07-23 08:06:49 -07:00
Sam Lantinga
04f86925d1 Fixed bug 1973 - test/Makefile.in fails on Mac OS X with X11 enabled...
Ryan C. Gordon

If you have the X11 SDK installed on Mac OS X, you'll build with X11 support, but the Makefile doesn't build anything but the Cocoa testnative code for Mac OS X, which is fine, but then testnative fails to link because testnative.h enables the X11 support based on the SDL config header.

Building the testnativex11.c code on Mac OS X doesn't work because you need to explicitly link with "-L/usr/X11/lib -lX11" if this code is enabled, but you can't link with that by default because the X11 SDK might be missing.

So this needs a little configure magic to do the right thing (or forcibly disabling X11 support on Mac OS X in testnative.h).
2013-07-21 12:47:47 -07:00
Philipp Wiesemann
bfc26adbd5 Replaced use of malloc()/free() with SDL_malloc()/SDL_free() in test program. 2013-07-20 21:51:53 +02:00
Philipp Wiesemann
aa1fee4fdb Removed not needed SDL_WINDOW_SHOWN from test programs.
See bug #1667.
2013-07-20 21:47:16 +02:00
Philipp Wiesemann
a30b85dd03 Replaced use of strcmp() with SDL_strcmp() in tests. 2013-07-20 21:39:54 +02:00
Sam Lantinga
9f8cddc1ba Re-enabled other messagebox tests, moved the SDL_Init() call as late as possible to show the circumstances where it's needed. 2013-07-14 12:16:10 -07:00
Sam Lantinga
c1de40a848 Added testing of messagebox with a parent window 2013-07-14 11:57:45 -07:00
Edward Rudd
fab88c0df2 add in High DPI support (aka Retina)
- based on Jørgen's patch with a few bug fixes
2013-09-20 13:43:00 -04:00
Sam Lantinga
da23163fbc Christoph Mallon: Replace strlen(x) == 0 (O(n)) by x[0] == '\0' (O(1)). 2013-08-29 08:30:21 -07:00
Sam Lantinga
6d9d4b6eba Christoph Mallon: Remove pointless if (x) before SDL_FreeSurface(x) 2013-08-29 08:29:51 -07:00
Sam Lantinga
753aae78fc Christoph Mallon: Remove pointless if (x) before SDL_free(x) 2013-08-29 08:29:21 -07:00
Ryan C. Gordon
6812b6f714 Fixed testgamecontroller output to make sense. 2013-08-28 00:07:02 -04:00
Gabriel Jacobo
5544eb2cb0 [Linux] Test config script: Add the X11 library search path if it is not empty
If ac_x_libraries is empty it means that the library's found in the default path,
so we skip adding it to the XLIB variable as it screws up the search path.
2013-08-28 12:43:29 -03:00
Gabriel Jacobo
795ba9047e Fixes test building 2013-08-28 10:41:25 -03:00
Gabriel Jacobo
8515791f86 OCD fixes: Adds a space after /* (glory to regular expressions!) 2013-08-21 09:47:10 -03:00
Gabriel Jacobo
871473e032 OCD fixes: Adds a space before */ 2013-08-21 09:43:09 -03:00
Ryan C. Gordon
8fe1cf47f2 Added SDL_GetBasePath() and SDL_GetPrefPath() in new filesystem module. 2013-08-20 19:57:11 -04:00
Gabriel Jacobo
f93c78450b More non C89 compliant comments 2013-08-20 20:34:40 -03:00
Andreas Schiffler
7582a71d05 Fix bug 2034: replace printf by SDL_Log in tests; update loopwave VS solution: copy missing dependency 2013-08-14 23:30:10 -07:00
Philipp Wiesemann
9b5b5539ee Fixed compiler warnings in test program by using wrapped functions. 2013-07-14 19:56:22 +02:00
Ryan C. Gordon
c88d5e0b60 Fixed compiler warning in testtimer.c 2013-07-14 13:25:49 -04:00
Philipp Wiesemann
8f0765a932 Fixed compiler warnings in test program by using wrapped functions. 2013-07-14 13:33:54 +02:00
Philipp Wiesemann
642825d6f6 Fixed compiler warnings in test programs by adding return statements. 2013-07-14 13:30:26 +02:00
Philipp Wiesemann
27e8a1013d Fixed compiler warnings in test programs by adding includes directives. 2013-07-14 13:27:19 +02:00
Philipp Wiesemann
843aed5449 Fixed compiler warnings in test programs. 2013-07-13 21:13:09 +02:00
Philipp Wiesemann
72b5424518 Added missing fclose() in test program.
Found by Cppcheck.
2013-07-13 21:06:56 +02:00
Philipp Wiesemann
80d2811c3f Removed unused variable and not needed assignment in test program.
Found by Cppcheck.
2013-07-13 21:05:13 +02:00
Philipp Wiesemann
2b52b168c3 Fixed printf() usage in test program.
Found by Cppcheck.
2013-07-13 21:02:23 +02:00
Ryan C. Gordon
35232f9450 Removed some unused variables. 2013-07-11 12:27:39 -04:00
Sam Lantinga
f5306d72d0 Added release/acquire memory barriers to the atomic API
* Added a destructor to clean up TLS memory at thread shutdown
* Refactored the TLS code to have platform independent code and a small platform dependent core with a fallback to generic code if platform dependent functions fail.
* Fixed recursion issues with SDL_GetErrBuf()
2013-07-10 18:31:17 -07:00
Sam Lantinga
9c0dea8e15 Implemented an API for thread-local storage: SDL_TLSCreate(), SDL_TLSSet(), SDL_TLSGet() 2013-07-10 02:32:04 -07:00
Edward Rudd
5d3f154808 change fsaa argument for testgl to accept a # of samples for FSAA 2013-07-08 17:51:17 -04:00
Sam Lantinga
35c747cd4d Added automated test to validate conversion between all supported formats. 2013-07-07 12:34:26 -07:00
Sam Lantinga
70ad624d0f We don't want to save the alpha modulation, we want to save the blend mode. 2013-06-27 11:49:19 -07:00
Sam Lantinga
7248fa2fff Updated testshader for the SDL 2.0 API 2013-06-27 11:44:07 -07:00
Sam Lantinga
5caa6632ae Better text printing for UTF-8 characters 2013-06-24 22:06:50 -07:00
Sam Lantinga
924968d2d0 Updated timer test and fixed performance counter on Mac OS X 2013-06-23 22:19:38 -07:00
Andreas Schiffler
ff47b549bd Update testsprite2 for visual testing: user fuzzer and add --iteration parameter to enable deterministic screen end-state 2013-06-23 15:00:23 -07:00
Sam Lantinga
13787068f8 Fixed bug 1916 - SDL_Keysym contains a deprecated field for unicode which may be removed.
Philipp Wiesemann

SDL_Keysym contains a deprecated field for unicode which may be removed for SDL 2.0 release.

As far as I can tell the field is not set on all "major" platforms and therefore will not be useful for most users. Its existence in a public header therefore becomes (in my opinion) only confusing.
2013-06-18 00:39:47 -07:00