Fixed modern opengl renderer not renderering model textures, framebuffer can be used without crashing, model uv coordinates are now in buffer, minor rendering optimization

This commit is contained in:
2020-03-22 17:22:10 -05:00
parent 35d6061198
commit 0d1d7ff6bc
5 changed files with 95 additions and 55 deletions

View File

@@ -72,6 +72,22 @@ class IMICFPS
glDrawBuffers(draw_buffers.size, draw_buffers.pack("I*"))
end
def bind_for_writing
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, @framebuffer)
end
def bind_for_reading
glBindFramebuffer(GL_READ_FRAMEBUFFER, @framebuffer)
end
def set_read_buffer(buffer)
glReadBuffer(GL_COLOR_ATTACHMENT0 + @textures.keys.index(buffer))
end
def unbind_framebuffer
glBindFramebuffer(GL_FRAMEBUFFER, 0)
end
def clean_up
glDeleteFramebuffers(@framebuffer)