Core: store framebuffer information as components

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
Stephen Gutekanst 2024-04-22 00:06:33 -07:00 committed by Stephen Gutekanst
parent 656b0202f2
commit 03a089610b
5 changed files with 25 additions and 5 deletions

View file

@ -23,7 +23,7 @@ fn init(game: *Mod, core: *mach.Core.Mod) !void {
// Color target describes e.g. the pixel format of the window we are rendering to.
const color_target = gpu.ColorTargetState{
.format = mach.core.descriptor.format,
.format = core.get(core.state().main_window, .framebuffer_format).?,
.blend = &blend,
};

View file

@ -48,7 +48,7 @@ fn init(
// Fragment state
const blend = gpu.BlendState{};
const color_target = gpu.ColorTargetState{
.format = mach.core.descriptor.format,
.format = core.get(core.state().main_window, .framebuffer_format).?,
.blend = &blend,
.write_mask = gpu.ColorWriteMaskFlags.all,
};