ROOT logo

From $ROOTSYS/tutorials/gui/games.C

void games()
{
   // This macro runs three "games" that each nicely illustrate the graphics capabilities of ROOT. 
   // Thanks to the clever usage of TTimer objects it looks like they are all
   // executing in parallel (emulation of multi-threading).
   // It uses the small classes generated in $ROOTSYS/test/Hello,
   // Aclock, Tetris
   //Author: Valeriy Onuchin
   
   Bool_t UNIX = strcmp(gSystem->GetName(), "Unix") == 0;
   Int_t st1 = gSystem->Load("$(ROOTSYS)/test/Aclock");
   if (st1 == -1) {
      printf("===>The macro games will try to build the Aclock library\n");
      if (UNIX)
         gSystem->Exec("(cd $ROOTSYS/test; make Aclock)");
      else
         gSystem->Exec("(cd %ROOTSYS%\\test && nmake -f Makefile.win32 Aclock.dll)");

      st1 = gSystem->Load("$(ROOTSYS)/test/Aclock");
   }
   Int_t st2 = gSystem->Load("$(ROOTSYS)/test/Hello");
   if (st2 == -1) {
      printf("===>The macro games will try to build the Hello library\n");
      if (UNIX)
         gSystem->Exec("(cd $ROOTSYS/test; make Hello)");
      else
         gSystem->Exec("(cd %ROOTSYS%\\test && nmake -f Makefile.win32 Hello.dll)");

      st2 = gSystem->Load("$(ROOTSYS)/test/Hello");
   }
   Int_t st3 = gSystem->Load("$(ROOTSYS)/test/Tetris");
   if (st3 == -1) {
      if (UNIX) {
         printf("===>The macro games will try to build the Tetris library\n");
         gSystem->Exec("(cd $ROOTSYS/test; make Tetris)");
      } else {
         gSystem->Exec("(cd %ROOTSYS%\\test && nmake -f Makefile.win32 Tetris.dll)");
      }
      st3 = gSystem->Load("$(ROOTSYS)/test/Tetris");
   }

   if (st1 || st2 || st3) {
      printf("ERROR: one of the shared libs in $ROOTSYS/test didn't load properly\n");
      return;
   }

   // run the dancing Hello World
   Hello *hello = new Hello();

   // run the analog clock
   Aclock *clock = new Aclock();

   // run the Tetris game
   Tetris *tetris = new Tetris();
}
 games.C:1
 games.C:2
 games.C:3
 games.C:4
 games.C:5
 games.C:6
 games.C:7
 games.C:8
 games.C:9
 games.C:10
 games.C:11
 games.C:12
 games.C:13
 games.C:14
 games.C:15
 games.C:16
 games.C:17
 games.C:18
 games.C:19
 games.C:20
 games.C:21
 games.C:22
 games.C:23
 games.C:24
 games.C:25
 games.C:26
 games.C:27
 games.C:28
 games.C:29
 games.C:30
 games.C:31
 games.C:32
 games.C:33
 games.C:34
 games.C:35
 games.C:36
 games.C:37
 games.C:38
 games.C:39
 games.C:40
 games.C:41
 games.C:42
 games.C:43
 games.C:44
 games.C:45
 games.C:46
 games.C:47
 games.C:48
 games.C:49
 games.C:50
 games.C:51
 games.C:52
 games.C:53
 games.C:54
 games.C:55
 games.C:56