module: basic event handler parameter validation
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
parent
92a9836c61
commit
b4a479fb3f
5 changed files with 28 additions and 23 deletions
|
|
@ -108,9 +108,9 @@ fn init(
|
|||
try text_mod.set(player, .text, text1);
|
||||
try text_mod.set(player, .style, styles);
|
||||
|
||||
text_mod.send(.init_pipeline, .{ Text.PipelineOptions{
|
||||
text_mod.send(.init_pipeline, .{Text.PipelineOptions{
|
||||
.pipeline = @intFromEnum(Pipeline.default),
|
||||
} });
|
||||
}});
|
||||
engine.dispatchNoError(); // TODO: no dispatch in user code
|
||||
|
||||
game.state = .{
|
||||
|
|
@ -226,14 +226,14 @@ fn tick(
|
|||
player_pos.v[0] += direction.x() * speed * delta_time;
|
||||
player_pos.v[1] += direction.y() * speed * delta_time;
|
||||
try text_mod.set(game.state.player, .transform, Mat4x4.scaleScalar(upscale).mul(&Mat4x4.translate(player_pos)));
|
||||
text_mod.send(.updated, .{ @intFromEnum(Pipeline.default) });
|
||||
text_mod.send(.updated, .{@intFromEnum(Pipeline.default)});
|
||||
|
||||
// Perform pre-render work
|
||||
text_mod.send(.pre_render, .{ @intFromEnum(Pipeline.default) });
|
||||
text_mod.send(.pre_render, .{@intFromEnum(Pipeline.default)});
|
||||
|
||||
// Render a frame
|
||||
engine.send(.begin_pass, .{ gpu.Color{ .r = 1.0, .g = 1.0, .b = 1.0, .a = 1.0 } });
|
||||
text_mod.send(.render, .{ @intFromEnum(Pipeline.default) });
|
||||
engine.send(.begin_pass, .{gpu.Color{ .r = 1.0, .g = 1.0, .b = 1.0, .a = 1.0 }});
|
||||
text_mod.send(.render, .{@intFromEnum(Pipeline.default)});
|
||||
engine.send(.end_pass, .{});
|
||||
engine.send(.present, .{}); // Present the frame
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue