FrameBuffer.h 921 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #ifndef DEF_FRAMEBUFFER
  2. #define DEF_FRAMEBUFFER
  3. // Include Windows
  4. #ifdef WIN32
  5. #include <GL/glew.h>
  6. // Include Mac
  7. #elif __APPLE__
  8. #define GL3_PROTOTYPES 1
  9. #include <OpenGL/gl3.h>
  10. // Include UNIX/Linux
  11. #else
  12. #define GL3_PROTOTYPES 1
  13. #include <GLES3/gl3.h>
  14. #endif
  15. // Includes communs
  16. #include <vector>
  17. #include "Texture.h"
  18. // Classe
  19. class FrameBuffer
  20. {
  21. public:
  22. FrameBuffer();
  23. FrameBuffer(int largeur, int hauteur, bool stencil = false);
  24. FrameBuffer(const FrameBuffer &frameBufferACopier);
  25. ~FrameBuffer();
  26. bool charger();
  27. void creerRenderBuffer(GLuint &id, GLenum formatInterne);
  28. GLuint getID() const;
  29. Texture* getColorBuffer(unsigned int index);
  30. int getLargeur() const;
  31. int getHauteur() const;
  32. private:
  33. GLuint m_id;
  34. int m_largeur;
  35. int m_hauteur;
  36. std::vector<Texture*> m_colorBuffers;
  37. GLuint m_depthBufferID;
  38. bool m_stencil;
  39. };
  40. #endif