LayeredFramebuffer.h 636 B

12345678910111213141516171819202122232425
  1. #ifndef LAYERED_FRAMEBUFFER_H
  2. #define LAYERED_FRAMEBUFFER_H
  3. #include <GL/glew.h>
  4. class LayeredFramebuffer final {
  5. GLuint texture;
  6. GLuint buffer;
  7. public:
  8. LayeredFramebuffer(int width, int height, int depth);
  9. ~LayeredFramebuffer();
  10. LayeredFramebuffer(const LayeredFramebuffer&) = delete;
  11. LayeredFramebuffer(LayeredFramebuffer&&) = delete;
  12. LayeredFramebuffer& operator=(const LayeredFramebuffer&) = delete;
  13. LayeredFramebuffer& operator=(LayeredFramebuffer&&) = delete;
  14. void bindAndClear();
  15. void bindTextureTo(int unit) const;
  16. void bindLayer(int layer);
  17. bool hasError() const;
  18. };
  19. #endif