CrystalSpace

Public API Reference

cstool/demoapplication.h
Go to the documentation of this file.
00001 /*
00002   Copyright (C) 2010-11 Christian Van Brussel, Institute of Information
00003       and Communication Technologies, Electronics and Applied Mathematics
00004       at Universite catholique de Louvain, Belgium
00005       http://www.uclouvain.be/en-icteam.html
00006 
00007   This library is free software; you can redistribute it and/or
00008   modify it under the terms of the GNU Library General Public
00009   License as published by the Free Software Foundation; either
00010   version 2 of the License, or (at your option) any later version.
00011 
00012   This library is distributed in the hope that it will be useful,
00013   but WITHOUT ANY WARRANTY; without even the implied warranty of
00014   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
00015   Library General Public License for more details.
00016 
00017   You should have received a copy of the GNU Library General Public
00018   License along with this library; if not, write to the Free
00019   Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00020 */
00021 #ifndef __CSDEMOAPPLICATION_H__
00022 #define __CSDEMOAPPLICATION_H__
00023 
00032 // All these files commonly needed are already included, so that the
00033 // applications only need to include the files relevant for them.
00034 #include "cssysdef.h"
00035 
00036 #include "cstool/csapplicationframework.h"
00037 #include "cstool/numberedfilenamehelper.h"
00038 #include "cstool/simplestaticlighter.h"
00039 #include "csutil/cfgacc.h"
00040 #include "csutil/cmdhelp.h"
00041 #include "csutil/common_handlers.h"
00042 #include "csutil/csbaseeventh.h"
00043 #include "csutil/event.h"
00044 #include "csutil/hash.h"
00045 #include "csutil/stringarray.h"
00046 
00047 #include "iengine/camera.h"
00048 #include "iengine/scenenode.h"
00049 #include "iengine/sector.h"
00050 #include "iengine/movable.h"
00051 #include "imesh/object.h"
00052 #include "iutil/cmdline.h"
00053 #include "iutil/csinput.h"
00054 #include "iutil/stringarray.h"
00055 #include "iutil/virtclk.h"
00056 #include "iutil/visualdebug.h"
00057 #include "ivideo/graph2d.h"
00058 #include "ivaria/cameramanager.h"
00059 #include "ivaria/hudmanager.h"
00060 #include "ivaria/view.h"
00061 
00062 namespace CS {
00063 namespace Utility {
00064 
00141 class CS_CRYSTALSPACE_EXPORT DemoApplication : public csApplicationFramework,
00142   public csBaseEventHandler
00143 {
00144  private:
00146   bool mouseInitialized;
00147 
00149   CS::NumberedFilenameHelper screenshotHelper;
00150 
00152   csString screenshotFormat;
00153 
00154  protected:
00156   csRef<iEngine> engine;
00158   csRef<iLoader> loader;
00160   csRef<iGraphics3D> g3d;
00162   csRef<iGraphics2D> g2d;
00164   csRef<iKeyboardDriver> kbd;
00166   csRef<iVirtualClock> vc;
00168   csRef<iView> view;
00170   csRef<FramePrinter> printer;
00172   csRef<iVFS> vfs;
00174   csRef<iMouseDriver> mouse;
00175 
00178   csVector2 previousMouse;
00179 
00181   csRef<iSector> room;
00182 
00184   csRef<CS::Utility::iHUDManager> hudManager;
00185 
00187   csRef<CS::Utility::iCameraManager> cameraManager;
00188 
00190   // TODO: remove
00191   csRef<CS::Debug::iVisualDebugger> visualDebugger;
00192 
00194   csConfigAccess config;
00195 
00196   //-- csBaseEventHandler
00202   virtual void Frame ();
00203 
00208   virtual bool OnKeyboard (iEvent& event);
00209 
00214   virtual bool OnMouseMove (iEvent& event);
00215 
00221   virtual bool CreateRoom ();
00222 
00227   virtual void PrintHelp ();
00228 
00234   virtual const char* GetApplicationConfigFile()
00235   { return nullptr; }
00236 
00237  public:
00243   DemoApplication (const char* applicationName);
00244   ~DemoApplication ();
00245 
00250   virtual bool OnInitialize (int argc, char* argv[]);
00251 
00257   virtual bool Application ();
00258 
00263   virtual void OnExit ();
00264 };
00265 
00266 } //namespace Utility
00267 } //namespace CS
00268 
00271 #endif // __CSDEMOAPPLICATION_H__

Generated for Crystal Space 2.0 by doxygen 1.7.6.1