Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions templates/docking/mcpp.toml.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[package]
name = "{{project.name}}"
version = "0.1.0"

[dependencies]
{{self.name}} = { version = "{{self.version}}", features = ["docking-full"] }
31 changes: 31 additions & 0 deletions templates/docking/src/main.cpp.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// {{project.name}} — generated from {{self.name}}@{{self.version}}:docking
import imgui.core;
import imgui.app;

int main() {
return ImGui::App::run({.title = "{{project.name}}"}, [] {
auto dockspace = ImGui::DockSpaceOverViewport();

static bool layout_built = false;
if (!layout_built) {
layout_built = true;
const auto root = dockspace;
auto left = ImGui::DockBuilderSplitNode(
dockspace, ImGui::Dir_Left, 0.22f, nullptr, &dockspace);
auto down = ImGui::DockBuilderSplitNode(
dockspace, ImGui::Dir_Down, 0.28f, nullptr, &dockspace);
auto right = ImGui::DockBuilderSplitNode(
dockspace, ImGui::Dir_Right, 0.30f, nullptr, &dockspace);
ImGui::DockBuilderDockWindow("Scene", left);
ImGui::DockBuilderDockWindow("Console", down);
ImGui::DockBuilderDockWindow("Inspector", right);
ImGui::DockBuilderDockWindow("Viewport", dockspace);
ImGui::DockBuilderFinish(root);
}

ImGui::Begin("Scene"); ImGui::TextUnformatted("scene tree"); ImGui::End();
ImGui::Begin("Viewport"); ImGui::TextUnformatted("drag tabs to re-split / detach"); ImGui::End();
ImGui::Begin("Inspector"); ImGui::TextUnformatted("properties"); ImGui::End();
ImGui::Begin("Console"); ImGui::TextUnformatted("logs"); ImGui::End();
});
}
3 changes: 3 additions & 0 deletions templates/docking/template.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[template]
description = "IDE-style docking layout + detachable OS windows (docking-full)"
post_message = "`mcpp run`: four docked panes; drag a tab outside to detach it."
6 changes: 6 additions & 0 deletions templates/window/mcpp.toml.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[package]
name = "{{project.name}}"
version = "0.1.0"

[dependencies]
{{self.name}} = "{{self.version}}"
11 changes: 11 additions & 0 deletions templates/window/src/main.cpp.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// {{project.name}} — generated from {{self.name}}@{{self.version}}:window
import imgui.core;
import imgui.app;

int main() {
return ImGui::App::run({.title = "{{project.name}}"}, [] {
ImGui::Begin("{{project.name}}");
ImGui::TextUnformatted("Hello from mcpp + imgui");
ImGui::End();
});
}
4 changes: 4 additions & 0 deletions templates/window/template.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[template]
description = "Minimal imgui.app window"
default = true
post_message = "cd into the project and run `mcpp run` — the window appears."
Loading