+ // Allocate an FBO with the the given texture(s) bound as framebuffer attachment(s),
+ // or fetch a previous used if possible. Unbinds GL_FRAMEBUFFER afterwards.
+ // Keeps ownership of the FBO; you must call release_fbo() of deleting
+ // it when you no longer want it.
+ //
+ // NOTE: In principle, the FBO doesn't have a resolution or pixel format;
+ // you can bind almost whatever texture you want to it. However, changing
+ // textures can have an adverse effect on performance due to validation,
+ // in particular on NVidia cards. Also, keep in mind that FBOs are not
+ // shareable across contexts, so you must have the context that's supposed
+ // to own the FBO current when you create or release it.
+ GLuint create_fbo(GLuint texture0_num,
+ GLuint texture1_num = 0,
+ GLuint texture2_num = 0,
+ GLuint texture3_num = 0);
+ void release_fbo(GLuint fbo_num);
+
+ // Informs the ResourcePool that the current context is going away soon,
+ // and that any resources held for it in the freelist should be deleted.
+ //
+ // You do not need to do this for the last context; the regular destructor
+ // will take care of that. This means that if you only ever use one
+ // thread/context, you never need to call this function.
+ void clean_context();
+