Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4317 in orxonox.OLD for orxonox/branches/physics


Ignore:
Timestamp:
May 27, 2005, 12:44:55 AM (20 years ago)
Author:
bensch
Message:

orxonox/branches/physics: threads work :)

Location:
orxonox/branches/physics/src/subprojects/particles
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/physics/src/subprojects/particles/framework.cc

    r4316 r4317  
    294294}
    295295
     296Framework* Framework::singletonRef = NULL;
     297
     298Framework* Framework::getInstance(void)
     299{
     300  if (Framework::singletonRef == NULL)
     301    Framework::singletonRef = new Framework();
     302  return Framework::singletonRef;
     303}
    296304
    297305Framework::Framework()
     
    358366 
    359367  guiMainWindow = new Window("ParticlesFUN");
    360  
     368  {
     369    Box* windowBox = new Box('v');
     370    {
     371      Button* quitButton = new Button("quit");
     372      windowBox->fill(quitButton);
     373    }
     374    guiMainWindow->fill(windowBox);
     375  }
    361376  Window::mainWindow->showall();
    362377  mainloopGUI();
     
    370385  pthread_t guiThread;
    371386
    372   Framework* framework = new Framework();
     387  Framework* framework = Framework::getInstance();
    373388
    374389  pthread_create(&guiThread, NULL, Framework::initGui,(void*) argv);
  • orxonox/branches/physics/src/subprojects/particles/framework.h

    r4316 r4317  
    1313class Framework {
    1414 private:
     15  Framework();
     16  static Framework* singletonRef;
     17
    1518  Camera* camera;
    1619 
     20
    1721  int movement [4];
    1822 
     
    2428
    2529 public:
    26   Framework();
    2730  ~Framework();
    2831 
     32  static Framework* getInstance(void);
     33
    2934  void initModule();
    3035  bool mainLoop();
Note: See TracChangeset for help on using the changeset viewer.