+bool RenderTarget::resize(int xsz, int ysz)
+{
+ if(!own_fbo) return false; /* TODO */
+
+ int new_tx = next_pow2(xsz);
+ int new_ty = next_pow2(ysz);
+
+ if(new_tx != tex_width || new_ty != tex_height) {
+ tex_width = new_tx;
+ tex_height = new_ty;
+
+ for(int i=0; i<4; i++) {
+ if(tex[i]) {
+ tex[i]->create(new_tx, new_ty, TEX_2D, tex[i]->get_format());
+ }
+ }
+
+ if(depth) {
+ depth->create(new_tx, new_ty, TEX_2D, depth->get_format());
+ }
+ }
+
+ if(rbdepth) {
+ glBindRenderbuffer(GL_RENDERBUFFER, rbdepth);
+ glRenderbufferStorage(GL_RENDERBUFFER, rbdepth_fmt, xsz, ysz);
+ }
+
+ width = xsz;
+ height = ysz;
+ return true;
+}
+