BsGLTextureManager.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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);
  21. protected:
  22. /**
  23. * @copydoc TextureManager::createTextureImpl
  24. */
  25. TexturePtr createTextureImpl();
  26. /**
  27. * @copydoc TextureManager::createRenderTextureImpl
  28. */
  29. RenderTexturePtr createRenderTextureImpl(const RENDER_TEXTURE_DESC& desc);
  30. /**
  31. * @copydoc TextureManager::createMultiRenderTextureImpl
  32. */
  33. MultiRenderTexturePtr createMultiRenderTextureImpl(const MULTI_RENDER_TEXTURE_DESC& desc);
  34. GLSupport& mGLSupport;
  35. };
  36. /**
  37. * @brief Handles creation of OpenGL textures.
  38. */
  39. class BS_RSGL_EXPORT GLTextureCoreManager : public TextureCoreManager
  40. {
  41. public:
  42. GLTextureCoreManager(GLSupport& support);
  43. protected:
  44. /**
  45. * @copydoc TextureCoreManager::createRenderTextureInternal
  46. */
  47. SPtr<RenderTextureCore> createRenderTextureInternal(const RENDER_TEXTURE_DESC& desc);
  48. /**
  49. * @copydoc TextureCoreManager::createMultiRenderTextureInternal
  50. */
  51. SPtr<MultiRenderTextureCore> createMultiRenderTextureInternal(const MULTI_RENDER_TEXTURE_DESC& desc);
  52. GLSupport& mGLSupport;
  53. };
  54. }