moGL
travis-test-3
Modern OpenGL wrapper, thin C++14 header-only layer on top of the OpenGL 4.5+ core spec
|
00001 00002 00003 00004 00005 00006 00007 00008 00009 00010 00011 00012 00013 #ifndef MOGL_FRAMEBUFFER_INCLUDED 00014 #define MOGL_FRAMEBUFFER_INCLUDED 00015 00016 #include <mogl/object/handle.hpp> 00017 #include <mogl/object/renderbuffer.hpp> 00018 #include <mogl/object/texture.hpp> 00019 00020 namespace mogl 00021 { 00022 class FrameBuffer : public Handle<GLuint> 00023 { 00024 public: 00025 FrameBuffer(); 00026 ~FrameBuffer(); 00027 00028 FrameBuffer(const FrameBuffer& other) = delete; 00029 FrameBuffer& operator=(const FrameBuffer& other) = delete; 00030 00031 FrameBuffer(FrameBuffer&& other) = default; 00032 00033 public: 00034 void bind(GLenum target); 00035 void setRenderBuffer(GLenum attachment, RenderBuffer& renderbuffer); 00036 void setTexture(GLenum attachment, Texture& texture, GLint level = 0); 00037 void setDrawBuffer(GLenum buffer); 00038 void setDrawBuffers(GLsizei size, const GLenum* buffers); 00039 void invalidate(GLsizei numAttachments, const GLenum* attachments); 00040 void invalidateSubData(GLsizei numAttachments, const GLenum* attachments, 00041 GLint x, GLint y, GLsizei width, GLsizei height); 00042 void set(GLenum property, GLint value); 00043 bool isComplete(GLenum target); 00044 bool isHandleValid() const override final; 00045 00046 public: 00047 template <class T> 00048 void clear(GLenum buffer, GLint drawbuffer, const T* value); 00049 void clear(GLenum buffer, GLfloat depth, GLint stencil); 00050 }; 00051 } 00052 00053 #include "framebuffer.inl" 00054 00055 #endif // MOGL_FRAMEBUFFER_INCLUDED 00056