BsTextureImportOptions.h 2.1 KB

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