Files
basis_universal/contrib/single_file_transcoder
Carl Woffenden 7d65ba367a ASTC support (and improved demo)
Exposed the ASTC transcoder. Improved the Emscripten example and tested on ASTC and ETC hardware. Workaround for usused functions and consts when disabling various transcode options.
2019-09-25 17:15:49 +02:00
..
2019-09-25 17:15:49 +02:00
2019-09-20 15:00:02 -04:00
2019-09-20 15:00:02 -04:00
2019-09-24 18:43:15 +02:00
2019-09-25 17:15:49 +02:00

Single File Basis Universal Transcoder

The script combine.sh creates an amalgamated source file that can be used with or without basisu_transcoder.h. This isn't a header-only file but it does offer a similar level of simplicity when integrating into a project.

Create basisutranslib.cpp from the transcoder source using:

cd basis_universal/contrib/single_file_transcoder
./combine.sh -r ../../transcoder -o basisutranslib.cpp basisutranslib-in.cpp

Then add the resulting file to your project (see the example files).

create_translib.sh will run the above script, creating the file basisutranslib.cpp.

Why?

Because all it now takes to support Basis Universal is the addition of a single file, two if using the header, with no configuration or further build steps.

The library is small, adding, for example, 181kB to an Emscripten compiled WebAssembly project (with transcoding disabled for BC7, ASTC and ATC; reenabling ASTC adds a further 64kB).