fce88032ca
- .mcp.json - bash/functions/infra/write_mcp_jupyter_config.md - bash/functions/infra/write_mcp_jupyter_config.sh - cpp/CMakeLists.txt - cpp/apps/chart_demo - cpp/apps/shaders_lab - cpp/functions/gfx/gl_framebuffer.cpp - cpp/functions/gfx/gl_framebuffer.h - cpp/functions/gfx/gl_framebuffer.md - cpp/functions/gfx/mesh_gpu.md - ... Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
20 lines
759 B
C++
20 lines
759 B
C++
#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
|