Andrew Gutekanst
f080a1c31e
sysaudio: fix wasapi wave format selection
2024-05-12 07:29:13 -07:00
Stephen Gutekanst
92086d8d66
examples: add hardware-check
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-05-12 16:27:52 +02:00
Stephen Gutekanst
3c778816d9
examples: improve play-opus code quality a bit
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-05-12 16:23:38 +02:00
Stephen Gutekanst
6e4105d8e2
math: add lerp
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-05-12 14:26:46 +02:00
Stephen Gutekanst
ca27f1e263
Core: add window size in virtual pixels, update info each frame
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-05-12 14:26:34 +02:00
Stephen Gutekanst
07e61fde30
module: bump eval branch quota on ComponentName
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-05-12 14:25:59 +02:00
Stephen Gutekanst
0200bed7ec
examples: simplify dependencies, mach depends on Opus
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-05-11 14:35:54 -07:00
Stephen Gutekanst
8578613adc
module: fix ECS alignment issues caught only on Windows
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-05-11 14:22:48 -07:00
Stephen Gutekanst
10f35a49ef
module: fix swap removal bug, improve code clarity
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-05-09 17:37:17 -07:00
Stephen Gutekanst
22ac26b57e
module: rename events -> systems, remove 'event arguments'
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-05-08 13:39:07 -07:00
Stephen Gutekanst
83d436ffa4
module: remove "global events" concept
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-05-08 13:39:07 -07:00
Stephen Gutekanst
8d669537dc
module: make adding/removing components/entities legal during query iteration
...
This makes adding/removing components and entities legal during the execution
of a query iterator. Previously, this could invalidate the iterator slices at
worst leading to UB. This fixes the issue by deferring all such actions until
after no queries are pending (i.e. all iterators have finished running)
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-05-07 23:40:56 -07:00
Stephen Gutekanst
27754cdf1f
gfx: add TODO for SpritePipeline multi-texturing
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-05-07 23:40:56 -07:00
Stephen Gutekanst
89ad7fce24
examples: sprite: fix release() bugs caught by sysgpu
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-05-07 23:40:56 -07:00
Stephen Gutekanst
5ec9f89821
examples: text: correctly release frame_render_pass
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-05-07 23:40:56 -07:00
Stephen Gutekanst
786d0d50b1
examples: glyphs: slightly improve release() logic
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-05-07 23:40:56 -07:00
Stephen Gutekanst
d8e0787c7e
examples: play-opus: release render_pass properly
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-05-07 23:40:56 -07:00
Stephen Gutekanst
3d4888f430
examples: glyphs: fix double-free of texture
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-05-07 23:40:56 -07:00
Stephen Gutekanst
6feaad630e
{examples,Audio}: optimize needless setComponent calls away
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-05-07 23:40:56 -07:00
Stephen Gutekanst
57767c2f9f
module: remove deprecated query API
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-05-07 23:40:56 -07:00
Stephen Gutekanst
b5b094642a
gfx: Text: remove __entities internal usage
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-05-07 23:40:56 -07:00
Stephen Gutekanst
e041bc65ea
gfx: Text: cache loaded font at least
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-05-07 23:40:56 -07:00
Stephen Gutekanst
bd655828e3
all: use new mach.Entity.Mod query API
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-05-07 23:40:56 -07:00
Stephen Gutekanst
541ce9e7c0
all: rename mach.Entity.Mod -> mach.Entities.Mod
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-05-07 23:40:56 -07:00
Stephen Gutekanst
11ebce62a3
module: rename Entities -> Database
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-05-07 23:40:56 -07:00
Stephen Gutekanst
2b6aea7d91
module: add query() method to injectable *mach.Entities.Mod
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-05-07 23:40:56 -07:00
Stephen Gutekanst
65e2168b9f
module: injected mach.Entity.Mod for global entity operations
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-05-07 23:40:56 -07:00
Stephen Gutekanst
cb6bdd7eca
examples: play-opus: change sfx noise
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-05-07 23:40:56 -07:00
Stephen Gutekanst
69ff2e027f
all: rename mod.entities -> mod.__entities (private)
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-05-07 23:40:56 -07:00
Stephen Gutekanst
3bd46d078d
module: add new query API
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-05-07 23:40:56 -07:00
Stephen Gutekanst
22feb42730
module: denote const vs. mut component queries
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-05-07 23:40:56 -07:00
Stephen Gutekanst
7d033ca2cf
module: rename query2 -> query
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-05-07 23:40:56 -07:00
Stephen Gutekanst
2e8926d6fa
module: rename query -> queryDeprecated
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-05-07 23:40:56 -07:00
Stephen Gutekanst
26b2351d4b
module: fix zero-size component bug
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-05-06 14:03:57 -07:00
Stephen Gutekanst
1b65702ae8
module: add test for zero-size component bug
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-05-06 14:03:57 -07:00
Stephen Gutekanst
261f94d3bc
module: begin improved query implementation
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-05-06 14:03:57 -07:00
Stephen Gutekanst
2075959dad
module: refactor: pass modules through Entities comptime logic
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-05-06 14:03:57 -07:00
Stephen Gutekanst
95c9ae5278
module: support merging module lists
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-05-06 14:03:57 -07:00
Stephen Gutekanst
b37ece1b9a
module: rename all_components -> component_types_by_name
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-05-06 14:03:57 -07:00
Stephen Gutekanst
7ccfcefa96
examples: update play-opus to latest Audio API
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-05-06 14:02:42 -07:00
Stephen Gutekanst
9a96820926
build: simplify link() usage
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-05-06 14:00:55 -07:00
Stephen Gutekanst
2c77c16356
build: correct .mach only build option (i.e. do not build examples/libs)
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-05-06 14:00:54 -07:00
Stephen Gutekanst
ca08255ec2
{gfx,examples}: fix refcounting bugs, improve sysgpu compatability
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-05-06 14:00:54 -07:00
Stephen Gutekanst
cbb728c37a
gfx: SpritePipeline: fix ref counting
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-05-06 14:00:54 -07:00
Stephen Gutekanst
329fe251ef
gfx: TextPipeline: fix ref counting
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-05-06 14:00:54 -07:00
Stephen Gutekanst
a065c79200
examples: glyphs: do not use event arguments
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-05-06 14:00:54 -07:00
Stephen Gutekanst
7ad38d6eff
Audio: do not use event arguments
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-05-06 14:00:54 -07:00
Ali Chraghi
e711f69fad
Audio: duplicate mono sounds to all channels
2024-05-06 14:00:36 -07:00
Stephen Gutekanst
9d95fcf0c2
Audio: always target 48000hz f32 audio
...
Resampling, which requires fairly involved (and certainly not free) filters,
is needed if the audio we are mixing does not match the sample rate of the
output device. Most OS audio APIs support resampling on their own, but have
preferred hardware formats. Most console hardware since Xbox/PS2/GC supposedly
prefers 48khz natively, but otherwise there seems to be no big preference
between 48khz or 44.1khz.
The important aspect is that we pick one, and encourage people to keep their
audio in one, so that runtime resampling is not required (both in mach itself,
and potentially without-our-knowledge in the OS audio system if we chose a
sample rate which the native hardware does not prefer.)
General guidance will be:
* `mach.Audio` module will always aim to select 48khz, f32 audio output from the
OS APIs. Let the OS APIs do resampling, or if they do not then we can do so.
* We will prefer 48khz, f32 audio samples everywhere internally in our basic audio
mixing etc. APIs.
* Tooling will aim to convert audio to Opus (or flac for lossless) format, with 48khz
and number of channels depending on audio type (e.g. 1ch for most sfx, any number of
channels for bgm, and maybe some exception for multi-channel sfx in the future.)
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2024-05-05 12:56:21 -07:00
Ali Chraghi
5bd6d0cf3d
add play-opus example
2024-05-05 21:10:07 +03:30