You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 rivejä
1.0 KiB

  1. #include <iostream>
  2. #include "../libShaderFile.hpp"
  3. int main(int argc, char **argv)
  4. {
  5. try
  6. {
  7. if (argc < 3)
  8. {
  9. std::cout << "error: expected input file and generator/class name as parameter" << std::endl;
  10. return 1;
  11. }
  12. // initialize library
  13. lsf::Library lib("../../libShaderFile-i386-win32.dll");
  14. // create and load shader file
  15. lsf::ShaderFile shaderFile(lib);
  16. shaderFile.loadFromFile(argv[1]);
  17. const lsf::Library& l = shaderFile.getLibrary();
  18. // get generator
  19. lsf::Generator generator(shaderFile, argv[2]);
  20. int i = 3;
  21. while (i < argc-1)
  22. {
  23. generator.setProperty(argv[i], argv[i+1]);
  24. i += 2;
  25. }
  26. std::cout << generator.generateCode() << std::endl;
  27. return 0;
  28. }
  29. catch(const std::exception& ex)
  30. {
  31. std::cout << "error: " << ex.what() << std::endl;
  32. return 2;
  33. }
  34. }