Skip to content

Instantly share code, notes, and snippets.

Avatar
🤨

moebiusSurfing moebiussurfing

🤨
View GitHub Profile
@moebiussurfing
moebiussurfing / toolbar.cpp
Created Jul 29, 2021 — forked from rmitton/toolbar.cpp
How to do a toolbar in Dear ImGui.
View toolbar.cpp
// 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));
ImGui::SetNextWindowViewport(viewport->ID);
@moebiussurfing
moebiussurfing / ImGuiDockspaceExample.cpp
Created Jul 29, 2021 — forked from AidanSun05/ImGuiDockspaceExample.cpp
A modified DockSpace example for Dear ImGui. Changes are listed at the top of the file.
View ImGuiDockspaceExample.cpp
// 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:
@moebiussurfing
moebiussurfing / dock_builder_example.cpp
Created Jul 29, 2021 — 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: https://github.com/ocornut/imgui
View dock_builder_example.cpp
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();
ImGui::SetNextWindowPos(viewport->Pos);
ImGui::SetNextWindowSize(viewport->Size);
ImGui::SetNextWindowViewport(viewport->ID);
@moebiussurfing
moebiussurfing / ffmpeg-hap-readme.md
Created Jul 20, 2021 — forked from dlublin/ffmpeg-hap-readme.md
Encoding to Hap from the command line using FFmpeg
View ffmpeg-hap-readme.md

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
moebiussurfing / ffmpeg.md
Created Jul 15, 2021 — forked from liangfu/ffmpeg.md
using ffmpeg to extract audio from video files
View ffmpeg.md

ffmpeg

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
moebiussurfing / imgui_color_gradient.cpp
Created Jun 27, 2021 — forked from galloscript/imgui_color_gradient.cpp
Gradient color generator and editor for ImGui
View imgui_color_gradient.cpp
//
// imgui_color_gradient.cpp
// imgui extension
//
// Created by David Gallardo on 11/06/16.
#include "imgui_color_gradient.h"
#include "imgui_internal.h"
View ImGui_SelectFile.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()) {
dir.allowExt("");
for(auto &&e : ext) {
@moebiussurfing
moebiussurfing / ofApp.cpp
Last active Mar 9, 2021
ImGui layout widgets filling width
View ofApp.cpp
if (ofxImGui::BeginWindow("TEST", mainSettings, flags)){
ImGui::BeginGroup();
{
int numRows = 2;
int numWidgets = 3;
float spcx =ImGui::GetStyle().ItemSpacing.x;
float spcy =ImGui::GetStyle().ItemSpacing.y;
float maxWidth = ImGui::GetContentRegionAvail().x - spcx;
@moebiussurfing
moebiussurfing / ofApp.cpp
Last active Aug 16, 2022
openFrameworks | ofParameters callbacks using modern lambdas. Exclusive toggle bool's behaviour. ofParameterGroup different types filtetering / casting too.
View ofApp.cpp
#include "ofApp.h"
//--------------------------------------------------------------
void ofApp::setup(){
ofSetFrameRate(30);
listenerMouse = ofEvents().mousePressed.newListener([this](ofMouseEventArgs&mouse) {
ofLogNotice() << __FUNCTION__ << "mouse:"<<ofToString(mouse);
});
@moebiussurfing
moebiussurfing / ofApp.cpp
Created Jan 5, 2021
openFrameworks | ofxImGui fbo + image + texture + clickable
View ofApp.cpp
//.h
ofTexture tex;
ofFbo fbo;
void quantizerRefreshImage();
//.cpp
//setup
bool b = ofGetUsingArbTex();
ofDisableArbTex();