BsGLMultiRenderTexture.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. #pragma once
  2. #include "BsGLPrerequisites.h"
  3. #include "BsMultiRenderTexture.h"
  4. #include "BsGLFrameBufferObject.h"
  5. namespace BansheeEngine
  6. {
  7. class GLMultiRenderTexture;
  8. /**
  9. * @brief OpenGL implementation of a render texture with multiple color surfaces.
  10. *
  11. * @note Core thread only.
  12. */
  13. class BS_RSGL_EXPORT GLMultiRenderTextureCore : public MultiRenderTextureCore
  14. {
  15. public:
  16. GLMultiRenderTextureCore(GLMultiRenderTexture* parent, MultiRenderTextureProperties* properties, const MULTI_RENDER_TEXTURE_DESC& desc);
  17. virtual ~GLMultiRenderTextureCore();
  18. /**
  19. * @copydoc MultiRenderTextureCore::getCustomAttribute
  20. */
  21. void getCustomAttribute(const String& name, void* pData) const;
  22. protected:
  23. friend class GLTextureManager;
  24. /**
  25. * @copydoc CoreObjectCore::initialize
  26. */
  27. virtual void initialize();
  28. /**
  29. * @copydoc CoreObjectCore::destroy
  30. */
  31. virtual void destroy();
  32. private:
  33. GLFrameBufferObject* mFB;
  34. };
  35. /**
  36. * @brief OpenGL implementation of a render texture with multiple color surfaces.
  37. *
  38. * @note Sim thread only.
  39. */
  40. class BS_RSGL_EXPORT GLMultiRenderTexture : public MultiRenderTexture
  41. {
  42. public:
  43. virtual ~GLMultiRenderTexture() { }
  44. /**
  45. * @copydoc MultiRenderTexture::requiresTextureFlipping
  46. */
  47. bool requiresTextureFlipping() const { return true; }
  48. protected:
  49. friend class GLTextureManager;
  50. GLMultiRenderTexture() { }
  51. /**
  52. * @copydoc MultiRenderTexture::createProperties
  53. */
  54. virtual RenderTargetProperties* createProperties() const;
  55. /**
  56. * @copydoc RenderTexture::createCore
  57. */
  58. virtual SPtr<CoreObjectCore> createCore() const;
  59. };
  60. }