Skip to content

Instantly share code, notes, and snippets.

@AidanSun05
AidanSun05 / DockBuilderExample.cpp
Created February 5, 2022 00:29
A commented example for Dear ImGui's DockBuilder API.
// The DockBuilder API is still marked as experimental, include Dear ImGui's internal header to pull the functions in:
#include "imgui_internal.h"
// [...]
// Beginning of main loop
// 1. DockBuilder functions only need to run once to take effect.
// This state variable will let us check for the first frame of the app.
static bool firstLoop = true;
@AidanSun05
AidanSun05 / ImGuiDockspaceExample.cpp
Last active April 26, 2023 19:54
A modified DockSpace example for Dear ImGui. Changes are listed at the top of the file.
// CHANGES MADE:
// Added more clarifying comments inside the function.
// Removed MSVC warning C6011 - null pointer dereference.
// Fixed a slight grammar error - "This demo app only demonstrate" => "This demo app only demonstrates"
// Demonstrate using DockSpace() to create an explicit docking node within an existing window.
// Note: You can use most Docking facilities without calling any API. You DO NOT need to call DockSpace() to use Docking!
// - Drag from window title bar or their tab to dock/undock. Hold SHIFT to disable docking.
// - Drag from window menu button (upper-left button) to undock an entire node (all windows).
// About dockspaces: