2
0

Main.cpp 811 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. // Copyright (C) 2009-2018, 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 "../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. return Error::NONE;
  17. }
  18. };
  19. int main(int argc, char* argv[])
  20. {
  21. Error err = Error::NONE;
  22. MyApp* app = new MyApp;
  23. err = app->init(argc, argv, "simple_scene");
  24. if(!err)
  25. {
  26. err = app->mainLoop();
  27. }
  28. if(err)
  29. {
  30. ANKI_LOGE("Error reported. Bye!");
  31. }
  32. else
  33. {
  34. delete app;
  35. ANKI_LOGI("Bye!!");
  36. }
  37. return 0;
  38. }