30 uint FrameBuffer::boundFbo = 0;
37 void FrameBuffer::internalCreate()
42 glGenFramebuffers(1, &m_fbo);
54 glDeleteFramebuffers(1, &m_fbo);
61 if(m_texture && m_texture->
getSize() == size)
70 glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, m_texture->
getId(), 0);
72 GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER);
73 if(status != GL_FRAMEBUFFER_COMPLETE)
113 void FrameBuffer::internalBind()
116 assert(boundFbo != m_fbo);
117 glBindFramebuffer(GL_FRAMEBUFFER, m_fbo);
118 m_prevBoundFbo = boundFbo;
120 }
else if(m_backuping) {
126 void FrameBuffer::internalRelease()
129 assert(boundFbo == m_fbo);
130 glBindFramebuffer(GL_FRAMEBUFFER, m_prevBoundFbo);
131 boundFbo = m_prevBoundFbo;