Commit graph

55 commits

Author SHA1 Message Date
Ryan C. Gordon
95f124004f Fixed more compiler warnings.
--HG--
extra : amend_source : 1308f531582719c674844d7aff00a60cc7d36c68
2016-11-23 11:49:26 -05:00
Sam Lantinga
97b094e050 Added debug output for new window events 2016-09-29 16:10:08 -07:00
Ryan C. Gordon
2875d70eba 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.

--HG--
extra : amend_source : 99ddce333d2a4de7d59adb88d5059b34d731d907
extra : histedit_source : 012e8cb2f7822cd55cbbc124f642ccc530e3f75b%2Cbddf95ecf18ca97e1e3d7840971ef14ca739c9da
2016-01-05 02:46:10 -05:00
Sam Lantinga
7ee8dda270 Updated copyright to 2016 2016-01-02 10:10:34 -08:00
Sam Lantinga
56b58afdbe Updated the copyright year to 2015 2015-05-26 06:27:46 -07:00
Ryan C. Gordon
317ab8a96a Fixed a compiler warning. 2015-03-18 00:56:33 -04:00
Ryan C. Gordon
0bdc0eedb8 Cleaned up some compiler warnings. 2014-12-26 23:16:54 -05:00
Edward Rudd
f39c6e8a6f switch to use SDL_PRI* macros for long long formatting everywhere. 2014-12-03 12:23:17 -05:00
Edward Rudd
e9d9c85e3c fix incorrect struct member name in test code for wheel direction 2014-12-03 11:04:07 -05:00
Edward Rudd
ecef423a78 update logging of events in test core
- log unknown as HEX instead of int (makes it easier to identify)
- add dollar gesture and multi gesture events
- add scroll reverse for mouse wheel
2014-12-03 11:00:56 -05:00
Sam Lantinga
c7790bdb2b 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
b273873297 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
8bd36ba18f 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
Ryan C. Gordon
c076f51669 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
Ryan C. Gordon
719a77b576 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
67f246e568 Implemented SDL_CaptureMouse(). 2014-05-24 01:30:37 -04:00
Sam Lantinga
4d9b83a876 Fail if we couldn't create the specified renderer 2014-04-05 16:25:30 -07:00
Sam Lantinga
c0e9a9afaf 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
Sam Lantinga
b7435a3ad3 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: 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
2d76dd6a5d 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
d7940a513e Fixed bug 2374 - Update copyright for 2014...
Is it that time already??
2014-02-02 00:53:27 -08:00
Sam Lantinga
b1e60f303c Make sure you clean up the associated renderer when destroying a window. 2014-01-18 11:47:03 -08:00
Jørgen P. Tjernø
38a50a1236 Test: Add Shift-Enter to switch between FS and desktop FS. 2014-01-15 11:08:55 -08:00
Jørgen P. Tjernø
ff68a1209b Tests: Refactor key modifier checking.
--HG--
extra : histedit_source : 97ec656c66fe1197d537484335ee7a0926ee5728%2C6b85a2c4eb34fd410c7a0549a065ad6b44a746bd
2014-01-15 10:40:14 -08:00
Sam Lantinga
e7bb3fd0fb 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
11fc41fde2 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
98ed49f28e Accidentally committed debug code 2013-11-18 20:22:36 -08:00
Sam Lantinga
5943722c97 Textures need to be freed before renderers 2013-11-18 20:21:45 -08:00
Philipp Wiesemann
42f34f61d6 Added missing resource release in test source. 2013-11-18 23:45:46 +01:00
Sam Lantinga
6f14a76111 Added space in the common state structure for render targets 2013-11-15 22:01:58 -08:00
Sam Lantinga
332f80d9f3 Toggling fullscreen now takes fullscreen flags 2013-11-11 01:59:20 -08:00
Ryan C. Gordon
d640f886b5 Fixed common test usage string (was "hidpi", should be "highdpi"). 2013-10-30 16:39:35 -04:00
Sam Lantinga
165ad7a5e6 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
a999af88e9 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
c51c4c0733 Adds gl_profile_mask to test framework, uses it in testgles 2013-10-10 00:49:57 -03:00
Sam Lantinga
583198f72e 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
a759ac24a1 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
3a11d95444 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
08dfaaa2e6 Christoph Mallon: Remove pointless if (x) before SDL_free(x) 2013-08-29 08:29:21 -07:00
Ryan C. Gordon
3a261795ed More compiler warning fixes. 2013-07-20 19:58:17 -04:00
Philipp Wiesemann
6fc856ae8a Corrected comments in test library source. 2013-07-20 11:16:50 +02:00
Ryan C. Gordon
600c62cf30 Added finger events to SDLTest_PrintEvent().
--HG--
extra : amend_source : 8e28c43eebf02b49e3f4502311a089090e65f2a6
2013-07-18 22:20:09 -04:00
Edward Rudd
60315067e3 add in alt+enter keyboard shortcut to test common to toggle fullscreen desktop 2013-06-04 12:02:18 -04:00
Andreas Schiffler
5d3e05c2c4 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
20c5cf1e8b 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
91ff680aa5 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
0cb6385637 File style cleanup for the SDL 2.0 release 2013-05-18 14:17:52 -07:00
Sam Lantinga
866f2e5f9e First pass on SDL render clip rect functionality 2013-05-04 04:46:00 -07:00
Jørgen P. Tjernø
4601f48f85 Add multimon & mouse tracking info to SDL_test_common. 2013-04-22 18:15:10 -07:00
Sam Lantinga
3afbe992d5 Removed Nintendo DS support since nobody has volunteered to maintain it for over a year. 2013-03-17 09:44:58 -07:00