PolycodeTemplateApp.cpp 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. //
  2. // Polycode template. Write your code here.
  3. //
  4. #include "PolycodeTemplateApp.h"
  5. PolycodeTemplateApp::PolycodeTemplateApp(PolycodeView *view) {
  6. core = new POLYCODE_CORE(view, 1280,720,false,false, 0,0,60);
  7. //core->addFileSource("archive", "default.pak");
  8. ResourcePool *globalPool = Services()->getResourceManager()->getGlobalPool();
  9. globalPool->loadResourcesFromFolder("default", true);
  10. SceneLabel::createMipmapsForLabels = false;
  11. MaterialManager *materialManager = Services()->getMaterialManager();
  12. // Write your code here!
  13. Scene *scene = new Scene(Scene::SCENE_2D);
  14. scene->useClearColor = true;
  15. ScenePrimitive *test = new ScenePrimitive(ScenePrimitive::TYPE_VPLANE, 0.5, 0.5);
  16. test->setMaterialByName("Unlit");
  17. test->getLocalShaderOptions()->loadTextureForParam("diffuse", "main_icon.png");
  18. scene->addChild(test);
  19. Sound *bgSound = new Sound("bedlayer_main.wav");
  20. bgSound->Play();
  21. }
  22. PolycodeTemplateApp::~PolycodeTemplateApp() {
  23. }
  24. bool PolycodeTemplateApp::Update() {
  25. return core->updateAndRender();
  26. }