Commit Graph

297 Commits

Author SHA1 Message Date
Shelvacu b1dba5939e lua.window.setPosition: add param waitForSync
if waitForSync is false, then SDL_SyncWindow is not called, and so the
method may return before the requested changes actually happen.

This is backwards-compatible with previous behaviour
2026-04-19 17:59:29 -07:00
Sasha Szpakowski 927fac1173 remove unused variable 2026-03-01 00:22:39 -04:00
Sasha Szpakowski 035187b637 window: fix setMode using stale minimum size information when applying the size.
fixes #2287
2026-03-01 00:20:32 -04:00
John Doe fc5eeb11a3 Fix copyright notice date 2026-01-21 18:49:11 +00:00
Miku AuahDark c4d30081f4 Move love.system.getTheme() to love.window.getSystemTheme().
Despite its name, `SDL_GetSystemTheme()` needs the video subsystem to properly function. So, put it in love.window instead.
2025-11-25 15:29:24 +08:00
John Doe 6f08eb94c6 Update copyright notice with correct year 2025-07-12 23:19:22 +01:00
Miku AuahDark be21958ab3 Don't canonicalize paths fom SDL file dialog callbacks.
If love.filesystem.openNativeFile can't open them, then it's SDL issue, not LOVE.
This is also needed because Android returns content:// URIs instead of regular paths.
2025-01-16 16:54:23 +08:00
Sasha Szpakowski 21c9c06d26 Fix vsync-off in conf.lua when vulkan is used 2025-01-07 20:28:28 -04:00
Sasha Szpakowski 44e26a12cd Fix build 2024-12-29 23:42:59 -04:00
Sasha Szpakowski ecd08a2b0f Add love.window.showFileDialog(type, callback [, settings]).
Resolves #990.

The type parameter is an enum: "openfile", "openfolder", or "savefile".

The callback parameter takes 3 args:
  files (array of full platform-dependent paths to selected files, empty if the dialog is canceled by the user),
  filtername (nil if none is set, see below),
  errorstring (nil if no error).

The optional settings parameter of showFileDialog has the following fields:
{
  title = string (optional title),
  acceptlabel = string (optional custom name for the Accept button),
  cancellabel = string (optional custom name for the Cancel button),
  defaultname = string (optional default folder/file name for the file text box),
  filters = table (filter names as keys and filter pattern strings as values).
}
2024-12-29 23:30:32 -04:00
Sasha Szpakowski e40e7317bb partial fix for high dpi on Windows
more work and possibly API redesigns will need to be done
2024-12-17 18:55:22 -04:00
Sasha Szpakowski a93eb5abc6 Fix icon and cursor rgba order 2024-11-01 17:09:42 -03:00
Sasha Szpakowski d099da1e3b Fix setting window position 2024-10-25 18:52:46 -03:00
Sasha Szpakowski b116857102 add love.exposed and love.occluded event callbacks.
Add love.window.isOccluded.

Resolves #2004.
2024-10-19 13:41:34 -03:00
Sasha Szpakowski d3cd2aef36 love.window.isVisible also checks if the window is minimized. 2024-10-19 11:26:17 -03:00
Sasha Szpakowski 337d8fa048 remove source code support for SDL2 2024-10-18 20:22:26 -03:00
Sasha Szpakowski 31ce65b9d2 Fix love.resize when SDL3 is used
Also fixes #2100.
2024-10-14 22:34:24 -03:00
Sasha Szpakowski b69a22dca3 sync window state in love.window.minimize 2024-10-14 17:37:56 -03:00
Sasha Szpakowski 28393cdfd5 Fix compilation on Windows when SDL3 is used 2024-10-06 20:27:59 -03:00
Sasha Szpakowski e986160431 Use SDL3-compatible SDL includes when SDL3 headers are available 2024-10-06 20:27:28 -03:00
Sasha Szpakowski 20b527f2ab Fix compile errors when SDL2 is used 2024-10-06 17:08:35 -03:00
Sasha Szpakowski dda7603d0d update SDL3 codepaths to work with 3.1. 2024-10-06 16:53:09 -03:00
Sasha Szpakowski ccdd7897f2 fix love.window.setMode failing to set an exclusive fullscreen mode. 2024-08-18 13:08:27 -03:00
Sasha Szpakowski ff2f57bdd4 fix msaa in love.window.getMode not updating after setMode. 2024-08-10 21:05:49 -03:00
Sasha Szpakowski 54a31ec615 Minimum required opengl version is now OpenGL 3.3 / OpenGL ES 3.0. 2024-06-19 18:08:09 -03:00
Sasha Szpakowski 1d9d3346c5 windows: prefer regular vsync instead of dwm flush syncs.
The latter can cause stuttering issues on some setups.
2024-04-05 22:30:58 -03:00
Mark Jansen a689d8e450 Fix building love on Windows for SDL3-3.1.0 2024-04-01 19:26:52 +02:00
Sasha Szpakowski 6dc2fdba35 SDL3: use synchronous window operations (for now). 2024-03-25 23:14:58 -03:00
Sasha Szpakowski 8d360113f8 update code for some recent SDL3 renames 2024-03-25 20:55:28 -03:00
Sasha Szpakowski 2bdadf51d4 Merge branch 'main' into SDL3 2024-03-24 18:53:08 -03:00
Sasha Szpakowski 1e97e09b28 Rework internal module registration to happen in constructors. 2024-02-24 15:21:38 -04:00
Sasha Szpakowski 007090af14 ImageData: remove automatic mutex locks. 2024-02-18 17:06:40 -04:00
Sasha Szpakowski ec177d51d1 deprecate love.window.close. 2024-02-12 20:06:55 -04:00
Sasha Szpakowski 64a30f177f Merge branch 'main' into 12.0-development 2024-02-10 12:24:48 -04:00
Sasha Szpakowski 94d5864144 update year for copyright notice 2024-02-10 12:13:22 -04:00
Sasha Szpakowski 62ac858f30 Initial source code support for SDL3. No build system support. 2024-02-04 17:02:26 -04:00
Sasha Szpakowski 6feedc8222 Add love.window.getPointer, returns a SDL_Window* as lightuserdata. 2024-01-08 21:09:40 -04:00
Sasha Szpakowski aaab9791d5 Improve backbuffer depth buffer.
- Setting the depth buffer for the backbuffer is now done as a boolean instead of a bit depth integer, in love.conf or love.window.setMode.
- Error if depth writes are enabled when the active canvas setup or backbuffer does not have a depth buffer (now it matches stencil behaviour).
- Don't allocate a backbuffer depth-stencil buffer if they're not requested. Metal also determines the format for that buffer based on which combination of depth and stencil is requested. OpenGL still has to allocate the depth-stencil buffer for the backbuffer all the time, because changing it requires the context to be recreated.
2024-01-06 15:21:06 -04:00
Sasha Szpakowski 6e80d85110 Merge branch 'main' into 12.0-development 2023-08-19 21:35:55 -03:00
Sasha Szpakowski e582677344 Fix mouse position backward compatibility with new SDL2 versions.
Clamp the mouse coordinates to the window's dimensions.
2023-07-01 17:53:29 -03:00
Sasha Szpakowski 7828d1e0fb Fix macOS colorspace backport 2023-04-23 21:19:32 -03:00
slime f6e9277a6d macOS: fix colors appearing oversaturated on P3 displays.
The fix only applies to macOS 11+ when using OpenGL.
2023-04-13 22:03:23 -03:00
Sasha Szpakowski 2c3ea60c79 Add love.window.focus (resolves #1911).
Calling the function brings the window into the foreground and makes it the focused window for keyboard input.
2023-04-01 18:02:16 -03:00
Sasha Szpakowski 95d44c2c2d very minor compile speed improvements 2023-02-11 16:29:24 -04:00
Sasha Szpakowski f6cdbdc868 Merge branch 'main' into 12.0-development 2022-12-31 22:46:34 -04:00
Sasha Szpakowski 0b75f6cfa5 Missed some files... 2022-12-31 22:36:48 -04:00
Sasha Szpakowski c823dbca96 Update copyright year for 2023 2022-12-31 22:25:49 -04:00
niki 28c69597e4 vulkan: fix crash 2022-12-22 02:27:35 +01:00
niki ccca355664 vulkan: fix love.window.setVsync 2022-12-22 01:27:05 +01:00
Sasha Szpakowski 90c3e8d6c8 remove pre-SDL 2.0.4 hacks from window code. 2022-12-07 23:30:20 -04:00