BsTextureImportOptions.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. #pragma once
  2. #include "BsCorePrerequisites.h"
  3. #include "BsImportOptions.h"
  4. #include "BsGpuProgram.h"
  5. #include "BsPixelUtil.h"
  6. namespace BansheeEngine
  7. {
  8. /**
  9. * @brief Contains import options you may use to control how is a texture imported.
  10. */
  11. class BS_CORE_EXPORT TextureImportOptions : public ImportOptions
  12. {
  13. public:
  14. TextureImportOptions();
  15. /**
  16. * @brief Sets the pixel format that the imported texture will have.
  17. */
  18. void setFormat(PixelFormat format) { mFormat = format; }
  19. /**
  20. * @brief Enables or disables mipmap generation for the texture.
  21. */
  22. void setGenerateMipmaps(bool generate) { mGenerateMips = generate; }
  23. /**
  24. * @brief Sets the maximum mip level to generate when generating mipmaps. If 0
  25. * then maximum amount of mip levels will be generated.
  26. */
  27. void setMaxMip(UINT32 maxMip) { mMaxMip = maxMip; }
  28. /**
  29. * @brief Gets the pixel format that the imported texture will have.
  30. */
  31. PixelFormat getFormat() const { return mFormat; }
  32. /**
  33. * @brief Checks will be imported texture have automatically generated mipmaps.
  34. */
  35. bool getGenerateMipmaps() const { return mGenerateMips; }
  36. /**
  37. * @brief Gets the maximum mip level to generate when generating mipmaps. If 0
  38. * then maximum amount of mip levels will be generated.
  39. */
  40. UINT32 getMaxMip() const { return mMaxMip; }
  41. /************************************************************************/
  42. /* SERIALIZATION */
  43. /************************************************************************/
  44. public:
  45. friend class TextureImportOptionsRTTI;
  46. static RTTITypeBase* getRTTIStatic();
  47. virtual RTTITypeBase* getRTTI() const;
  48. private:
  49. PixelFormat mFormat;
  50. bool mGenerateMips;
  51. UINT32 mMaxMip;
  52. };
  53. }