RunnableState.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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 __RUNNABLE_STATE_H
  11. #define __RUNNABLE_STATE_H
  12. #include "AppTypes.h"
  13. #include "State.h"
  14. class AppInterface;
  15. class RunnableState : public State
  16. {
  17. public:
  18. virtual void Update(AppTime curTimeMS, AppTime elapsedTimeMS)=0;
  19. virtual void UpdateEnd(AppTime curTimeMS, AppTime elapsedTimeMS) {};
  20. virtual void Render(AppTime curTimeMS)=0;
  21. void SetParentApp(AppInterface *parent);
  22. // Call when internal variables set and the state is ready to use
  23. virtual void OnStateReady(void);
  24. // Don't do this so I can override by return type in derived classes
  25. //virtual AppInterface *GetParentApp(void) const;
  26. virtual void SetFocus(bool hasFocus);
  27. protected:
  28. AppInterface *parent;
  29. };
  30. #endif
粤ICP备19079148号