00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033 #ifndef _VRJ_APP_H_
00034 #define _VRJ_APP_H_
00035
00036 #include <vrj/vrjConfig.h>
00037
00038 #include <boost/concept_check.hpp>
00039
00040 #include <vpr/Util/Assert.h>
00041 #include <vrj/Util/Debug.h>
00042 #include <jccl/RTRC/ConfigElementHandler.h>
00043 #include <vrj/Sound/SoundManagerFactory.h>
00044
00045 #include <gadget/Type/PositionProxy.h>
00046 #include <gadget/Type/Position/PositionUnitConversion.h>
00047
00048 namespace vrj
00049 {
00050
00051 class DrawManager;
00052 class Kernel;
00053
00082 class VJ_CLASS_API App : public jccl::ConfigElementHandler
00083 {
00084 public:
00090 App(Kernel* kern);
00091
00093 App();
00094
00095 virtual ~App()
00096 {
00097 ;
00098 }
00099
00100 public:
00101
00107 virtual void init()
00108 {;}
00109
00115 virtual void apiInit()
00116 {;}
00117
00119 virtual void exit()
00120 {;}
00121
00126 virtual void preFrame()
00127 {;}
00128
00136 virtual void latePreFrame()
00137 {;}
00138
00140 virtual void intraFrame()
00141 {;}
00142
00146 virtual void postFrame()
00147 {;}
00148
00154 virtual void reset()
00155 {;}
00156
00167 bool haveFocus()
00168 {
00169 return mHaveFocus;
00170 }
00171
00173 virtual void focusChanged()
00174 {;}
00175
00182 void setFocus(bool newState)
00183 {
00184 if(newState != mHaveFocus)
00185 {
00186 mHaveFocus = newState;
00187 this->focusChanged();
00188 }
00189 }
00190
00200 virtual float getDrawScaleFactor()
00201 {
00202 return gadget::PositionUnitConversion::ConvertToFeet;
00203 }
00204
00205
00206 public:
00208 virtual bool configCanHandle(jccl::ConfigElementPtr element)
00209 {
00210 boost::ignore_unused_variable_warning(element);
00211 return false;
00212 }
00213
00221 virtual bool depSatisfied()
00222 {
00223 return true;
00224 }
00225
00226 protected:
00228 virtual bool configAdd(jccl::ConfigElementPtr element)
00229 {
00230 boost::ignore_unused_variable_warning(element);
00231 vprASSERT(false);
00232 return false;
00233 }
00234
00236 virtual bool configRemove(jccl::ConfigElementPtr element)
00237 {
00238 boost::ignore_unused_variable_warning(element);
00239 vprASSERT(false);
00240 return false;
00241 }
00242
00243 public:
00244 Kernel* mKernel;
00245 bool mHaveFocus;
00246
00247 public:
00252 virtual DrawManager* getDrawManager() = 0;
00253
00258 virtual SoundManager* getSoundManager()
00259 {
00260 return &SoundManagerFactory::get();
00261 }
00262 };
00263
00264 }
00265
00266 #endif