-
Notifications
You must be signed in to change notification settings - Fork 87
Description
Shaders are stored at INSTALL_DIR\shaders (INSTALL_DIR\doc)
It can be improved using new command line arguments -shadersDir and -docsDir:
- If they are not used then the program should behave as before.
- If they are used with relative path then the path should be relative exe file of the program.
- if they are used with absolute path then this path should be used without changes.
The arguments can be useful in the following scenarios:
- To use new shaders without re-instaling the program, and without write permissions to the shaders path
- When the Displaz is being developed in Visual Studio (see project properties->Debugging->Command Arguments).
Before this change INSTALL_DIR was the path where binary is installed minus its last four symbols. This path was created using QCoreApplication::applicationDirPath(). It did not work when Displaz was started from Visual Studio IDE. In this case this function returns something like
C:\repos\displaz\build\bin\Debug
The last four symbols of the path were not "/bin", and as a result loading shaders and documents failed and there is no good way to make the program to use another path.
There was one one more small issue there, which also was fixed. There was a misleading error message. If INSTALL_DIR did not finish with "/bin" then the program wrote a message that shaders cannot be loaded. But in fact in that case shaders AND documentation cannot be loaded.
Note: this change was written and tested on Window. It would be good to make sure that it also work on Linux.