2
0

BsGLTextureManager.h 1.9 KB

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