Wave 1 de parallel-fix-issues integrada a master: - 0025: text_editor_cpp_core + file_watcher_cpp_core - 0026: gl_texture_load_cpp_gfx (vendor: stb_image v2.30) Ademas se commitea WIP previo de master que estaba sin commitear (cambios en shaders_lab, dag_*, framework, tokens, kpi_card, gl_loader.md, etc.) para dejar HEAD buildable. Notas: - Algunos deps del gallery (button.cpp, toolbar.cpp, modal_dialog.cpp...) siguen UNTRACKED — gating con FN_BUILD_GALLERY=ON (default OFF) para que master build (sin flag) no los necesite. - Build OK con y sin flag. fn index registra 904 functions. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
3.6 KiB
name, kind, lang, domain, version, purity, signature, description, tags, uses_functions, uses_types, returns, returns_optional, error_type, imports, tested, tests, test_file_path, file_path, framework, params, output
| name | kind | lang | domain | version | purity | signature | description | tags | uses_functions | uses_types | returns | returns_optional | error_type | imports | tested | tests | test_file_path | file_path | framework | params | output | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| graph_renderer | function | cpp | viz | 1.1.0 | impure | GraphRenderer* graph_renderer_create(int width, int height, const GraphRendererConfig& config) | Renderer GPU de grafos con instanced rendering a FBO, compatible con ImGui::Image para visualizacion de grafos grandes |
|
|
false | error_go_core |
|
false | cpp/functions/viz/graph_renderer.cpp | imgui |
|
Handle opaco al renderer. Usar graph_renderer_draw() para obtener texture ID de OpenGL, pasable directamente a ImGui::Image() |
graph_renderer
Renderer GPU de grafos basado en OpenGL 3.3 core profile con instanced rendering. Renderiza nodos y aristas de un GraphData a un FBO interno y retorna el texture ID para integracion directa con ImGui::Image().
Funciones del API
// Ciclo de vida
GraphRenderer* graph_renderer_create(int width, int height, const GraphRendererConfig& config = {});
void graph_renderer_destroy(GraphRenderer* r);
void graph_renderer_resize(GraphRenderer* r, int width, int height);
// Renderizado
unsigned int graph_renderer_draw(GraphRenderer* r, const GraphData& graph,
float cam_x, float cam_y, float cam_zoom);
Ejemplo de uso con ImGui
// Inicializacion (una vez)
GraphRenderer* renderer = graph_renderer_create(800, 600);
// En el render loop
ImVec2 panel_size = ImGui::GetContentRegionAvail();
graph_renderer_resize(renderer, (int)panel_size.x, (int)panel_size.y);
unsigned int tex = graph_renderer_draw(renderer, graph_data,
cam_x, cam_y, cam_zoom);
ImGui::Image((ImTextureID)(uintptr_t)tex,
panel_size,
ImVec2(0, 1), ImVec2(1, 0)); // flip Y para OpenGL
// Destruccion
graph_renderer_destroy(renderer);
Notas de implementacion
Renderizado de nodos: Instanced rendering con un quad unitario [-0.5, 0.5] expandido por el tamano del nodo. El fragment shader aplica un SDF circular con anti-aliasing via smoothstep y un anillo de outline.
Renderizado de aristas: GL_LINES con datos de posicion y color empaquetados por arista. El ancho se controla con GraphRendererConfig::edge_width.
Transformacion de camara:
tx = -cam_x * zoom + width/2
ty = -cam_y * zoom + height/2
ndc = (screen / viewport) * 2 - 1
Paleta de comunidades: 10 colores ABGR usados cuando node.color == 0, seleccionados por node.community % 10.
Estado GL: Guarda y restaura GL_FRAMEBUFFER_BINDING y GL_VIEWPORT para ser compatible con el render loop de ImGui sin efectos secundarios.
Includes GL: Usa gfx/gl_loader.h (v1.1+). En Linux es no-op (incluye headers con GL_GLEXT_PROTOTYPES). En Windows expone los simbolos modernos via wglGetProcAddress con macros #define gl* fn_gl*. Cualquier app que use graph_renderer debe linkear gl_loader.cpp y llamar fn::gfx::gl_loader_init() una vez tras crear el contexto GL.
Notas
- v1.1 (2026-04-25): cambia de raw
<GL/glext.h>agfx/gl_loader.hpara que compile en cross-compile MinGW. Sin cambios funcionales — el binario Linux es bit-equivalente.