Skip to content

Instantly share code, notes, and snippets.

Avatar

Tammo 'kb' Hinrichs kebby

View GitHub Profile
View outline_shader.glsl
#version 410 core
uniform float fGlobalTime; // in seconds
uniform vec2 v2Resolution; // viewport resolution (in pixels)
uniform sampler1D texFFT; // towards 0.0 is bass / lower freq, towards 1.0 is higher / treble freq
uniform sampler1D texFFTSmoothed; // this one has longer falloff and less harsh transients
uniform sampler1D texFFTIntegrated; // this is continually increasing
float fMidiKnob;
float time = fGlobalTime;
View MFEncTest.cpp
// Media Foundation h.264 encode test, by Tammo "kb" Hinrichs, 2016-8-31
// This source code file is in the public domain.
// This really is a minimal test, and it only does the raw encoding, no
// color space conversion or muxing whatsoever. So to make it usable you'll
// probably want to put the main loop into its own thread and make it poll
// the rendering thread for new image data instead of the RenderImage() call,
// and you'll probably also want to construct an MF graphfor color space
// conversion/muxing/audio, or call the respective MFTs manually. And get rid
// of the memory buffers and give the encoder your backbuffer surfaces instead.
View gist:7040ceeb42fb8f79eb65
// stuff you should know:
abstract class OutgoingCallBase
{
// ...
}
private readonly ConcurrentDictionary<int, OutgoingCallBase> OutgoingCalls = new ConcurrentDictionary<int, OutgoingCallBase>();
private int CallId;
@kebby
kebby / ZLibDecoder.cs
Created Oct 28, 2013
Inflate (ZLib decoder) implementation in C#, taken from Sean Barrett's stb_image: http://nothings.org/stb_image.c You might wonder why I did this if there has always been DeflateStream which works well enough: I had to learn that DeflateStream isn't always available. One example is the Unity3D engine where you can't use it in web player projects…
View ZLibDecoder.cs
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
namespace Utility
{
/// <summary>
/// public domain zlib decode
/// original: v0.2 Sean Barrett 2006-11-18
You can’t perform that action at this time.