HelloPolycodeApp.cpp 1.1 KB

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