Commit Graph

30 Commits (bb7e45b9a3fa65e0670d237a66643a3f0efd1052)

Author SHA1 Message Date
cosmonaut 0df2944ccf CommandBuffer is now a pooled class + more state validation 2024-01-18 12:27:34 -08:00
cosmonaut df3f38a67b Debug mode bounds checks for buffer and texture upload 2024-01-15 22:19:59 -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 a736ed031d clean up graphics resource code 2023-11-20 17:09:22 -08:00
cosmonaut b2a0ca3515 replace WeakReference with weak GCHandle 2023-11-20 15:18:06 -08:00
cosmonaut e616b0fa62 resource management and logging improvements 2023-10-04 14:45:17 -07:00
cosmonaut b026b9e81f add lots more doc comments 2023-09-19 13:19:41 -07:00
cosmonaut e0f05881b0 new MoonWorks.Graphics.Fence API 2023-09-18 23:18:21 -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 5baa1d7b40 Fix video shader base path lookup 2023-02-08 12:44:36 -08:00
cosmonaut 36ce74b58a tweak video shader filenames 2023-02-03 15:07:32 -08:00
TheSpydog 05de9a4066 Make video shaders optional and search for them in the root output directory (#42)
Whenever the video shaders change, they can be rebuilt with refreshc and distributed alongside the moonlibs.

Co-authored-by: Caleb Cornett <caleb.cornett@outlook.com>
Reviewed-on: #42
Co-authored-by: TheSpydog <thespydog@noreply.example.org>
Co-committed-by: TheSpydog <thespydog@noreply.example.org>
2023-01-21 23:37:01 +00:00
TheSpydog b1d30a9e6c Remove isFixed param from AcquireCommandBuffer call (#41)
Co-authored-by: Caleb Cornett <caleb.cornett@outlook.com>
Reviewed-on: #41
Co-authored-by: TheSpydog <thespydog@noreply.example.org>
Co-committed-by: TheSpydog <thespydog@noreply.example.org>
2023-01-14 18:04:53 +00:00
cosmonaut 36e6c6f332 optimize AcquireSwapchainTexture 2022-12-13 00:52:35 -08:00
cosmonaut 916962da6c garbage collection optimizations 2022-12-13 00:34:16 -08:00
cosmonaut b66e077376 GraphicsDevice throw if backend invalid 2022-09-29 19:21:47 -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 efb9893aef Theora video support + audio improvements (#20)
- `SoundInstance.Play` no longer takes a loop parameter
- `SoundInstance.Stop` is split into `Stop` and `StopImmediate` instead of taking an immediate parameter
- Added `StreamingSoundSeekable` to better support streaming audio that does not support seek
- `StreamingSound` no longer has a Loop property, but `StreamingSoundSeekable` does
- abstract `StreamingSound.AddBuffer` renamed to `FillBuffer`
- `FillBuffer` is now provided with a native buffer to avoid an extra data copy
- `StreamingSound` buffer implementation optimized to avoid repeated alloc/frees

- added `Video` class which can load and play Theora (.ogv) streaming video/audio

Reviewed-on: #20
2022-08-02 21:04:12 +00:00
cosmonaut 17333cfb67 destroy update 2022-03-03 17:16:39 -08:00
cosmonaut 1fa73f0275 more presentation API improvements 2022-03-01 23:21:42 -08:00
cosmonaut 8a3d93d2dc intellisense improvement + API tweak 2022-02-22 22:16:06 -08:00
cosmonaut 8973b3e658 Formatting pass 2022-02-22 21:14:32 -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 1fe256a479 get rid of badly conceived command buffer queue 2022-01-10 12:11:24 -08:00
cosmonaut eda1efedbe properly destroy audio 2021-01-28 18:01:42 -08:00
cosmonaut d10f018f14 fix graphics resources disposing out of order 2021-01-26 21:06:15 -08:00
cosmonaut db44c3e37a change refs + a SetData convenience method 2021-01-21 17:27:25 -08:00
cosmonaut 2cabaa6186 replace Campari with MoonWorks.Graphics 2021-01-19 19:33:27 -08:00