Skip to content

Commit

Permalink
updated documents, fixed an error when using some cmake options on Un…
Browse files Browse the repository at this point in the history
…ix systems
  • Loading branch information
matyalatte committed Nov 21, 2022
1 parent 9e7c240 commit 69c7a2c
Show file tree
Hide file tree
Showing 9 changed files with 62 additions and 34 deletions.
9 changes: 9 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,15 @@ option(TEXCONV_USE_SINGLEPROC "Use -singleproc" OFF)
option(TEXCONV_USE_TGA20 "Use -tga20 " OFF)
option(TEXCONV_USE_TEXASSEMBLE "Use texassemble as a dll function" OFF)

if(NOT WIN32)
set(TEXCONV_USE_WIC OFF)
set(TEXCONV_USE_PPM OFF)
set(TEXCONV_USE_FLIP OFF)
set(TEXCONV_USE_MULTIPLE_FILES OFF)
set(TEXCONV_NO_GPU_CODEC OFF)
set(TEXCONV_USE_TIMING OFF)
endif()

# show variables
function(texconv_show_variables)

Expand Down
2 changes: 1 addition & 1 deletion TexconvDLL/texassemble.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -852,7 +852,7 @@ namespace
#endif
L"\n"
L" (cube, volume, array, cubearray, merge only)\n"
L" -stripmips Use only base image from input dds files\n"
L" -stripmips Use only base image from input dds files\n";

wprintf(L"%ls", s_usage);

Expand Down
1 change: 1 addition & 0 deletions batch_files/build_texassemble.bat
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ cmake -G "%VS_VERSION%"^
-D CMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded^
-D TEXCONV_BUILD_AS_EXE=ON^
-D TEXCONV_USE_USAGE=ON^
-D TEXCONV_USE_3D=ON^
-D TEXCONV_USE_TEXASSEMBLE=ON^
../

Expand Down
8 changes: 7 additions & 1 deletion docs/Build-on-Unix.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ But it might not work on your environment.

- Ubuntu 20.04 + GCC 9.4
- MacOS 10.15 + AppleClang 12.0
- MacOS 11 + AppleClang 13.0

## 0. Requirements

Expand All @@ -39,8 +40,13 @@ You can build `libtexconv.so` (or `libtexconv.dylib`) with a shell script.
Move to `Texconv-Custom-DLL/shell_scripts` and type `bash build.sh` on the terminal.
`libtexconv.so` (or `libtexconv.dylib`) will be generated in `./Texconv-Custom-DLL/`.

## 4. Build executable
## 4. Build executable (optional)

If you want an executable, use `build_as_exe.sh` instead of `build.sh`.
`texconv` will be generated in `./Texconv-Custom-DLL/`.
You can use it on the terminal. (e.g. `./texconv -ft tga -y -o outdir test.dds`)

## 5. Build texassemble (optional)

If you want to build texassemble as an executable, use `build_texassemble.sh` instead of `build.sh`.
If you want to use texassemble as a dll function, use `build_dds_full_support.sh` instead of `build.sh`.
9 changes: 7 additions & 2 deletions docs/Build-on-Windows.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Move to `./Texconv-Custom-DLL` and type `git submodule update --init --recursive
It'll download DirectXTex to the repository.
(`git submodule update --init --recursive` will work as well, but it'll download unnecessary repositories for Windows.)

## 2-a. Build .dll with Batch Files
## 2-a. Build .dll with batch files

You can build texconv.dll with batch files.
Move to `./Texconv-Custom-DLL/batch_files` and type `build.bat` on the command prompt.
Expand All @@ -22,8 +22,13 @@ Of course, you can build the dll with Visual Studio.
Open `./Texconv-Custom-DLL` with Visual Studio and load CMakeLists.txt.
Then, you can build texconv.dll.

## 3. Build executable
## 3. Build executable (optional)

If you want an executable, use `build_as_exe.bat` instead of `build.bat`.
`texconv.exe` will be generated in `./Texconv-Custom-DLL/`.
You can use it on the command prompt. (e.g. `texconv.exe -ft tga -y -o outdir test.dds`)

## 4. Build texassemble (optional)

If you want to build texassemble as an executable, use `build_texassemble.bat` instead of `build.bat`.
If you want to use texassemble as a dll function, use `build_dds_full_support.bat` instead of `build.bat`.
58 changes: 29 additions & 29 deletions docs/CMake-Options.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,45 +7,45 @@ If you enable all options, the dll will be almost the same size as the original

## exe options

- `TEXCONV_BUILD_AS_EXE`: Build Texconv as .exe
- `TEXCONV_USE_ICON_FOR_EXE`: Use `directx.ico` when TEXCONV_BUILD_AS_EXE is ON
- `TEXCONV_BUILD_AS_EXE`: Build Texconv as .exe.
- `TEXCONV_USE_ICON_FOR_EXE`: Use `directx.ico` when `TEXCONV_BUILD_AS_EXE` is ON.

## format options

- `TEXCONV_USE_WIC`: Enable to use WIC-supported format (bmp, jpg, png, jxr, etc.)
- `TEXCONV_USE_PPM`: Enable to use .ppm and .pfm
- `TEXCONV_USE_WIC`: Enable to use WIC-supported formats (bmp, jpg, png, etc.) (Only available for Windows)
- `TEXCONV_USE_PPM`: Enable to use ppm and pfm formats (Only available for Windows)
- `TEXCONV_USE_PLANAR`: Enable to use planar dds formats
- `TEXCONV_USE_3D`: Enable to use 3D textures
- `TEXCONV_USE_LEGACY`: Enable to use legacy dds formats
- `TEXCONV_USE_16BPP`: Enable to use 16bpp format (B5G6R5, B5G5R5A1, B4G4R4A4)
- `TEXCONV_USE_16BPP`: Enable to use 16bpp formats (B5G6R5, B5G5R5A1, B4G4R4A4)

## Printing options

- `TEXCONV_USE_LOGO`: Enable to use PrintLogo()
- `TEXCONV_USE_USAGE`: Enable to use -help
- `TEXCONV_USE_PRINT_INFO`: Enable to use PrintInfo() and PrintFormat()
- `TEXCONV_USE_TIMING`: Enable to use -timing
- `TEXCONV_USE_LOGO`: Enable to use `PrintLogo()`
- `TEXCONV_USE_USAGE`: Enable to use `-help` (Only available for Windows)
- `TEXCONV_USE_PRINT_INFO`: Enable to use `PrintInfo()` and `PrintFormat()`
- `TEXCONV_USE_TIMING`: Enable to use `-timing` (Only available for Windows)

## Other options

- `TEXCONV_USE_FLIP`: Enable to use -hflip and -vflip
- `TEXCONV_USE_SWIZZLE`: Enable to use -swizzle
- `TEXCONV_USE_ROTATE_COLOR`: Enable to use -rotatecolor
- `TEXCONV_USE_COLORKEY`: Enable to use -c
- `TEXCONV_USE_ALPHA_CONFIG`: Enable to use -pmalpha, -alpha, -keepcoverage, -aw, and -at
- `TEXCONV_USE_ADDRESSING`: Enable to use -wrap and -mirror
- `TEXCONV_USE_TONEMAP`: Enable to use -tonemap
- `TEXCONV_USE_MULTIPLE_FILES`: Enable to use -r and -flist
- `TEXCONV_USE_NMAP_CONFIG`: Enable to use -nmap and -nmapamp
- `TEXCONV_USE_MINOR_DDS_CONFIG`: Enable to use -tu, -tf, -dword, -badtails, -fixbc4x4, -xlum, -dx10, and -dx9
- `TEXCONV_USE_FEATURE_LEVEL`: Enable to use -fl
- `TEXCONV_USE_BC_CONFIG`: Enable to use -bc
- `TEXCONV_USE_SRGB`: Enable to use -srgb, -srgbi, and -srgbo
- `TEXCONV_USE_NAME_CONFIG`: Enable to use -px, -sx, and -l
- `TEXCONV_USE_DITHER`: Enable to use dither filters
- `TEXCONV_NO_GPU_CODEC`: Disable GPU codec for BC6 and BC7
- `TEXCONV_USE_GPU_CONFIG`: Enable to use -gpu and -nogpu
- `TEXCONV_USE_X2BIAS`: Enable to use -x2bias
- `TEXCONV_USE_SINGLEPROC`: Enable to use -singleproc
- `TEXCONV_USE_TGA20`: Enable to use -tga20
- `TEXCONV_USE_FLIP`: Enable to use `-hflip` and `-vflip` (Only available for Windows)
- `TEXCONV_USE_SWIZZLE`: Enable to use `-swizzle`
- `TEXCONV_USE_ROTATE_COLOR`: Enable to use `-rotatecolor`
- `TEXCONV_USE_COLORKEY`: Enable to use `-c`
- `TEXCONV_USE_ALPHA_CONFIG`: Enable to use `-pmalpha`, `-alpha`, `-keepcoverage`, `-aw`, and `-at`
- `TEXCONV_USE_ADDRESSING`: Enable to use `-wrap` and `-mirror`
- `TEXCONV_USE_TONEMAP`: Enable to use `-tonemap`
- `TEXCONV_USE_MULTIPLE_FILES`: Enable to use `-r` and `-flist` (Only available for Windows)
- `TEXCONV_USE_NMAP_CONFIG`: Enable to use -nmap and `-nmapamp`
- `TEXCONV_USE_MINOR_DDS_CONFIG`: Enable to use `-tu`, `-tf`, `-dword`, `-badtails`, `-fixbc4x4`, `-xlum`, `-dx10`, and `-dx9`
- `TEXCONV_USE_FEATURE_LEVEL`: Enable to use `-fl`
- `TEXCONV_USE_BC_CONFIG`: Enable to use `-bc`
- `TEXCONV_USE_SRGB`: Enable to use `-srgb`, `-srgbi`, and `-srgbo`
- `TEXCONV_USE_NAME_CONFIG`: Enable to use `-px`, `-sx`, and `-l`
- `TEXCONV_USE_DITHER`: Enable to use dither filters for `-if` option
- `TEXCONV_NO_GPU_CODEC`: Disable GPU codec for BC6 and BC7 (Only available for Windows)
- `TEXCONV_USE_GPU_CONFIG`: Enable to use `-gpu` and `-nogpu`
- `TEXCONV_USE_X2BIAS`: Enable to use `-x2bias`
- `TEXCONV_USE_SINGLEPROC`: Enable to use `-singleproc`
- `TEXCONV_USE_TGA20`: Enable to use `-tga20`
- `TEXCONV_USE_TEXASSEMBLE`: Enable to use texassemble as a DLL function
4 changes: 3 additions & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ If you want to restore them, you need to use [cmake options](./CMake-Options.md)
You can add some features by [cmake options](./CMake-Options.md).
- Disable GPU codec (`TEXCONV_NO_GPU_CODEC`)
- Enable to use [texassemble](https://github.com/microsoft/DirectXTex/wiki/Texassemble) as a DLL function (`TEXCONV_USE_TEXASSEMBLE`)
- Enable to build [texassemble](https://github.com/microsoft/DirectXTex/wiki/Texassemble) as an executable (`TEXCONV_USE_TEXASSEMBLE` and `TEXCONV_BUILD_AS_EXE`)

## Platform

Expand All @@ -50,13 +51,14 @@ But the custom build supports the following platforms and compilers.
- Ubuntu 20.04 (or later) + GCC

## Download

You can download the built binary from [the release page](https://github.com/matyalatte/Texconv-Custom-DLL/releases).

- `TexconvCustomDLL*-Windows.zip` is for Windows.
- `TexconvCustomDLL*-macOS.tar.bz2` is for Mac (10.15 or later).
- `TexconvCustomDLL*-Linux.tar.bz2` is for Ubuntu (20.04 or later).

Each zip file has a DLL and a executable.
Each zip file has a DLL and an executable.
You can copy whichever you want to use to your project.
(The execuatble won't refer the DLL.)

Expand Down
4 changes: 4 additions & 0 deletions docs/Usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ And 1 means failed to convert.
You can use [texassemble](https://github.com/microsoft/DirectXTex/wiki/Texassemble) if you built the dll with `TEXCONV_USE_TEXASSEMBLE` option.
> **Warning**
> This function is not included in the released builds.
> You need to build it by yourself if you want to use.
```c++
int texassemble(int argc, wchar_t* argv[], bool verbose = true,
bool init_com = false,
Expand Down
1 change: 1 addition & 0 deletions shell_scripts/build_texassemble.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ cmake \
-D CMAKE_POSITION_INDEPENDENT_CODE=ON\
-D TEXCONV_BUILD_AS_EXE=ON\
-D TEXCONV_USE_USAGE=ON\
-D TEXCONV_USE_3D=ON\
-D TEXCONV_USE_TEXASSEMBLE=ON\
../
cmake --build .
Expand Down

0 comments on commit 69c7a2c

Please sign in to comment.