Skip to content

Commit

Permalink
Add high-frequency touch events to iOS GameView (MonoGame#8092)
Browse files Browse the repository at this point in the history
* Fix iOS GamePlatform to run pending background tasks MonoGame#7520

In other `Platform` classes (such as `SDLGamePlatform` and `AndroidGamePlatform`, `Threading.Run()` is called during `Tick()` or `RunLoop()` (inconsistently, it may be called before or after `Game.Tick()` unfortunately).

Fixing this for `iOSGamePlatform`. `WinForms` and perhaps other platforms (Switch?) may suffer from the same issue.

Note that texture loading from background thread is discouraged however a lot of computationally intensive operations (reading/decoding the image file streams, allocating CPU buffers) could be done in the background thread and hence is a good practice to move such work alone into the bgthread until we request the actual texture from the main thread.

* Update docs for sync/test code

* Fix typo in comment

* Add coalesced touch events to iOS GameView

* Add coalesced touch API to TouchPanel*

* Fix UTF-8 copyright mistake

* Ensure we process coalesced touches only if the client asked for it

* Avoid using C#5.0+ features (expression-bodied properties)

* Suggested changes

* Remove Coalesced API (new) and update existing touch event with a flag for `isHighFrequency`.
 - Also consistently use `high-frequency` instead of `coalesced` when referring to this new behavior.

* Remove `out int` C# 7.0 / use C# 5.0 feature instead

* Update based on @harry-cpp comments

* Rename to `origin` instead of `upstream`

* Remove git stuff

* Address PR comments

* Change (c) UTF-8 due to codepage issues, my bad.

---------

Co-authored-by: Tom Spilman <tom@sickheadgames.com>
Co-authored-by: Thao D <thao.mindfulplay@gmail.com>
Co-authored-by: Simon (Darkside) Jackson <darkside@zenithmoon.com>
Co-authored-by: mindfulplay.build <mindfulplay@appu.app>
  • Loading branch information
5 people committed Dec 28, 2023
1 parent 6426332 commit 6570e12
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion MonoGame.Framework/Input/Touch/TouchPanel.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#region License
// /*
// Microsoft Public License (Ms-PL)
// XnaTouch - Copyright © 2009-2010 The XnaTouch Team
// XnaTouch - Copyright (C) 2009-2010 The XnaTouch Team
//
// All rights reserved.
//
Expand Down

0 comments on commit 6570e12

Please sign in to comment.