Skip to content

Instantly share code, notes, and snippets.

vec4 box = vec4(0.0, 0, 0.3, 0.3);
void mainImage( out vec4 fragColor, in vec2 fragCoord )
{
box.x += 0.05 * iTime;
box.y -= 0.03 * iTime;
// Normalized pixel coordinates (from 0 to 1)
vec2 uv = fragCoord/iResolution.xy;
vec2 looped = uv / box.zw;
enum {
Body_Normal,
Body_Sensor = 1<<1,
};
enum {
Shape_AABB,
Shape_Circle,
Shape_TriangleTL,
@WilliamBundy
WilliamBundy / _vimrc
Created November 17, 2018 18:19
_vimrc November 2018
set nocompatible
behave mswin
filetype plugin indent on
call plug#begin('C:/Vim/vimfiles/bundle')
Plug 'raymond-w-ko/vim-lua-indent'
Plug 'beyondmarc/hlsl.vim'
Plug 'William-Bundy/papercolor-theme'
Plug 'tomasr/molokai'
Plug 'vim-scripts/wombat'
/****************************************
* wb_gl_loader.h
*
* A single-header OpenGL loader, using
* Win32 or SDL as its backend.
*
* Can also create contexts for Win32
* (because dealing with that yourself is terrible)
*
* Sample Usage:
@WilliamBundy
WilliamBundy / _vimrc
Created June 15, 2018 22:23
Vimrc 2018
set nocompatible
behave mswin
filetype plugin indent on
call plug#begin('C:/Vim/vimfiles/bundle')
Plug 'raymond-w-ko/vim-lua-indent'
Plug 'tomasr/molokai'
Plug 'vim-scripts/wombat'
Plug 'tpope/vim-surround'
Plug 'ctrlpvim/ctrlp.vim'
typedef __m128 vf128;
WBTM_API vf128 wb_atan_ps(vf128 xx)
{
vf128 mask, mask2, y = ppf(0);
vf128 one = ppf(1.0f);
vf128 signs = _mm_and_ps(xx, pfi(0x80000000));
vf128 x = _mm_and_ps(xx, pfi(~0x80000000));
{
vf128 tx1, tx2;
@WilliamBundy
WilliamBundy / wplRender.c
Created May 20, 2018 03:51
Some gl rendering stuff out of context
/* Graphics */
#define Shader_MaxAttribs 16
#define Shader_MaxUniforms 16
struct wShaderComponent
{
string name;
i32 loc, divisor;
@WilliamBundy
WilliamBundy / make_example.bat
Created November 6, 2017 01:13
A short example of a make.bat file for windows or a make.sh file for linux
rem Windows Batch is bad.
@echo off
rem Save line space
set msvcdir="C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\"
rem get compiler in our current path
if not defined DevEnvDir call %msvcdir%vcvars64.bat >nul
@WilliamBundy
WilliamBundy / wb_alloc.h
Created November 3, 2017 01:05
A single-file header allocation library for C (probably bugs out in C++, sorry)
/* This is free and unencumbered software released into the public domain. */
/* Check the bottom of this file for the remainder of the unlicense */
/* wb_alloc.h
*
* Three custom allocators that can (hopefully) safely allocate a very large
* amount of memory for you. Check the warnings below for an explanation
*
* Version 0.0.1 Testing Alpha
*/
@WilliamBundy
WilliamBundy / _vimrc
Created November 1, 2017 19:25
Will's vimrc as of 11/1/17
set nocompatible
behave mswin
filetype plugin indent on
call plug#begin('C:/Vim/vimfiles/bundle')
Plug 'raymond-w-ko/vim-lua-indent'
Plug 'tomasr/molokai'
Plug 'tpope/vim-surround'
Plug 'ctrlpvim/ctrlp.vim'
Plug 'craigemery/vim-autotag'