Skip to content

Instantly share code, notes, and snippets.

@Youlean
Youlean / gist:5ea7fce073b4c342117ef4334547b017
Created May 15, 2023 12:03
Check allocations with new override
#pragma once
#include <iostream>
#include <thread>
#ifdef _DEBUG
static std::thread::id YOULEAN_ALLOCATOR_MAIN_THREAD_ID = std::thread::id();
static std::thread::id YOULEAN_ALLOCATOR_AUDIO_THREAD_ID = std::thread::id();
@Youlean
Youlean / gist:daed25b08861eed0a4b90ddd8e9559d1
Created October 15, 2022 11:16
Print Visual Studio Warning
// Required code
#define STRING2(x) #x
#define STRING(x) STRING2(x)
#define warning_vs(t) message(__FILE__ "(" STRING(__LINE__) "): warning: " STRING(t))
// Example Usage
#pragma warning_vs("This is my custom warning")
// Easing
const float PI2 = PI * 2;
inline float LinearEase(float p)
{
return p;
}
inline float QuadraticEaseIn(float p)
#pragma once
#include <fstream>
#include <codecvt>
class Windows_UTF_Converter
{
public:
#ifdef WIN32
std::string utf8_to_ansi(std::string s)