HelloPolycodeApp.cpp 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. #include "HelloPolycodeApp.h"
  2. HelloPolycodeApp::HelloPolycodeApp(PolycodeView *view) : EventHandler() {
  3. core = new POLYCODE_CORE(view, 640,480,false,false,0,0,90);
  4. CoreServices::getInstance()->getResourceManager()->addArchive("Resources/default.pak");
  5. CoreServices::getInstance()->getResourceManager()->addDirResource("default", false);
  6. Scene *scene = new Scene(Scene::SCENE_2D_TOPLEFT);
  7. ScenePrimitive *shape = new ScenePrimitive(ScenePrimitive::TYPE_VPLANE, 100,100);
  8. shape->setColor(1.0, 0.0, 0.0, 1.0);
  9. shape->setPosition(150,240);
  10. scene->addChild(shape);
  11. shape = new ScenePrimitive(ScenePrimitive::TYPE_CIRCLE, 100,100,100);
  12. shape->setColor(0.0, 1.0, 0.0, 1.0);
  13. shape->setPosition(260,240);
  14. scene->addChild(shape);
  15. shape = new ScenePrimitive(ScenePrimitive::TYPE_CIRCLE, 100,100,3);
  16. shape->setColor(1.0, 0.0, 1.0, 1.0);
  17. shape->setPosition(350,240);
  18. scene->addChild(shape);
  19. shape = new ScenePrimitive(ScenePrimitive::TYPE_CIRCLE, 100,100,6);
  20. shape->setColor(0.0, 1.0, 1.0, 1.0);
  21. shape->setPosition(460,240);
  22. scene->addChild(shape);
  23. }
  24. bool HelloPolycodeApp::Update() {
  25. return core->updateAndRender();
  26. }