|
- #include <iostream>
- #include "../../libShaderFile.hpp"
-
- int main(int argc, char **argv)
- {
- try
- {
- if (argc < 3)
- {
- std::cout << "error: expected input file and generator/class name as parameter" << std::endl;
- return 1;
- }
-
- // initialize library
- lsf::Library lib("../../../libShaderFile-i386-win32.dll");
-
- // create and load shader file
- lsf::ShaderFile shaderFile(lib);
- shaderFile.loadFromFile(argv[1]);
-
- const lsf::Library& l = shaderFile.getLibrary();
-
- // get generator
- lsf::Generator generator(shaderFile, argv[2]);
-
- int i = 3;
- while (i < argc-1)
- {
- generator.setProperty(argv[i], argv[i+1]);
- i += 2;
- }
-
- std::cout << generator.generateCode() << std::endl;
-
- return 0;
- }
- catch(const std::exception& ex)
- {
- std::cout << "error: " << ex.what() << std::endl;
- return 2;
- }
- }
|