Skip to content

Instantly share code, notes, and snippets.

@micahpearlman
Created January 18, 2013 01:22
Show Gist options
  • Save micahpearlman/4561519 to your computer and use it in GitHub Desktop.
Save micahpearlman/4561519 to your computer and use it in GitHub Desktop.
Compile GLSL shaders into a C include file
#NOTE: because xxd doesn't emit a \0 null character we use sed to add that extra bit
#see: http://gamesfromwithin.com/quick-tip-working-with-shaders-on-ios
cd ${INPUT_FILE_DIR}
xxd -i ${INPUT_FILE_NAME} | sed s/}\;/,0x00}\;/ > ${INPUT_FILE_PATH}.h
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment