Skip to content

Instantly share code, notes, and snippets.

@slembcke
slembcke / NearlyNearestNeighborFiltering.glsl
Last active December 27, 2020 21:19
Anti-aliased Nearest Neighbor Filtering.
uniform sampler2D texture;
varying vec2 uv;
void main(){
vec2 size = textureSize(texture);
vec2 puv = uv*size;
vec2 hfw = 0.5*fwidth(puv);
vec2 fl = floor(puv - 0.5) + 0.5;
@wangkuiyi
wangkuiyi / pre-commit-clang-format
Last active August 19, 2021 14:04
Git pre-commit hook that invokes clang-format to reformat C/C++/Objective-C source code.
#!/bin/bash
# git pre-commit hook that runs an clang-format stylecheck.
# Features:
# - abort commit when commit does not comply with the style guidelines
# - create a patch of the proposed style changes
# modifications for clang-format by rene.milk@wwu.de
# This file is part of a set of unofficial pre-commit hooks available
# at github.
@arielm
arielm / manip1App.cpp
Created June 11, 2011 17:38
Adaptation of "3D manipulation techniques for multitouch displays" to the iPad
#include "cinder/app/AppCocoaTouch.h"
#include "cinder/app/Renderer.h"
#include "cinder/Camera.h"
#include "cinder/CinderResources.h"
#include "cinder/ImageIo.h"
#include "cinder/gl/Texture.h"
#include <vector>
#include <map>
#include <list>