I created a low-resolution framebuffer object which has a retro-style display.
The framebuffer seems to display itself, causing a mess of pixels at the bottom of the screen.
This is how it looks when framebuffer is drawn completely overlapping the viewport
This is how it looks when framebuffer is drawn in overlapping the quarter of the viewport
This is how I made the Framebuffer and the Renderbuffer
FBO = glGenFramebuffers(1)
DBO = glGenRenderbuffers(1)
glBindRenderbuffer(GL_RENDERBUFFER, DBO)
glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT, 1280, 720)
glBindFramebuffer(GL_FRAMEBUFFER, FBO)
glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, DBO)
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0)
And this is the code in mainloop
glDrawElements(GL_TRIANGLES, len(indices), GL_UNSIGNED_INT, None) # Drawing Stuff
###
glBindFramebuffer(GL_FRAMEBUFFER, 0)
glBlitFramebuffer(
640 - 128,
360 - 72,
640 + 128,
360 + 72,
0,
0,
1280,
720,
GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT,
GL_NEAREST
)
I am using Python 3 with PyOpenGL