This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
CONCEPT SKETCH: | |
Singleton Cache Manager Using Custom Smart Pointer Deleters | |
by Patrick Hebron | |
*/ | |
#include <iostream> | |
#include <memory> | |
#include <map> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Default Passthrough | |
// GLSL Vertex Shader | |
// Implementation by Patrick Hebron | |
void main() | |
{ | |
gl_FrontColor = gl_Color; | |
gl_TexCoord[0] = gl_MultiTexCoord0; | |
gl_Position = ftransform(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Sobel Edge Detection Filter | |
// GLSL Fragment Shader | |
// Implementation by Patrick Hebron | |
uniform sampler2D texture; | |
uniform float width; | |
uniform float height; | |
void make_kernel(inout vec4 n[9], sampler2D tex, vec2 coord) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// PIMPL Idiom | |
// Example by Patrick Hebron | |
#include <memory> | |
#include <string> | |
#include <iostream> | |
/** @brief templated pimpl wrapper */ | |
template <typename Impl> class pimpl_t { | |
public: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// RTTI Type Traits | |
// Example by Patrick Hebron | |
template <typename T> struct TypeTraits | |
{ | |
static const char* name() { return "TYPE_NAME"; } | |
}; | |
struct Base | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// GLSL Image Filters | |
// Curated by Patrick Hebron | |
// Influences: | |
// http://thndl.com | |
// https://gist.github.com/BlackBulletIV/4218802 | |
// http://mouaif.wordpress.com/?p=94 | |
uniform sampler2D tex; |