HelloPolycodeApp.cpp 1.0 KB

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