BsGLTextureManager.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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. /** @addtogroup GL
  11. * @{
  12. */
  13. /** Handles creation of OpenGL textures. */
  14. class BS_RSGL_EXPORT GLTextureManager : public TextureManager
  15. {
  16. public:
  17. GLTextureManager(GLSupport& support);
  18. virtual ~GLTextureManager();
  19. /**
  20. * Converts the provided format for the specified texture type and usage into a format that is supported by OpenGL.
  21. */
  22. PixelFormat getNativeFormat(TextureType ttype, PixelFormat format, int usage, bool hwGamma) override;
  23. protected:
  24. /** @copydoc TextureManager::createRenderTextureImpl */
  25. SPtr<RenderTexture> createRenderTextureImpl(const RENDER_TEXTURE_DESC& desc) override;
  26. GLSupport& mGLSupport;
  27. };
  28. /** Handles creation of OpenGL textures. */
  29. class BS_RSGL_EXPORT GLTextureCoreManager : public TextureCoreManager
  30. {
  31. public:
  32. GLTextureCoreManager(GLSupport& support);
  33. protected:
  34. /** @copydoc TextureCoreManager::createTextureInternal */
  35. SPtr<TextureCore> createTextureInternal(TextureType texType, UINT32 width, UINT32 height, UINT32 depth,
  36. int numMips, PixelFormat format, int usage = TU_DEFAULT, bool hwGammaCorrection = false,
  37. UINT32 multisampleCount = 0, UINT32 numArraySlices = 1, const SPtr<PixelData>& initialData = nullptr) override;
  38. /** @copydoc TextureCoreManager::createRenderTextureInternal */
  39. SPtr<RenderTextureCore> createRenderTextureInternal(const RENDER_TEXTURE_DESC_CORE& desc) override;
  40. GLSupport& mGLSupport;
  41. };
  42. /** @} */
  43. }