App3D.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /*
  2. * Copyright (c) 2014, Oculus VR, Inc.
  3. * All rights reserved.
  4. *
  5. * This source code is licensed under the BSD-style license found in the
  6. * LICENSE file in the root directory of this source tree. An additional grant
  7. * of patent rights can be found in the PATENTS file in the same directory.
  8. *
  9. */
  10. #ifndef __APP_3D_H
  11. #define __APP_3D_H
  12. #include "AppInterface.h"
  13. namespace Ogre
  14. {
  15. class Root;
  16. class Camera;
  17. class SceneManager;
  18. class RenderWindow;
  19. class Viewport;
  20. class SceneNode;
  21. class Math;
  22. class Overlay;
  23. class Viewport;
  24. }
  25. class FadingTextList;
  26. class App3D : public AppInterface
  27. {
  28. public:
  29. App3D();
  30. virtual ~App3D();
  31. virtual void PreConfigure(void);
  32. //virtual void StartupSound(int maxchannels, unsigned int flags, void *extradriverdata, unsigned logType, bool logActive=false);
  33. virtual bool Configure(void);
  34. // Note that Ogre is bugged - setting recursive to true just crashes
  35. virtual void PostConfigure(const char *defaultResourceConfigurationPath, bool recursive);
  36. virtual void InitSceneManager(Ogre::SceneManager *sm=0);
  37. virtual void InitGUIManager(void);
  38. virtual void InitCamera(Ogre::Camera *cam=0);
  39. virtual void InitViewport(Ogre::Viewport *vp=0);
  40. virtual void Update(AppTime curTimeMS,AppTime elapsedTimeMS);
  41. virtual void Render(AppTime curTimeMS);
  42. virtual void SetVisible(bool _isVisible);
  43. virtual bool IsVisible(void) const;
  44. virtual bool ShouldQuit(void) const;
  45. virtual void OnAppShutdown(void);
  46. virtual void SetState(int stateType, RunnableState* state);
  47. bool HasPixelShader2(void) const;
  48. // Returns filename written
  49. const char * TakeScreenshot(const char *prefix, const char *suffix);
  50. Ogre::SceneManager* GetSceneManager(void) const;
  51. const char* GetWorkingDirectory(void) const;
  52. Ogre::Root *root;
  53. Ogre::Camera* camera;
  54. Ogre::RenderWindow* window;
  55. Ogre::Viewport* viewport;
  56. // This is here because the math trig tables don't get initialize until Math is instantiated, even though the tables are static.
  57. Ogre::Math *math;
  58. //Ogre::SceneNode *gameplayNode;
  59. protected:
  60. Ogre::SceneManager* sceneManager;
  61. void UpdateDefault(AppTime curTimeMS,AppTime elapsedTimeMS);
  62. virtual char * GetWindowTitle(void) const=0;
  63. bool isVisible;
  64. char workingDirectory[512];
  65. bool hasPixelShader2;
  66. };
  67. #endif
粤ICP备19079148号