FramebufferHandle.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. // Copyright (C) 2009-2015, Panagiotis Christopoulos Charitos.
  2. // All rights reserved.
  3. // Code licensed under the BSD License.
  4. // http://www.anki3d.org/LICENSE
  5. #ifndef ANKI_GR_FRAMEBUFFER_HANDLE_H
  6. #define ANKI_GR_FRAMEBUFFER_HANDLE_H
  7. #include "anki/gr/GrHandle.h"
  8. #include "anki/gr/FramebufferCommon.h"
  9. namespace anki {
  10. /// @addtogroup graphics
  11. /// @{
  12. /// Framebuffer handle
  13. class FramebufferHandle: public GrHandle<FramebufferImpl>
  14. {
  15. public:
  16. using Base = GrHandle<FramebufferImpl>;
  17. using Initializer = FramebufferInitializer;
  18. FramebufferHandle();
  19. ~FramebufferHandle();
  20. /// Create a framebuffer
  21. ANKI_USE_RESULT Error create(CommandBufferHandle& commands,
  22. Initializer& attachments);
  23. /// Bind it to the state
  24. /// @param commands The command buffer
  25. /// @param invalidate If true invalidate the FB after binding it
  26. void bind(CommandBufferHandle& commands, Bool invalidate);
  27. /// Blit another framebuffer to this
  28. /// @param[in, out] commands The command buffer
  29. /// @param[in] b The sorce framebuffer
  30. /// @param[in] sourceRect The source rectangle
  31. /// @param[in] destRect The destination rectangle
  32. /// @param attachmentMask The attachments to blit
  33. /// @param linear Perform linean filtering
  34. void blit(CommandBufferHandle& commands,
  35. const FramebufferHandle& b,
  36. const Array<U32, 4>& sourceRect,
  37. const Array<U32, 4>& destRect,
  38. GLbitfield attachmentMask,
  39. Bool linear);
  40. };
  41. /// @}
  42. } // end namespace anki
  43. #endif