Skip to content

Instantly share code, notes, and snippets.

#include <filesystem>
#include <imgui.h>
#define BIT(x) (1 << x)
std::pair<bool, uint32_t> DirectoryTreeViewRecursive(const std::filesystem::path& path, uint32_t* count, int* selection_mask)
{
ImGuiTreeNodeFlags base_flags = ImGuiTreeNodeFlags_OpenOnArrow | ImGuiTreeNodeFlags_OpenOnDoubleClick | ImGuiTreeNodeFlags_SpanAvailWidth | ImGuiTreeNodeFlags_SpanFullWidth;
bool any_node_clicked = false;
@Braytiner
Braytiner / Windows Defender Exclusions VS 2019.ps1
Last active December 6, 2024 15:47 — forked from dknoodle/Windows Defender Exclusions VS 2017.ps1
Adds Windows Defender exclusions for Visual Studio 2019
$userPath = $env:USERPROFILE
$pathExclusions = New-Object System.Collections.ArrayList
$processExclusions = New-Object System.Collections.ArrayList
$pathExclusions.Add('C:\source\repos') > $null
$pathExclusions.Add('C:\Windows\Microsoft.NET') > $null
$pathExclusions.Add('C:\Windows\assembly') > $null
$pathExclusions.Add($userPath + '\AppData\Local\Microsoft\VisualStudio') > $null
$pathExclusions.Add($userPath + '\AppData\Local\Microsoft\VisualStudio Services') > $null
$pathExclusions.Add($userPath + '\AppData\Local\GitCredentialManager') > $null
@LAK132
LAK132 / filebrowser.cpp
Last active March 23, 2022 07:25
Cross platform file system browser using Dear ImGui and std::filesystem
template<typename T> struct complete
{
bool good = true, done = false;
T value;
complete() {}
complete(const T& t, bool g = true, bool d = false) : value(t), good(g), done(d) {}
complete(T&& t, bool g = true, bool d = false) : value(t), good(g), done(d) {}
};
void windowOpenPath(complete<fs::path>& dir, bool file = true)
{
@carasuca
carasuca / ImRotateDemo.cpp
Last active December 30, 2024 21:11
Rotating text and icon demo for dear imgui
#include "imgui_internal.h"
int rotation_start_index;
void ImRotateStart()
{
rotation_start_index = ImGui::GetWindowDrawList()->VtxBuffer.Size;
}
ImVec2 ImRotationCenter()
{
@Flix01
Flix01 / imguitabwindow.cpp
Last active August 19, 2023 08:35
ImGui::TabWindow: a self-partitioning ImGui::Window with TabLabels that can be dragged around.
#include "imguitabwindow.h"
#include <imgui_internal.h>
#include <imgui.h> // intellisense
// TODO: Clean this code, it's a mess!
namespace ImGui {