Skip to content

Commit

Permalink
[Compressonator SDK] v3.1 Examples update
Browse files Browse the repository at this point in the history
  • Loading branch information
NavNTCMP committed Nov 16, 2018
1 parent 2ee0e92 commit 43a53d4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 16 deletions.
19 changes: 7 additions & 12 deletions Compressonator/Examples/example2/SDK_Example2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,13 +129,13 @@ int main(int argc, const char* argv[])

for (int i = 0; i<MXT; i++)
{
destTexture[0].dwSize = sizeof(destTexture);
destTexture[0].dwWidth = srcTexture.dwWidth;
destTexture[0].dwHeight = srcTexture.dwHeight;
destTexture[0].dwPitch = 0;
destTexture[0].format = destFormat[i];
destTexture[0].dwDataSize = CMP_CalculateBufferSize(&destTexture[i]);
destTexture[0].pData = (CMP_BYTE*)malloc(destTexture[0].dwDataSize);
destTexture[i].dwSize = sizeof(destTexture[i]);
destTexture[i].dwWidth = srcTexture.dwWidth;
destTexture[i].dwHeight = srcTexture.dwHeight;
destTexture[i].dwPitch = 0;
destTexture[i].format = destFormat[i];
destTexture[i].dwDataSize = CMP_CalculateBufferSize(&destTexture[i]);
destTexture[i].pData = (CMP_BYTE*)malloc(destTexture[i].dwDataSize);
}

//=======================================
Expand Down Expand Up @@ -196,10 +196,5 @@ int main(int argc, const char* argv[])
std::printf("\nProcessed in %.3f seconds\n", timeStampsec() - start_time);
#endif

// Clean up memory used for textures
free(srcTexture.pData);
for (int i = 0; i < MXT; i++)
free(destTexture[i].pData);

return 0;
}
7 changes: 4 additions & 3 deletions Compressonator/Examples/example3/SDK_Example3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,13 @@ int main(int argc, const char* argv[])
#endif
if (argc < 4)
{
std::printf("Compressonator_Test SourceFile DestFile Quality\n");
std::printf("Example3 SourceFile DestFile Quality\n");
std::printf("This example shows how to compress a single image\n");
std::printf("to a BC7 compression format using single threaded low level\n");
std::printf("compression blocks access with a quality setting\n");
std::printf("usage: Example3.exe ruby.dds ruby_bc7.dds 0.05\n");
std::printf("this will generate a compressed ruby file in BC7 format\n");
std::printf("** NOTE ** sample image Width and Height must be divisable by 4\n\n");
std::printf("usage: Example3.exe sample.dds sample_bc7.dds 0.05\n");
std::printf("this will generate a compressed file in BC7 format\n");
return 0;
}

Expand Down
2 changes: 1 addition & 1 deletion Compressonator/Examples/example3/SDK_Example3.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
<ProjectGuid>{B06F1D70-67F1-4491-B479-1B98175768E6}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>Sample</RootNamespace>
<ProjectName>SDK_Example3</ProjectName>
<ProjectName>Example3</ProjectName>
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)/Microsoft.Cpp.Default.props" />
Expand Down

0 comments on commit 43a53d4

Please sign in to comment.