UiManager.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #ifndef UI_MANAGER_H
  2. #define UI_MANAGER_H
  3. #include <OgreRenderQueueListener.h>
  4. #include <OgreSingleton.h>
  5. #include <OgreUTFString.h>
  6. #include <tinyxml.h>
  7. #include "UiFont.h"
  8. #include "UiWidget.h"
  9. class UiManager : public Ogre::RenderQueueListener, public Ogre::Singleton< UiManager >
  10. {
  11. public:
  12. UiManager();
  13. virtual ~UiManager();
  14. void Initialise();
  15. void Update();
  16. void OnResize();
  17. void AddFont( UiFont* font );
  18. UiFont* GetFont( const Ogre::String& name );
  19. void AddPrototype( const Ogre::String& name, TiXmlNode* prototype );
  20. TiXmlNode* GetPrototype( const Ogre::String& name ) const;
  21. void AddWidget( UiWidget* widget );
  22. UiWidget* GetWidget( const Ogre::String& name );
  23. UiWidget* ScriptGetWidget( const char* name );
  24. void renderQueueStarted( Ogre::uint8 queueGroupId, const Ogre::String& invocation, bool& skipThisInvocation );
  25. private:
  26. std::vector< UiFont* > m_Fonts;
  27. struct UiPrototype
  28. {
  29. Ogre::String name;
  30. TiXmlNode* node;
  31. };
  32. std::vector< UiPrototype > m_Prototypes;
  33. std::vector< UiWidget* > m_Widgets;
  34. };
  35. #endif // UI_MANAGER_H