LayeredFramebuffer.h 654 B

123456789101112131415161718192021222324252627
  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();
  9. ~LayeredFramebuffer();
  10. LayeredFramebuffer(const LayeredFramebuffer&) = delete;
  11. LayeredFramebuffer(LayeredFramebuffer&&) = delete;
  12. LayeredFramebuffer& operator=(const LayeredFramebuffer&) = delete;
  13. LayeredFramebuffer& operator=(LayeredFramebuffer&&) = delete;
  14. void init(int width, int height, int depth);
  15. void bindAndClear();
  16. void bindTextureTo(int unit) const;
  17. void bindLayer(int layer);
  18. bool hasError() const;
  19. };
  20. #endif