QGearsBackgroundFileManager.h 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /*
  2. * Copyright (C) 2022 The V-Gears Team
  3. *
  4. * This file is part of V-Gears
  5. *
  6. * V-Gears is free software: you can redistribute it and/or modify it under
  7. * terms of the GNU General Public License as published by the Free Software
  8. * Foundation, version 3.0 (GPLv3) of the License.
  9. *
  10. * V-Gears is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. */
  15. #pragma once
  16. #include <OgreResourceManager.h>
  17. #include "QGearsPrerequisites.h"
  18. #include "QGearsBackgroundFile.h"
  19. namespace QGears{
  20. /**
  21. * A manager for background files.
  22. */
  23. class _QGearsExport BackgroundFileManager
  24. : public Ogre::ResourceManager,
  25. public Ogre::Singleton<BackgroundFileManager>
  26. {
  27. public:
  28. /**
  29. * Constructor.
  30. */
  31. BackgroundFileManager();
  32. /**
  33. * Destructor.
  34. */
  35. virtual ~BackgroundFileManager();
  36. /**
  37. * Retrieves a singleton to the manager.
  38. */
  39. static BackgroundFileManager& GetSingleton();
  40. /**
  41. * Retrieves a pointer to the manager singleton.
  42. */
  43. static BackgroundFileManager* GetSingletonPtr();
  44. protected:
  45. /**
  46. * Loads the manager.
  47. *
  48. * @param name[in] The unique name of the manager.
  49. * @param handle[in] @todo Understand and document.
  50. * @param group[in] The name of the resource group to which this
  51. * resource belong.
  52. * @param is_manual[in] True if the resource is manually loaded,
  53. * false otherwise.
  54. * @param loader[in] Pointer to a ManualResourceLoader
  55. * implementation which will be called when the Resource wishes to
  56. * load (should be supplied if is_manual is set to true). It can be
  57. * null, but the Resource will never be able to reload if anything
  58. * ever causes it to unload. Therefore provision of a proper
  59. * ManualResourceLoader instance is strongly recommended.
  60. * @param create_params[in] Unused.
  61. */
  62. Ogre::Resource *createImpl(
  63. const Ogre::String &name, Ogre::ResourceHandle handle,
  64. const Ogre::String &group, bool is_manual,
  65. Ogre::ManualResourceLoader *loader,
  66. const Ogre::NameValuePairList *create_params
  67. );
  68. };
  69. }