From 1d3fcb59cde87ccb4ec879bf7100daca95f04117 Mon Sep 17 00:00:00 2001 From: Dan Bagnell Date: Mon, 9 Jan 2017 15:04:52 -0500 Subject: [PATCH] Update README with instructions for using Emscripten. --- readme.txt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/readme.txt b/readme.txt index 39116ff..237e551 100644 --- a/readme.txt +++ b/readme.txt @@ -308,3 +308,12 @@ hasn't been tuned for max. quality yet. supported when writing to .DDS, not .KTX. Also, only plain block by block compression is supported when writing to ETC1, and .CRN does not support ETC1. +Compile to Javascript with Emscripten +------------------------------------- + +Download and install Emscripten: + http://kripken.github.io/emscripten-site/docs/getting_started/downloads.html + +From the root directory, run: + emcc -O3 emscripten/crn.cpp -I./inc -s EXPORTED_FUNCTIONS="['_malloc', '_free', '_crn_get_width', '_crn_get_height', '_crn_get_levels', '_crn_get_dxt_format', '_crn_get_bytes_per_block', '_crn_get_uncompressed_size', '_crn_decompress']" -s NO_EXIT_RUNTIME=1 -s NO_FILESYSTEM=1 -s ELIMINATE_DUPLICATE_FUNCTIONS=1 -s ALLOW_MEMORY_GROWTH=1 --memory-init-file 0 -o crunch.js +