| 928 | static std::vector<framebuffer*> fbStack; |
| 929 | |
| 930 | void framebuffer::bindForWriting() { |
| 931 | if (fbo) { |
| 932 | GL_CHECK_ERR(glBindFramebuffer(GL_FRAMEBUFFER, fbo)); |
| 933 | GL_CHECK_ERR(glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, fbo_color, 0)); |
| 934 | GL_CHECK_ERR(glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_TEXTURE_2D, fbo_depth, 0)); |
| 935 | GL_CHECK_ERR(glViewport(0, 0, xsize, ysize)); |
| 936 | fbStack.push_back(this); |
| 937 | } |
| 938 | } |
| 939 | |
| 940 | void framebuffer::bindForReading() const { |
| 941 | GL_CHECK_ERR(glBindFramebuffer(GL_READ_FRAMEBUFFER, fbo)); |
no outgoing calls
no test coverage detected