Skip to content

Commit ff9bf9f

Browse files
committed
Restoring Windows part of the project... (wip).
1 parent c06f640 commit ff9bf9f

39 files changed

+64225
-292
lines changed

build.zig

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ pub fn build(b: *std.build.Builder) void {
4444
installDemo(b, gamepad_wgpu.build(b, options), "gamepad_wgpu");
4545
installDemo(b, physics_test_wgpu.build(b, options), "physics_test_wgpu");
4646

47-
//var aaa: *zwin32.d3d12.IDeviceChild = undefined;
48-
//_ = aaa.Release();
49-
//installDemo(b, minimal.build(b, options), "minimal");
47+
if (@import("builtin").target.os.tag == .windows) {
48+
//installDemo(b, minimal.build(b, options), "minimal");
49+
}
5050

5151
//
5252
// Tests

libs/common/build.zig

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
const std = @import("std");
2+
3+
pub fn getPkg(dependencies: []const std.build.Pkg) std.build.Pkg {
4+
return .{
5+
.name = "common",
6+
.source = .{ .path = thisDir() ++ "/src/common.zig" },
7+
.dependencies = dependencies,
8+
};
9+
}
10+
11+
pub fn build(b: *std.build.Builder) void {
12+
_ = b;
13+
}
14+
15+
pub fn link(exe: *std.build.LibExeObjStep) void {
16+
const lib = buildLibrary(exe);
17+
exe.linkLibrary(lib);
18+
//exe.addIncludePath(thisDir() ++ "/src/c");
19+
exe.addIncludePath(thisDir() ++ "/libs/imgui");
20+
//exe.addIncludePath(thisDir() ++ "/../zmesh/libs/cgltf");
21+
//exe.addIncludePath(thisDir() ++ "/../zstbi/libs/stbi");
22+
}
23+
24+
fn buildLibrary(exe: *std.build.LibExeObjStep) *std.build.LibExeObjStep {
25+
const lib = exe.builder.addStaticLibrary("common", thisDir() ++ "/src/common.zig");
26+
27+
lib.setBuildMode(exe.build_mode);
28+
lib.setTarget(exe.target);
29+
//lib.addIncludePath(thisDir() ++ "/src/c");
30+
31+
lib.linkSystemLibraryName("c");
32+
lib.linkSystemLibraryName("c++");
33+
lib.linkSystemLibraryName("imm32");
34+
35+
lib.addIncludePath(thisDir() ++ "/libs");
36+
lib.addCSourceFile(thisDir() ++ "/libs/imgui/imgui.cpp", &.{""});
37+
lib.addCSourceFile(thisDir() ++ "/libs/imgui/imgui_widgets.cpp", &.{""});
38+
lib.addCSourceFile(thisDir() ++ "/libs/imgui/imgui_tables.cpp", &.{""});
39+
lib.addCSourceFile(thisDir() ++ "/libs/imgui/imgui_draw.cpp", &.{""});
40+
lib.addCSourceFile(thisDir() ++ "/libs/imgui/imgui_demo.cpp", &.{""});
41+
lib.addCSourceFile(thisDir() ++ "/libs/imgui/cimgui.cpp", &.{""});
42+
43+
//lib.addIncludePath(thisDir() ++ "/../zmesh/libs/cgltf");
44+
//lib.addCSourceFile(thisDir() ++ "/../zmesh/libs/cgltf/cgltf.c", &.{"-std=c99"});
45+
46+
//lib.addIncludePath(thisDir() ++ "/../zstbi/libs/stbi");
47+
//lib.addCSourceFile(thisDir() ++ "/../zstbi/libs/stbi/stb_image.c", &.{"-std=c99"});
48+
49+
return lib;
50+
}
51+
52+
inline fn thisDir() []const u8 {
53+
return comptime std.fs.path.dirname(@src().file) orelse ".";
54+
}

libs/common/libs/imgui/LICENSE.txt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2014-2022 Omar Cornut
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)