BsGLTextureManager.h 1.7 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 bs { namespace ct
  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(const TEXTURE_DESC& desc,
  36. const SPtr<PixelData>& initialData = nullptr, GpuDeviceFlags deviceMask = GDF_DEFAULT) override;
  37. /** @copydoc TextureCoreManager::createRenderTextureInternal */
  38. SPtr<RenderTextureCore> createRenderTextureInternal(const RENDER_TEXTURE_DESC& desc,
  39. UINT32 deviceIdx = 0) override;
  40. GLSupport& mGLSupport;
  41. };
  42. /** @} */
  43. }}