var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; //import * as ImGui_Impl from "../imgui-js/example/imgui_impl"; import * as ImGui from "imgui-js"; //import { ImGuiIO } from "imgui-js"; function main() { return __awaiter(this, void 0, void 0, function* () { console.log("main()"); yield ImGui.default(); window.requestAnimationFrame(init); }); } function init() { console.log("init()"); //console.log("Total allocated space (uordblks) @ _init:", ImGui.bind.mallinfo().uordblks); // Setup Dear ImGui binding //ImGui.IMGUI_CHECKVERSION(); //ImGui.CreateContext(); //const io: ImGuiIO = ImGui.GetIO(); // io.ConfigFlags |= ImGui.ConfigFlags.NavEnableKeyboard; // Enable Keyboard Controls // Setup style //ImGui.StyleColorsDark(); //const output: HTMLElement = document.getElementById("output") || document.body; //const canvas: HTMLCanvasElement = document.createElement("canvas"); //output.appendChild(canvas); //canvas.tabIndex = 1; //canvas.style.position = "absolute"; //canvas.style.left = "0px"; //canvas.style.right = "0px"; //canvas.style.top = "0px"; //canvas.style.bottom = "0px"; //canvas.style.width = "100%"; //canvas.style.height = "100%"; //ImGui_Impl.Init(canvas); } (function () { window.onload = main; })();