Skip to content

Instantly share code, notes, and snippets.

View moebiussurfing's full-sized avatar

moebiusSurfing moebiussurfing

View GitHub Profile
moebiussurfing / toolbar.cpp
Created July 29, 2021 05:47 — forked from rmitton/toolbar.cpp
How to do a toolbar in Dear ImGui.
// How to do a toolbar in Dear ImGui.
const float toolbarSize = 50;
void DockSpaceUI()
ImGuiViewport* viewport = ImGui::GetMainViewport();
ImGui::SetNextWindowPos(viewport->Pos + ImVec2(0, toolbarSize));
ImGui::SetNextWindowSize(viewport->Size - ImVec2(0, toolbarSize));
moebiussurfing / ImGuiDockspaceExample.cpp
Created July 29, 2021 05:43 — forked from AidanSun05/ImGuiDockspaceExample.cpp
A modified DockSpace example for Dear ImGui. Changes are listed at the top of the file.
// 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:
moebiussurfing / dock_builder_example.cpp
Created July 29, 2021 03:36 — forked from PossiblyAShrub/dock_builder_example.cpp
Simple example, of how to use the dock builder API. (Adapted from the dock space example in the demo window) You need to use the docking branch and set the ImGuiConfigFlags_DockingEnable config flag. Learn more about Dear ImGui here:
static ImGuiDockNodeFlags dockspace_flags = ImGuiDockNodeFlags_PassthruCentralNode;
// We are using the ImGuiWindowFlags_NoDocking flag to make the parent window not dockable into,
// because it would be confusing to have two docking targets within each others.
ImGuiWindowFlags window_flags = ImGuiWindowFlags_MenuBar | ImGuiWindowFlags_NoDocking;
ImGuiViewport* viewport = ImGui::GetMainViewport();
moebiussurfing /
Created July 20, 2021 01:33 — forked from dlublin/
Encoding to Hap from the command line using FFmpeg

Encoding to Hap from the command line using FFmpeg

For users who prefer working with a command line or need to access advanced encoding settings for Hap the popular FFmpeg library can be used to work with Hap movies.

  1. If this is your first time using FFmpeg you may need to install it on your system, or compile it from source. In either case be sure that Snappy is enabled as part of the binary. If you already have FFmpeg on your system with Snappy enabled, you can skip this step.

    You can check that your version of FFmpeg can encode Hap using

    ffmpeg -encoders | grep hap
moebiussurfing /
Created July 15, 2021 22:07 — forked from liangfu/
using ffmpeg to extract audio from video files


Converting Audio into Different Formats / Sample Rates

Minimal example: transcode from MP3 to WMA:
ffmpeg -i input.mp3 output.wma

You can get the list of supported formats with:
ffmpeg -formats

Convert WAV to MP3, mix down to mono (use 1 audio channel), set bit rate to 64 kbps and sample rate to 22050 Hz:

moebiussurfing / imgui_color_gradient.cpp
Created June 27, 2021 20:42 — forked from galloscript/imgui_color_gradient.cpp
Gradient color generator and editor for ImGui
// imgui_color_gradient.cpp
// imgui extension
// Created by David Gallardo on 11/06/16.
#include "imgui_color_gradient.h"
#include "imgui_internal.h"
namespace ImGui
static bool SelectFile(const std::string &path, std::string &selected, const std::vector<std::string> &ext={}) {
bool ret = false;
if(ofFile(path).isDirectory()) {
if(TreeNode(ofFilePath::getBaseName(path).c_str())) {
ofDirectory dir;
if(!ext.empty()) {
for(auto &&e : ext) {