Commit Graph

83 Commits

Author SHA1 Message Date
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
Andreas Schiffler
81ede0b7ca Fix option for forced run of disabled tests in test harness 2014-07-06 20:41:39 -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
Ryan C. Gordon
25c056b0ae Changed SDL_GetAbsoluteMouseState() to SDL_GetGlobalMouseState().
This matches naming conventions in the main repository, between
 SDL_GetRelativeMouseState() and SDL_WarpMouseGlobal().
2014-06-25 16:16:55 -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 Clegg
5cc37d29ec Fix compiler warnings in Native Client and Linux builds. 2014-06-20 11:10:16 -03:00
Brandon Schaefer
e6bd634e07 Turns out visualstudio does not like PRIu64, soo lets just cast it to llu. 2014-06-05 15:37:33 -07:00
Brandon Schaefer
aa844a18c6 Fix warnings, only major one being an SDL_SetError not providing enough arguments. 2014-06-05 15:29:23 -07:00
Sam Lantinga
e1f626d3ff Code analysis annotations found a legitimate bug! 2014-06-05 09:49:45 -07:00
Ryan C. Gordon
1c00a0fc42 Implemented SDL_GetAbsoluteMouseState().
X11 only for now, but this should be doable on every platform, I think.
2014-06-05 00:03:33 -04:00
Sam Lantinga
667b15f3c8 Added annotations to help code analysis tools
CR: Bruce Dawson
2014-06-04 10:56:56 -07: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
Ryan C. Gordon
c28b3364b0 Implemented SDL_CaptureMouse(). 2014-05-24 01:30:37 -04:00
Sam Lantinga
ea48adddc2 Fail if we couldn't create the specified renderer 2014-04-05 16:25:30 -07:00
Sam Lantinga
0097382ac2 Added an event SDL_RENDER_DEVICE_RESET, which is triggered on Direct3D 11 when the device has been lost and all textures need to be recreated. 2014-03-23 23:09:22 -07: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
34d80ff6f0 Fixed bug 2423 - timeBeginPeriod & timeEndPeriod mismatch
Coriiander

In src\timer\windows\SDL_systimer.c there is an error with regards to timeBeginPeriod and timeEndPeriod. These functions typically get called when no high resolution timer is available, and GetTickCount is not used.

According to MSDN (link: http://msdn.microsoft.com/en-us/library/windows/desktop/dd757624(v=vs.85).aspx), for every call to timeBeginPeriod a subsequent call to timeEndPeriod is required. While SDL is currently doing this, it fails to call timeEndPeriod when cleaning up/shutting down SDL. Please note that these functions affect things on a system level. Failing to call timeEndPeriod, disables applications for using WINMM-timers after usage&shutdown of SDL, as effectively they the mechanism is now broken.

Solution:
Ensure this code gets called when shutting down the timer subsystem:

#ifndef USE_GETTICKCOUNT
if (!hires_timer_available)
{
    timeSetPeriod(0);
}
#endif
2014-03-01 09:50:52 -08:00
Sam Lantinga
38e55d5f40 Added SDL_DXGIGetOutputInfo which returns the adapter and output indices that are used to create DX10 and DX11 devices and swap chains on a particular display.
CR: SamL
2014-02-13 11:05:30 -08:00
Sam Lantinga
e987abc343 Exposed the font character size and SDLTest_DrawCharacter() to make it easier to do custom debug text layout 2014-02-10 10:02:42 -08:00
Sam Lantinga
dba255c1e5 Fixed bug 2374 - Update copyright for 2014...
Is it that time already??
2014-02-02 00:53:27 -08:00
Philipp Wiesemann
9cc268018e Fixed spaces in source file license comment. 2014-01-29 00:29:14 +01:00
Sam Lantinga
1ae5a81b22 Make sure you clean up the associated renderer when destroying a window. 2014-01-18 11:47:03 -08:00
Jørgen P. Tjernø
0fbedf0a52 Test: Add Shift-Enter to switch between FS and desktop FS. 2014-01-15 11:08:55 -08:00
Jørgen P. Tjernø
0cc44e6565 Tests: Refactor key modifier checking. 2014-01-15 10:40:14 -08:00
Sam Lantinga
1b084ac193 Print events with SDL_Log() so they show up in Visual Studio debug output
Added some joystick and controller events to the set that are printed out.
2013-12-23 15:55:47 -08:00
Sam Lantinga
85c6638510 Added support for double-clicks, through a new "clicks" field in the mouse button event. 2013-12-23 12:17:52 -08:00
Sam Lantinga
314373bb57 Accidentally committed debug code 2013-11-18 20:22:36 -08:00
Sam Lantinga
1551cdcaae Textures need to be freed before renderers 2013-11-18 20:21:45 -08:00
Philipp Wiesemann
99411672af Added missing resource release in test source. 2013-11-18 23:45:46 +01:00
Sam Lantinga
fc5aad869c Added space in the common state structure for render targets 2013-11-15 22:01:58 -08:00
Sam Lantinga
3149882085 Toggling fullscreen now takes fullscreen flags 2013-11-11 01:59:20 -08:00
Ryan C. Gordon
31d687d92e Fixed common test usage string (was "hidpi", should be "highdpi"). 2013-10-30 16:39:35 -04:00
Sam Lantinga
756d6bb44a Fixed bug 2015 - surface getting leak in SDLTest_ScreenShot function
Nitz 2013-08-06 03:53:41 UTC

In function SDLTest_ScreenShot() surface pointer getting leak while return
2013-10-21 00:30:05 -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
Gabriel Jacobo
8eae84fcf7 Adds gl_profile_mask to test framework, uses it in testgles 2013-10-10 00:49:57 -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
dcaec5adaf Moved D3D_LoadDLL and SDL_Direct3D9GetAdapterIndex to SDL_windowswindow.c at Jorgen's insistence. That file is wrapped in a more appropriate define check so it will work if somebody builds a binary without D3D support.
Added a reference to SDL_Direct3D9GetAdapterIndex to SDL_test_common.c so SDL will fail to compile if the new symbol isn't included properly.

CR: Jorgen
2013-09-28 14:06:20 -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
753aae78fc Christoph Mallon: Remove pointless if (x) before SDL_free(x) 2013-08-29 08:29:21 -07:00
Gabriel Jacobo
8515791f86 OCD fixes: Adds a space after /* (glory to regular expressions!) 2013-08-21 09:47:10 -03:00
Ryan C. Gordon
7ad45365b7 More compiler warning fixes. 2013-07-20 19:58:17 -04:00
Philipp Wiesemann
4c6c11e3a3 Corrected comments in test library source. 2013-07-20 11:16:50 +02:00
Ryan C. Gordon
a5e528c444 Added finger events to SDLTest_PrintEvent(). 2013-07-18 22:20:09 -04:00
Ryan C. Gordon
71117d7c74 Attempt to fix a compiler warning on Haiku.
(if this works...Haiku generates no warnings. I know, right?!?)
2013-07-11 23:17:52 -04:00
Edward Rudd
c4fe4c4f29 add in alt+enter keyboard shortcut to test common to toggle fullscreen desktop 2013-06-04 12:02:18 -04:00
Andreas Schiffler
4835250790 Fix bug 1492: Visual Studio builds sdl.lib and sdl.dll for version 2.0 (contributed by Jan Reitz); update SDL_bool handling in test_common to fix VS compiler warnings 2013-05-30 20:03:56 -07:00
Sam Lantinga
028c19b92b When the window is resized, the viewport is automatically reset.
This resolves lots of confusion around resizable windows.  Most people don't expect a viewport to be implicitly set when the renderer is created and then not to be reset to the window size if the window is resized.

Added common test command line parameters --logical WxH and --scale N to test the render logical size and scaling APIs.
2013-05-29 03:22:19 -07:00
Sam Lantinga
1063a72829 Fixed bug 1837 - Use error extension instead of glGetError()
Implemented support for GL_ARB_debug_output, but was unable to test it on Mac OS X.
2013-05-19 22:28:10 -07:00
Sam Lantinga
0d9b661db8 File style cleanup for the SDL 2.0 release 2013-05-18 14:17:52 -07:00