Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

839 stacking layout config for tesseratos #1422

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added

- SSAO resolution scale (#1423, **@tomas7770**).
- Enable ImGui docking branch and modify Tesseratos to accommodate it (#839, **@jdbaracho**).

### Changed

Expand Down
2 changes: 1 addition & 1 deletion default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ let
imgui = fetchFromGitHub {
owner = "ocornut";
repo = "imgui";
rev = "v1.89.9";
rev = "v1.89.9-docking";
sha256 = "sha256-0k9jKrJUrG9piHNFQaBBY3zgNIKM23ZA879NY+MNYTU=";
};

Expand Down
2 changes: 1 addition & 1 deletion engine/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ target_link_libraries(cubos-engine PUBLIC cubos-core)
FetchContent_Declare(
imgui
GIT_REPOSITORY https://github.com/ocornut/imgui.git
GIT_TAG v1.89.9
GIT_TAG v1.89.9-docking
)
FetchContent_Declare(
implot
Expand Down
24 changes: 23 additions & 1 deletion tools/tesseratos/src/tesseratos/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,30 @@ int main(int argc, char** argv)
input.bind(*bindings);
});

cubos.startupSystem("set ImGui context").after(imguiInitTag).call([](ImGuiContextHolder& holder) {
cubos.startupSystem("set ImGui context and enable docking").after(imguiInitTag).call([](ImGuiContextHolder& holder) {
ImGui::SetCurrentContext(holder.context);
ImGui::GetIO().ConfigFlags |= ImGuiConfigFlags_DockingEnable;
});

cubos.system("setup ImGui dockspace").tagged(imguiTag).call([]() {

// make DockSpace fullscreen
const ImGuiViewport* viewport = ImGui::GetMainViewport();
ImGui::SetNextWindowPos(viewport->WorkPos);
ImGui::SetNextWindowSize(viewport->WorkSize);
ImGui::SetNextWindowViewport(viewport->ID);

// ImGui window flags, check imgui.h for definition
ImGuiWindowFlags windowFlags = ImGuiWindowFlags_MenuBar | ImGuiWindowFlags_NoDocking;
windowFlags |= ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove;
windowFlags |= ImGuiWindowFlags_NoBringToFrontOnFocus | ImGuiWindowFlags_NoNavFocus;

ImGui::Begin("Tesseratos", nullptr, windowFlags);

ImGuiID dockspaceId = ImGui::GetID("TesseratosRoot");
ImGui::DockSpace(dockspaceId, ImVec2(0.0F, 0.0F));

ImGui::End();
});

cubos.run();
Expand Down
Loading