GOSImagePool.hpp 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. //===========================================================================//
  2. // Copyright (C) Microsoft Corporation. All rights reserved. //
  3. //===========================================================================//
  4. #pragma once
  5. #define MLR_GOSIMAGEPOOL_HPP
  6. #if !defined(MLR_MLR_HPP)
  7. #include <MLR\MLR.hpp>
  8. #endif
  9. namespace MidLevelRenderer {
  10. class GOSImagePool
  11. #if defined(_ARMOR)
  12. : public Stuff::Signature
  13. #endif
  14. {
  15. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  16. // Constructors/Destructors
  17. //
  18. public:
  19. GOSImagePool();
  20. ~GOSImagePool();
  21. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  22. // Image handling
  23. //
  24. public:
  25. GOSImage*
  26. GetImage(const char* imageName);
  27. GOSImage*
  28. GetImage(const char* imageName, gos_TextureFormat format, int size, gos_TextureHints hints);
  29. virtual bool
  30. LoadImage(GOSImage *image, int=0)=0;
  31. void
  32. RemoveImage(GOSImage *image);
  33. void UnLoadImages (void);
  34. void
  35. GetTexturePath(Stuff::MString* pName) const
  36. { Check_Object(this); *pName = texturePath; }
  37. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  38. // Testing
  39. //
  40. public:
  41. void
  42. TestInstance() const
  43. {}
  44. protected:
  45. Stuff::HashOf<GOSImage*, Stuff::MString>
  46. imageHash;
  47. Stuff::MString
  48. texturePath;
  49. };
  50. class TGAFilePool:
  51. public GOSImagePool
  52. {
  53. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  54. // Constructors/Destructors
  55. //
  56. public:
  57. TGAFilePool(const char* path);
  58. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  59. // Image handling
  60. //
  61. public:
  62. bool
  63. LoadImage(GOSImage *image, int=0);
  64. };
  65. }