Commit Graph

287 Commits

Author SHA1 Message Date
Joseph Cloutier
4819ff3b27 Make C++ mutex methods constant.
Closes #1729.

Co-authored-by: Diego Fonseca <fonseca.diego.feeshy@gmail.com>
2024-02-05 15:11:33 -05:00
Joseph Cloutier
9a9b89ae06 Merge branch 'develop' into 8.2.0-Dev 2023-08-17 21:07:12 -04:00
Josh Tynjala
9e2d431e2b Merge branch 'develop' into 8.1.0-Dev 2023-06-06 12:35:57 -07:00
Josh Tynjala
aebf139dc7 Fix window show/hide on desktop being incorrectly considered the same as app going into and out of the background/suspend on mobile
The app's Timers should still continue when a window is hidden. Especially since an app could have multiple windows, with some being shown and some being hidden. If only one were hidden, the other shown windows would clearly behave in a broken manner because the one hidden window would cause all app timers, even those associated with other windows, to be paused.

Introduces new WINDOW_SHOW AND WINDOW_HIDE events from C++ to Haxe, and new onShow and onHide events on Haxe Window.

Followup to 0918ee2381
2023-06-06 10:56:06 -07:00
Josh Tynjala
f053205b7e Merge branch 'develop' into 8.1.0-Dev 2023-06-05 14:29:12 -07:00
Josh Tynjala
0918ee2381 SDLApplication: fix inconsistent setting of inBackground flag when dispatching WINDOW_DEACTIVATE and WINDOW_ACTIVATE (closes openfl/openfl#2645)
On SDL_APP_WILLENTERBACKGROUND and SDL_APP_DIDENTERFOREGROUND, inBackground was being toggled, but it was not toggled on SDL_WINDOWEVENT_SHOWN and SDL_WINDOWEVENT_HIDDEN. However, both pairs were dispatching WINDOW_DEACTIVATE and WINDOW_ACTIVATE from C++ to Haxe. When inBackground wasn't toggled, the UPDATE ApplicationEvent continued being dispatched from the C++, but the Haxe assumed that it wouldn't be. This meant that timers were still updated after WINDOW_DEACTIVATE for SDL_WINDOWEVENT_HIDDEN, but then they were still "advanced" as if paused on WINDOW_ACTIVATE for SDL_WINDOWEVENT_SHOWN. The next update time would be some time in the future, roughly equal to how long the Haxe thought the timers were paused. This could make it seem like the timers completed stopped updating, especially if they should have been paused for a long time. They would eventually continue, but they should have paused on WINDOW_DEACTIVATE and continued immediately on WINDOW_ACTIVATE.
2023-06-05 14:22:19 -07:00
Joshua Granick
35d1436dcd Revert WebAssembly improvements (moved to 8.1.0-Dev branch) 2023-05-30 09:03:18 -07:00
Joshua Granick
58275329cc Minor WebAssembly adjustments 2023-05-30 08:54:19 -07:00
Joshua Granick
79e11e4270 Minor main loop change for Emscripten 2023-05-30 08:54:09 -07:00
Joshua Granick
2406ff4b94 Minor WebAssembly adjustments 2023-05-24 12:37:17 -07:00
Joshua Granick
de5844aae1 Minor main loop change for Emscripten 2023-05-23 20:49:54 -07:00
EliteMasterEric
a7b83cb688 Removed Joystick trackball support. 2023-05-11 20:22:27 -04:00
Josh Tynjala
ab0cdc057d Merge branch '8.1.0-Dev' into 8.2.0-Dev 2023-04-24 14:01:04 -07:00
Josh Tynjala
f07e94708b Window: minWidth/minHeight/setMinSize and maxWidth/maxHeight/setMaxSize 2023-04-11 09:46:10 -07:00
Josh Tynjala
2b8e3c439e Merge branch '8.1.0-Dev' into 8.2.0-Dev 2023-03-20 09:44:45 -07:00
Josh Tynjala
0160c12311 Window: visible property to show and hide window 2023-03-16 08:41:56 -07:00
Josh Tynjala
2f4b0844ef Merge pull request #1531 from player-03/submodules
Restructure and update submodules
2023-01-13 13:44:33 -08:00
player-03
ea1c233251 Merge branch 'openfl:develop' into submodules 2022-12-01 11:58:25 -05:00
player-03
fe6f1db7fd Merge pull request #1579 from ShaharMS/develop
Implement `clickCount` on HTML5 and Native.
2022-10-10 13:32:34 -04:00
ShaharMS
5a18ed4f1a implementation in SDLApplication, fix in MouseEvent.cpp 2022-09-13 13:05:25 +03:00
player-03
f69c5a5d5c Sort function declarations. 2022-08-12 12:17:30 -04:00
player-03
42e3450614 Sort functions and standardize formatting.
The new version no longer checks the return code of `SDL_GetWindowOpacity`, for consistency with the other getters. In theory this should be fine, because the only documented error condition is if the window is invalid, at which point none of the getters matter. If the platform doesn't support transparency, "opacity will be reported as 1.0f without error."
2022-08-12 12:16:26 -04:00
Apprentice-Alchemist
1c8c6c1a5e Implement window transparency. 2022-08-04 22:00:49 +02:00
Josh Tynjala
81d682d355 Window: add new setTextInputRect() method to optionally specify the location of the input when textInputEnabled is set to true
On native, this uses SDL_SetTextInputRect
2022-06-09 14:14:05 -07:00
Joseph Cloutier
31e9ab663d Remove unused case.
The `HX_WINDOWS` case is handled a bit further down.
2022-05-19 18:23:20 -04:00
Joseph Cloutier
19eab56416 Define HAVE_STDIO_H.
SDL can operate without stdio.h, but Lime requires it in most cases.
2022-05-19 18:21:48 -04:00
Joseph Cloutier
d21847e65c Update SDL to 2.0.22.
On Android, `SDL_RWops` no longer stores a plain file descriptor,
so the `AAsset` API must be used instead:
https://developer.android.com/ndk/reference/group/asset

`HAVE_INOTIFY` is required on Linux at the moment, but the bug will be
fixed in the next SDL release.
2022-05-19 17:34:20 -04:00
Joseph Cloutier
f200ecd9ca Use the official SDL repo as a submodule.
Continuing to use version 2.0.12 for now.

Missing changes:
370d05558c
e572215f5a
fa51fcb56b

Notes:
The changes in e572215 will be included when we update SDL.
The files.xml change from fa51fcb is actually included.
https://github.com/kcat/openal-soft/pull/227 is not resolved.
2022-05-12 23:17:16 -04:00
Justin Espedal
ed3686661a Fix GC issues on iOS 15 with iPhone 12
https://github.com/HaxeFoundation/hxcpp/issues/969#issuecomment-941127280
2021-11-01 10:10:12 -07:00
Joshua Granick
20baa3ba6e Make sure strings are null-terminated (resolve #1441) 2021-01-04 11:34:54 -08:00
Joshua Granick
aeb6c415c5 Compile fix 2020-12-17 12:37:37 -08:00
Joshua Granick
fcac041024 Revert "Allow sparse rendering while resizing/moving application on Windows"
This reverts commit c873ff2f2e.
2020-03-31 14:31:06 -07:00
Joshua Granick
8fc7b43eda Revert "Send both update and render events on Windows resize/move"
This reverts commit a2413c4fad.
2020-03-31 14:30:56 -07:00
Joshua Granick
a2413c4fad Send both update and render events on Windows resize/move 2020-03-11 11:28:17 -07:00
Joshua Granick
c873ff2f2e Allow sparse rendering while resizing/moving application on Windows 2020-03-10 13:04:58 -07:00
Joshua Granick
3000f74f06 Revert unneeded window changes for Android fullscreen 2019-10-09 11:52:41 -07:00
Joshua Granick
bb2af5eed1 Rely on SDL for Android fullscreen window behavior 2019-10-08 13:41:36 -07:00
Joshua Granick
e9a790a4ea Update SDL to 2.10 2019-08-20 12:59:31 -07:00
Joshua Granick
703a57b6fa Main loop tweaks 2019-07-10 15:17:54 -07:00
Joshua Granick
dda2edd8e4 Update SDL again 2019-05-08 17:12:51 -07:00
Joshua Granick
2cb09c55df Retain SDL joystick IDs 2019-04-04 10:20:35 -07:00
Joshua Granick
3b9ca3a770 Fixes for vdynamic return types 2019-03-14 12:34:08 -07:00
Joshua Granick
a482c14d5c GL binding fixes 2019-03-14 10:15:00 -07:00
Joshua Granick
a445e62030 Allow Android applications to manage back button 2019-02-14 13:28:05 -08:00
Joshua Granick
290c2912a3 Fix incorrect SDL init 2019-02-14 13:24:21 -08:00
Joshua Granick
964242ae14 Use consistent data type for application frame updates 2019-02-06 01:43:04 -08:00
Joshua Granick
4f5c9a0987 Don't init audio if unused 2019-01-11 16:08:01 -08:00
Joshua Granick
1a5090d5be Fix GL_MakeCurrent call 2018-11-29 17:26:49 -08:00
Joshua Granick
18502d49c0 Make sure can set our GL context as the current on Window creation 2018-11-29 12:37:08 -08:00
Joshua Granick
2dcd5c969c Add missing minor changes to internal Clipboard API 2018-11-15 19:15:18 -08:00