BsGLTextureManager.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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 "Managers/BsTextureManager.h"
  8. namespace bs
  9. {
  10. /** @addtogroup GL
  11. * @{
  12. */
  13. /** Handles creation of OpenGL textures. */
  14. class GLTextureManager : public TextureManager
  15. {
  16. public:
  17. GLTextureManager(ct::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. ct::GLSupport& mGLSupport;
  27. };
  28. namespace ct
  29. {
  30. /** Handles creation of OpenGL textures. */
  31. class GLTextureManager : public TextureManager
  32. {
  33. public:
  34. GLTextureManager(GLSupport& support);
  35. protected:
  36. /** @copydoc TextureManager::createTextureInternal */
  37. SPtr<Texture> createTextureInternal(const TEXTURE_DESC& desc,
  38. const SPtr<PixelData>& initialData = nullptr, GpuDeviceFlags deviceMask = GDF_DEFAULT) override;
  39. /** @copydoc TextureManager::createRenderTextureInternal */
  40. SPtr<RenderTexture> createRenderTextureInternal(const RENDER_TEXTURE_DESC& desc,
  41. UINT32 deviceIdx = 0) override;
  42. GLSupport& mGLSupport;
  43. };
  44. }
  45. /** @} */
  46. }