// fbo_width and fbo_height are the desired width and height of the FBO.
// For Opengl <= 4.4 or if the GL_ARB_texture_non_power_of_two extension
// is present, fbo_width and fbo_height can be values other than 2^n for
// some integer n.

// Build the texture that will serve as the color attachment for the framebuffer.
GLuint color_renderbuffer;
{%glGenRenderbuffers}(1, &color_renderbuffer);
{%glBindRenderbuffer}( GL_RENDERBUFFER, (GLuint)color_renderbuffer );
{%glRenderbufferStorage}( GL_RENDERBUFFER, GL_R