Code Monkey home page Code Monkey logo

textureviewer's Introduction

Texture Viewer

Currently, there is no viewer program itself, however, simple texture can be loaded using a bind_texture test.

Also, there is also a texturetool that can convert between texture formats. However, it's capabilities are very limited at the moment - only saving DDS and PKM is supported and no other formats other than textures (i.e. png, jpg are not supported for now).

License

This program is distributed under the GNU LGPL

Formats

Below is the list of formats supported by the API.

  • DDS (Direct Draw Surface)
  • PKM (PKM Texture Format)
  • KTX (Khronos Texture)
  • VTF (Valve Texture Format)

Building from source

Build requirements

Windows

  • Microsoft Visual Studio 17 or higher
  • Qt 5.11.0 (maybe earlier versions will work too)
  • Qbs 1.11.1 (packed with Qt Creator)

Mac OS

  • XCode 9.4.1 or higher
  • Qt 5.11.0 (maybe earlier versions will work too)
  • Qbs 1.11.1 (packed with Qt Creator)

Linux

  • opengl headers
  • GCC-6/G++-6 or higher
  • Qt 5.11.0 (maybe earlier versions will work too)
  • Qbs 1.11.1

On debian-based systems the required packages can be installed using command

apt-get install gcc-6 g++6 libgl1-mesa-dev

Building in Qt Creator

Open the textureviewer.qbs file in a Qt Creator and press "Build"

Building from command line

Configuring QBS

First, you need to configure QBS. Skip this step if you already did that for an other project or if you are already using qbs and it is properly configured.

The first step is to setup the compilers.

$ qbs setup-toolchains --detect
Trying to detect gcc...
Profile 'gcc' created for '/usr/bin/gcc'.
Trying to detect clang...
Profile 'clang' created for '/usr/bin/clang'.
...

Second step is to configure a Qt version that you will use for building. Specify the correct path to qmake if you have a Qt installed in a different location (i.e. on Mac and Windows)

$ qbs setup-qt /usr/bin/qmake myqt
Creating profile 'myqt'.
WARNING: You need to set up toolchain information before you can use this Qt version for building.
Consider setting one of these profiles as this profile's base profile: <list of your profiles>

If you get the warning above, you should manually setup the compiler that will be used for this Qt version (the warning is shown if multiple toolchains found)

$ qbs config profiles.myqt.baseProfile <profile name>

The profile name can be chosen after calling the following command (choose one profile from the list without "profiles." prefix and the profile properties after the name, i.e. simply "clang" or "gcc" in the following example):

$ qbs config --list profiles
profiles.clang.cpp.toolchainInstallPath: "/usr/bin"
profiles.clang.qbs.toolchain: ["clang", "llvm", "gcc"]
profiles.gcc.cpp.toolchainInstallPath: "/usr/bin"
profiles.gcc.qbs.toolchain: ["gcc"]
...

Third step is to tell QBS which profile it should use by default.

$ qbs config defaultProfile myqt

Otherwise, you will get strange warning during the compilation saying "Dependency 'Qt.core' not found for product ''". You also can manually specify profile when building.

For more details see Qt documentation how to

Building TextureViewer

$ cd textureviewer/
$ mkdir build
$ cd build/
$ qbs build -f ../textureviewer.qbs qbs.defaultBuildVariant:release
$ qbs install -f ../textureviewer.qbs qbs.defaultBuildVariant:release --install-root <install path>

Installing mimetypes

On Linux OS, QMimeDatabase uses system information about mimetypes, so additional mimetypes should be installed in the system. This is done using linux_mimetypes.sh script (run as root):

$ sudo ./linux_mimetypes.sh
Unknown media type in type 'all/all'
Unknown media type in type 'all/allfiles'
$

textureviewer's People

Contributors

abbapoh avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.