OpenGL low resolution to simulate old games

I am interested to know how to properly use the image for old games (e.g. Atari 2600) in OpenGL to make an fps game. I guess the best way to do this is to write a buffer to the texture, put it on a square and display it until the screen resolution.

See http://www.youtube.com/watch?v=_ELRv06sa-c for example (great game!)

Any advice, help or sample code would be appreciated.

+5
source share
1 answer

I think the best way to do this would be, as you said, to do everything in low-resolution text (it is best to use FBOs ) and then just display the texture by drawing a square of sceen size (of course, using GL_NEARESTas an increase filter for the texture). Perhaps you can also use glBlitFramebufferto copy directly from a low-level FBO to a high-resolution framebuffer, although I don't know if you can directly copy to a standard framebuffer (displayed) this way.

: framebuffer_blit , , res FBO , glBlitFramebuffer(EXT/ARB). , , - ( ). , , , . :

generate FBO with low-res renderbuffers for color and depth (and stencil)
...
glBindFramebuffer(GL_FRAMEBUFFER, lowFBO);
render_scene();
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
glBlitFramebuffer(0, 0, 640, 480, 0, 0, 1024, 768, 
    GL_COLOR_BUFFER_BIT [| GL_DEPTH_BUFFER_BIT], GL_NEAREST);
+9

All Articles