Alex Szpakowski
65e07b3884
iOS/tvOS: fix support for SDL_GameControllerGetButton(controller, GUIDE) with MFi controllers (thanks Caleb!)
...
Fixes bug #4463 .
2019-01-31 19:52:47 -04:00
Alex Szpakowski
dc3443602b
render: Fix internal state getting out of sync when destroying a texture that was just rendered and then creating a new one, in the GL and GLES2 backends. Fixes bug #4433 .
2018-12-21 20:53:31 -04:00
Alex Szpakowski
c7db6ade7d
metal: Implement SDL_LockTexture for YUV formats.
2018-12-19 18:27:21 -04:00
Alex Szpakowski
ce8c716ada
metal: Implement SDL_LockTexture for non-YUV textures.
2018-12-18 14:23:05 -04:00
Alex Szpakowski
37b1f989ce
metal: use a staging texture in SDL_UpdateTexture, to make sure it doesn't stomp texture data being drawn in a previous frame on the GPU.
2018-11-25 22:13:09 -04:00
Alex Szpakowski
872936a485
metal: Fix an incorrect division.
2018-11-21 23:46:37 -04:00
Alex Szpakowski
4a58722b9f
metal: SDL_RenderFillRects uses one draw call per 16k rectangles (within the given FillRects call), instead of one draw call per rectangle. Reduces CPU usage when drawing many rectangles.
2018-11-21 23:37:23 -04:00
Alex Szpakowski
c525ff354d
cocoa: fix building with the macOS 10.7 SDK (thanks Riccardo!)
...
Fixes bug #4368
2018-11-10 20:56:23 -04:00
Alex Szpakowski
5029d50ea8
Add SDL_TouchDeviceType enum and SDL_GetTouchDeviceType(SDL_TouchID id).
...
Touch device types include SDL_TOUCH_DEVICE_DIRECT (a touch screen with window-relative coordinates for touches), SDL_TOUCH_DEVICE_INDIRECT_ABSOLUTE (a trackpad-style device with absolute device coordinates), and SDL_TOUCH_DEVICE_INDIRECT_RELATIVE (a trackpad-style device with screen cursor-relative coordinates).
Phone screens are an example of a direct device type. Mac trackpads are the indirect-absolute touch device type. The Apple TV remote is an indirect-relative touch device type.
2018-11-10 16:15:48 -04:00
Alex Szpakowski
244b79e194
metal: SDL_RenderReadPixels on macOS synchronizes the render target's texture data if it's managed, before reading from it.
2018-11-04 14:31:56 -04:00
Alex Szpakowski
c9fed27289
metal: fix the SDL_RENDERER_PRESENTVSYNC flag not being set on the renderer info on macOS, when vsync is used.
2018-11-04 12:31:02 -04:00
Alex Szpakowski
c2bba9e448
metal: fix the size of the buffer used for constant data.
2018-11-04 12:24:05 -04:00
Alex Szpakowski
457390fcf8
metal: avoid an extra buffer allocation and GPU data copy in RunCommandQueue, it's not needed. Improves overall performance.
2018-11-01 20:24:21 -03:00
Alex Szpakowski
4e86dfd8d1
metal: remove an obsolete section of a constant buffer.
2018-11-01 19:49:01 -03:00
Alex Szpakowski
e2ad654f2e
iOS: Don't ignore the requested alpha bit size when determining whether to use an RGBA8 backbuffer.
2018-10-14 17:26:10 -03:00
Alex Szpakowski
8c41e2624e
metal: Fix SDL_RenderReadPixels to wait for the GPU to finish rendering to the active texture before reading its pixels.
2018-10-13 03:36:42 -03:00
Alex Szpakowski
d8022d19b4
macOS: Fixed MoltenVK dynamic library loading code.
2018-10-12 23:23:52 -03:00
Alex Szpakowski
d9094421e1
metal: Fix high dpi and resizing on macOS, and clean up iOS code. Fixes bug #4250 .
2018-10-12 17:55:42 -03:00
Alex Szpakowski
fb485986eb
macOS: Fix a crash when the video subsystem quits, if SDL_MAC_NO_SANDBOX was defined when SDL was compiled.
2018-09-30 11:26:41 -03:00
Alex Szpakowski
3bfada2e02
Android: resolve symlinks in SDL_AndroidGetInternalStoragePath (thanks Henrique Gemignani and cigumo!)
...
Fixes issues on modern Android versions when the path is used in code that explicitly doesn't follow symlinks (such as PHYSFS_mkdir).
2018-01-10 19:56:51 -04:00
Alex Szpakowski
7d5437bb31
metal: set max texture size based on device capability.
2018-01-07 22:00:37 -04:00
Alex Szpakowski
a8c0532c08
metal: Fix pipeline states to use the pixel format of the current render target, instead of a hard-coded format.
2018-01-07 16:57:32 -04:00
Alex Szpakowski
740a90af37
metal: Add support for YUV/NV12 texture formats.
2018-01-06 18:54:12 -04:00
Alex Szpakowski
9a8683b275
metal: use a private instead of managed buffer for the renderer's non-changing constant data.
...
Recommended by Xcode's Metal frame capture analysis.
2018-01-04 22:16:42 -04:00
Alex Szpakowski
990ebba55a
metal: Implement fast hardware clearing when possible, by deferring the start of a render pass until a clear or draw operation happens.
2018-01-04 19:29:33 -04:00
Alex Szpakowski
888198ee31
metal: Misc. improvements.
...
- Use a single buffer for various non-changing constants accessed by the GPU, instead of multiple buffers.
- Do the half-pixel offset for points and lines using a transform matrix so we don't need a malloc when rendering.
- Don't add a half-pixel offset for other primitives and textures. This matches D3D and GL render behaviour.
- Remove the half-texel texture coordinate offset since it's not needed now that there's no more half-pixel position offset when rendering a texture.
- Don't try to set texture usage on iOS 8 since it doesn't exist there.
2018-01-03 00:43:01 -04:00
Alex Szpakowski
f9cd765020
metal and moltenvk: fix highdpi.
2018-01-02 21:44:28 -04:00
Alex Szpakowski
ef1014ac68
configure script: Implement testing for build-time Metal SDK support.
2018-01-02 19:06:14 -04:00
Alex Szpakowski
07f08b47ff
metal: Fix a typo preventing iOS compilation...
2018-01-01 23:06:08 -04:00
Alex Szpakowski
1cc6603378
metal: Clean up manual reference counting. Fixes some memory leaks.
2018-01-01 23:03:50 -04:00
Alex Szpakowski
a452a08458
iOS: fix build
2018-01-01 19:40:29 -04:00
Alex Szpakowski
639ea9fdbc
metal: Use sampler state objects instead of shader-declared samplers for linear vs nearest filtering.
...
This avoids a ton of shader duplication once multiple shaders that use samplers are added (e.g. the currently missing YUV shaders).
2018-01-01 19:37:16 -04:00
Alex Szpakowski
cf45cf70e5
metal: Add support for custom blend modes.
2018-01-01 18:06:27 -04:00
Alex Szpakowski
85470a2f95
metal: implement SDL_RenderCopyEx, and fix a memory leak in SDL_CreateTexture.
2017-12-31 21:06:16 -04:00
Alex Szpakowski
047d387b2e
metal: Use the existing cocoa code for creating a Metal view on macOS. Fixes the renderer size when the window is resized.
2017-12-31 15:30:08 -04:00
Alex Szpakowski
48fea0cee4
macOS: Fix MoltenVK Metal view resizing, and allow the metal view to be used without vulkan.
2017-12-31 15:21:25 -04:00
Alex Szpakowski
42b19c9749
metal: Respect the vsync flag on macOS 10.13+.
2017-12-30 22:39:55 -04:00
Alex Szpakowski
e24dc9053b
metal: use a projection matrix instead of manually transforming vertices into clip space on the CPU.
2017-12-30 20:32:22 -04:00
Alex Szpakowski
49df65c25a
metal: only 4 (instead of 5) vertices are needed to draw rectangles and textures, and only 3 (instead of 5) vertices are needed to cover the screen for the 'full-screen quad' when clearing.
2017-12-30 18:48:07 -04:00
Alex Szpakowski
64ec4c3334
macOS: Make sure the desktop's display mode is always in SDL's list of display modes.
2017-12-29 22:13:40 -04:00
Alex Szpakowski
5501bcc834
macOS: Fix an OS-generated warning printed to stdout on launch in bundled apps.
2017-11-09 22:24:09 -04:00
Alex Szpakowski
fb071a4cd9
Mac: Fix the menu bar not always working for non-.app-bundled apps. Fixes bug #3051 .
2017-09-25 20:49:31 -03:00
Alex Szpakowski
e5cfb58f4a
iOS MoltenVK code style cleanup.
2017-09-21 20:30:25 -03:00
Alex Szpakowski
80f9e2f199
iOS: Fix compiling using the iOS 7 SDK, partially broken since MoltenVK support was added.
...
Note that apps submitted to the iOS App Store *must* use a modern iOS SDK (currently iOS 10 is probably the minimum), however the SDK used to build is separate from the minimum iOS version an app supports at runtime.
2017-09-21 20:11:44 -03:00
Alex Szpakowski
d452b89f9b
iOS: I don't think SDL compiles with the iOS 7 SDK anymore, so we might as well drop the #ifdefs trying to guard for that.
2017-09-20 11:01:32 -03:00
Alex Szpakowski
12fb004fba
iOS: remove an unused static variable
2017-09-20 10:53:41 -03:00
Alex Szpakowski
20207abf80
macOS: Update controller mapping of Steelseries Stratus XL to account for reversed thumbstick y-axis values (bug #3483 ).
2017-08-31 22:07:28 -03:00
Alex Szpakowski
d7ae313134
macOS: Fix menubar items being enabled when they shouldn't be.
2017-08-31 21:34:29 -03:00
Alex Szpakowski
b959be2569
Code style cleanup in the Cocoa and UIKit vulkan files.
2017-08-31 21:26:13 -03:00
Alex Szpakowski
cfd7a7fac6
macOS: Prevent unwanted native fullscreen (Spaces) toggles when the window is in fullscreen or isn't resizable. Fixes bug #3691 .
2017-08-31 21:13:32 -03:00
Alex Szpakowski
3d0f521be5
iOS 10: Work around screen bounds orientation bug. Fixes bugs #3465 and #3505 .
2017-08-18 23:23:30 -03:00
Alex Szpakowski
efc43a1d88
More cleanup of the iOS keyboard demo.
2017-08-15 23:00:54 -03:00
Alex Szpakowski
a0a09f646c
Improve iOS keyboard demo code a bit.
2017-08-15 22:53:57 -03:00
Alex Szpakowski
2e4248ed44
Address a compiler warning.
2017-08-15 18:29:47 -03:00
Alex Szpakowski
9be597a0d6
iOS: Fix app orientation when creating a landscape fullscreen window with the device currently in portrait orientation.
2017-08-12 22:16:04 -03:00
Alex Szpakowski
01050d4ed1
iOS: Use modern replacements for deprecated functions, when available.
2017-07-15 17:41:58 -03:00
Alex Szpakowski
efe179cdfe
macOS: Fix compilation when using 10.11 or earlier to build.
2017-07-14 17:42:11 -03:00
Alex Szpakowski
562473c1f4
macOS: Address more compiler warnings when building with a recent deployment target.
2017-07-13 23:09:37 -03:00
Alex Szpakowski
bc3ede1ed0
macOS: Replace uses of deprecated Cocoa enum names with modern/consistent equivalents.
2017-07-13 22:59:02 -03:00
Alex Szpakowski
e0ea4da4ae
Fix a potential crash in macOS 10.7 and earlier.
2017-07-12 21:32:10 -03:00
Alex Szpakowski
8292d73ebb
macOS: Expose more display modes on retina screens. Fixes an issue found in BZFlag.
2017-07-12 21:28:32 -03:00
Alex Szpakowski
bb100d3bab
Expose display refresh rate on iOS/tvOS 10.3+.
2017-06-10 21:29:37 -03:00
Alex Szpakowski
75fb07a6d2
iOS: Only mark interrupted audio devices as non-interrupted if AudioQueueStart is successful.
2017-05-03 18:05:29 -03:00
Alex Szpakowski
fd85f5748d
Mac: back out commit 3e9b2ae41adf. It causes significant overhead on many GPUs.
2016-12-23 22:49:37 -04:00
Alex Szpakowski
d719374cb9
Mac: Fix over-saturated colors on P3 displays (e.g. the 2016 MBPs).
2016-12-23 22:08:18 -04:00
Alex Szpakowski
eda74fda96
tvOS: Expose remote swipe gestures as arrow key presses (thanks oviano!)
2016-12-18 13:05:14 -04:00
Alex Szpakowski
787a54c84b
iOS bug #3377 : work around bugs in some third party iOS libraries (e.g. Google admob) where they assume the optional UIApplicationDelegate ?window? property always exists and will crash if it doesn?t.
2016-12-18 12:28:28 -04:00
Alex Szpakowski
8500de8fa5
Fix tabs -> spaces
2016-10-01 19:16:46 -03:00
Alex Szpakowski
f0539aa25e
Fix bug 3436 - SDL_RaiseWindow not working on windows
2016-10-01 19:12:58 -03:00
Alex Szpakowski
571f4ce8a6
Fix CMake setting an incorrect video backend on iOS
2016-10-01 17:05:29 -03:00
Alex Szpakowski
f31c7086d8
Enable SDL_LoadObject on iOS 8+ and tvOS.
2016-09-25 15:02:06 -03:00
Alex Szpakowski
77bacfd72d
tvOS launch images are now properly supported.
2016-09-25 11:46:25 -03:00
Alex Szpakowski
a8b033d7c4
Update the code for the iOS demos to handle modern devices. Fixes bug #3337
2016-09-25 00:23:35 -03:00
Alex Szpakowski
40ecac8e60
Don't try to load a launch storyboard on tvOS (it doesn't use them).
2016-09-25 00:21:12 -03:00
Alex Szpakowski
666d3fecc8
iOS/tvOS: Try to load the launch screen as a storyboard. Xcode 8 compiles it as a storyboard instead of a nib.
2016-09-24 23:33:49 -03:00
Alex Szpakowski
9165ba7ebd
iOS/tvOS: Always send SDL_WINDOWEVENT_FOCUS_GAINED when a window is created on the main screen (fixes bug #3395 ).
2016-09-24 20:12:57 -03:00
Alex Szpakowski
450fa8cdf9
Use OS-provided click counts on macOS and iOS for mouse press and release events.
2016-09-24 18:46:34 -03:00
Alex Szpakowski
bac5394127
Fix mouse wheel events on macOS 10.12 (thanks Eric Wasylishen!)
...
Fixes bug #3432
2016-09-24 13:28:40 -03:00
Alex Szpakowski
f0fca2880f
Handle audio interruptions on iOS/tvOS. Fixes bugs 2569 and 2960.
2016-09-18 19:22:09 -03:00
Alex Szpakowski
459102a5c0
Updated URL in a comment
2016-09-17 01:36:29 -03:00
Alex Szpakowski
a96b6f2104
Added a new hint SDL_HINT_APPLE_TV_REMOTE_ALLOW_ROTATION.
...
When set to "1", the orientation of the Apple TV remote affects the axes of the corresponding SDL joystick. It is "0" (disabled) by default.
2016-09-17 01:31:07 -03:00
Alex Szpakowski
4bcce330d1
tvOS: Add drop-file support
2016-09-15 21:49:29 -03:00
Alex Szpakowski
4209a1fd4c
CoreAudio iOS/tvOS: Use AVFoundation instead of AudioSession. Fixes audio on tvOS.
...
Note that linking with AVFoundation is now required if you don't disable SDL_audio compilation on iOS and tvOS.
2016-09-15 19:59:57 -03:00
Alex Szpakowski
f050576665
Initial Apple TV / tvOS support.
...
The Apple TV remote is currently exposed as a joystick with its touch surface treated as two axes. Key presses are also generated when its buttons and touch surface are used.
A new hint has been added to help deal with deciding whether to background the app when the remote's menu button is pressed: SDL_HINT_APPLE_TV_CONTROLLER_UI_EVENTS.
2016-09-13 22:18:06 -03:00
Alex Szpakowski
86708c3cd8
Enable more compiler warnings in the Xcode projects (based on Xcode 8's suggestion), made some integer downcasts explicit.
2016-09-13 19:51:10 -03:00
Alex Szpakowski
d0bd0e4855
iOS: Fix an OpenGL ES error when rotating the device if MSAA is used (thanks Cole Campbell!)
...
Fixes bug #3378 .
2016-07-02 13:38:31 -03:00
Alex Szpakowski
ea2f5e5930
Windows: Fix other window positions/sizes being changed when exiting exclusive fullscreen (bug #3315 , thanks Simon Hug!)
2016-05-23 15:29:25 -03:00
Alex Szpakowski
0a4085a048
Mac: Fix a crash when SDL is compiled with SDL_MAC_NO_SANDBOX enabled, by increasing the stack size of the mouse tap thread back to OS X' default of 512 KB.
2016-05-21 12:09:23 -03:00
Alex Szpakowski
4a468739f8
Removed Mac OS 10.5 support (bug #3137 ). Also fixed a warning about deprecated Carbon code when using SDL_audio (bug #3127 , thanks Dominik!)
2016-05-21 00:20:52 -03:00
Alex Szpakowski
b15efce277
Cocoa mouse code: Replaced NSPointInRect with NSMouseInRect (thanks Eric Wasylishen!) Fixes bug #3312 .
2016-05-01 21:41:30 -03:00
Alex Szpakowski
d383502657
Mac: replaced a deprecated CGSetLocalEventsSuppressionInterval call that I missed in commit 2f72bdfee9bb
2016-05-01 19:51:10 -03:00
Alex Szpakowski
34f095e098
iOS: Fixed SDL_GL_CreateContext crashing instead of returning null when a GLES3 context is requested on iOS 6 and older.
2016-04-10 22:07:10 -03:00
Alex Szpakowski
6cfa71a10e
iOS: Also do the Dictation crash workaround before executing the animation callback.
2016-04-02 13:21:01 -03:00
Alex Szpakowski
88372277b7
Add a new hint SDL_HINT_MAC_MOUSE_FOCUS_CLICKTHROUGH, which allows mouse click events to occur when clicking to focus a window in Mac OS X.
...
Fixes bug #3300 .
2016-04-02 11:54:05 -03:00
Alex Szpakowski
5520ed9cc2
iOS: Workaround for a crash after Dictation is used.
2016-04-01 19:18:50 -03:00
Alex Szpakowski
08488e6d34
Mac: avoid calling CGSetLocalEventsSuppressionInterval, it was deprecated in OS X 10.6.
2016-03-20 15:35:34 -03:00
Alex Szpakowski
2c3bf6658a
Windows CMake: don't try to link dxguid, it's unavailable when using Visual Studio's XP-compatible toolset.
2016-03-18 22:15:53 -03:00
Alex Szpakowski
33af421d7b
Windows: make sure SDL_TicksInit has been called before calling Sleep(ms) in SDL_Delay. This ensures the Windows system timer resolution is properly set before Sleep is called.
2016-02-14 21:17:25 -04:00
Alex Szpakowski
8e7cd6b5da
iOS: Implemented clipboard support.
2016-02-03 20:32:55 -04:00
Alex Szpakowski
325921789a
x11: Fix AltGr generating an invalid keycode (bug #3244 ). Thanks Thomas!
2016-01-31 09:39:42 -04:00