mirror of
https://github.com/cyberarm/i-mic-fps.git
synced 2025-12-15 23:52:35 +00:00
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:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user