BsGLTextureManager.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. RenderTexturePtr createRenderTextureImpl(const RENDER_TEXTURE_DESC& desc) override;
  26. /** @copydoc TextureManager::createMultiRenderTextureImpl */
  27. MultiRenderTexturePtr createMultiRenderTextureImpl(const MULTI_RENDER_TEXTURE_DESC& desc) override;
  28. GLSupport& mGLSupport;
  29. };
  30. /**
  31. * @brief Handles creation of OpenGL textures.
  32. */
  33. class BS_RSGL_EXPORT GLTextureCoreManager : public TextureCoreManager
  34. {
  35. public:
  36. GLTextureCoreManager(GLSupport& support);
  37. protected:
  38. /** @copydoc TextureCoreManager::createTextureInternal */
  39. SPtr<TextureCore> createTextureInternal(TextureType texType, UINT32 width, UINT32 height, UINT32 depth,
  40. int numMips, PixelFormat format, int usage = TU_DEFAULT, bool hwGammaCorrection = false,
  41. UINT32 multisampleCount = 0, const PixelDataPtr& initialData = nullptr) override;
  42. /** @copydoc TextureCoreManager::createRenderTextureInternal */
  43. SPtr<RenderTextureCore> createRenderTextureInternal(const RENDER_TEXTURE_CORE_DESC& desc) override;
  44. /** @copydoc TextureCoreManager::createMultiRenderTextureInternal */
  45. SPtr<MultiRenderTextureCore> createMultiRenderTextureInternal(const MULTI_RENDER_TEXTURE_CORE_DESC& desc) override;
  46. GLSupport& mGLSupport;
  47. };
  48. /** @} */
  49. }