Cleaned up rendering module
This commit is contained in:
parent
473c4aeffb
commit
b1d092b6e3
10 changed files with 21 additions and 16 deletions
20
build.zig
20
build.zig
|
|
@ -24,21 +24,19 @@ pub fn build(b: *std.Build) void {
|
||||||
.optimize = optimize,
|
.optimize = optimize,
|
||||||
});
|
});
|
||||||
|
|
||||||
const renderer = b.createModule(.{
|
const rendering = b.createModule(.{
|
||||||
.root_source_file = b.path("src/renderer/Renderer.zig"),
|
.root_source_file = b.path("src/rendering.zig"),
|
||||||
.target = target,
|
.target = target,
|
||||||
.optimize = optimize,
|
.optimize = optimize,
|
||||||
.link_libc = true,
|
.link_libc = true,
|
||||||
});
|
});
|
||||||
renderer.addIncludePath(b.path("ext"));
|
rendering.addIncludePath(b.path("ext"));
|
||||||
renderer.addCSourceFile(.{ .file = b.path("ext/stb_image.c") });
|
rendering.addCSourceFile(.{ .file = b.path("ext/stb_image.c") });
|
||||||
//renderer.addImport("sideros", sideros);
|
rendering.addImport("math", math);
|
||||||
renderer.addImport("math", math);
|
rendering.addImport("ecs", ecs);
|
||||||
renderer.addImport("ecs", ecs);
|
ecs.addImport("rendering", rendering);
|
||||||
// TODO(ernesto): ecs and renderer should be decoupled
|
|
||||||
ecs.addImport("renderer", renderer);
|
|
||||||
|
|
||||||
compileAllShaders(b, renderer);
|
compileAllShaders(b, rendering);
|
||||||
|
|
||||||
const sideros = b.addLibrary(.{
|
const sideros = b.addLibrary(.{
|
||||||
.name = "sideros",
|
.name = "sideros",
|
||||||
|
|
@ -53,7 +51,7 @@ pub fn build(b: *std.Build) void {
|
||||||
|
|
||||||
sideros.root_module.addImport("mods", mods);
|
sideros.root_module.addImport("mods", mods);
|
||||||
sideros.root_module.addImport("ecs", ecs);
|
sideros.root_module.addImport("ecs", ecs);
|
||||||
sideros.root_module.addImport("renderer", renderer);
|
sideros.root_module.addImport("rendering", rendering);
|
||||||
|
|
||||||
b.installArtifact(sideros);
|
b.installArtifact(sideros);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,9 @@ const std = @import("std");
|
||||||
const Allocator = std.mem.Allocator;
|
const Allocator = std.mem.Allocator;
|
||||||
const components = @import("components.zig");
|
const components = @import("components.zig");
|
||||||
const sparse = @import("sparse.zig");
|
const sparse = @import("sparse.zig");
|
||||||
const Renderer = @import("renderer");
|
const rendering = @import("rendering");
|
||||||
const Camera = @import("renderer").Camera;
|
const Renderer = rendering.Renderer;
|
||||||
|
const Camera = rendering.Camera;
|
||||||
const ecs = @import("ecs.zig");
|
const ecs = @import("ecs.zig");
|
||||||
const Input = ecs.Input;
|
const Input = ecs.Input;
|
||||||
|
|
||||||
|
|
|
||||||
4
src/rendering.zig
Normal file
4
src/rendering.zig
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
pub const Mesh = @import("rendering/Mesh.zig");
|
||||||
|
pub const vk = @import("rendering/vulkan.zig");
|
||||||
|
pub const Camera = @import("rendering/Camera.zig");
|
||||||
|
pub const Renderer = @import("rendering/Renderer.zig");
|
||||||
|
|
@ -2,9 +2,9 @@ const math = @import("math");
|
||||||
const ecs = @import("ecs");
|
const ecs = @import("ecs");
|
||||||
const std = @import("std");
|
const std = @import("std");
|
||||||
const vk = @import("vulkan.zig");
|
const vk = @import("vulkan.zig");
|
||||||
pub const Mesh = @import("Mesh.zig");
|
const Mesh = @import("Mesh.zig");
|
||||||
const Texture = vk.Texture;
|
const Texture = vk.Texture;
|
||||||
pub const Camera = @import("Camera.zig");
|
const Camera = @import("Camera.zig");
|
||||||
const Allocator = std.mem.Allocator;
|
const Allocator = std.mem.Allocator;
|
||||||
|
|
||||||
const Renderer = @This();
|
const Renderer = @This();
|
||||||
|
|
@ -1,7 +1,9 @@
|
||||||
pub const ecs = @import("ecs");
|
pub const ecs = @import("ecs");
|
||||||
pub const Renderer = @import("renderer");
|
pub const rendering = @import("rendering");
|
||||||
pub const mods = @import("mods");
|
pub const mods = @import("mods");
|
||||||
|
|
||||||
|
const Renderer = rendering.Renderer;
|
||||||
|
|
||||||
const api = @cImport({
|
const api = @cImport({
|
||||||
@cInclude("sideros_api.h");
|
@cInclude("sideros_api.h");
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue