From a0d750702a807e83df01a5218c016f708a5f3d7d Mon Sep 17 00:00:00 2001 From: castano Date: Mon, 3 Dec 2007 08:37:48 +0000 Subject: [PATCH] Add ctest. --- src/nvtt/tests/ctest.c | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 src/nvtt/tests/ctest.c diff --git a/src/nvtt/tests/ctest.c b/src/nvtt/tests/ctest.c new file mode 100644 index 0000000..a200641 --- /dev/null +++ b/src/nvtt/tests/ctest.c @@ -0,0 +1,35 @@ + +#include + +#include + + +int main(void) +{ + NvttInputOptions inputOptions = 0; + NvttOutputOptions outputOptions = 0; + NvttCompressionOptions compressionOptions = 0; + + const unsigned int img[16*16]; + + memset(img, 0, sizeof(unsigned int) * 16 * 16); + + inputOptions = nvttCreateInputOptions(); + nvttSetInputOptionsTextureLayout(inputOptions, NVTT_TextureType_2D, 16, 16, 1); + nvttSetInputOptionsMipmapData(inputOptions, img, 16, 16, 1, 0, 0); + + outputOptions = nvttCreateOutputOptions(); + nvttSetOutputOptionsFileName(outputOptions, "output.dds"); + + compressionOptions = nvttCreateCompressionOptions(); + nvttSetCompressionOptionsFormat(compressionOptions, NVTT_Format_BC1); + + nvttCompress(inputOptions, outputOptions, compressionOptions); + + nvttDestroyCompressionOptions(compressionOptions); + nvttDestroyOutputOptions(outputOptions); + nvttDestroyInputOptions(inputOptions); + + return 0; +} +