Main.cpp 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. // Copyright (C) 2009-2021, Panagiotis Christopoulos Charitos and contributors.
  2. // All rights reserved.
  3. // Code licensed under the BSD License.
  4. // http://www.anki3d.org/LICENSE
  5. #include <cstdio>
  6. #include <Samples/Common/Framework.h>
  7. using namespace anki;
  8. class MyApp : public SampleApp
  9. {
  10. public:
  11. Error sampleExtraInit()
  12. {
  13. ScriptResourcePtr script;
  14. ANKI_CHECK(getResourceManager().loadResource("Assets/Scene.lua", script));
  15. ANKI_CHECK(getScriptManager().evalString(script->getSource()));
  16. getMainRenderer().getOffscreenRenderer().getVolumetricFog().setFogParticleColor(Vec3(1.0f, 0.9f, 0.9f));
  17. getMainRenderer().getOffscreenRenderer().getVolumetricFog().setParticleDensity(2.0f);
  18. return Error::NONE;
  19. }
  20. };
  21. ANKI_MAIN_FUNCTION(myMain)
  22. int myMain(int argc, char* argv[])
  23. {
  24. Error err = Error::NONE;
  25. MyApp* app = new MyApp;
  26. err = app->init(argc, argv, "Sponza");
  27. if(!err)
  28. {
  29. err = app->mainLoop();
  30. }
  31. delete app;
  32. if(err)
  33. {
  34. ANKI_LOGE("Error reported. Bye!!");
  35. }
  36. else
  37. {
  38. ANKI_LOGI("Bye!!");
  39. }
  40. return 0;
  41. }