Add ctest.
This commit is contained in:
parent
ed04c2249a
commit
a0d750702a
35
src/nvtt/tests/ctest.c
Normal file
35
src/nvtt/tests/ctest.c
Normal file
@ -0,0 +1,35 @@
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include <nvtt/nvtt_wrapper.h>
|
||||
|
||||
|
||||
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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user