Commit Graph

46 Commits (threaded_video_fix)

Author SHA1 Message Date
cosmonaut bde31fbe07 change graphics backend selection behavior 2024-03-07 10:34:30 -08:00
cosmonaut c84752f38c D3D11 support 2024-03-05 16:17:29 -08:00
cosmonaut 4dbd5a2cbe MSDF font rendering + improved resource tracking (#52)
This is a major rewrite of the Font system. MoonWorks now uses MSDF font rendering, which allows high quality rendering of fonts at arbitrary sizes.

We now ship default embedded shader binaries for Video and Font. If you replace them with shader binaries of the same name located in your base directory, those will be used instead.

Many improvements have been made to resource tracking to prevent memory corruption, particularly on shutdown.

You must be careful not to leak AudioResource classes in particular, as there isn't much we can automatically do to recover from this without potentially crashing your game.

Reviewed-on: #52
2023-12-15 18:46:43 +00:00
cosmonaut 450b08cbd8 Atomically call graphics resource destroy function 2023-12-08 16:07:38 -08:00
cosmonaut e616b0fa62 resource management and logging improvements 2023-10-04 14:45:17 -07:00
cosmonaut 0c76c568a4 document the Game class 2023-09-19 17:04:28 -07:00
cosmonaut 81cd397013 fix AudioDevice crash on shutdown 2023-07-28 15:02:20 -07:00
cosmonaut bf3ad0c8b0 add Game.ShowRuntimeError method 2023-06-29 11:30:32 -07:00
cosmonaut 7e79e4a11d fix validator warnings on Quit 2023-06-15 17:45:26 -07:00
cosmonaut 80f3711f4c add Quit method to Game 2023-03-16 16:48:52 -07:00
cosmonaut 1f0e3b5040 Audio Improvements (#47)
- Audio is now processed on a background thread instead of the main thread
- Audio tick rate is now ~200Hz
- MoonWorks.Math.Easings class completely rewritten to be easier to understand and use
- SoundInstance properties no longer call into FAudio unless the value actually changed
- SoundInstance property values can now be interpolated over time (tweens)
- SoundInstance tweens can be delayed
- SoundInstance sets a sane filter frequency default when switching filter type
- StreamingSound classes can be designated to update automatically on the audio thread or manually
- StreamingSound buffer consumption should now set Stopped state in a more sane way
- Added ReverbEffect, which creates a submix voice for a reverb effect
- SoundInstance can apply a ReverbEffect, which enables the Reverb property
- Audio resource tracking improvements
- Some tweaks to VideoPlayer to make its behavior more consistent

Reviewed-on: #47
2023-03-07 23:28:57 +00:00
cosmonaut 970517c3c2 add window size change callback support 2022-11-15 22:53:37 -08:00
cosmonaut 59190e619d fix Mouse.Wheel calculation 2022-10-21 11:39:06 -07:00
cosmonaut 66c6ceec04 hide main window until Game.Run is called 2022-09-30 13:03:05 -07:00
cosmonaut dfddc24d0e add PresentMode to WindowCreateInfo 2022-09-30 13:02:51 -07:00
cosmonaut 07c0b1b9a2 Window API revision + Framerate limiter (#27)
- add `Backend` enum
- `GraphicsDevice` can now take a preferred backend at creation

- add `GraphicsDevice.ClaimWindow`
- add `GraphicsDevice.UnclaimWindow`
- add `GraphicsDevice.SetPresentMode`

- add `Window.Claimed`
- add `Window.SwapchainFormat`
- fix certain odd behaviors in multi-window scenarios

- rename `FramerateSettings` to `FrameLimiterSettings`
- add `Game.SetFrameLimiter`

Reviewed-on: #27
2022-09-29 22:22:50 +00:00
cosmonaut c649b24dad Game.Timestep is now public 2022-08-11 21:55:12 -07:00
cosmonaut 5a5fbc0c77 handle OS window size changes 2022-07-28 16:06:50 -07:00
cosmonaut f6fc80804e improve gamepad init and support hotplugging 2022-07-13 11:53:09 -07:00
cosmonaut a9b3b53ce9 add optional Destroy method to Game 2022-06-23 23:59:23 -07:00
cosmonaut 436affe5de remove some unnecessary qualifiers 2022-06-05 12:29:35 -07:00
darkerbit ff544140e0 add file drop API 2022-06-05 12:27:46 -07:00
cosmonaut d2a51ce524 decouple fixed timestep from draw, add frame cap 2022-06-04 15:48:55 -07:00
cosmonaut 5a9709c843 revert Game and GameState change 2022-06-01 18:31:22 -07:00
cosmonaut 0e8188682e game state now changes on next update 2022-05-23 19:12:27 -07:00
cosmonaut 412f0ca179 game state system 2022-04-08 00:03:42 -07:00
cosmonaut 17333cfb67 destroy update 2022-03-03 17:16:39 -08:00
cosmonaut 9028a8b1a0 remove Window namespace 2022-02-25 13:23:31 -08:00
cosmonaut 8973b3e658 Formatting pass 2022-02-22 21:14:32 -08:00
cosmonaut a0c57c7a59 Cleanup fixes 2022-02-22 16:44:39 -08:00
cosmonaut 5679dba978 Actually dispose graphics resources 2022-02-22 14:29:50 -08:00
cosmonaut cb25e6feff resource destroy now requires a CB 2022-02-18 21:02:16 -08:00
cosmonaut 9f588d389b tighten game loop timing 2021-07-23 15:47:02 -07:00
cosmonaut 681e620477 add mouse wheel support 2021-03-26 12:20:05 -07:00
cosmonaut 984e30cc4c add system for text input 2021-03-25 15:57:26 -07:00
cosmonaut b93945c51b draw every loop 2021-01-26 14:09:10 -08:00
cosmonaut 0dcb103994 rename Window to OSWindow for namespacing + add alpha timing to draw 2021-01-25 13:02:35 -08:00
cosmonaut 2978528f3b set a more sensible max delta time 2021-01-22 23:43:48 -08:00
cosmonaut f2487cd71b add mouse input + move inputs to Input namespace 2021-01-22 00:20:07 -08:00
cosmonaut ec28d17a75 fix static sound loading + window title 2021-01-19 21:33:25 -08:00
cosmonaut adf047955e handle quit 2021-01-19 20:23:09 -08:00
cosmonaut bc69931042 small style change 2021-01-19 19:34:26 -08:00
cosmonaut 2cabaa6186 replace Campari with MoonWorks.Graphics 2021-01-19 19:33:27 -08:00
cosmonaut 768bf38e3f starting audio implementation 2021-01-19 18:06:10 -08:00
cosmonaut 55cd87ab28 more window init stuff 2021-01-19 11:24:23 -08:00
cosmonaut 7d3932da9b initial input handling 2021-01-18 23:29:07 -08:00