Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
djfos committed Feb 9, 2023
0 parents commit 832f748
Show file tree
Hide file tree
Showing 16 changed files with 954 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# /.vscode
/build
6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[submodule "imgui/cimgui"]
path = imgui/cimgui
url = https://github.com/cimgui/cimgui.git
[submodule "imgui/build-glfw"]
path = imgui/build-glfw
url = https://github.com/deno-windowing/build-glfw.git
25 changes: 25 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
// 使用 IntelliSense 了解相关属性。
// 悬停以查看现有属性的描述。
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"request": "launch",
"name": "Launch Program",
"type": "node",
"program": "${file}",
"cwd": "${workspaceFolder}",
"runtimeExecutable": "C:\\Users\\Li\\scoop\\shims\\deno.EXE",
"runtimeArgs": [
"run",
"--unstable",
"--inspect-wait",
"--allow-all"
],
"attachSimplePort": 9229,
"outputCapture": "std",
"console": "integratedTerminal"
}
]
}
14 changes: 14 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"deno.enable": true,
"deno.unstable": true,
"cmake.sourceDirectory": "${workspaceFolder}/imgui",
"files.associations": {
"imgui.h": "c",
"xstring": "cpp",
"gl.h": "c",
"cimgui.h": "c",
"imgui_impl_opengl3.h": "c",
"internal.h": "c"
},
"C_Cpp.default.configurationProvider": "ms-vscode.cmake-tools"
}
45 changes: 45 additions & 0 deletions build.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
const $ = (cmd: string, ...args: string[]) => {
console.log(`%c$ ${cmd} ${args.join(" ")}`, "color: #888");
return new Deno.Command(cmd, {
args,
stdin: "null",
stdout: "inherit",
stderr: "inherit",
}).outputSync();
};

// try {
// Deno.removeSync("./imgui/build", { recursive: true });
// } catch (_e) {
// // ignore
// }

const cmakeArgs = [
"-S",
"./imgui",
"-B",
"./imgui/build",
];

$("cmake", ...cmakeArgs);

$("cmake", "--build", "./imgui/build", "--config", "Release");

// const BIN_FILE = "./imgui/build/bin/imgui.dll";

// const OUT_FILE = `./build/imgui_${Deno.build.os}${
// Deno.build.arch === "aarch64" ? "_aarch64" : ""
// }.js`;

// const encode = (Deno as any)[(Deno as any).internal]
// .core
// .ops.op_base64_encode;

// Deno.writeTextFileSync(
// OUT_FILE,
// `const BASE64 = "${
// encode(Deno.readFileSync(BIN_FILE))
// }";\nconst DECODED = Deno.build.os === "${Deno.build.os}" && Deno.build.arch === "${Deno.build.arch}" ? Deno[Deno.internal].core.ops.op_base64_decode(BASE64) : new Uint8Array();\nexport default DECODED;\n`,
// );

// console.log(`%cWrote ${OUT_FILE}`, "color: #888");
7 changes: 7 additions & 0 deletions deno.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"tasks": {
"build": "deno run --unstable --allow-all build.ts",
"test-self": "deno run --unstable --allow-all --allow-ffi test_self_window.ts",
"test-dwm": "deno run --unstable --allow-all --allow-ffi test_dwm_window.ts"
}
}
57 changes: 57 additions & 0 deletions deno.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 832f748

Please sign in to comment.