examples: rename main modules -> App
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
parent
e0640cc948
commit
fb37f74d41
12 changed files with 14 additions and 16 deletions
|
|
@ -2,7 +2,7 @@ const std = @import("std");
|
|||
const mach = @import("mach");
|
||||
const gpu = mach.gpu;
|
||||
|
||||
pub const name = .game;
|
||||
pub const name = .app;
|
||||
pub const Mod = mach.Mod(@This());
|
||||
|
||||
pub const global_events = .{
|
||||
|
|
@ -3,7 +3,7 @@ const mach = @import("mach");
|
|||
// The global list of Mach modules registered for use in our application.
|
||||
pub const modules = .{
|
||||
mach.Core,
|
||||
@import("Game.zig"),
|
||||
@import("App.zig"),
|
||||
};
|
||||
|
||||
pub fn main() !void {
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ pub const global_events = .{
|
|||
|
||||
// Define the globally unique name of our module. You can use any name here, but keep in mind no
|
||||
// two modules in the program can have the same name.
|
||||
pub const name = .game;
|
||||
pub const name = .app;
|
||||
|
||||
// The mach.Mod type corresponding to our module struct (this file.) This provides methods for
|
||||
// working with this module (e.g. sending events, working with its components, etc.)
|
||||
|
|
@ -147,7 +147,7 @@ fn tick(
|
|||
// Query all the entities that have the .follower tag indicating they should follow the player.
|
||||
// TODO(important): better querying API
|
||||
var archetypes_iter = core.entities.query(.{ .all = &.{
|
||||
.{ .game = &.{.follower} },
|
||||
.{ .app = &.{.follower} },
|
||||
} });
|
||||
while (archetypes_iter.next()) |archetype| {
|
||||
// Iterate the ID and position of each entity
|
||||
|
|
@ -161,7 +161,7 @@ fn tick(
|
|||
var avoidance = Vec3.splat(0);
|
||||
var avoidance_div: f32 = 1.0;
|
||||
var archetypes_iter_2 = core.entities.query(.{ .all = &.{
|
||||
.{ .game = &.{.follower} },
|
||||
.{ .app = &.{.follower} },
|
||||
} });
|
||||
while (archetypes_iter_2.next()) |archetype_2| {
|
||||
const other_ids = archetype_2.slice(.entity, .id);
|
||||
|
|
@ -1,14 +1,12 @@
|
|||
const std = @import("std");
|
||||
|
||||
const mach = @import("mach");
|
||||
const Renderer = @import("Renderer.zig");
|
||||
const Game = @import("Game.zig");
|
||||
|
||||
// The global list of Mach modules registered for use in our application.
|
||||
pub const modules = .{
|
||||
mach.Core,
|
||||
Renderer,
|
||||
Game,
|
||||
@import("App.zig"),
|
||||
@import("Renderer.zig"),
|
||||
};
|
||||
|
||||
// TODO: move this to a mach "entrypoint" zig module
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ frame_render_pass: *gpu.RenderPassEncoder = undefined,
|
|||
|
||||
// Define the globally unique name of our module. You can use any name here, but keep in mind no
|
||||
// two modules in the program can have the same name.
|
||||
pub const name = .game;
|
||||
pub const name = .app;
|
||||
pub const Mod = mach.Mod(@This());
|
||||
|
||||
pub const global_events = .{
|
||||
|
|
@ -5,8 +5,8 @@ pub const modules = .{
|
|||
mach.Core,
|
||||
mach.gfx.Sprite,
|
||||
mach.gfx.SpritePipeline,
|
||||
@import("App.zig"),
|
||||
@import("Glyphs.zig"),
|
||||
@import("Game.zig"),
|
||||
};
|
||||
|
||||
// TODO(important): use standard entrypoint instead
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ pub const App = @This();
|
|||
|
||||
var gpa = std.heap.GeneralPurposeAllocator(.{}){};
|
||||
|
||||
pub const name = .piano;
|
||||
pub const name = .app;
|
||||
pub const Mod = mach.Mod(@This());
|
||||
|
||||
pub const global_events = .{
|
||||
|
|
@ -4,7 +4,7 @@ const mach = @import("mach");
|
|||
pub const modules = .{
|
||||
mach.Core,
|
||||
mach.Audio,
|
||||
@import("Piano.zig"),
|
||||
@import("App.zig"),
|
||||
};
|
||||
|
||||
// TODO(important): use standard entrypoint instead
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ frame_render_pass: *gpu.RenderPassEncoder = undefined,
|
|||
|
||||
// Define the globally unique name of our module. You can use any name here, but keep in mind no
|
||||
// two modules in the program can have the same name.
|
||||
pub const name = .game;
|
||||
pub const name = .app;
|
||||
pub const Mod = mach.Mod(@This());
|
||||
|
||||
pub const global_events = .{
|
||||
|
|
@ -5,7 +5,7 @@ pub const modules = .{
|
|||
mach.Core,
|
||||
mach.gfx.Sprite,
|
||||
mach.gfx.SpritePipeline,
|
||||
@import("Game.zig"),
|
||||
@import("App.zig"),
|
||||
};
|
||||
|
||||
// TODO(important): use standard entrypoint instead
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ pub const modules = .{
|
|||
mach.gfx.Text,
|
||||
mach.gfx.TextPipeline,
|
||||
mach.gfx.TextStyle,
|
||||
@import("Game.zig"),
|
||||
@import("App.zig"),
|
||||
};
|
||||
|
||||
// TODO(important): use standard entrypoint instead
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue