2
0

BsGLTextureManager.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
  2. //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
  3. #pragma once
  4. #include "BsGLPrerequisites.h"
  5. #include "BsGLTexture.h"
  6. #include "BsGLSupport.h"
  7. #include "BsTextureManager.h"
  8. namespace BansheeEngine
  9. {
  10. /**
  11. * @brief Handles creation of OpenGL textures.
  12. */
  13. class BS_RSGL_EXPORT GLTextureManager : public TextureManager
  14. {
  15. public:
  16. GLTextureManager(GLSupport& support);
  17. virtual ~GLTextureManager();
  18. /**
  19. * @brief Converts the provided format for the specified texture type and usage
  20. * into a format that is supported by OpenGL.
  21. */
  22. PixelFormat getNativeFormat(TextureType ttype, PixelFormat format, int usage, bool hwGamma) override;
  23. protected:
  24. /**
  25. * @copydoc TextureManager::createRenderTextureImpl
  26. */
  27. RenderTexturePtr createRenderTextureImpl(const RENDER_TEXTURE_DESC& desc) override;
  28. /**
  29. * @copydoc TextureManager::createMultiRenderTextureImpl
  30. */
  31. MultiRenderTexturePtr createMultiRenderTextureImpl(const MULTI_RENDER_TEXTURE_DESC& desc) override;
  32. GLSupport& mGLSupport;
  33. };
  34. /**
  35. * @brief Handles creation of OpenGL textures.
  36. */
  37. class BS_RSGL_EXPORT GLTextureCoreManager : public TextureCoreManager
  38. {
  39. public:
  40. GLTextureCoreManager(GLSupport& support);
  41. protected:
  42. /**
  43. * @copydoc TextureCoreManager::createTextureInternal
  44. */
  45. SPtr<TextureCore> createTextureInternal(TextureType texType, UINT32 width, UINT32 height, UINT32 depth,
  46. int numMips, PixelFormat format, int usage = TU_DEFAULT, bool hwGammaCorrection = false,
  47. UINT32 multisampleCount = 0, const PixelDataPtr& initialData = nullptr) override;
  48. /**
  49. * @copydoc TextureCoreManager::createRenderTextureInternal
  50. */
  51. SPtr<RenderTextureCore> createRenderTextureInternal(const RENDER_TEXTURE_CORE_DESC& desc) override;
  52. /**
  53. * @copydoc TextureCoreManager::createMultiRenderTextureInternal
  54. */
  55. SPtr<MultiRenderTextureCore> createMultiRenderTextureInternal(const MULTI_RENDER_TEXTURE_CORE_DESC& desc) override;
  56. GLSupport& mGLSupport;
  57. };
  58. }