Skip to content

Instantly share code, notes, and snippets.

@SaschaWillems
SaschaWillems / vk.cpp
Last active November 23, 2023 10:02
Multiple Vulkan buffer binding points
Shader
layout (location = 0) in vec3 inPos;
layout (location = 1) in vec3 inColor;
layout (location = 2) in vec3 inPosB;
layout (location = 3) in vec3 inColorB;
...
Application
@codebrainz
codebrainz / main.c
Created June 23, 2015 02:48
List include files using libclang
#include <stdio.h>
#include <stdlib.h>
#include <clang-c/Index.h>
enum CXChildVisitResult
onVisitCursor(CXCursor cursor, CXCursor parent, CXClientData client_data)
{
if (clang_getCursorKind(cursor) == CXCursor_InclusionDirective) {
CXFile file = clang_getIncludedFile(cursor);
function reblaze(vals, fn) {
if (typeof fn !== 'function')
throw new TypeError('fn should be a function');
// V8 will automatically throw if vals is not an object.
var keys = Object.keys(vals);
var regexp;
var fn_name = fn.name;
@t-mat
t-mat / wasapi-rendering-stream.cpp
Created December 18, 2014 16:57
WIN32 : WASAPI - Rendering a Stream
// WASAPI : Rendering a Stream
// http://msdn.microsoft.com/en-us/library/dd316756%28v=VS.85%29.aspx
#define _USE_MATH_DEFINES
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <stdio.h>
#include <mmdeviceapi.h>
#include <audioclient.h>
@tmpvar
tmpvar / cherry-keyboard-key-holder.js
Last active August 29, 2015 14:05
livecad snippets
var buttons = [];
var rows = 1;
var columns = 1;
var distanceBetween = 20;
var borderH = 1;
var borderW = 2;
var w = rows*distanceBetween + borderW
var h = columns*distanceBetween + borderH
@cheery
cheery / demo.js
Created October 28, 2012 11:24
Bug with Raspberry pi, EGL and node.js.
console.log("loading bagu");
var bagu = require("./build/Release/bagu");
console.log("bagu loaded");
console.log(bagu);
@tmpvar
tmpvar / TLC5971 breakout.jpg
Created October 11, 2012 23:13
arduino uno control of of a TLC5971 rgb led driver
TLC5971 breakout.jpg
@chandlerprall
chandlerprall / ThreeBSP.js
Created December 16, 2011 05:22
Port of Evan Wallace's csg.js to Three.js
THREE.Vector3.prototype.lerp = function ( a, t ) {
return this.clone().addSelf( a.clone().subSelf( this ).multiplyScalar( t ) );
};
THREE.Vertex.prototype.interpolate = function( other, t ) {
var v = new THREE.Vertex( this.position.lerp( other.position, t ) );
v.normal = this.normal.clone();
return v;
};