Skip to content

Instantly share code, notes, and snippets.

View JSandusky's full-sized avatar

Jonathan Sandusky JSandusky

  • Ohio, United States
View GitHub Profile
#include <Urho3D/Resource/Image.h>
#include <vector>
#include <set>
#include <windows.h>
#include <shlobj.h>
#include <Urho3D/DebugNew.h>
@JSandusky
JSandusky / ImSequencer.cpp
Created March 28, 2018 02:41
ImSequencer Revisions
#include "ImSequencer.h"
#include "imgui.h"
#include "imgui_internal.h"
#include <vector>
namespace ImSequencer
{
struct ScrollBarInfo
@JSandusky
JSandusky / imgui_bitfield.cpp
Created March 26, 2018 05:56
ImGui Bitfield Checkbox Matrix
bool BitField(const char* label, unsigned* bits, unsigned* hoverIndex)
{
unsigned val = *bits;
ImGuiWindow* window = GetCurrentWindow();
if (window->SkipItems)
return false;
unsigned oldFlags = window->Flags;
ImGuiContext* g = ImGui::GetCurrentContext();
@JSandusky
JSandusky / ParseSrc.txt
Created February 5, 2018 10:01
Graph helpers
// vmath = float, vector, matrix
// matrix = float3x3 or float4x4
// scalar = float, vector
// vector = float2, float3, float4
// any = int, float, float2, float3, float4, matrix, bool, object
//======================================================
// basic math
//======================================================
vmath radians(vmath value);
@JSandusky
JSandusky / ImGuiBindings.cpp
Last active November 19, 2019 19:45
Urho3D DearImGui
#include "../Precompiled.h"
#include "../AngelScript/Addons.h"
#include "../AngelScript/Script.h"
#include "../Math/Color.h"
#include "../Math/Vector2.h"
#include "../Math/Vector3.h"
#include "../Math/Vector4.h"
#include <AngelScript\angelscript.h>
// Vector2 into Vector2 swizzles
public static Vector2 XX(this Vector2 v) { return new Vector2(v.X, v.X); }
public static Vector2 YX(this Vector2 v) { return new Vector2(v.Y, v.X); }
public static Vector2 YY(this Vector2 v) { return new Vector2(v.Y, v.Y); }
// Vector2 into Vector3 swizzles
public static Vector3 XXX(this Vector2 v) { return new Vector3(v.X, v.X, v.X); }
public static Vector3 XXY(this Vector2 v) { return new Vector3(v.X, v.X, v.Y); }
public static Vector3 XYX(this Vector2 v) { return new Vector3(v.X, v.Y, v.X); }
public static Vector3 XYY(this Vector2 v) { return new Vector3(v.X, v.Y, v.Y); }
public static Vector3 YXX(this Vector2 v) { return new Vector3(v.Y, v.X, v.X); }
@JSandusky
JSandusky / Context.cs
Created November 20, 2017 05:59
Code generator for serialization code
// only included in case some of the ctx weirdness needs explanation
using System;
using System.Collections.ObjectModel;
using System.IO;
using System.Linq;
namespace SprueKit.Data
{
// When we have a broken path have to have a means to fix it
@JSandusky
JSandusky / IOCLite.cs
Last active February 11, 2022 19:27
Singleton access manager
/// <summary>
/// While null it will automatically check to seek out
/// </summary>
/// <typeparam name="T">Type of the object we we to acquire</typeparam>
public class IOCDependency<T> where T : class
{
public delegate void DependencyResolved(IOCDependency<T> self);
public event DependencyResolved DependencyResolvedHandler = delegate { };
@JSandusky
JSandusky / UrhoResourceCache.cpp
Created May 24, 2017 02:06
Resource cache printing
#include "UrhoResourceCache.h"
#include <Urho3D/Core/Context.h>
#include <Urho3D/IO/FileSystem.h>
#include <Urho3D/Resource/ResourceCache.h>
#include <Urho3D/Core/StringUtils.h>
using namespace Urho3D;
namespace UrhoEditor
@JSandusky
JSandusky / IMWidget.cpp
Created May 19, 2017 02:41
Nuklear in QT
#include "IMWidget.h"
#include <QAction>
#include <QApplication>
#include <QClipboard>
#include <QComboBox>
#include <QImage>
#include <QItemDelegate>
#include <QListWidget>
#include <QPainter>