#pragma once

namespace fn::gfx {

struct Framebuffer {
    unsigned int fbo       = 0;
    unsigned int tex       = 0;        // GL_RGBA8 color
    unsigned int depth_rbo = 0;        // GL_DEPTH_COMPONENT24 renderbuffer, 0 si sin depth
    int          width     = 0;
    int          height    = 0;
    bool         has_depth = false;
};

void fb_init(Framebuffer& f);                        // crea fbo+tex 1x1 (color-only, retro-compat)
void fb_init_depth(Framebuffer& f);                  // crea fbo+tex+depth_rbo 1x1
void fb_resize(Framebuffer& f, int w, int h);        // redimensiona color y depth (si has_depth); no-op si iguales
void fb_destroy(Framebuffer& f);                     // libera fbo, tex y depth_rbo si existen

} // namespace fn::gfx
