Skip to main content

khora_editor/
main.rs

1// Copyright 2025 eraflo
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15//! Khora Engine Editor application entry point.
16//!
17//! Thin trampoline. The substance lives in:
18//!   - `app.rs`        — `EditorApp` + `EngineApp`/`AgentProvider`/`PhaseProvider`
19//!   - `bootstrap.rs`  — winit + overlay/shell setup, CLI parsing
20//!   - `commands.rs`   — menu actions, save/load/build dispatchers
21//!   - `input.rs`      — per-frame input event routing
22//!   - `hot_reload.rs` — project VFS hot-reload pump
23
24// Install the tracking allocator so the editor reports the same heap telemetry
25// as the runtime/sandbox (memory pressure + allocation-churn feed the DCC). A
26// `#[global_allocator]` is a per-binary attribute, so each entry point sets it.
27#[global_allocator]
28static GLOBAL: khora_sdk::prelude::SaaTrackingAllocator =
29    khora_sdk::prelude::SaaTrackingAllocator::new(std::alloc::System);
30
31mod app;
32mod bootstrap;
33mod build_game;
34mod chrome;
35mod cmd_palette;
36mod commands;
37mod fonts;
38mod hot_reload;
39mod input;
40mod mod_agents;
41mod mod_gizmo;
42mod ops;
43mod panels;
44mod picking;
45mod project_vfs;
46mod scene_io;
47mod util;
48mod widgets;
49mod workbench;
50
51fn main() -> anyhow::Result<()> {
52    bootstrap::run()
53}